
[space] SparkLayer Docs

[title] SparkLayer Ignite
[path] Backend/

## Introduction

[SparkLayer Ignite](https://www.sparklayer.io/ignite/) is a commerce framework that enables any platform to easily integrate with the power of SparkLayer. From delivering a world-class frontend B2B self-service ordering experience, to connecting to SparkLayer's extensive B2B pricing engine.&#x20;

::embed[]{url="https://www.youtube.com/watch?v=50LtDBjQQ54"}

Our [technical documentation covers](https://docs.sparklayer.io/ignite) all key principles and concepts required to build an integration via the SparkLayer Ignite framework. This includes how to connect a platform (e.g. an eCommerce platform) and synchronise data, right through to connecting to specific endpoints to allow you to customise as you need to.&#x20;


:::hint{type="info"}
**Ready to get started?&#x20;**&#xA;For early access, get in touch with our [support team](docId\:NNUw1G9z7eaJ4M78vk7t9). For any questions or feedback, please contact your technical representative at SparkLayer.
:::




[title] SparkLayer API
[path] Backend/

:::hint{type="info" attributes="[object Object]"}
**Please note**
Access to the SparkLayer API is only available on our [Pro and Enterprise plans.](https://www.sparklayer.io/pricing/)
:::

## Introduction

:::hint{type="success"}
**Ready to get started?**
Explore the [SparkLayer API and Technical Docs](https://docs.sparklayer.io/tech-docs)
:::

The SparkLayer API lets you connect your backend systems (e.g. ERP, CRM, PIM, or iPaas) and send through B2B data such as product and pricing information, customer rules, and much more! Once you've completed the API integration, you can then install the SparkLayer Frontend, converting your eCommerce website into a powerful B2B ordering system.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zXcqAwdGiMnKom4mzJcae_image.png)

The SparkLayer API follows REST principles with OAuth2 authentication, allowing you to tightly integrate with your backend systems. Our API Docs give a complete overview of how to integrate with SparkLayer and we've also included some key information below.




***

## API elements

The SparkLayer API can be used to connect to a wide range of data and the extent will depend on your integration and the systems you intend to use.

For example, if you're using one of the supported platform integrations (e.g. [Shopify](docId:7TmhkOEHbgEGGFdd6EMr1)), SparkLayer will automatically be able to retrieve product and customer data from the platform itself. In this scenario, the SparkLayer API will only be used to send through Product price list data primarily and limited other data (e.g. pack sizes). If you're building a bespoke integration with a custom platform, the integration will be more extensive and require most elements of the Core API to be used.

The SparkLayer API is structured as follows:

| Area                                        | Details                                                                                                                                                                          |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Pricing API](docId\:NhGZqBIad2GyM04vUDE7p) | The SparkLayer Pricing API is typically used to automate your pricing data into SparkLayer. You can learn more about how it works in the [here](docId\:NhGZqBIad2GyM04vUDE7p).   |
| [Core API](docId\:o0F97SiGhW23RNy9Na7_z)    | The SparkLayer Core API provides support for a wider range of data elements (e.g., products, customers, orders). You can learn more in the [here](docId\:o0F97SiGhW23RNy9Na7_z). |



***

## Getting started

Integrating with the SparkLayer API will require technical expertise and our recommendation is to review our documentation in detail before beginning the process. To get started, visit our [SparkLayer API Docs](https://docs.sparklayer.io/tech-docs).

:::hint{type="info"}
**Please note**
Before starting, you'll need your unique `Site ID` which can be found in the SparkLayer Dashboard [My Account section](https://app.sparklayer.io/settings/account) and you'll also need to generate your unique API keys [here](https://app.sparklayer.io/configuration/api). If you have any technical questions about how best to integrate with the SparkLayer API, please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.
:::



***

## SparkLayer Ignite

[SparkLayer Ignite](https://www.sparklayer.io/ignite/) is a commerce framework that enables any platform to easily integrate with the power of SparkLayer. From delivering a world-class frontend B2B self-service ordering experience, to connecting to SparkLayer's extensive B2B pricing engine.&#x20;

::embed[]{url="https://www.youtube.com/watch?v=50LtDBjQQ54"}

Our [technical documentation covers](https://docs.sparklayer.io/ignite) all key principles and concepts required to build an integration via the SparkLayer Ignite framework. This includes how to connect a platform (e.g. an eCommerce platform) and synchronise data, right through to connecting to specific endpoints to allow you to customise as you need to.&#x20;

[title] Data Limitations
[path] Backend/

## Introduction

SparkLayer has been designed and built with scalability in mind, however there are some limitations in the amount of data that can be sent and processed to prevent performance implications.&#x20;

This is particularly applicable if you have large data-sets (e.g. a high volume of price lists) and we've detailed our recommendations below.

| Area                       | <font color="#3b9f0f">Maximum Entries</font><br />(Recommended) | <font color="#eb144c">Hard Limit</font><br />(Performance implications) |
| -------------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `Customer Groups`          | 50                                                              | 100                                                                     |
| `Products`                 | 50,000                                                          | 100,000                                                                 |
| `Customers`                | 100,000                                                         | 250,000                                                                 |
| `Customer Sub-Accounts*`   | 250                                                             | 250                                                                     |
| `Customer Addresses*`      | 250                                                             | 500                                                                     |
| `Sales Agents`             | Not applicable                                                  | None                                                                    |
| `Sales Agent Groups`       | 1,000                                                           | 2,500                                                                   |
| `Price Lists`              | 15,000                                                          | 25,000                                                                  |
| `Customer Carts`           | Unlimited (stored for up to 3 months since last amend)          |                                                                         |
| `Line Items within a cart` | 250                                                             | 250                                                                     |
| `Discounts`                | 50 unique discounts<br />15 concurrent                          | 100 unique discounts<br />25 concurrent                                 |

\*Limit per customer



***

## Platform limitations

For other limitations specific to platforms, please refer to [Integrations](docId\:Eewk4JDEtPwyhjhrTwlvp).

[title] Intelligent Cart (AI)
[path] Features/

## Introduction 

SparkLayer Intelligent Cart introduces a revolutionary new way for your B2B customers and sales teams to build orders quickly and effortlessly using the power of AI.

::embed[]{url="https://www.youtube.com/embed/IhpfEUwKZXI"}

The magic lies in its simplicity: files and emails containing order details (such as SKUs, barcodes, and quantities) can be uploaded or emailed directly to SparkLayer, instantly creating a shopping cart. In addition, live barcode scanning is supported, providing powerful, fast ways to build orders without manually browsing and searching for products.

:::hint{type="success"}
**✨ Want to test it out the magic?**
Try our [demo store](https://demo.sparklayer.io/pages/b2b-login-register) and see how the Intelligent Cart works!
:::

:::hint{type="info"}
**Please note the following&#x20;**&#xA;SparkLayer prioritises security and privacy. Data is **never** used for training purposes. Uploaded and emailed data is **immediately deleted** after cart population (and always deleted after 24 hours if not popuplated). You can learn more about our security and privacy policy in [Policies & Data](docId\:IHwcUeK1zbDVqrZuXgB8B)&#x20;
:::



***

## Features

The SparkLayer Intelligent Cart comes with the following features:

| Item               | Details                                                                                                                                                                                                      |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Upload a file`    | **✨ AI-powered file recognition**<br />Upload common file types such as PDFs, CSVs, spreadsheets, documents, and images (e.g., JPGs). Recognised SKUs and quantities are instantly added to the active cart. |
| `Forward an email` | **✨ AI-powered email recognition**<br />Forward an email containing order details (either in the email body or an attachment) and automatically populate the cart.                                           |
| `Scan a barcode`   | Instantly add products to the cart using a mobile or computer device camera to scan product barcodes.                                                                                                        |

Typical use cases include:

- Uploading an invoice, purchase order (PO), or document containing order details
- Uploading a spreadsheet (XLS/CSV) listing SKUs and quantities
- Taking a photo of a handwritten order (e.g., at a trade show)
- Scanning barcodes in-store or at an event
- Forwarding any of the above via email

There are countless other scenarios where the SparkLayer Intelligent Cart makes B2B ordering even faster.

*We currently support the below file types: pdf, xlsx, png, jpg, csv, txt, json and docx.*

:::hint{type="info"}
**Please note**
If you'd prefer not to use the [Intelligent Cart (AI)](docId\:rIAcYwzOMfwSomd5KB5p8) features within the SparkLayer Cart, you can now hide these by going to the [Setttngs > Configurations](https://app.sparklayer.io/configuration/settings/general) section of the SparkLayer Dashboard.
:::



***

## Getting Started

:::hint{type="success"}
**🚀 Upgrading to the latest SparkLayer version**
To begin using the SparkLayer Intelligent Cart, you'll need to be using the latest version. To learn more about how to upgrade, see [our guide here](docId\:QWXsYM9X5_pvIOGUteKcP).
:::

To get started with the SparkLayer Intelligent Cart, you'll need to login to your website and view the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-). You'll then see the options to **Upload a file**, **Forward an email**, and **Scan a barcode**.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/EyTDfosl-VZMH6zkiiegt_image.png)



***

## Upload a file

Customers or sales agents can click **Upload a file** to select a file from their computer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/sX9bDRCZDjA-wedyd54_3_image.png)

Supported file types include PDF, CSV, XLS, DOC, PNG, JPG, and others. Within seconds of upload, the cart will be populated with the SKUs and quantities found in the file (provided they match products in your store).

::embed[]{url="https://www.youtube.com/embed/glQAAX7csG4"}

Let's take the use case of uploading a previous invoice. In the below example, the SparkLayer Intelligent Cart will scan the document and pick up all the SKUs in the first column and the matching quantities in the next column. Providing the SKUs are matched on the store, these will then be added to the cart.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VoEupP239PelQe9fgXls1_image.png)

The user can then proceed as normal to make further edits to the cart before going through the checkout process.

:::hint{type="info"}
**Please note**
If the SKUs cannot be found or do not match those setup on the store, these will not be added to the cart.
:::



***

## Forward an email

Customers or sales agents can click **Forward an email** to begin.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/9DGLrhO8eNtaP7h-QUkHZ_image.png)

Each customer account has a unique, pre-generated email address that can be copied and then any email forward to this address.

::embed[]{url="https://www.youtube.com/embed/5IWEw5OkPb8"}

Once the email has been forwarded, within a matter of seconds, the cart will indicate that it has received the email and items can be added by clicking the "Populate cart from email" link.

:::hint{type="info"}
**Please note**
The pregenerated email address will always take the form of `ai+yourstoreid+has@b2b.sparklayer.io` and cannot be changed
:::

Let's take the use case of a sales agent forwarding the contents of an email sent by one of their customers. They would log in as that customer (using the [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) feature), copy the email address and then send the email to this address.

In the example below, there are a list of SKUs and the user has indicated they want 20 of each.  Providing the SKUs are matched on the store, these will then be added to the cart.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/rsd4-ov53jqtP4UxRszSs_image.png)

Just as with the "Upload a file" feature, this works by populating a cart and the user can then proceed as normal to make any edits before going through the checkout.



***

## Scan a barcode

To begin using this feature, customers or sales agents simply click the "Scan a barcode" button. Providing the device being used has access to a built-in camera, the device can then be used to scan a barcode.

If the SparkLayer Intelligent Cart recognises this as an active barcode within the store, the product will be added to the cart.

:::hint{type="info"}
**Setting up barcodes**
To configure this feature, you'll need to ensure your store is setup with barcodes within the admin. You can also learn more about barcode display in [our guide here](docId\:m3DF4f0Eyc2rM-vUaRG9H).&#x20;
:::



***

## Inventory and settings

When using the SparkLayer Intelligent Cart:

- Items added respect your store’s inventory and product settings (e.g., pack sizes, minimum/maximum order quantities).
- If an order doesn't meet product requirements (e.g., must be ordered in multiples of 12), this will be clearly indicated in the cart (see below).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/q2WXlbJdGOc4G9W91uHaF_image.png)

The customer or sales agent can then proceed to make edits as normal and even submit the order as a quote if you have the [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo) activated.



***

## Frequently Asked Questions

:::ExpandableHeading
**Is this using Artificial Intelligence (AI)?**

Yes. Within the scopes of AI, the SparkLayer Intelligent Cart is making use of machine learning and associated algorithims in order to scan, interpret, and filter the contents of files and emails purely for the purposes of building B2B orders.
:::

:::ExpandableHeading
**What file types can I upload?**

You can upload a wide range of file types including PDFs, CSVs, spreadsheets (XLS, XLSX), Word documents (DOC, DOCX), and image formats like PNG or JPG.
:::

:::ExpandableHeading
**What if some SKUs are not recognised?**

Only SKUs that match products in your store will be added to the cart. Unrecognised SKUs are ignored, and you’ll have the option to manually edit the cart afterward.
:::

:::ExpandableHeading
**What are typical use cases?**

Some example scenarios:

- Uploading an invoice or PO to reorder items
- Forwarding a customer’s email containing a product list
- Scanning barcodes at a trade show to quickly build a cart
- Taking a photo of a handwritten order sheet
:::

:::ExpandableHeading
**Can customers use this on mobile devices?**

Yes. The SparkLayer Intelligent Cart fully supports mobile devices, including file upload, barcode scanning, and email forwarding.
:::

:::ExpandableHeading
**Does it work offline?**

No, the SparkLayer Intelligent Cart requires an internet connection to process uploaded files, emails, and barcode scans.
:::



***

## Feedback

We've love to know if you have feedback on this feature. Let our team know by emailing **product\@sparklayer.io**


[title] Shopping Lists
[path] Features/

## Introduction

Shopping Lists let your B2B customers save products into named lists they can preview, edit, and reorder in seconds. Instead of rebuilding the same order each time, customers keep lists like "Every month order" or "Regular Buys", adjust them whenever they need to, and add them straight to the cart when they're ready to buy.

::embed[****]{url="https://www.youtube.com/embed/rhuLyeKaMQY"}

This is ideal for B2B buyers who place repeat orders, manage seasonal ranges, or prepare an order over several days before checking out. Sales agents can use lists in the same way when ordering on behalf of customers.

Shopping Lists are available to your B2B customers without any setup. Customers can create and manage their own lists from the cart, from any product page, and from the My Account area.

:::hint{type="success"}
**Want to test out Shopping Lists?**&#x20;
Head over to our [B2B Demo store](https://demo.sparklayer.io/pages/b2b-login-register) and give it a go!
:::



***

## Key features

- **Faster reordering** - customers save the products they buy regularly and add them to the cart in one step, rather than searching for the same items every time.
- **Multiple lists per customer** - customers keep separate lists for different needs, such as monthly restocks, seasonal lines, or one-off planned orders.
- **Add from anywhere** - products can be added to a list straight from the product page, the cart or from an existing purchase, so building a list fits into how customers already browse.
- **Preview and edit before ordering** - customers see exactly what's in a list, change quantities, add or remove products, and reorder items before anything reaches the cart.
- **Adds to the cart without overwriting it** - sending a list to the cart tops up any matching products already there rather than replacing them, so nothing gets lost.
- **Export to CSV** - customers and sales agents download a list as a CSV to share internally or work with offline.



***

## How it works

### Creating a shopping list

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/PMTR1gF5EeoVelehstVbW_image.png)

Customers can create a list in three ways:

1. From the **My Account** area, go to **Shopping Lists** and click **Create List**.&#x20;
2. When adding a product to a list, click **Or create a new shopping list** in the "Add to shopping list" window.
3. From the cart, open the **Actions** menu and choose **Add to shopping list**, then create a new list.

Each list shows its name and the date it was last updated, so customers can quickly find the one they need.

:::hint{type="info"}
**Please note**
Creating a list from My Account starts an empty list and leaves the current cart untouched, so customers don't have to clear their cart to begin a new list.
:::

### Adding products to a list

There are two places a customer can add products to a list.

**From a product page**

On any product page, customers click the **Add to shopping list** icon next to the **Add to Cart** button. A window opens where they choose an existing list or create a new one. Whatever quantity the customer has selected is added to the list, and a confirmation message shows the item has been saved.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ixHKa7hzrGq3eekK4MjYP_list-1.png)

**From the cart**

In the cart, customers click **Actions**, then either **Add to shopping list** or a specific list shown under the **Shopping Lists** section of the menu.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qzqIi-Er9_Qzp7cEsvJBt_image.png)

In both cases, a window appears where the customer picks the list to add to and clicks **Save**.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/njRlI_KHnXnJkfXbBsD3W_screenshot-2026-06-30-at-052352.png)

### Previewing and editing a list

Customers open a list from the **Shopping Lists** page to see and manage everything in it. From here they can:

- **Preview the contents** - see every product and its quantity before adding anything to the cart.
- **Add products** - search by name, SKU, or barcode and add new items with the quantity they need.
- **Adjust quantities** - increase or decrease the quantity of any item.
- **Remove items** - delete items one at a time, or select several and remove them together.

Each list also shows when it was created and last modified, giving customers a clear record of their saved orders.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-ceH3-F1W7aD_6df8Cf2t_list2-1.png)

### Adding a list to the cart

When a customer is ready to reorder, they can add a list to their cart in two ways:

- **Add the whole list** - every item in the list, with its saved quantities, is added to the cart.
- **Add selected items only** - the customer selects the products they want and adds just those.

If a product is already in the cart, adding it from a list increases the existing quantity rather than replacing it. Nothing already in the cart is removed. The customer then continues to checkout as normal.

### Exporting a list

Customers and sales agents can download a list as a CSV to share with colleagues or work with offline. Any unsaved changes are saved automatically before the export runs, so the file always matches what's on screen.

The CSV includes the SKU, name, unit pricing, and quantity for every item in the list.

### Turning Shopping List off

Shopping lists are on by default. If you'd prefer not to offer them to your customers, you can turn them off from the SparkLayer dashboard:

1. Go to [Storefront → Options](https://app.sparklayer.io/storefront/options).
2. Open the **My Account Settings** section.
3. Turn off the **Show shoppinglists** toggle.
4. Click **Save & publish** to apply the change to your live site.

Once turned off, the shopping lists icon no longer appears on product pages, and the Shopping lists section is removed from the My Account.



***

## FAQ

:::ExpandableHeading
**Can a customer create more than one shopping list?**

Yes. Customers can create as many lists as they need and name each one, making it easy to keep separate lists for different ordering needs.
:::

:::ExpandableHeading
**Can products be added to a list without going to the account area?**

Yes. Products can be added straight from the product page or from the cart, so there's no need to open the account area first.
:::

:::ExpandableHeading
**Does adding a list to the cart replace what's already there?**

No. Items from a list are added to the current cart. If a product is already in the cart, its quantity is increased rather than overwritten, so nothing already in the cart is lost.
:::

:::ExpandableHeading
**Are quantities saved with a list?**

Yes. The quantity set against each item is saved, so when a customer adds the list to their cart the quantities carry over.
:::

:::ExpandableHeading
**Can a customer remove items in a list?**

Yes. Items can be removed individually or several at once.
:::

:::ExpandableHeading
**Can a list be downloaded?**

Yes. Customers and sales agents can export any list as a CSV, including the product name, SKU, quantity, price, and barcode.
:::


[title] 
[path] Features/Forms/


[title] Data References
[path] Features/Forms/



![Data reference picker UI](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/htLND4eCsRtGCbkviuA7Q_image.png "Data reference picker UI")

Data References let you use dynamic data from forms, entries, customers, Data Tables, workflows, and SparkLayer records across your form setup.

Instead of typing a fixed value, you can reference data that already exists. SparkLayer resolves the reference when the form is viewed, submitted, updated, or when a workflow runs.

Data References are used in places such as:

- Display logic
- Validation rules
- Default field values
- Workflow conditions and actions
- Emails, API requests, and calculations
- Select, radio, and other option-based fields
- Entry views, filters, and columns

## Common Things You Can Reference

Here is a list of common references you might want to use, and where to find this in the Reference Picker UI:

| **What you want to use**               | **Data Reference in Picker UI** |
| -------------------------------------- | ------------------------------- |
| A value submitted on the current form  | Current entry → Entry answers   |
| Admin-only values attached to an entry | Current entry → Internal fields |
| The logged-in SparkLayer customer      | Current entry → Customer        |
| Customer group rules and settings      | SparkLayer → Customer Groups    |
| Store name, email, phone, or address   | SparkLayer → Store Details      |
| Orders data                            | SparkLayer → Purchases          |
| Reusable option lists (Data Tables)    | Data Tables                     |
| Entries from another form              | Forms                           |
| A previous workflow result             | Current workflow run            |
| The current item in a loop             | Current iteration               |

## How the Reference Picker Works

Fields and configurations that support Data References include a **Reference** button:



::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/yhO_w-2bhIigtO5Ra-UXA_image.png" size="64" width="856" height="160" position="center" caption="Reference button example" alt="Reference button example in UI" darkWidth="856" darkHeight="160" showCaption="true"}

References can also be inserted into templated fields:



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/UlFUhRcW7C7dV-1H8ma6X_image.png)

The picker only shows references that are relevant to the place you are configuring. For example, a workflow calculation will show values that can be used in a calculation, while an option data source will show lists that can be used as options.

Some items can be opened to browse deeper. Others can be selected immediately.

If a reference cannot be selected, it usually means one of the following:

- The field expects a single value, but the reference is a list
- The field expects a list, but the reference is a single value
- The value type is not compatible for the current context



![Example of an incompatible reference option](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/XEcgiiHhxUYIpxThY-CNh_image.png "Example of an incompatible reference option")

## Current Entry References

The current entry is the form entry being viewed, submitted, or processed.

You can reference:

- Submitted answers
- Entry status
- Entry ID
- SparkLayer Customer ID and data
- Created, updated, and submitted dates
- Dashboard admin URL
- Internal fields

Common examples:

- Show a field when another answer has a specific value
- Include submitted answers in an email
- Send form data to an external API
- Update an internal status field in a workflow
- Use the entry URL in an admin notification

### Logged-In SparkLayer Customer

When a form is used by a logged-in SparkLayer customer, Data References can access the customer connected to the current entry.

This is useful when the form should respond to who the customer is, not just what they typed into the form.

You can reference customer data such as:

- First and last name
- Email address
- Company name
- SparkLayer customer ID
- External ID or accounting ID
- Customer group
- Customer status
- Role information
- Tax exempt status
- Discount percentage
- Default billing or shipping address IDs
- Payment on account details, such as credit limit, balance, currency, and net terms

Common examples:

- Show different fields for different customer groups
- Route submissions based on customer group or other details
- Include customer account details in workflow emails
- Send customer identifiers to an external system
- Apply approval rules for customers with payment on account enabled

:::hint{type="info"}
Please note that if a form is embedded on a page where the SparkLayer Core Script is not included or loaded, or where the customer is not actively logged in, the form submission entry is created without an associated customer.
:::

## SparkLayer Objects

SparkLayer Objects let references use wider B2B data from SparkLayer, not only data from the current form.

Depending on where the reference is used, this can include:

- Customer groups
- Customer group settings
- Store details
- Customers
- Purchases

:::hint{type="danger"}
**IMPORTANT:** Please make sure that you filter any data references to the correct customer records when building external customer facing forms. For example, when attaching Purchases data source to a select field, ensure to filter by `Entry -> Customer -> ID` to ensure the customers only see their own purchases.
:::

### Customer Groups and Settings

Customer group references are useful when forms or workflows need to follow rules already configured in SparkLayer.

You can reference data such as:

- Group slug
- Group name
- Parent group
- Price list settings
- Address editing settings
- Checkout permissions
- Allowed payment methods
- Order quantity limits
- Order total limits
- Credit limit enforcement
- Quote settings
- Stock display settings

Common examples:

- Show fields only for customers in certain groups
- Validate a request against customer group rules
- Route approvals based on payment method availability
- Check whether quote or checkout behaviour is enabled
- Include customer group details in an internal notification

### Store Details

Store details can be used in templates, messages, and workflow steps.

You can reference:

- Store name
- Store email
- Store phone number
- Store website
- Store address

Common examples:

- Add store contact details to email From and To fields
- Include store information in generated messages

### Purchases

Purchase references can access SparkLayer purchasing.

You can reference data such as:

- Purchase type
- Purchase identifiers
- Customer identifiers
- Payment method
- Payment status
- Currency
- Calculated totals
- Quote status
- Purchase dates
- Shipping or billing address details
- Line items, quantities, SKUs, and totals
- Tax lines
- Shipments and tracking details

Common examples:

- Route workflows based on purchase or quote status
- Include purchase totals in emails or API requests
- Look up purchase data for a customer
- Check payment status or payment method
- Use purchases, packages and line item data as the options Data Source for select fields

## Data Tables

Data Tables are useful for reusable lists of structured data.

Examples:

- Selectable items lists
- Regions or territories
- Dealer locations
- Approval rules
- Discount bands
- Licence types
- Industry categories
- Customer group to approval logic outcome mappings

Data Tables can be used as option sources for select or radio fields, or as lookup data inside workflows.

Common examples:

- Populate a product dropdown from a Data Table
- Show only active dealer locations
- Look up a sales region from a selected country
- Find an approval rule based on order value
- Use a discount band in a calculation

## Other Forms

You can reference entries from another form when information is managed across multiple forms.

Common examples:

- Use submitted partner records as options in another form
- Look up a previous application
- Create a related entry in another form
- Update a connected record through a workflow
- Build internal admin processes across multiple forms

This is useful when one form collects data and another form needs to reuse or act on it.

## Workflow and Loop Data

Inside workflows, Data References can use data from previous workflow steps.

You can reference:

- Calculation results
- API request outputs
- Values created or updated by earlier steps
- The current item in a For Each loop
- The current loop index or item key

Common examples:

- Calculate a total, then write it back to the entry
- Use an API response in a later email
- Loop through line items and update each item
- Branch a workflow based on a previous step output
- Send calculated or looked-up values to another system

## Using References in Conditions

Conditions are used in display logic, validation rules, and workflow branches.

Example conditions:

- Show “VAT Number” when “Country” equals “United Kingdom”
- Require “Trade Licence” when “Business Type” equals “Licensed Trade”
- Continue a workflow only when “Approval Status” equals “Approved”
- Apply a discount when “Order Total” is greater than 1000
- Route an entry when the customer group equals “Wholesale”

The Reference picker helps you choose compatible values for each side of the condition.

## Using References in Templates

Some workflow fields and messages support templates. In these areas, references can be inserted into text.

Examples:

- Email subject: New application from \{\{ Customer Name }}
- Email body: Customer email: \{\{ Email }}
- API URL: https\://example.com/customers/\{\{ Customer ID }}
- API body: include submitted answers in a JSON payload
- Calculation: use numeric answers to calculate totals, discounts, or scores

Templates are commonly used in emails, API requests, success messages, and workflow calculations.

## Using References for Option Data Sources



::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/wLDUBw6k7qu6tTv78a34S_image.png" size="72" width="906" height="726" position="center" caption="Option Data Source UI" alt="Option Data Source UI" showCaption="true"}

Select, radio, and similar fields can use a Data Reference as their option source instead of manually entered options.

This is useful when options change regularly, are a long list, or are used in multiple places.

Common examples:

- Populate a product dropdown from a Data Table
- Show a list of matching dealer locations based on current customer's group
- Let admins select from submitted partner records
- Use a repeatable field as the source for another option field

When the source is a list of simple values, SparkLayer can use each value directly as the option label.

When the source is a list of rows or objects, choose which field should be used as the visible option label.

The option value is the ID of the item. For instance, it might be the SparkLayer customer or purchase ID, a customer group slug, or a repeater instance key.

## Filters and Lookups



![Reference filters UI](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/icJz528C4286bW2MZF3sJ_image.png "Reference filters UI")

Some references can be filtered before they are used. Filters help narrow a list of entries, rows, customers, or objects to only the records that matter.

Examples:

- Use only Data Table rows where “Active” is true
- Find products where “Category” equals “Accessories”
- Look up a rule where “Country” equals the customer’s selected country
- Select form entries where “Status” equals complete
- Find the first matching row and use one field from it
- Find purchases for the customer associated with the current entry and where the payment status matches a certain value

Filters can use fixed values or dynamic values from other references.

Example:

A form asks for the customer’s country. A workflow looks up a Data Table row where the country matches that answer, then uses the matching row to assign the correct sales region.

Available filter options depend on the type of field being filtered. Common operators include:

- Equals
- Not equals
- Contains
- Greater than
- Less than
- Is empty
- Is not empty
- Is true
- Is false

## Lists vs Single Values

Some places need one value. Others need a list.

Single value examples:

- An email address
- A customer name
- A number used in a calculation
- A target field to update
- The first matching Data Table row
- A customer group name

List examples:

- Rows used as select options
- Items in a repeatable group
- Entries processed by a For Each workflow step
- A filtered set of Data Table rows
- Purchase line items

If a reference cannot be selected, it may be because the place you are configuring expects a single value but the reference points to a list, or the other way around.

## Formatters



::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/0lIXwpkFtn7ABAnpqZqGn_image.png" size="86" width="1348" height="1384" position="center" showCaption="false"}

In workflow template based fields, formatters can change a referenced value before it is used.

Examples:

- Convert text to uppercase or lowercase
- Use a fallback value if the reference is empty
- Join a list into a single line of text
- Extract one field from each item in a list
- Count items in a list
- Format a date
- Format a number

Common examples:

- Join selected tags into a comma-separated list
- Count the number of line items
- Format a submitted date for an email
- Use “Not provided” when an optional answer is empty

## Best Practices

- Use Data Tables for reusable or long lists of options.
- Use customer references when logic depends on who is submitting the form. This is often better than asking the customer to re-enter information SparkLayer already knows.
- Use SparkLayer Object references when logic depends on customer groups, settings, purchases, quotes, or store data.
- Use filters to keep references specific. A filtered reference is usually safer than referencing an entire list.
- Test with real examples. Check empty values, unexpected values, different customer groups, and multiple entries.
- Test both in the preview tab, but more importantly on the actual store, using the type of customer account (or not logged in) that the target user will use.

[title] Frontend Integration Guide
[path] Frontend/

## Introduction

The process of installing the SparkLayer Frontend is designed to be as streamlined as possible, requiring only a small number of code changes to your website. Once the code has been added, your B2B customers can then log in to your website and start placing B2B orders.&#x20;

The process of installing the SparkLayer frontend involves three main steps:

::::WorkflowBlock
:::WorkflowBlockItem
**Adding the SparkLayer Core Script**
This is a JavaScript code snippet that instructs your website to display all the frontend interfaces required for SparkLayer to work.
:::

:::WorkflowBlockItem
**Adding the product page scripts**
To display customer-specific pricing and the ability to add products to an order, special SparkLayer widgets are installed on your website's product pages.
:::

:::WorkflowBlockItem
**Setting the design customisations**
SparkLayer has CSS configurations that allow control over the look and feel such as colours, typefaces, and spacing.
:::
::::

Beyond these steps, you can then apply further customisations and configurations to really tailor your B2B experience. You can learn more in [Configurations](docId\:SBEaOaCq_A7FfbTatX8bD) as well as platform-specific recommendations in our [Integrations](docId\:Eewk4JDEtPwyhjhrTwlvp) guide.


:::hint{type="success"}
**Ready to get started?**
Within the SparkLayer Dashboard, the [Frontend Integration](https://app.sparklayer.io/integrations/widgets/core) section gives you personalised instructions on how to implement the special code snippets on your website.
:::



***

## The SparkLayer Core Script

The SparkLayer Core Script works by adding a special JavaScript code snippet into your website's theme. Once added, this then enables SparkLayer to render the special [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) that allow your B2B customers to place orders, manage their account, and more.&#x20;

### Installing the script

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
On Shopify, the SparkLayer core script is loaded automatically via the **SparkLayer app embed**. There's no need to edit theme.liquid or any other theme files.

To enable it:

1. Go to the [Theme setup](https://admin.shopify.com/apps/sparklayer/theme-setup) page in the SparkLayer Shopify app
2. Select your theme from the **Theme** dropdown
3. Click **Enable app embed** - this opens your Shopify theme editor in a new tab
4. In the theme editor, click **Save** in the top right to activate the app embed

That's it - the core script is now loaded on your storefront. You can verify it's working by checking the **App Blocks** table on the same page, where the **App Embed** row should show as Enabled.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/rE39jPARU0lHcum6uqUzQ_image.png)

:::hint{type="info"}
**Please note**
If you'd prefer not to install SparkLayer yourself, our team can do this for you free of charge. From the Theme setup page, click Install SparkLayer for me to request a free install.
:::
::::

:::Tab{title="🌐 Other platforms"}
To install the SparkLayer Core Script, it simply needs to be included within the main "header" of your website's source code within the `<head>...</head>` tags. For BigCommerce, this is typically within the file `/templates/layout/base.html`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vMYsiehB3_WTJkt7gZtqu_image.png)

To get started, head over to the SparkLayer Dashboard and you'll see your customised SparkLayer Core Script within the [Frontend Configurations](https://app.sparklayer.io/configuration/frontend/core).&#x20;

```html
<script async src="https://sparkcdn.io/sparkjs/yourstorehere/live"></script>
```

When you first install SparkLayer, you'll automatically use the latest version and you can also manually update this via the "SparkLayer Core Script version" section. To see what's new, please see make sure to bookmark [What's New!](docId\:WDCEwpeMoHPbrR96TaYCL).

### Technical details

From a technical point of view, the Core Script provides SparkLayer with key information that controls how it works on your website.&#x20;

```html
<!-- Go to app.sparklayer.io/configuration/frontend/core -->

<script>
  window.sparkOptions = {
    siteId: "examplestore", // your unique site id
    platform: "shopify", // your platform
    rootUrl: {{ routes.root_url | json }},
    language: {{ request.locale.iso_code | json }},
    accountRedirect: {
      urlRegex: /\/account/g,
      goTo: "/index", // page to redirect logged in users to
    },
    display: {
      stock: {
        show: false, // set to true to show stock level display
        max: 50, // highest stock level to show
        last: 5, // last remaining stock
        low: 15, // low stock threshold
        last: true, // set to false to hide last stock message
      },
    },
    auth: {
      user: {{ customer.email | json }},
      token: {{ customer.metafields.sparklayer.authentication | json }},
    },
  };
</script>
<script async src="https://sparkcdn.io/sparkjs/yourstorehere/live"></script>
```

This information includes:

| Item              | Details                                                                             |
| ----------------- | ----------------------------------------------------------------------------------- |
| `siteId`          | The website's unique identifier ([learn more](docId\:r9NG74uJdtyWlvGbpnB5u))        |
| `platform`        | The eCommerce platform of the website                                               |
| `language`        | The language to be used                                                             |
| `accountRedirect` | The URL to redirect logged in customers to                                          |
| `display`         | Which display configurations to enable ([learn more](docId\:SBEaOaCq_A7FfbTatX8bD)) |
| `auth`            | The authentication details of the logged in customer                                |
:::
:::::

### Modifying the core script

The SparkLayer Core Script supports a wide range of customisations and configurations to enable (or disable) specific features.

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
On Shopify, the SparkLayer core script is loaded automatically via the **app embed** - you don't need to add it manually. However, if you want to apply customisations or configurations, you'll need to add a small `<script>` block to your theme that defines them.

Add the following to your theme's theme.liquid file, just before the closing `</head>` tag:

```html
<script>
  window.sparkOptions = {
    // Add your customisations here
  };
</script>
```

For example, to set the language and account redirect URL:

```html
<script>
  window.sparkOptions = {
    language: 'en',
    accountRedirect: '/collections/all'
  };
</script>
```

:::hint{type="info"}
**Please note**
The `window.sparkOptions` block must appear **before** the SparkLayer app embed loads, so always place it in the `<head>` of your theme rather than the \<body> or footer.
:::
::::

:::Tab{title="🌐 Other platforms"}
To install the SparkLayer Core Script, it simply needs to be included within the main "header" of your website's source code within the `<head>...</head>` tags. For BigCommerce, this is typically within the file `/templates/layout/base.html`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vMYsiehB3_WTJkt7gZtqu_image.png)

To get started, head over to the SparkLayer Dashboard and you'll see your customised SparkLayer Core Script within the [Frontend Configurations](https://app.sparklayer.io/configuration/frontend/core).&#x20;

```html
<script async src="https://sparkcdn.io/sparkjs/yourstorehere/live"></script>
```

When you first install SparkLayer, you'll automatically use the latest version and you can also manually update this via the "SparkLayer Core Script version" section. To see what's new, please see make sure to bookmark [What's New!](docId\:WDCEwpeMoHPbrR96TaYCL).

### Technical details

From a technical point of view, the Core Script provides SparkLayer with key information that controls how it works on your website.&#x20;

```html
<!-- Go to app.sparklayer.io/configuration/frontend/core -->

<script>
  window.sparkOptions = {
    siteId: "examplestore", // your unique site id
    platform: "shopify", // your platform
    rootUrl: {{ routes.root_url | json }},
    language: {{ request.locale.iso_code | json }},
    accountRedirect: {
      urlRegex: /\/account/g,
      goTo: "/index", // page to redirect logged in users to
    },
    display: {
      stock: {
        show: false, // set to true to show stock level display
        max: 50, // highest stock level to show
        last: 5, // last remaining stock
        low: 15, // low stock threshold
        last: true, // set to false to hide last stock message
      },
    },
    auth: {
      user: {{ customer.email | json }},
      token: {{ customer.metafields.sparklayer.authentication | json }},
    },
  };
</script>
<script async src="https://sparkcdn.io/sparkjs/yourstorehere/live"></script>
```

This information includes:

| Item              | Details                                                                             |
| ----------------- | ----------------------------------------------------------------------------------- |
| `siteId`          | The website's unique identifier ([learn more](docId\:r9NG74uJdtyWlvGbpnB5u))        |
| `platform`        | The eCommerce platform of the website                                               |
| `language`        | The language to be used                                                             |
| `accountRedirect` | The URL to redirect logged in customers to                                          |
| `display`         | Which display configurations to enable ([learn more](docId\:SBEaOaCq_A7FfbTatX8bD)) |
| `auth`            | The authentication details of the logged in customer                                |
:::
:::::

:::hint{type="success"}
**Available configurations**
You can learn more about all the available configurations on SparkLayer in [our guide here](docId\:SBEaOaCq_A7FfbTatX8bD).&#x20;
:::

### Upgrading to the latest version&#x20;

To upgrade your version of SparkLayer to the latest version, within the SparkLayer Dashboard, go to **Integrations** and click **Widgets** (or [click here](https://app.sparklayer.io/configuration/frontend/core)).

::::WorkflowBlock
:::WorkflowBlockItem
Within the "Upgrade Core Script" section, we recommend selecting the latest numeric version as your preference and then click Save.
:::

:::WorkflowBlockItem
Next, you'll need to update your website to ensure you're using the correct SparkLayer Core Script. If you're not already on version 2, your core script will look something like the below.

```javascript
<script async src="https://cdn.sparklayer.io/spark.1.36.x.js"></script>
```

This needs to be updated to the new version that uses the below format:

```javascript
<script async src="https://sparkcdn.io/sparkjs/<site-id>/<env>"></script>
```

| Item        | Details                                                                                                                                                                           |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<site-id>` | This should be replaced with your unique site ID that you [can find here](https://app.sparklayer.io/settings/account).                                                            |
| `<env>`     | This denotes the environment to use on SparkLayer. This should be set to `live` unless you're using SparkLayer in [Test Mode](docId\:y74DZm4NK61rsUZwJ3Vcn)  (use `test` instead) |

In this example, we've adjusted this for a store with Site ID `b2bstore` on a `live` environment.

```javascript
<script async src="https://sparkcdn.io/sparkjs/b2bstore/live"></script>
```


:::
::::



***

## Product page scripts

The product page scripts are the special interfaces B2B customers see when they login to your website.&#x20;

There are three interfaces available:

::::WorkflowBlock
:::WorkflowBlockItem
[Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT)
This is show on your product detail pages and allow customers to rapidly add products to an order in a special 'table view'. [Learn more](docId\:JkCjbYUAnjzp75I8ul7MT)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/dajgJUodEp9gw5t_Ns1jA_image.png)
:::

:::WorkflowBlockItem
[Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv)****
This is shown anywhere a "product card" is shown such as on a product collection page or product upsell area. [Learn more](docId\:Mrp_Z0QIZQ2QksseuJylv)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/X5pInSAAkIWqkEcm0xbQZ_image.png)
:::

:::WorkflowBlockItem
[Product Price Interface](docId\:jrUxEh5YK36OMPgJ5x2tC)
This allows you to display a product's B2B price anywhere on your website, whether a product detail page or product collection page. [Learn more](docId\:ngbcwK-OO4NJmCp8s8gYb)


![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/EoOgtj-ocPsgYSaM3Oa37_image.png)
:::
::::

In terms of implementing the product page scripts, there are two key steps to follow:

::::WorkflowBlock
:::WorkflowBlockItem
**Hiding elements**
If you're installing SparkLayer on your existing retail website, you will want to ensure specific elements are **hidden** to ensure your B2B customers see the correct pricing and content. For example, this may include your **existing** retail pricing, add to cart button, variant options and the quantity selector. To do this, SparkLayer has a special tag you can add to any HTML element (see below)
:::

:::WorkflowBlockItem
**Displaying the SparkLayer interfaces**
Special code snippets need to be added to your product pages, e.g. product detail page and product collection page. When a B2B customer logs in, these will automatically show to them and they can see prices, add items to an order, view their account, and checkout. You can learn more about the specific interfaces and how to customise them within the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) guide.

:::
::::

### Hiding elements

SparkLayer lets you hide any element on your website by using a special HTML tag. This can be added to any HTML element that you want to be **hidden** from your B2B customers.

Typically elements that you would typically hide include:

- Price information
- Product variant information
- Quantity selection
- Buy button

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GoODnZ-GsFhmWROK9Ni7l_image.png)

To get started, you'll require access to the source code of your website and you'll need to locate the specific files that contain the elements you want to hide. For example, this could include editing the following pages

- A product detail page
- A product collection page
- Specific "components" that are used in multiple locations on your website

Once you've located the files, you can then use the special `data-spark="b2c-only"` to hide elements. This essentially adds a `display: none` within the CSS of your website and then hides the element when a logged in B2B customer views the page.

::embed[]{url="https://www.youtube.com/embed/rmMv-l98JoI?controls=0"}

:::hint{type="info"}
**Please note**
This step requires changing the code of your website and you may want to consult an expert on how best to apply this to your website. For platform-specific guidance, please refer to [Integrations](docId\:Eewk4JDEtPwyhjhrTwlvp)
:::

```html
<div data-spark="b2c-only">
  <!-- Anything inside here will be hidden for B2B customers -->
</div>

<p class="price" data-spark="b2c-only">
  <!-- In this example, the price would be hidden -->
  {{ product.price }}
</div>

<!-- Repeat this process for any HTML element you want hidden -->
```

### Displaying the SparkLayer interfaces

Once you've completed the step above, you can then proceed to add the special SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa).&#x20;

| Interface        | Details                                                                                                                                                                                                                   |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Product Detail` | This is shown on your product detail pages and allow customers to rapidly add products to an order.<br />[Learn more](docId\:JkCjbYUAnjzp75I8ul7MT) about how to add the code snippets                                    |
| `Product Card`   | This is shown anywhere a "product card" is shown such as on a product collection page.<br />[Learn more](docId\:Mrp_Z0QIZQ2QksseuJylv) about how to add the code snippets                                                 |
| `Product Price`  | This allows you to display a product's B2B price anywhere on your website. You can use this instead of or alongside the "Product Card"<br />[Learn more](docId\:ngbcwK-OO4NJmCp8s8gYb) about how to add the code snippets |



***

## Design customisations (CSS)

SparkLayer by default has a relatively neutral user interface but it's possible to update nearly all aspects of the look and feel using special CSS variables.

- Colours
- Typography (e.g. typefaces and font sizing)
- Spacing (e.g. padding and margin)
- Button styling
- Form styling

As with the SparkLayer Core Script, the CSS code can be added to your existing CSS stylesheets or placed within the main header of your website's source code. If you're placing the CSS in your main header, remember to wrap it within the `<head>...</head>` tags.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7vDQr0cPNevSuKwwP--9l_image.png)

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/CSS-Edit.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

### What can be styled

An effective way to determine the colours you want to change is to use your browser 'Inspect Element' tool. All styling for SparkLayer uses special styling codes that are proceeded with `--spark-` and each one can be isolated and updated.&#x20;

In the Inspect Element tool, you'll see something like the below. Nearly all styling elements (e.g. for a button) can be replaced and these simply needed to be added to your websites source code.  Learn more in [Customising the Design](docId\:qCt2Zk8wjhYIV2ZbVBJYy)

```css
/* Go to app.sparklayer.io/configuration/frontend/css */

.btn, .btn-large, .btn-small {
    color: var(--spark-button-raised-color,var(--spark-lightest-color,#fff));
    background-color: var(--spark-button-raised-background,var(--spark-secondary-color,#125ef8));
    border: var(--spark-button-border,none);
    border-radius: var(--spark-button-radius,var(--spark-border-radius-button,4px));
    padding: var(--spark-button-padding,.875em 1.75em);
    text-transform: var(--spark-button-text-transform,none);
    letter-spacing: var(--spark-button-text-letter-spacing,0);
    font-weight: var(--spark-button-font-weight,400);
    font-family: var(--spark-button-font-family,Poppins,sans-serif);
}
```

:::hint{type="success"}
**Customisations available**
For all design customisations available please see our [Customising the Design](docId\:qCt2Zk8wjhYIV2ZbVBJYy) guide.
:::



***

## Frontend Integration Checklist

If you're in the process of setting up SparkLayer on your website, we've included a handy checklist below to make sure you've captured everything:

:::hint{type="info"}
- [ ] **Core script**

* You've <font color="#3b9f0f">**added**</font> the SparkLayer Core Script to your website header. On Shopify, you've enabled the SparkLayer App Embed.

- [ ] **Product detail page**

* You've <font color="#3b9f0f">**added**</font> the *SparkLayer Product Detail Page widget* to your product detail pages.&#x20;
* You've <font color="#ff6900">**hidden** </font>any content that you don't want to show to B2B customers, such as your regular "DTC" pricing, add to cart buttons, "sticky" content that references pricing, or non-B2B content

- [ ] **Product cards**

* You've <font color="#3b9f0f">**added**</font> the *SparkLayer Product Card widget* to your product cards (typically shown on your collection and category pages).
* You've <font color="#ff6900">**hidden** </font>any content that you don't want to show to B2B customers, such as your regular "DTC" pricing, add to cart buttons, "quick buy" buttons, or non-B2B content
* You've <font color="#2166ae">**checked**</font> all areas of your website that include product cards such as the homepage and product recommendations

- [ ] **CSS and design**

* You've <font color="#3b9f0f">**added**</font> the *SparkLayer CSS* to your website (e.g. in the header or in a CSS file) and you've applied any styling formatting to match your branding

- [ ] **Cart (and Cart Drawer)**

* You've <font color="#2166ae">**checked**</font> that when clicking the "cart icon" in your website header, this triggers the My Cart Interface. If it doesn't, you need to ensure the cart is set to not trigger JavaScript for B2B customers and points to the URL `/cart`

- [ ] **General site audit**

* You've <font color="#2166ae">**checked**</font> functionality such as site search and wish-lists to ensure regular (DTC) prices are hidden (you can hide this in CSS or in the code)
:::




[title] Quoting Engine
[path] Features/

:::hint{type="info" attributes="[object Object]"}
**Please note**
The SparkLayer Quoting Engine is available on the SparkLayer *Pro* and *Enterprise* plan or as an addon for $49 per month on *any plan*. You can [change your plan here](https://app.sparklayer.io/settings/plan) or [learn more](https://www.sparklayer.io/pricing/) about our how pricing works.
:::

## Introduction

The SparkLayer Quoting Engine introduces a unified solution that streamlines the entire "quote-to-order" process directly from your existing online store. It allows you to handle quotes more effectively, converting them into completed orders faster than ever!

::embed[]{url="https://www.youtube.com/embed/Lmjwg4RK0r8"}

The SparkLayer Quoting Engine works by allowing your B2B customers to easily request quotes for review, and for your sales team to then communicate with the customer until they're ready to complete their order. Use-cases include:

- Managing the **negotiation process** with a customer
- Managing **pre-ordering** where customers need to request quotes ahead of time
- Managing **sales-assisted** orders where your sales team can add products to an order that your customer can then make edits to before they finalise
- Managing **price on application (POA)&#x20;**&#x70;roducts where your customers can add items to a quote before finalising pricing

This guide runs through how to get started with the SparkLayer Quoting Engine and how you can configure it for your own business requirements.

:::hint{type="success"}
**Want to test it out?**
Try our [interactive demo](https://www.figma.com/proto/EImqog20F76HKgwXPGG6hG/SparkLayer-Quoting?page-id=0%3A1\&node-id=0-4591\&viewport=1497%2C630%2C0.15\&t=PxY0LmnWuGO5gszG-1\&scaling=min-zoom\&content-scaling=fixed\&starting-point-node-id=0%3A2882) of the SparkLayer Quoting Engine.
:::



***

## Features

By way of summary, the SparkLayer Quoting Engine currently supports the following range of features and configurations. You can learn more throughout the guide below.

| Item                          | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Configurations`              | - The ability to **hide or show** “Request a quote” based on a customer group
- The **ability to email&#x20;**&#x77;hen the sales team receives a new quote                                                                                                                                                                                                                                                                                                   |
| `Workflows`                   | * The ability to **assign a quote** to a sales person for handling
* The ability to **set a quote status** against the quote to group quotes
* The ability to **define a default&#x20;**&#x71;uote status
* Quote statuses that can **provide rules&#x20;**&#x69;ncluding:
  - Whether the customer can edit the quote
  - Whether the the customer can complete the quote
  - Whether the customer can download a PDF
  - Whether an expiry date is required |
| `Ordering`                    | - The ability to **add custom line items**
- The ability to **add custom shipping**
- The ability to **add unavailable / POA&#x20;**(Price on Application) products to the quote
- The ability to **add out of stock products&#x20;**&#x74;o the quote
- The ability to **set payment method&#x20;**&#x61;gainst the quote                                                                                                                                    |
| `PDF`                         | * The ability t&#x6F;**&#x20;download the quote&#x20;**&#x61;s a PDF
* The ability to **theme and customise** the PDF                                                                                                                                                                                                                                                                                                                                         |
| `Expiration`                  | - The ability to **set quotes to expire** after a specific date date                                                                                                                                                                                                                                                                                                                                                                                          |
| `Timeline and Communications` | * The ability to **send messages&#x20;**&#x74;o the customer
* The ability t&#x6F;**&#x20;save internal notes** to be viewed by all sales agents
* The ability t&#x6F;**&#x20;track changes** that are made to the quote
* The ability t&#x6F;**&#x20;send email notifications** when a change is made to the quote or a message is received                                                                                                                  |



***

## Getting Started

:::hint{type="success"}
**🚀 Upgrading to the latest SparkLayer version**
To begin using the SparkLayer Quoting Engine, you'll need to be using version `3.7` or above. To learn more about how to upgrade, see [our guide here](docId\:QWXsYM9X5_pvIOGUteKcP).
:::

To get started with the Quoting Engine, you'll need to enable a special setting. Within the SparkLayer Dashboard, go to the [Settings area](https://app.sparklayer.io/configuration/settings/general) and switch on "Enable Quotes".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/1OgU6sOvaweCfbLeDQTHD_image.png)

Once enabled, this then allows your B2B customers to request an order as a quote for subsequent review (see "How it works" below). You'll also see the option to set the following:

| Configuration         | Details                                                                                                                                            |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|  `Quote Statuses`     | Quote Statuses allow you to specify actions and permissions against a specific status (see "Quote Statuses" below).                                |
| `Quote Notifications` | This allow you to set which email recipients are notified of quote activity. We recommend configuring this before launching quoting on your store. |

:::hint{type="warning"}
**Please note**
If you've been using SparkLayer before June, 2025, the SparkLayer Quoting Engine **replaces** the *previous* "Request for Quote" payment method that shows during the checkout process. Once enabled, this payment method will no longer show to customers during the checkout process.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GZMiAIZDF0H7VvDb0cR8o_image.png)

When enabling quoting, you will be prompted to&#x20;
:::



***

## How it works

:::hint{type="success"}
**Want to test it out?**
Try our [interactive demo](https://www.figma.com/proto/EImqog20F76HKgwXPGG6hG/SparkLayer-Quoting?page-id=0%3A1\&node-id=0-4591\&viewport=1497%2C630%2C0.15\&t=PxY0LmnWuGO5gszG-1\&scaling=min-zoom\&content-scaling=fixed\&starting-point-node-id=0%3A2882) of the SparkLayer Quoting Engine.
:::

To understand how the SparkLayer Quoting Engine works, it's useful to illustrate the process at a high-level and how it also works as a B2B customer and a sales agent.

### The quote-to-order process

Generally speaking, the process of requesting and completing a quote works as follows:

::::WorkflowBlock
:::WorkflowBlockItem
**The quote is requested** <font color="#009907">*Active participants: The B2B Customer*</font>
First, the B2B customer adds products to their cart and rather than selecting "Checkout", they select "Request Quote". They can then select their preferred payment method (once the quote is approved) and sumit a request for review.

::embed[]{url="https://www.youtube.com/embed/Na-SjdkksVE"}
:::

:::WorkflowBlockItem
**The quote is reviewed** <font color="#009907">*Active participants: The sales team*</font>
Next, your team (e.g. a sales agent) is notified of the new quote and the review process begins. The sales agent can login, view the contents of the quote, communicate with the customer, and make any edits.

::embed[]{url="https://www.youtube.com/embed/4rLIw1A7zS4"}
:::

:::WorkflowBlockItem
**The quote is negotiated** <font color="#009907">*Active participants: The B2B Customer &amp; the sales team*</font>
Your sales team and the customer can continue to communicate and make edits to the point where the quote is complete and ready to complete as an order.

::embed[]{url="https://www.youtube.com/embed/ClfYwJT0ims"}
:::

:::WorkflowBlockItem
**The quote is completed** <font color="#009907">*Active participants: The B2B Customer*</font>
Once the quote is ready, the customer can then confirm their payment method (e.g. net terms, pay online by card), and the order is then marked as "Processing" and goes through your standard order processing workflows until it's shipped.

::embed[]{url="https://www.youtube.com/embed/DW43LnTqAU4"}
:::
::::

### The process as a B2B customer

When a customer is ready to request a quote, the end-to-end process works as follows:

::::WorkflowBlock
:::WorkflowBlockItem
**Customer adds items to an order**
As they would do with a regular order, the customer can browse your online store and add items to [their B2B shopping cart](docId\:efevur-A3yCJXUHvrR7t-)**.&#x20;**&#x4F;nce they're ready and - providing the Quoting Engine is turned on - they'll then see the option to "Request Quote" at the bottom.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/AixyP9kaLc2OhXwQXnVqC_image.png)
:::

:::WorkflowBlockItem
**Customer goes through checkout**
The customer then selects their preferred shipping method and payment method and reviews the details of the quote before finally clicking "Request Quote". It's important to note that the selected shipping and payment method will subsequently be used when the customer is ready to complete their order.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7h5Y24xKMmS0rR6KNTBxw_image.png)
:::

:::WorkflowBlockItem
**Customer views the quote**
At any point, the customer can access the quote by going to [their My Account](docId\:lQXaNI7IVDqna09D9soAP) and viewing their recent activity. They can quickly see:

| Item           | Details                                                                                                                                                                   |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Requested on` | The date the quote was requested                                                                                                                                          |
| `Expiry date`  | The expiry date of the quote. If a quote status is set to "archive", when an expiry date is passed, no further changes to the quote can be made and it will be cancelled. |
| `Assignee`     | The sales agent the quote has been assigned to                                                                                                                            |
| `Status`       | The status of the quote, as specified in "Quote Statuses" (see below).                                                                                                    |
| `Items`        | The line items (i.e. the products) within the quote with quantities and pricing                                                                                           |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Fyf3AzanEMroM5v6G9zjJ_image.png)
:::

:::WorkflowBlockItem
**Customer communicates with sales team**
The quote includes a special "timeline" view that allows short-form messages to be sent between the customer and the sales team. For example, you may want to send the sales team a revision to your quote or ask a specific question. The timeline review gives customers a history of all communication in one place and is a great way to keep all correspondence unified within the My Account area.

Any communication sent via the timeline is also sent in an email to the customer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pL66OgzHia4V953HFDyTZ_image.png)
:::

:::WorkflowBlockItem
**Customer selects an action**
Depending on the actions and permissions set in "Quote Statuses" (see below), the customer can then perform a range of actions on the quote.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/LAzll6Kz4lxyTpcIiriDt_image.png)

| Action               | Details                                                                                                                                                                                                                                                                                           |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Edit Quote`         | This allows the customer to make edits to the quote such as adding/removing products, changing quantities and more. Clicking this will load the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) with the quote pre-populated.                                                                   |
| `Confirm & Complete` | When the customer is ready to complete the quote, clicking this will take them through to the checkout process to confirm the order. The shipping and payment details will be pre-populated based on the options selected when originally requesting the quote (these can be edited if required). |
| `Cancel & archive`   | This will cancel the quote and prevent any further edits or updates being performed against it. This should only be used if the quote is not longer require.                                                                                                                                      |
:::

:::WorkflowBlockItem
**Customer completes the quote**
Once the customer is ready to complete their quote, they can click the "Confirm & Complete" button (see above). This takes them through to the final step of the B2B checkout process where they can then confirm their preferred shipping and payment method (noting that these will be pre-populated based on the options selected when originally requesting the quote). The customer can then perform a final review of the quote and click "Complete Order"

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/nPMxWYFpwNkcgwwvkDgAK_image.png)
:::

:::WorkflowBlockItem
**Order is ready for processing**
Once the quote has been completed, it will be "converted" into an order and then undergoes your standard workflows for shipping the order to the customer.
:::
::::

### The process as a sales agent

Using the Quoting Engine as a sales agents is one of the best use-cases of this feature. It gives your sales team a great way to proactively create quotes for your customers which can then be reviewed and modified before requesting as an order.

:::hint{type="info"}
**Please note**
For quoting, you need to have setup a sales agent within SparkLayer. A sales agent could be anyone in your business that wants to be able to place orders on behalf your customers in SparkLayer. Learn more about how sales agents work in [our guide here](docId\:Uw8mDbMEfwWKqZrVB5CqX).

**Roles**
In some areas of our docs, we refer to “Sales Agent” as a general term. However, there is a distinction between Sales Agents and Sales Admins. Only a Sales Admin can assign quotes and perform certain higher-level tasks.
:::

The process of reviewing a quote works in much the same way as detailed above with the exception of some sales agent specific actions that streamline the review process.

:::::WorkflowBlock
:::WorkflowBlockItem
**Notification of a new quote&#x20;**&#xA;Based on how you've set up notifications (see "Quote Notifications" below), an email will be sent informing your team that a quote has been requested. This will include the customer's details and the items within their quote.&#x20;
:::

::::WorkflowBlockItem
**Sales agent is assigned to a quote**
Within the notifcation sent (see above), the "Review quote" button allows the quote process to begin. When clicked, you'll be prompted to sign in to the website and you'll then be taken to the quote where a number of actions can be performed by clicking the edit icon within the yellow box. If the quote needs to be assigned, this can be done by a Sales Admin.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/oYLFLxW0YO2hQ6TWa0XvQ_image.png)

:::hint{type="info"}
**Please note**
Only sales agents assigned to the quote by a Sales Admin can perform these changes.
:::

The following details can be edited:

| Item                   | Details                                                                                                                                                                                             |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Assigned Sales Agent` | A Sales Admin can assign a specific Sales Agent to the quote. Once saved, they'll be notified to sign in to review the quote                                                                        |
| `Quote Status`         | This allows a status to be assigned to the quote based on the options set up within "Quote Statuses" (see below)                                                                                    |
| `Expiry Date`          | This allows an expiry date to be set against the quote. If a quote status is set to "archive", when an expiry date is passed, no further changes to the quote can be made and it will be cancelled. |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zuS4xY8EkbiQRGak6qI3X_image.png)
::::

:::WorkflowBlockItem
**Sales agent begins review process**
When a quote is assigned to a sales agent by a Sales Admin, the Sales Agent will be notified via email and can then proceed to begin their review. The sales agent can also view a quote at any point by signing into their account and seeing their recent activity. The "Status" gives an easy way to distinguish quotes versus regular orders.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/2TOCcHJlSjwWXHYETjikf_image.png)
:::

:::WorkflowBlockItem
**Sales agent communicates with the customer**
As with the customer, the sales agent can use the special "Timeline" to send messages to the customer as well as private "internal notes". This is a great way to leave an audit trail of any important activity related to the quote.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/CxCrZMI7eyjAZ1bD6DeA0_image.png)
:::

:::WorkflowBlockItem
**Sales agent selects an action**
Based on an actions required, the sales agent can perform an number of activities against the quote.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/LAzll6Kz4lxyTpcIiriDt_image.png)

| Action               | Details                                                                                                                                                                                                                                                                                                                      |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Edit Quote`         | This allows the sales agent to make edits to the quote such as adding/removing products, updating line-item pricing, editing shipping costs, changing quantities and more. Clicking this will load the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) with the quote pre-populatd.                                        |
| `Confirm & Complete` | This allows the sales agent to complete the quote on behalf of the customer. Clicking this will take them through to the checkout process to confirm the order. The shipping and payment details will be pre-populated based on the options selected when originally requesting the quote (these can be edited if required). |
| `Cancel & archive`   | This will cancel the quote and prevent any further edits or updates being performed against it. This should only be used if the quote is not longer require.                                                                                                                                                                 |

If the sales agent selects to edit the quote and they subsequently make changes, they'll be prompted on the to confirm the quote status, expiry date, and they can optionally leave notes. You can learn more about "Quote Statuses" below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/6JMgADiby1tT_jVBopHCv_image.png)
:::

:::WorkflowBlockItem
**Sales agent finalises the quote**
The final step of the process is to "Confirm & Complete" the quote. This may be performed by the customer themselves or by the sales agent. Once the quote has been completed, it will be "converted" into an order and then undergoes your standard workflows for shipping the order to the customer.
:::
:::::



***

## Quote Statuses

Quote Statuses allow you to customise rules and workflows around how the quote process works. For example, you may want to restrict customers performing specific actions (e.g. being able to edit a quote), or you want quotes to automatically archive once the quote expiry date has passed.

By assigning a status to a quote, you can control how the quote process works and how you engage your sales team and customer throughout.

To get started with the Quote Statuses, within the SparkLayer Dashboard go to the [Settings area](https://app.sparklayer.io/configuration/settings/general) and clicked the "Edit" button next to "Quote Statuses".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/1OgU6sOvaweCfbLeDQTHD_image.png)

You'll then see active statuses as well as the option to "Add new status". By default, all quotes are set to a status of "Quote Requested" and there's an additional status of "Awaiting Customer" that can be used when sales agents perform actions.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/F558IHTd4JoHrjtMrpYMd_image.png)

When editting or adding a new status, you can configure a range of rules that will take effect when a quote is assigned to this specific status.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/g03i1bUSAq62Ts1CK3kUZ_image.png)

| Item                                        | Details                                                                                                          |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `Quote Status Display Name`                 | This is the status that will show when viewing the quote via the My Account on your website.                     |
| `Quote Status Handle`                       | This is used for internal purposes only                                                                          |
| `Set as default quote status for customers` | When set to active, all new quotes requested will use this status initially.                                     |
| `Quote status when edited`                  | When a quote is edited (either by the customer or sales agent), the quote can automatically be assigned a status |
| `Actions allowed`                           | Specific actions can be assigned to a status                                                                     |

Once you made changes to your quote statuses, you'll then see these reflect when viewing the details of the quote within the My Account area.

:::hint{type="info"}
**Please note**
Only sales agents assigned to the quote can perform changes to quote statuses.
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zuS4xY8EkbiQRGak6qI3X_image.png)



***

## Quote Notifications

Notifications are triggered based on certain activities (see "Email notifications sent" below) and it's possible to configure how these work. The notifications work as follows:

| Recipient                    | Details                                                                                                                                                            |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Sales Agent`                | When a Sales Admin assigns a quote to a Sales Agent, they will receive all subsequent notifications to the email address you've set up for them                    |
| `Additional email addresses` | You can optionally specify additional email addresses to send quote activity to (see below)                                                                        |
| `Store email (fallback)`     | If a Sales Agent hasn't been assigned to a quote ad no additional email addresses have been configured, notifications will be sent to your store email (see below) |

**Sales Agent**

This will be the email address you use when setting up a Sales Agent via our [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) tool.

**Additional email addresses**

For quotes that aren't assigned to a Sales Agent, you can also manage who receives notifications of quote activity via the [Configurations](https://app.sparklayer.io/configuration/settings/general) section of the SparkLayer Dashboard. This will take effect for new quotes or if a quote is unassigned.

Once you've enabled quotes, simply click **Edit** next to **Quote Notifications** and you can add any email addresses you require.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Krrx-j4WgrJIidtCTQIl6_image.png)

**Store email (fallback)**

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
The store email can be managed within your Shopify admin by going to Settings, General and [modifying your store details](https://admin.shopify.com/settings/general). This is typically the email address where standard Shopify notifications are sent to.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qMPDUIgEV_vXRXnlajrsK_image.png)
:::

:::Tab{title="🌐 Other platforms"}
For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
::::

### Email notifications sent&#x20;

:::hint{type="info"}
**Please note**
The content for notifications sent are managed by the [Templates](https://app.sparklayer.io/configuration/theme) section of the SparkLayer Dashboard. You can learn how this works in [our guide here](docId\:gznStzTqCRffLFZSTAw0N).&#x20;
We also recommend enabling [My Account "quick links"](docId\:lQXaNI7IVDqna09D9soAP) to make it easier to view quotes via clicking the link within the email notification.
:::

**Quote management & communication emails**
Notifications triggered during key stages of the quote lifecycle, including creation, assignment, messaging and updates:

::::ExpandableHeading
**New quote notification (sent to merchant)&#x20;**

**Trigger:&#x20;**&#x53;ent when an end-customer requests a new quote****
**Recipient:** Sales Administrator (and any emails configured in "Quote Notifications")
**Template**: `Emails/new-quote-notification-to-merchant` ([Learn more](docId\:gznStzTqCRffLFZSTAw0N))

:::BlockQuote
**Email Subject:**
\[Company name] has requested a new quote \[#Pxxxx]
**Email Copy:&#xA;**\[Customer name] has requested a new quote \[#Pxxxx].
To review, approve, or amend the details, please click the button below.
**Button:&#x20;**\[View requested quote]
:::
::::

::::ExpandableHeading
**New quote assigned (sent to Sales Agent)&#x20;**

**Trigger:&#x20;**&#x53;ent when a quote is assigned to a Sales Agent****
**Recipient:** Sales Agent&#x20;
**Template**: `Emails/quote-assigned-notification-to-agent` ([Learn more](docId\:gznStzTqCRffLFZSTAw0N))

:::BlockQuote
**Email Subject:&#x20;**\[Sales Admin name] has assigned you a quote for \[Company name] \[#Pxxxx]
**Email Copy:&#x20;**&#x41; quote for \[Customer name] has been assigned to you by \[Sales Admin name]. Assigned on \[Date] with Quote ID \[#Pxxxx].
**Button:&#x20;**\[View assigned quote]
:::
::::

::::ExpandableHeading
**First response from Sales Agent to quote request (sent to end-customer)**

**Trigger:&#x20;**&#x53;ent when a Sales Agent sends their first reply on a new quote
**Recipient:&#x20;**&#x45;nd-customer
**Template**: `Emails/quote-request-responded-to-notification-to-customer` ([Learn more](docId\:gznStzTqCRffLFZSTAw0N))

:::BlockQuote
**Email Subject:&#x20;**\[Sales Agent name] has responded to your quote request \[#Pxxxx]
**Email Copy:&#x20;**\[Sales Agent name] from \[Merchant name] has responded to your quote request \[#Pxxxx].
**Customer Message:&#x20;**&#x78;xxxx
**Email Copy:&#x20;**&#x54;o access the full conversation in your account and reply, click below.
**Button:&#x20;**\[View quote and conversation]
:::
::::

::::ExpandableHeading
**Subsequent quote update from Sales Agent (sent to end-customer)**

**Trigger:&#x20;**&#x53;ent when a Sales Agent updates an existing quote (price, quantities, products, etc)
**Recipient:&#x20;**&#x45;nd-customer
**Template**: `Emails/quote-updated-notification-to-customer` ([Learn more](docId\:gznStzTqCRffLFZSTAw0N)**)**

:::BlockQuote
**Email Subject:&#x20;**\[Sales Agent name] has updated your quote \[#Pxxxx]
**Email Copy:&#x20;**\[Sales Agent name] from \[Merchant name] has updated your quote \[#Pxxxx].
**Customer Message:&#x20;**&#x78;xxxx
**Email Copy:&#x20;**&#x54;o access the full conversation in your account and reply, click below.
**Button:&#x20;**\[View quote and conversation]
:::
::::

::::ExpandableHeading
**Quote sent to end-customer by Sales Agent**

**Trigger:&#x20;**&#x53;ent when a Sales Agent creates a quote and sends it to the customer
**Recipient:&#x20;**&#x45;nd-customer
**Template**: `Emails/quote-created-notification-to-customer` ([Learn more](docId\:gznStzTqCRffLFZSTAw0N))

:::BlockQuote
**Email Subject:&#x20;**\[Sales Agent name] has sent a quote to review \[#Pxxxx]
**Email Copy:&#x20;**\[Sales Agent name] from \[Merchant name] has created a new quote for you to review \[#Pxxxx].
**Customer Message:&#x20;**&#x78;xxxx
**Email Copy:&#x20;**&#x54;o access the full conversation in your account and reply, click below.
**Button:&#x20;**\[View quote and conversation]
:::
::::

::::ExpandableHeading
**Timeline - message sent by Sales Agent to end-customer**

**Trigger:&#x20;**&#x53;ent to a customer when a sales agent leaves a note
**Recipient:&#x20;**&#x45;nd-customer
**Template**: `Emails/purchase-history-message-notification-to-customer` ([Learn more](docId\:gznStzTqCRffLFZSTAw0N))

:::BlockQuote
**Email Subject:&#x20;**\[Sales Agent name] has sent you a message about your quote \[#Pxxxx]
**Email Copy:&#x20;**\[Sales Agent name] from \[Merchant name] has sent you a new message about your quote \[#Pxxxx].
**Customer Message:&#x20;**&#x78;xxxx
**Email Copy:&#x20;**&#x54;o access the full conversation in your account and reply, click below.&#x20;**&#xA;Button:&#x20;**\[View quote and conversation]
:::
::::

::::ExpandableHeading
**Timeline - message sent by end-customer to Sales Agent**

**Trigger:&#x20;**&#x53;ent to a Sales Agent when a customer leaves a note
**Recipient:&#x20;**&#x53;ales Agent
**Template**: `Emails/purchase-history-message-notification-to-agent` ([Learn more](docId\:gznStzTqCRffLFZSTAw0N))

:::BlockQuote
**Email Subject:** \[Company name] has sent you a message about their quote \[#Pxxxx]
**Email Copy:&#x20;**\[Customer name] from \[Company name] has sent a new message about their quote \[#Pxxxx].
**Customer Message:&#x20;**&#x78;xxxxx
**Email Copy:&#x20;**&#x54;o access the full conversation in your account and reply, click below.
**Button:&#x20;**\[View quote and conversation]
:::
::::

**Limited user approval flow emails**
Notifications triggered when limited users submit orders for approval and when those orders are approved by a merchant:

::::ExpandableHeading
**Limited user order submitted for approval (sent to merchant)**

**Trigger:&#x20;**&#x53;ent when a limited user (end-customer) submits an order created from a quote for approval
**Recipient:&#x20;**&#x4D;ain company user (merchant) / approver
**Template**: `Emails/limited-user-purchase-review` ([Learn more](docId\:gznStzTqCRffLFZSTAw0N))

:::BlockQuote
**Email Subject:&#x20;**\[Limited User name] has submitted a new order for your review \[#Pxxxx]
**Email Copy:&#x20;**\[Limited User name], a limited user on your account, has requested to place order \[#Pxxxx].
As a main user, your approval is required before the order can be processed.
To review and approve or amend the details, please click the button below:
**Button:&#x20;**\[Review Order]
:::
::::

::::ExpandableHeading
**Limited user order approved (sent to end-customer)**

**Trigger:&#x20;**&#x53;ent when a main company user (merchant) approves an order submitted by a limited user
**Recipient:&#x20;**&#x4C;imited user (end-customer)
**Template**: `Emails/limited-user-purchase-approved` ([Learn more](docId\:gznStzTqCRffLFZSTAw0N))

:::BlockQuote
**Email Subject:&#x20;**&#x59;our order \[#Pxxxx] has been approved by \[Main User name]
**Email Copy:&#x20;**&#x59;our order \[#Pxxxx] for \[Company name] has been approved by \[Main User name] and will now be processed for shipment. For any questions, please contact \[Main User name].To access the full conversation in your account and reply, click below.
**Button:&#x20;**\[View Approved Order]
:::
::::



***

## Reviewing Quotes

When reviewing a quote requested by a customer, there are a number of key areas to be aware of. These relate to how you're notified of new quotes, right through to how you can communicate with the customer about the quote.

### Making edits to a quote&#x20;

It's possible to make edits to a quote such as updating quantities, adding or removing products, shipping methods and more. Please see **"How it works"** above to learn more.

### The quote timeline

The SparkLayer Quoting Engine features a special "timeline" that allows communication relevant to a quote to be centralised in one place. It's a great way for customers and Sales Agents to interact and ensures a full audit of the quote is made in the process.

**Timeline activities**

The quote timeline will display the following activities:

| Item                   | Details                                                            |
| ---------------------- | ------------------------------------------------------------------ |
| `Quote actions`        | Including when it was requested and updated                        |
| `Customer messages`    | any messages requested by the customer                             |
| `Sales agent messages` | any messages requested by a Sales Agent                            |
| `Internal notes`       | any private messages requested by a Sales Agent                    |
| `Quote edits`          | any edits are detailed with an audit log of what changes were made |

**Adding messages**

The timeline works by enabling a message box when viewing a specific quote with the [My Account area](docId\:lQXaNI7IVDqna09D9soAP). Any messages added are also sent as email notifications to the recipient (see "Notifications sent" above). Based on the user type, the timeline works slightly differently.

::::Tabs
:::Tab{title="Sales Agent View"}
The sales agent is given the option to send a message (and notify the customer) or save as an internal note.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fGOqx3fwg5YBMvXHs_c8Y_image.png)

When saving as an internal note, the message is denoted in a yellow box and kept private from the customer. Only other sales agents can see these notes.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7YJ0CMdOnmyb3H6zNDlP3_image.png)
:::

:::Tab{title="B2B Customer View"}
The customer will see a simple message box in the timeline view.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/CnKrEYSxZ04fLMySIs4g9_image.png)

When adding a message, these are displayed with the date and time logged.



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Y3SCFwTJRd9igi6k6ffhR_image.png)
:::
::::



***

## Converting a Quote to an Order

When any quote is requested, the final part of the process is to complete the quote and convert it into an order. At this point, the order can then be processed and shipped just like any other.

To learn more about how this works, see **"How it works"** above.



***

## Configuring customer groups

It's possible to configure which [Customers](docId:5_lWMNohhjBJJppg9E6Vh) you'd like to be able to request quotes via your website, allowing you to control which customers can access the feature.

To get started, go to the [Customer Groups section](https://app.sparklayer.io/customers/groups) of the SparkLayer Dashboard and edit the appropriate customer group by clicking the edit icon. Within the "Quoting Engine" section, simply check the box to enable quoting for that specific customer group.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/9ssa8hBXsrVcW_lwF-xKd_image.png)



***

## Quick links to view quotes

SparkLayer has built-in functionality that can optionally 'auto-redirect' a customer or sales agent directly to the order or quote details, simply by clicking a link. To learn how this works, please see [our guide here](docId\:lQXaNI7IVDqna09D9soAP).



***

## Frequently Asked Questions

:::ExpandableHeading
**Can I restrict which customer groups can request quotes?**

Yes, please see "Configuring customer groups" above.
:::

:::ExpandableHeading
**Do I need to have sales agents to use the Quoting Engine?**

If you don't have sales agents within your business, you can still use the Quoting Engine. You will however need to configure a user to essentially act as a sales agent as the quoting process does require being able to login on behalf of a customer to begin the quote review process. You can do this easily via the [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) tool and setting up an account to have "Sales Adminstrator" access.
:::

:::ExpandableHeading
**Can I edit the prices and shipping costs on a quote?**

Yes. When viewing a customer's quote as a sales agent (with [Administrator](docId\:Uw8mDbMEfwWKqZrVB5CqX) access), you can edit the prices of products in an order as well as the shipping cost.
:::

:::ExpandableHeading
**Can I apply discounts to a quote?**

It is not currently possible to add discounts to a quote at this time.
:::

:::ExpandableHeading
**How do I edit the email notifications sent?**

The content for notifications sent are managed by the "Themes" section of the SparkLayer Dashboard. If you requite changes to notifications, please [contact our team](docId\:NNUw1G9z7eaJ4M78vk7t9).&#x20;
:::

:::ExpandableHeading
**Can I use "Request for Quote" as a payment method alongside this?**

It is not possible to use both. The SparkLayer Quoting Engine **replaces** the "Request for Quote" payment method that shows during the checkout process. Once enabled, this payment method will no longer show to customers during the checkout process.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GZMiAIZDF0H7VvDb0cR8o_image.png)
:::

:::ExpandableHeading
**Does the Quoting Engine create a draft order in Shopify?&#x20;**

No, the SparkLayer Quoting Engine manages quotes entirely within SparkLayer. A draft order is **not** created in Shopify. Once a quote is confirmed by the customer, it’s converted into a regular Shopify order that enters your usual order processing flow.
:::



***

## Customising text

It's possible to adjust the text specific to the Quoting Engine functionality by adding special code to the SparkLayer Core Script.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "pdp.messaging.poa": "POA",
    "cart.request-quote": "Request Quote",
    "cart.edit-quote": "Edit Quote",
    "account.order-view.quote": "View & Download Quote",
    "account.order-view.edit-quote": "Edit Quote",
    "account.order-view.confirm-and-complete": "Confirm & Complete",
    "account.order-view.cancel-and-archive": "Cancel and archive.",
    "account.order-view.redirect-to-checkout": "You'll be redirected to the checkout to edit or complete your order.",
    "account.order-view.quote-not-required": "No longer require this quote?",
  },
},
/* End of code */
```



***

## Limitations

The SparkLayer Quoting Engine will be subject to many ongoing improvements, however please be aware of the following limitations currently.

| Item                    | Description                                                                                                                      |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `Company Users`         | It is not currently possible for Limited Users to request quotes. Learn more about [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ)  |
| `Out of stock products` | BigCommerce does not allow out of stock items when creating or editing a quote.                                                  |



***

## Coming soon

As part of ongoing improvements to the SparkLayer Quoting Engine, there will be a number of improvements planned.

| Item                    | Description                                                                                                           |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `Out of stock products` | When completing a quote, if products in the order are out of stock, this will prevent the quote from being finalised. |



***

## Feedback

We've love to know if you have feedback on the SparkLayer Quoting Engine. Let our team know by emailing **product\@sparklayer.io**


[title] Supported Pricing Rules
[path] Dashboard/Price Lists/

## Introduction

SparkLayer has a powerful built-in B2B Pricing Engine that allows you to configure pricing in any of these ways:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qmVzVi59pUeMVHfVqSIBU_b2b-pricing-types.jpg)

### Pricing configurations

Related to the above, SparkLayer can support the following specific pricing configurations.

| **Pricing Type**         | **Details**                                                                                                                                                                                                                                                                                                   |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Pricing source`         | Price lists can be created either via:<br />* **manually uploading** specific prices (via a CSV file), allowing you to set specific prices
* **automated rules** by taking the prices from your eCommerce store (e.g. 50% off retail prices)                                                                  |
| `Product setup`          | - Price lists are set up at a product variant level and rely on SKUs being available                                                                                                                                                                                                                          |
| `Customer-rules`         | * Price lists can be assigned to customers via [customer groups](docId:5_lWMNohhjBJJppg9E6Vh)
* Multiple price lists can be assigned at a customer group level or specific customer level
* Percentage discounts can be assigned at a customer-level via settings. [Learn more](docId\:v8dVUcJ7Ju0fH7BvINrEw) |
| `Currencies`             | - Price lists can be set up in different currencies.&#x20;                                                                                                                                                                                                                                                    |
| `Quantity pricing`       | * You can set quantity pricing (volume-based discounts), e.g. Buy 1 at $10, Buy 10 at $8.&#x20;
* You can set up quantity pricing at a variant level but for quantity calculations to work at parent level                                                                                                    |
| `Discounts & promotions` | - In addition to price lists, you can also configure discounts and promotions for customers. [Learn more](docId\:WrejPw9URyjQwiQeKs_Cg)                                                                                                                                                                       |
| `Advanced settings`      | * You can configure rules such as minimum and maximum order quantities, pack sizes and more at a per customer group level. See more within [Configurations](docId\:SBEaOaCq_A7FfbTatX8bD)                                                                                                                     |


[title] Managing Pricing
[path] Dashboard/Price Lists/

## Introduction

Generally speaking, SparkLayer works by creating price lists that are then assigned to customers (via [Customers](docId:5_lWMNohhjBJJppg9E6Vh)). Once the customer then logs into your website, they then see the pricing rules you've set for them.&#x20;

When setting up your pricing, SparkLayer supports the following methods:

| **Type**            | **Details**                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Manually uploaded` | You can upload pricing into SparkLayer via our built-in CSV file import tool. It works by assigning prices to your product SKUs, allowing you to set **specific prices** as required. This option is great if you need very precise pricing rules.                                                                                                                                                                  |
| `Automatic `        | Automatic pricing works by letting you select a "pricing source" which you can then apply **discounting rules**, e.g. a percentage increase or decrease. For example, if you're using Shopify, you can automatically use your Shopify pricing and apply a discount (e.g. 50% off Shopify prices). This option is great if you have a relatively simple B2B pricing structure that is based on percentage discounts. |
| `Integration`       | If you're connecting a backend system to SparkLayer (e.g. an ERP, PIM, or CRM) you can automatically send pricing data through to SparkLayer                                                                                                                                                                                                                                                                        |

:::hint{type="info"}
**Key concepts**

- **Pricing types can be combined.&#x20;**&#x46;or example, you can have an automatic price list (50% off retail prices) and then manually upload pricing for a specific range of products
- **Pricing is always shown as "net pricing" on your store.&#x20;**&#x44;epending on how you have tax set up, tax is then added during the checkout process
:::



***

## Creating a new price list

When you first sign up to SparkLayer, you'll be asked to create a price list. You can even choose from 'ready-made' price lists that will automatically setup pre-defined rules for you. When you click "Create Price List" you'll then be presented with the following screen:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/y8jY2vk82Mztr1s5IksE6_image.png)

You'll then be prompted to complete the following information:

| **Item**              | **Details**                                                                                                                                           |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Price List Name`     | The price list name as displayed in SparkLayer. You'll use this name to assign it to a customer group.                                                |
| `Price List Handle`   | The unique handle (i.e. ID) of the price list. This is used for internal purposes and relevant if you're connecting your backend system to SparkLayer |
| `Price List Currency` | The default currency, e.g. GBP                                                                                                                        |
| `Automatic pricing`   | Enabling this will allow you to select another pricing source in which to apply your pricing rules (e.g. 50% off Shopify prices)                      |
| `Manual pricing`      | At any point, you can additionally upload a manual price list, even if you've set the price list to be automated                                      |

Finally, when you click the **Create price list&#x20;**&#x62;utton, the newly created price list will then show in the list of available price lists and you can then perform actions against it.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/gpP0r3zERnJOE7UY5FIj7_image.png)

Please note, if you're connecting your backend system to SparkLayer, price lists should only be manually added if they aren't automatically imported via your backend system.



***

## Automatic price lists

Automatic price lists are a great way to set up pricing rules that are **automatically** applied to your B2B customers. This differs from manual price lists (see below) that let you set the exact prices your customer see.

### How automatic price lists work

Automatic price lists work by selecting where you want the pricing to come from (called a "pricing source") and then applying rules against it, such as a percentage variation. Pricing sources are grouped by the pricing type (e.g. manual, automatic, or integration).

### Configuring an automatic price list

To get started, tick the "Enable automatic pricing" checkbox.

From the **Pricing Source&#x20;**&#x6D;enu, you can then select which pricing source you want to use.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/rHzwftEPSTs2AXNg8xwqc_image.png)

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
If you're using Shopify, SparkLayer will automatically synchronise pricing from your Shopify store. Each time you update your pricing in your Shopify admin, this will reflect in the pricing rules you've set up in SparkLayer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/UlEDNWaNXQBuWqIQr1ttJ_image.png)

From SparkLayer, you can select from the following pricing sources when creating a price list:

| **Shopify Price**        | **Details**                                                                                   |
| ------------------------ | --------------------------------------------------------------------------------------------- |
| Shopify Price            | This is the price your regular customers see on your store                                    |
| Shopify Compare-at Price | This is the 'Compare-at price' you set against products, sometimes referred to as RRP or MSRP |

Within your Shopify admin, these correspond to the pricing fields you see when editing a product.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FSFOAmOh31jccpwKswF6m%2Fimage.png?alt=media&token=8efd66ed-f54e-440e-bac6-ea8ddad59bfc)
:::

:::Tab{title="🌐 Other platforms"}
No configurations applicable or necessary
:::
::::

### Applying a percentage variation

Once you've selected your pricing source, you can then choose how you want to apply discounts using a feature called "Percentage Variation".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/sAvE-MfcwI1MiNYfyFFEn_image.png)

Based on the pricing source chosen, you can then enter a percentage variation that either **decreases** or **increases** the pricing. For example, if you want to apply a 50% discount against a pricing source (e.g. your default B2B pricing), simply enter "50".

### Setting a currency conversion

If you're setting up a new price in a **different currency** to your pricing source, you can optionally choose to set a manual exchange rate. For example, if your pricing source is set in GBP (£) and you want your new price list to be in EUR (Euros), you can set a fixed curency conversion rate.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/BR7-VL3P2EfDzFftak9vx_image.png)

:::hint{type="warning"}
**Please note**
If the currency of the new price list is the same as the pricing source, you won't be able to set a currency conversion.
:::

### Accounting for tax

One of the important things to note about SparkLayer pricing is that pricing will always be shown to customers **exclusive of tax** (i.e. net pricing). If you have tax configured on your store, tax will subsequently be added during the checkout as a separate calculation.

If you're using automatic price lists and you're looking to apply a percentage variation (e.g. 20% off your prices), the pricing the customer sees **may not necessarily correspond to this** when they see pricing on the product page. This is because pricing is being adjusted off a price that may already include tax.

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
If you're using Shopify, you can review [how tax is set up here](https://admin.shopify.com/settings/taxes). Providing "**Include tax in prices**" is enabled in Shopify and you've configured sales tax for applicable countries, you'll then be able to use the tax adjustment feature below.&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FDQPDfuEz5xfE3edLbpXu%2Fimage.png?alt=media&token=48ee9ca7-31b8-466e-895c-50c7be072be4)

When configuring an automatic price list, you can account for tax variation by using the built in tax adjustment feature.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DAawNLJer81Daj1gtYX9K_image.png)

When this is clicked, it will adjust your original percentage (e.g. 20%) to factor in the necessary tax calculation. The end result is your customers can place orders and will be charged at the exact percentage intended.

:::hint{type="info"}
**Please note**
If you're Shopify store is setup to use "line item tax" where you're charging specific tax rates on a SKU level, automatic price lists will not factor this into the B2B price calculations
:::
::::

:::Tab{title="🌐 Other platforms"}
No configurations applicable or necessary
:::
:::::



***

## Manual price lists

Manual price lists differ to automatic ones in that you can upload th&#x65;**&#x20;exact pricing** you want for a price list. Perhaps you require very specific pricing for a customer group and you need to have control over the **exact** pricing they see.&#x20;

:::hint{type="success"}
**Combining pricing types**
It's possible to combine manual price lists and automatic price lists! This is a great way to automate your pricing and give you the flexibility to manually specify pricing for specific products.
:::

To get started, click "**Upload CSV"&#x20;**&#x6F;n the Price list you want to add prices to.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TObwauEIPCOIgHwTB0vJD_image.png)

You'll then be prompted with the following screen and asked to upload a CSV file.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/sAge7nimA8V8vvRgf_CA5_image.png)

### How CSV files work

A CSV file (or comma-separated values file) is a common format that is used to quickly import structured data. All software systems used for creating spreadsheets will allow you to save a file as a CSV and typically you can do this from the "File" menu. In our example below, we've illustrated how this works in [Google Sheets](https://www.google.co.uk/sheets/about/)

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2F1wxmQOq3b3XBXjKhvcT4%2Fimage.png?alt=media\&token=0583795c-276a-4cee-b054-9ddb7d5f87ce)

### Use our template CSV file

You can save time and use our ready-made template CSV file and then adapt for your specific pricing structure:

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[Download a CSV template
](https://cdn.shopify.com/s/files/1/0565/7500/0728/files/Example_CSVs_-_Simple_Example.csv?v=1634317574)Use our example CSV file as a starting point.
:::

:::LinkArrayItem
[Google Sheets Example
](https://docs.google.com/spreadsheets/d/13gi0W7yZcZ-CtWXYw1nUJN_art-gSbzRjqN8GSLNaig/edit?usp=sharing)Use our example Google sheet as a starting point.
:::
::::

In order for the CSV file to import successfully, you simply need to set up the following columns:

| **Column** | **Details**                                                                                                 | **Required** |
| ---------- | ----------------------------------------------------------------------------------------------------------- | ------------ |
| `sku`      | The product SKU as set up in your eCommerce platform or backend system                                      | `Yes`        |
| `price`    | The unit price for the SKU (e.g. 14.99).<br />Note: this must **not** include a currency symbol (e.g. $, £) | `Yes`        |

You can see how this looks in the example below.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FlGkZeCCdTrEExl2Rjpq4%2Fimage.png?alt=media\&token=4b6dee3a-403c-46b2-9fb3-15853a6abdc2)

:::hint{type="success"}
**Time-saving tip**
if you only need to upload prices for certain products, you can do this with 'partial CSV uploads'. Simply create a CSV file with the product SKU and price (as noted above) and this will update any existing pricing SparkLayer holds. You can also use [The Price Editor](docId\:fWW4Oh09nSO1-G9TXUTOP) tool to edit prices rapidly.
:::

### Upload quantity pricing

If you're looking to apply quantity pricing (e.g. Buy 1 for $10.00, Buy 5 for $8.00), please see [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe)

### Updating multiple price lists

It's also possible to update multiple price lists in one go via the CSV upload. To access this, first go the [Price Lists overview](https://app.sparklayer.io/pricing/lists), and click "Bulk Upload" at the top of the page.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5j9L8oe82JLnGI_j7AsJP_image.png)

To get started with your CSV file, you'll first need to locate the price list "**Handle"** and you can find this on the main price list overview below the price list name. In the example below, the handles would be `base-uk` and `base-us`.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Lkk5nPWW30HKMHoxBqBVo_image.png)

In your CSV file, simply add a new column at the end, `price_list_slug`. Within this column, you can then enter the price list handle and add as many entries as required. When you upload the CSV file, all associated price lists will then be updated.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/lGRbph8ISteBPexM13iHc_image.png)

:::hint{type="info"}
**Having issues?&#x20;**&#xA;Please see our [troubleshooting guide](docId\:BlCEkkx3I30nkUcglsfw7) for ways to solve common issues.
:::

### Validating the CSV file

When you upload the CSV file, you'll then be shown validation messages based on the content of the file. If the CSV file successfully passes validation, you'll be notified and shown a sample of what has been imported.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MjsEOZdgV2No9vgOjkA%2F-MjsGei3fnjmWhzpIKoO%2Fimage.png?alt=media\&token=d01d4083-2662-4272-a005-c4a721b26ddb)

Clicking **Save Price List&#x20;**&#x77;ill then import the file into SparkLayer and customers will then see these prices when logged in.

### Validation notices & warnings

If the file cannot be imported, e.g. missing prices or an incorrectly formatted file, you'll be notified with relevant details.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MjsEOZdgV2No9vgOjkA%2F-MjsGx6Ii5njbCD3g1JH%2Fimage.png?alt=media\&token=fb012b7f-daf7-4226-b484-c67c7c0d3e81)

It's important to note that a file can be successfully imported but include missing data, e.g. perhaps a product SKU has been listed multiple times in your price list. You'll be notified of affected SKUs and notes on how to remedy the issue.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MjsEOZdgV2No9vgOjkA%2F-MjsHvjekXkJNpp4FSXy%2Fimage.png?alt=media\&token=5445721a-c675-4b64-acd0-da9e4a1c0146)



***

## Synchronising price lists via the API

If you're looking to import your price lists into SparkLayer automatically from your backend system (e.g. ERP), you'll need to send price list data via the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT)



***

## Assigning price lists to customers

Once you've created and uploaded prices for your Price list(s), you can then assign these to different [Customers](docId:5_lWMNohhjBJJppg9E6Vh). This means you can control which customers see which prices when they sign into your website. Learn more in our [Customers](docId:5_lWMNohhjBJJppg9E6Vh) guide.



***

## Customer-specific discounts & price lists

Once you've created a price list and assigned it to a customer group, it's also possible to set up customer-specific discounts **on top** of the price list giving you even more flexibility in the prices your customers see.&#x20;

If you're looking for a more advanced setup (e.g. via your ERP system), you can also configure customer-specific price lists using **metafield data.**

Learn more in [Customer Pricing](docId\:v8dVUcJ7Ju0fH7BvINrEw)



***

## Price lists and tax

Please refer to [our guide here](docId\:ZSsXG6FjRLCod_GxoluTN).



***

## Discounts & promotions

SparkLayer supports the ability to have discounts and promotions applied during the checkout and these can either be redeemed via discount codes, or applied "automatically" to the customer's order.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/discount-codes.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

The SparkLayer Discount Engine unlocks a range of discount rules including:

- **Order-level discounts:** eg, spend $1,000 and get 10% off, spend $2,000 and get 15% off
- **Percentage and fixed discounts:&#x20;**&#x65;g, 20% off an order total, $100 off an order total 
- **Coupon codes:** eg, enter code NEWCUSTOMER and get 5% off
- **Scheduled discounts:** eg, start discount today and end it on a specific date and time
- **Customer-specific discounts:** eg, only allow customer group ‘b2b-vip’ to qualify for the discount 
- And more

:::hint{type="info"}
**Learn more about discounts**
You can see a full overview of what’s possible with discounts in [our guide here](docId\:WrejPw9URyjQwiQeKs_Cg).
:::



***

## Frequently Asked Questions

### Automatic Price Lists

:::ExpandableHeading
**How do I set up automatic price lists (based off my DTC pricing with a discount)?**

Please refer to [our guide here](docId\:NX9Q00eWV_kbjxc3tg1ut).
:::

:::ExpandableHeading
**How can I override pricing for some products if I'm using an automatic price list?**

It's possible to combine manual price lists and automatic price lists! This is a great way to automate your pricing and give you the flexibility to manually specify pricing for specific products.&#x20;

- Once you've created your price list using "automatic" rules, simply click "Options" and then "Upload CSV"&#x20;
- You can manually upload any additional prices you want to assign to the price list.

You can then easily check these via the [Price Editor](https://app.sparklayer.io/products/price-editor).
:::

:::ExpandableHeading
**If I change a product's price in my admin, how long will it take to automatically update in SparkLayer?**

If you're using automatic pricng, this will update instantaneously from your platform into SparkLayer
:::

### Manual Price Lists

:::ExpandableHeading
**How do I remove a price for a product for manually uploaded price lists?**

There are a variety of ways to remove pricing from a product:

- From the [Price Editor](https://app.sparklayer.io/products/price-editor), search for a SKU and then remove any entries you see
- From [Price Lists,](https://app.sparklayer.io/products/price-lists) under "Options" next to a price list, click the "Clear" button. This will remove all pricing for all products
- From [Price Lists](https://app.sparklayer.io/products/price-lists), upload a CSV file with just the SKU(s) you want to remove. In the "**price**" column, leave this blank
:::

:::ExpandableHeading
**How do I clear (empty) a price list for manually uploaded price lists?**

From [Price Lists,](https://app.sparklayer.io/products/price-lists) under "Options" next to a price list, click the "Clear" button. This will remove all pricing for all products
:::

:::ExpandableHeading
**How do I see prices I’ve already uploaded?**

When you upload pricing via the [SparkLayer Dashboard](https://app.sparklayer.io/products/price-lists), there are a variety of ways you can see the pricing you've uploaded:

- You can download the contents of your price list as a CSV file. Simply click "Options" then "Download CSV"
- You can log into your website and view the product page you need to check. You'll need to follow [this guide](docId:5_lWMNohhjBJJppg9E6Vh) to ensure you are logged in correctly as a B2B customer.
- Use the [Price Editor](https://app.sparklayer.io/products/price-editor) within the SparkLayer Dashboard to quickly search by SKU. Learn more about the [Price Editor](docId\:zi2EaFxu8l_7PIFJxlS35)
:::

### Quantity pricing

:::ExpandableHeading
**How do I set up quantity (tiered) pricing?**

Please refer to [our guide here](docId\:t2cEaOsmeOHmgZStjCnhe)
:::

:::ExpandableHeading
**Do I need to specify a price for a single unit if using quantity pricing?**

Yes. When importing a price list that includes tiered pricing, please ensure that you include a tier for the price for a single unit, as demonstrated in the example below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Yabgq17moY4Ww5dnyoqlG_image.png)
:::

### Price configuration

:::ExpandableHeading
**Do I need product SKUs when uploading pricing?**

In terms of product SKUs, SparkLayer relies on these being added to your products within Shopify so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.
:::

:::ExpandableHeading
**Why isn't my B2B pricing showing on my website?**

&#x20;If you're not able to see the B2B pricing, this could be due to one of the following:

- Check that you've imported a [price list](https://app.sparklayer.io/products/price-lists) and assigned to a [customer group](https://app.sparklayer.io/customers/groups)
- Check that all your products have **unique SKUs** assigned
- Check that the product in your website admin has been set to Product Status "**Active**". Currently SparkLayer will only import prices for products that are active (versus in "Draft" status)
- Check th&#x65;**&#x20;SKU exists** within your product catalogue
:::

:::ExpandableHeading
**How do I show the gross price?**

In the context of SparkLayer, SparkLayer will **always&#x20;**&#x6F;utput the prices in the Net amounts, regardless of the tax status you set on your website. In effect, when you upload your B2B pricing via SparkLayer, the customer will see the **exactly the same prices** on your website.&#x20;

If there are circumstances where you do want to show Gross pricing to your B2B customers, there is a potential way around this.

- It's possible to set a customer within your eCommerce platform (e.g. Shopify) to be 'Tax exempt'. This would mean their order would be zero tax rated.
- In the price lists you upload to SparkLayer, set the prices to be the "gross" amounts (even though they don't technically include tax).
- As to reporting, you would need to report on the tax amounts after the fact (e.g. via your accounting system)
:::

:::ExpandableHeading
**How do I show RRP (MSRP) pricing?**

Please refer to [our guide here](docId\:S_VTlJBorGmnwjjfSMom9).
:::

:::ExpandableHeading
**How do I setup and manage multiple currencies?**

SparkLayer supports multiple currencies by default and you can easily configure different currencies for your customer. To learn more about how to set this up, please refer to our platform-specific guides:

- [Shopify Markets & Currencies](docId\:vex5XjFlT6Pvb0AzhlKQD)
:::

:::ExpandableHeading
**Can I set B2B pricing to be higher than my DTC prices**

Yes! In this scenario, you may be looking to set up B2B pricing that is higher than the pricing you have set up for your regular (DTC) customers. With SparkLayer, you can set prices to be higher than the "retail" prices in your eCommerce platform should you require.
:::

:::ExpandableHeading
**Can I set up different automatic pricing rules based on product collections?**

SparkLayer has no built in way to automatically selection which collections (or categories) to apply B2B pricing to, however we do have a suggested workaround if this is a requirement:

- Create a [separate price list](https://app.sparklayer.io/products/price-lists) for each collection you require (Collection A, Collection B, etc)
- In your [customer groups](https://app.sparklayer.io/customers/groups), assign each price list you want to show for your specific customer groups and you can even assign **multiple** price lists to a customer group


:::

### Discounts

:::ExpandableHeading
**How do I set up discount promotional codes at checkout?**

It's possible to set up discount codes that customers can use during the checkout process. For example, you could set up a discount coupon that gives them 10% off their order.

To learn how discounts work, please see [our guide here.](docId\:WrejPw9URyjQwiQeKs_Cg)
:::

:::ExpandableHeading
**How do I set up discounts to apply across a product range?&#x20;**

Within the SparkLayer [Discounts](docId\:WrejPw9URyjQwiQeKs_Cg), using the "Advanced requirements and rewards", you can setup discounts to apply to products with specific tags setup within your store (e.g. in Shopify). For example, you could set the discount to only apply if products within the cart have a tag of `dog-toy` applied, or match a broad term of `dog`. This allows you to setup discounts to apply to collections and product ranges easily.

There are also other workarounds without using discounts:

- You could create a brand new product in your website catalogue and set up a range of variants within it (e.g. all the products you want to offer within the discount)
- We have a special setting called *minimum product quantity* ([See our guide here](docId\:CmxfrPgjQxfz9vJzTVv0D)) which forces the customer to order at least X of the product (e.g. 3)
- Using the [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe), you can then set up your discounted rates (e.g. buy 3 and the price is 10% cheaper)
- Within Shopify, you could make these products 'hidden' from standard B2C customers simply by not associating them to a collection
:::

:::ExpandableHeading
**How do I set up discounts based on an order total?**

It's possible to set up discounts that apply based on a certain threshold, e.g. the order total or the number of items in a cart. To learn more about discounts, see [our guide here](docId\:WrejPw9URyjQwiQeKs_Cg)
:::

### Customer configuration

:::ExpandableHeading
**Can I assign multiple price lists to one customer group and/or customer?**

****

From the [SparkLayer Dashboard](https://app.sparklayer.io/customers/groups), you can assign multiple price lists to a customer group if you want to set up more sophisticated pricing. From the "Update Price Lists" screen, simply click "Add new" to select a price list. In terms of pricing, if a product SKU exists in multiple price lists, SparkLayer will search through all available price lists and use the first one it finds.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/XZicTzb_fXz0y-YSqTEJt_image.png)
:::

:::ExpandableHeading
**How do I assign a price list to a specific customer?**

Please refer to [our guide here](docId\:v8dVUcJ7Ju0fH7BvINrEw).


:::


[title] Launching SparkLayer
[path] Introduction/

:::hint{type="success"}
**Book a FREE Onboarding Call**
Remember, our expert team is here to help you go live. If you need assistance along the way, please [book your free call here](https://book.sparklayer.io/).
:::

## ℹ️  Introduction

The [SparkLayer Dashboard](https://app.sparklayer.io/) guides you through the steps to setup SparkLayer such as adding the special frontend widgets, and setting up your B2B pricing and customer rules. You can learn more about this in [our guide here](docId:-5djX1YCIgzAI6MRkq0u6).

Once you've completed the above, you're then ready to begin the process of launching!&#x20;

| Step                   | Details                                                             |
| ---------------------- | ------------------------------------------------------------------- |
| **✅ Testing&#x20;**    | Perform your own tests such as logging in and placing a test order. |
| **💌  Inviting&#x20;** | Begin inviting a range of customers to use your new B2B store       |
| 🚀 **Launching**       | Going live with your new B2B store and onboarding more customers    |



***

## ✅ Testing&#x20;

:::hint{type="info"}
**Before you start testing, please make sure:**
✅ You've added the [SparkLayer frontend](https://app.sparklayer.io/configuration/frontend/core) (or our team has done this for you)
✅ You've added a [B2B price list](https://app.sparklayer.io/pricing/lists) (even if it's just a test one)
✅ You've added a [B2B customer group](https://app.sparklayer.io/customers/groups) (even if it's just a test one)
:::

You've setup the basics of SparkLayer (see above), you're now ready to start testing it! We recommend going through a testing process to ensure you're familiar with how everything works.

::::::::ExpandableHeading
**🔍 1. Test as a customer and log in  &#x20;**

The first step is to test your website as if you were a B2B customer. We recommend creating an example customer using the guide below.

:::::::Tabs
::::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Before you start!**
For any customers that you want to place B2B orders, they must have a tag of `b2b` assigned to them in [Shopify](https://admin.shopify.com/customers). Without this tag, SparkLayer will **not** load.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FQIfDxuilIEXOND3Aj8zm%2Fimage.png?alt=media&token=dd372248-b122-407a-af11-c3e70b8d58ff)
:::

:::::WorkflowBlock
:::WorkflowBlockItem
**Ensure customer accounts are enabled**
You’ll need to make sure that customer accounts are **enabled** on your storefront so that customers can sign in. Within your Shopify admin, go to [Customer Accounts](https://admin.shopify.com/settings/customer_accounts) and select either "**Customer Accounts**" or "**Legacy Accounts**" (both are compatible with SparkLayer).
:::

:::WorkflowBlockItem
**Edit or create a customer record**
Within your [Shopify Customers admin](https://admin.shopify.com/customers), find an **existing** customer record or add a **new one**.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2Fu3AcpGjnxiWnE6Ea66Md%2Fimage.png?alt=media&token=167b7a73-ecf7-4ae1-8d43-9def1aba00a8)

Fill in all the form fields, **including the address**. It's important that an address is specified otherwise SparkLayer won't find the customer record.
:::

::::WorkflowBlockItem
**Tag the customer**
Next, tag the customer with `b2b`

From within the customer record in Shopify, go to the **Tags** section and type `b2b` into the field. You can either choose from an existing tag, or add it as a new tag

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/shopify-tag-add.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::
::::

:::WorkflowBlockItem
**Invite the customer**
If you're using Shopify "**Customer Accounts**", you can simply direct your customers to the login page and they can then enter their email to receive a 6-digit access code. You can access this by going to `www.yourstore.com/account`.

If you're using "**Legacy accounts**" and you're creating a brand new customer record, you'll need to click "**Send account invite"** and then confirm the account once you've received the activation email ([learn more here](https://help.shopify.com/en/manual/customers/customer-accounts#invite-customers-to-create-accounts)).

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FN1nMCUqE9AKpxfLBGTIz%2Fimage.png?alt=media&token=268d58c4-aa72-4676-9afd-588e144d07e7)

The customer will then receive an email asking them to confirm your account by setting a password. Should you require, you can also edit the contents [of this email here](https://admin.shopify.com/email_templates/customer_account_activate/preview).

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FdWavKJr5PzkJ76rIof4j%2Fimage.png?alt=media&token=773b9e3c-94a9-4a3b-863a-c3bebc64b709)
:::

::::WorkflowBlockItem
**Login as a customer**
Finally, return to your website and visit the login page (e.g. `www.yourstore.com/account`) and enter your details. If you're using Shopify "Customer Accounts", you'll be prompted to enter a 6-digit code that will be sent to your email.

You'll then see SparkLayer load and you can browse your store as a B2B customer!

:::hint{type="info"}
**Please note**
If you can't access this page, make sure you have [customer accounts enabled](https://admin.shopify.com/settings/customer_accounts).
:::
::::

:::WorkflowBlockItem
**Inviting customers**
See our guide further down this page on how to invite your customers.
:::
:::::
::::::

::::::Tab{title="🔵 Using Wix"}
To get started, please following the below steps:

:::::WorkflowBlock
::::WorkflowBlockItem
Within Wix, go to **Customers & Leads** and click **Contacts.&#x20;**&#x59;ou can either create a new customer or edit an existing one.

:::hint{type="warning"}
**Please note**
Please ensure that a valid address is added and all address fields are populated. Make a note of the email address you’ve added as you will need to access this to login.
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/yasbN2UmzPABqPUAYyD4R_image.png)
::::

::::WorkflowBlockItem
To synchronise to SparkLayer, the customer must have a label of `b2b` assigned to them and be a **Site Member**.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/wix-admin-labels.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

You can set this up by clicking the **Add Label** button when editing a customer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pclEA1XohgIVsFe-J6qgG_image.png)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/t2Z4CihI4u6oyA1eMDawa_image.png)

:::hint{type="warning"}
**Please note the following on customer groups**

- SparkLayer will only synchronise customers that have a label of `b2b` assigned
- If you have created additional [customer groups](https://app.sparklayer.io/customers/groups) within SparkLayer, please ensure that the labels are added to the contact record in Wix exactly as shown. e.g. `b2b` `b2b-additional-group`
- Customers must be set up as **Site Members** to be able to sign in to your online store.
- When adding a new label in Wix, please ensure that it is not subsequently edited.
:::
::::

:::WorkflowBlockItem
Once your customers have been set up in Wix (i.e. those with a label of `b2b`), and you've assigned the customer group to **at least** one customer, you can then manage specific rules within the [Customer groups area.](https://app.sparklayer.io/customers/groups)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Xct7huw_ma9kdd8c8DUV5_image.png)
:::

:::WorkflowBlockItem
You'll see a default **Base** customer group that you can use for your B2B customers. If you want to set up additional rules, you can simply click **Create Customer Group** and configure accordingly. For any additional customer groups you create, you'll need to update the labels on the customer record in Wix to match (e.g. `b2b` and `b2b-account`)
:::

:::WorkflowBlockItem
To simulate logging in as a B2B customer, please see **✅ Testing & launching** below.
:::

:::WorkflowBlockItem
You can also check if your customer record is syncing by using the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. Within Wix, navigate to a Contact record that has a label of b2b. Within the URL, you'll see a unique ID at the end of the URL. In the example below, the unique ID is `66b4c99a-3431-47d6-995d-309e4e8c5908`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GVKla6zDdNg2IEVmcqV7m_image.png)

With this unique ID, you can then paste this into the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. If the search results show the customer details, this confirms the customer is synchronosing correctly.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/c5I3ypE5OwwZzNDGPMsaV_image.png)
:::
:::::
::::::

:::Tab{title="🌐 Other platforms"}
Please refer to your platform for details.
:::
:::::::

:::hint{type="success"}
**Checking a B2B customer**
You can also check that a B2B customer has successfully synchronised to SparkLayer in the [Customer Sync](https://app.sparklayer.io/data-sync/customers) tool within the SparkLayer Dashboard.
:::
::::::::

:::::::ExpandableHeading
**🆔 2. Check you have product SKUs**

:::hint{type="info"}
**Please note**
For SparkLayer to work, all products that you want B2B customers to see pricing for **must** have unique SKUs. Without SKUs, SparkLayer has no way to show B2B pricing or our special frontend "widgets"
:::

::::::Tabs
:::Tab{title="🛍️ Using Shopify"}
**How to check for SKUs in Shopify**
Within your [Shopify Products admin](https://admin.shopify.com/products?selectedView=all), if you navigate to any product, you should see a SKU display within the product details.&#x20;

In our example below, the product has a SKU of `MUG-CAT` which is the unique identifier for the product.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/HGx6YYGcL9Qmu0tGu6ij0_image.png)

**How to add SKUs**
If you don't already have SKUs, it's relatively quick to do. You can either edit individual products and add them manually, or you can use the Shopify admin's **Import** or feature to do this in bulk.&#x20;

You may also want to consider an app such as [Matrixify](https://apps.shopify.com/excel-export-import) if you have a lot of SKUs to add.

**Ensuring you have unique SKUs**
For SparkLayer to work, any SKUs added must also be unique (e.g. MUG-CAT, MUG-DOG). If SKUs are "shared" between products, these will need to be adjusted to ensure SKUs are individually set.
:::

:::::Tab{title="🔵 Using Wix"}
To get started, please following the below steps:

::::WorkflowBlock
:::WorkflowBlockItem
For any products that you want your B2B customers to be able to buy, these products **must** have unique SKUs assigned. You can check this by going to **Catalogue > Store Products > Products** and editing a product.

For regular products, you'll see the option to add a SKU within the **Inventory and shipping** section.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/AxJLfxEJF7sXxZaqlPmzH_image.png)

For products that have variants (e.g. colour, size), you'll need to edit a variant and add this within the **Product variants** section and ensure the setting **"Manage pricing and inventory for each product variant"** is turned on.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Bc9tuvHqENppsI-okLIej_image.png)
:::

:::WorkflowBlockItem
Next, go to [Price Lists](https://app.sparklayer.io/pricing/lists) within SparkLayer and click "Create Price List" to create your first B2B Price list. You can choose between an automatic or manual price list and configure how this works.
:::
::::
:::::

:::Tab{title="🌐 Other platforms"}
No customisations applicable.
:::
::::::
:::::::

:::::ExpandableHeading
**✅ 3. Check your products are 'enabled'**

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
For SparkLayer to show B2B pricing, products must be assigned to the **SparkLayer B2B & Wholesale** and **Online Store** sales channels for each product. If the product is not assigned, SparkLayer will not show any pricing.&#x20;

If you don't want the product to be purchaseable by your B2B customers, leaving **SparkLayer B2B & Wholesale** channel *unticked* can be a good way to make specific products "Unavailable" to your B2B customers.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/xSLuHWJD2x0Fn-50vKVRL_image.png)
:::

:::Tab{title="🌐 Other platforms"}
No customisations applicable.
:::
::::
:::::

::::ExpandableHeading
**💰 4. Set up your B2B pricing**

:::hint{type="info"}
**Please note**
SparkLayer will not show any B2B pricing until this step is done.
:::

Now you've got your customer account setup, you'll want to test how your B2B pricing works.

You can add all your B2B prices in the [Price List section](https://app.sparklayer.io/pricing/lists) of SparkLayer and set either **automatic** price lists (a percentage off your retail prices) or **manually** uploaded prices.

With manually uploaded prices, you can upload prices via CSV if you want to set exact B2B pricing (you can also download [a sample price list here](docId\:NX9Q00eWV_kbjxc3tg1ut)).&#x20;
::::

::::ExpandableHeading
**📦 5. Set up your B2B shipping**

:::hint{type="info"}
**Please note**
If you're wanting to customise shipping for your B2B customers, please follow this step.
:::

SparkLayer will by **default** use the shipping rules set up within your eCommerce platform (e.g. Shopify).&#x20;

You can also configure SparkLayer to use special "B2B-specific" shipping rules that only show for your B2B customers and you can [get started here](https://app.sparklayer.io/configuration/shipping).

If you'd rather use your eCommerce platform for shipping rules, you can learn more in  [our full guide here](docId\:CfZ_ZpGw2umOVAo73Lc5m) .
::::

::::::ExpandableHeading
**🛒 6. Set up your B2B payment methods and place an order**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
Providing you have SKUs set up for your products, you can place an order by **going to any product page** and adding items to your order.&#x20;

When you add items, they will then appear in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) and you can then proceed to checkout to complete the order.

**How payment methods work**

When customers reach the payment step, they'll see available methods and can select their preference.

| Payment method       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment on Account` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** needing to enter any payment details.<br /><br />**🏦 For merchants:**<br />It's essentially an 'offline' payment method and you can even set credit limit rules and net payment terms such as `Net 30, Net 60, etc`[Learn more](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                                                                                                                                   |
| `Payment by invoice` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** having to enter in payment details.<br />**🏦 For merchants:**<br />Like "Payment on Account", this is essentially an 'offline' payment method. You can then process the order and take payment via offline channels (e.g. by bank transfer)                                                                                                                                                                                                                     |
| `Pay Online by Card` | **👪 For the B2B customer:**<br />The customer will be directed to your **standard checkout process&#x20;**&#x61;nd will be required to make payment right away (e.g. by card or via another payment processor). This is sometimes referred to as "Pro-forma payment".<br />**🏦 For merchants:**<br />This will come through as a paid (or "completed") order and no further action should be required to collect payment. Note: this is termed "Upfront Payment" within the [Customers](docId:5_lWMNohhjBJJppg9E6Vh) area of the SparkLayer Dashboard |
| `Request for quote`  | **👪 For the B2B customer:**<br />The customer can submit their order **without** choosing a payment method.<br />**🏦 For merchants:**<br />The order will be marked as a 'Draft' order and can subsequently be edited (e.g. changing the shipping cost, adding additional discounts, adding or removing products from an order).                                                                                                                                                                                                                      |

The diagram below helps to illustrate how payments working with SparkLayer and Shopify, based on the payment method the B2B customer selects.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/YPCkYB0irWqwvjrLUfF5T_image.png)

**How orders arrive into Shopify**

Depending on which [payment method](docId\:ibIKczvHM085BkeJIfFYv) you've selected, orders will arrive into Shopify in the following ways by default

| Payment Method       | Flow                                                                                                                    | Status                                                               |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `Pay by Invoice`     | The order is submitted as a **Draft order** within Shopify and then has to be manually acted upon                       | Order is left in Draft status until the payment is successfully made |
| `Pay on Account`     | The order is submitted as a **Draft order** within Shopify and then has to be manually acted upon                       | Order is left in Draft status until the payment is successfully made |
| `Pay Online by Card` | The order is submitted as a **completed order** within Shopify and the customer will **receive an order notification**  | Order is "Paid" status and can be fulfilled (shipped)                |
| `Request for Quote`  | The order is submitted as a **Draft order** within Shopify and then has to be manually acted upon                       | Order is left in Draft status until the payment is successfully made |

**Draft orders and "Completed" orders**

If you're using Shopify, by default **all payment methods** other than Upfront Payment will be generated as [Draft orders](https://help.shopify.com/en/manual/orders/create-orders). If you'd prefer to automatically convert Draft orders into *Completed* orders, you can enable this via the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/settings/general).

**Shopify checkout payment methods**

If a customer selects "Pay Online by Card" (i.e. "Upfront payment"), they'll be directed to the Shopify checkout. By default, they will see all Shopify payment methods you have set up (e.g. card payment, Paypal, etc). It's possible to set rules on which payment methods show for your B2B customers and we recommend [exploring available apps here](https://apps.shopify.com/payfy-conditional-payments).

Please note that if a customer uses "Pay Online by Card" and doesn't complete their order, this will still show in your Shopify Draft Orders admin for review.

:::hint{type="success"}
**Please note**
You can automatically convert "Draft" orders into "Completed" orders by turning on the "Auto-complete Shopify Draft orders" in the [Sparklayer Dashboard here](https://app.sparklayer.io/configuration/settings/general).
:::

**Additional order details**

When an order is placed via SparkLayer, it will also include the following additional data:

| Attribute | Notes                                                                                                                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tag`     | A tag of `b2b` is added to any order placed via SparkLayer. This is particularly useful for filtering and segmenting orders, or even adding more advanced automations                               |
| `note`    | Order Note: `sparkCartId`<br />This is added as an **order note.**<br />This is primarily for internal use for debugging                                                                            |
| `note`    | Order Note: `sparkPaymentType`<br />This is added as an **order note.**<br />This contains the name of the payment option used:<br />* upfrontPayment
* paymentOnAccount
* paymentByInvoice
* quote |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Rvq1u6FZpNUn2i6qXrjXW_image.png)

:::hint{type="success"}
**Viewing B2B orders in Shopify**
You can quickly view B2B orders by logging into your Shopify admin and adding this to the URL `orders?tag=b2b` or [by going here](https://admin.shopify.com/store/orders?tag=b2b)
:::
::::

:::Tab{title="🔵 Using Wix"}
When customers reach the payment step, they'll see a variety of available payment methods and can select their preference.

| Payment method       | Description                                                                                                                                                                                                                                                            |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment on Account` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** needing to enter any payment details.                                                                                                                                           |
| `Payment by invoice` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** having to enter in payment details.                                                                                                                                             |
| `Pay Online by Card` | **👪 For the B2B customer:**<br />The customer will be directed to your **standard checkout process&#x20;**&#x61;nd will be required to make payment right away (e.g. by card or via another payment processor). This is sometimes referred to as "Pro-forma payment". |
| `Request for quote`  | **👪 For the B2B customer:**<br />The customer can submit their order **without** choosing a payment method.                                                                                                                                                           |

**How orders arrive into Wix**

Depending on which [payment method](docId\:ibIKczvHM085BkeJIfFYv) you've selected, orders will arrive into Wix in the following ways:

| Payment Method       | Flow                                                                                                                                                                                                                                                       |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Pay by Invoice`     | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                |
| `Pay on Account`     | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                |
| `Pay Online by Card` | The order will be created within **Sales > Orders** with a payment status of "PAID". You can then proceed to fulfil the order. Note: this is termed "Upfront Payment" within the [Customers](docId:5_lWMNohhjBJJppg9E6Vh) area of the SparkLayer Dashboard |
| `Request for Quote`  | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                |

**"Unpaid" orders and "Paid" orders**

By default **all payment methods** other than Upfront Payment will be generated as "Unpaid" orders.&#x20;

**Wix checkout payment methods**

If a customer selects "Pay Online by Card" (i.e. "Upfront payment"), they'll be directed to the Wix checkout. By default, they will see all Wix payment methods you have set up (e.g. card payment, Paypal, etc).&#x20;
:::

:::Tab{title="🌐 Other platforms"}
No customisations applicable.
:::
:::::
::::::

::::ExpandableHeading
**🎨 7. Check your design customisations (CSS)**

:::hint{type="info"}
**Please note**
If you've requested our team to install SparkLayer for you, this step will already be completed.
:::

We typically recommend adding some basic CSS customisations to your website to match your styling.&#x20;

If you'd like to customise these further, please see [Customising the Design](docId\:qCt2Zk8wjhYIV2ZbVBJYy)
::::

:::::ExpandableHeading
**📝 8. Set up a B2B login and registration process&#x20;**

:::hint{type="info"}
**Please note**
It's worth noting that you may not require a registration form at all if you are manually inviting your B2B customers. You can learn more in our "Inviting your customers" guide lower down on this page.
:::

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
There are three recommended ways to set up a B2B registration process.

1. **Use our "B2B login and register" page:&#x20;**&#x57;e've a ready-made template that also includes a registration form. You can see this in action on our [demo store](docId:87ILO_vHmG3XUXKecOLXv). Learn more in [Shopify B2B Registration & Login](docId\:Gfc0UW7mJnMNpnNO6EdRl)&#x20;
2. **SparkLayer Forms (recommended)** - Our built-in, no-code form builder lets you create and manage B2B registration forms directly within the [SparkLayer Dashboard](https://app.sparklayer.io/forms/) - no third-party apps needed. Get started with the ready-made Customer Registration Form template which includes approval workflows, automatic customer tagging, and email notifications. [Learn more about SparkLayer Forms](docId\:nn5qnfmfGkXlyUmAMpSnq)&#x20;
:::

:::Tab{title="🌐 Other platforms"}
No customisations applicable.
:::
::::
:::::

::::ExpandableHeading
**🚀 9. Enable additional B2B features (hiding products, approval form, shipping)**

:::hint{type="info"}
**Please note**
This step is optional and you can continue testing without applying customisations if you do not require them.
:::

We've got a variety of additional features you can add such as showing a live stock level, pack sizes, B2B-only products, retail prices (RRP), and much more.&#x20;

You can explore all available SparkLayer features in our [our interactive demo](https://www.figma.com/proto/5FPCY5hSGl7mlwjsjMZI2t/SparkLayer-Interfaces?page-id=0%3A1\&type=design\&node-id=86-36708\&viewport=554%2C-398%2C0.33\&t=34VlPwbCqpvQOTsh-8\&scaling=min-zoom\&starting-point-node-id=35%3A7920\&hide-ui=1).

:::hint{type="success"}
**Customer experience**
✅  [Set up a B2B login page](docId\:Gfc0UW7mJnMNpnNO6EdRl)&#x20;
✅  [Set up a B2B registration page](docId\:Gfc0UW7mJnMNpnNO6EdRl)
✅  [Hiding B2B products from regular DTC customers](docId:30hMTg4Cqqv69EhqNvpnf)&#x20;
✅  [Show B2B-only content](docId:30hMTg4Cqqv69EhqNvpnf)&#x20;
✅  [Create a B2B-only navigation menu](docId:30hMTg4Cqqv69EhqNvpnf)&#x20;
✅  [Modify your B2B email notifications](docId\:FAW11UwvEk1KN06woxik0)&#x20;

****
**Checkout process**
✅  [Configure B2B-only shipping](docId\:ZSsXG6FjRLCod_GxoluTN)
✅  [Customise your B2B payment methods](docId\:ibIKczvHM085BkeJIfFYv)
✅  [Configure custom checkout data fields](docId\:o3nDhZBCxisWH6M6satDt)


**Product configurations**
✅  [Setup product pack sizing](docId\:CmxfrPgjQxfz9vJzTVv0D)
✅  [Setup minimum and maximum quantities](docId\:CmxfrPgjQxfz9vJzTVv0D)
✅  [Show live inventory levels](docId\:Gj_Ao_gQ6oA-jx0D27Hys)
✅  [Setup pre-orders and backorders](docId\:Gj_Ao_gQ6oA-jx0D27Hys)
✅  [Set "reserve inventory" for your DTC customers](docId\:Gj_Ao_gQ6oA-jx0D27Hys)

**Automations**
✅  [Shopify Flow (Ready-made automations)](docId\:uvXV1kUg_VsZEPr5Dlb2z)&#x20;
:::

To see what else is possible, check [our full guide here](docId\:SSzdKXuNMlEIDOOITHQcU).
::::

:::hint{type="info"}
**Need help troubleshooting?**
Please see our [Troubleshooting](docId\:BlCEkkx3I30nkUcglsfw7) guide for how to solve the most common queries.
:::



***

## 💌  Inviting&#x20;

You've tested SparkLayer and you're happy it works. Next, let's invite some customers to use it! We've some recommend tips you can use as part of your onboarding process. &#x20;

::::::::ExpandableHeading
**👤  Inviting your customers&#x20;**

:::hint{type="warning"}
**Before you invite your customers**
We strongly recommend you perform a full end-to-end test of the steps within "*Test & Launch SparkLayer"*. Once you're done, you may want to invite a subset of customers to guage any feedback before inviting all your customers!
:::

:::::::Tabs
::::::Tab{title="🛍️ Using Shopify"}
When you're ready to begin inviting your B2B customers to your Shopify store, you can easily manage this via the Shopify admin by following the process below.

:::hint{type="info"}
**Before you start**
You'll need to make sure you have accounts enabled in your Shopify store. Within your [Shopify admin here](https://admin.shopify.com/settings/customer_accounts), go to Customer Accounts and select either "Customer Accounts" or "Legacy Accounts" (both are compatible with SparkLayer).
:::

To begin inviting customers, you can follow the steps below:

:::::WorkflowBlock
:::WorkflowBlockItem
**Edit or create a customer record**
First, within your Shopify Customers admin, find an existing customer record or add a new one.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2Fu3AcpGjnxiWnE6Ea66Md%2Fimage.png?alt=media&token=167b7a73-ecf7-4ae1-8d43-9def1aba00a8)

Fill in all the form fields, **including the address.** It's important that an address is specified otherwise SparkLayer won't find the customer record.
:::

::::WorkflowBlockItem
**Tag the customer**
Next, tag the customer with `b2b`

From within the customer record in Shopify, go to the **Tags** section and type `b2b` into the field. You can either choose from an existing tag, or add it as a new tag

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/shopify-tag-add.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::
::::

:::WorkflowBlockItem
**Invite the customer**
If you're using Shopify "**Customer Accounts"**, you can simply direct your customers to your login page (e.g. `www.yourstore.com/account`). They will be prompted to enter their email address and this will email them a 6-digit access code to sign in.

If you're using **"Legacy accounts"** and you're creating a brand new customer record, you'll need to click **'Send account invite'&#x20;**&#x77;ithin the customer record in your Shopify admin.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FN1nMCUqE9AKpxfLBGTIz%2Fimage.png?alt=media&token=268d58c4-aa72-4676-9afd-588e144d07e7)

The customer will then receive an email asking them to confirm your account by setting a password. You can edit the contents [of this email here](https://admin.shopify.com/email_templates/customer_account_activate/preview).

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FdWavKJr5PzkJ76rIof4j%2Fimage.png?alt=media&token=773b9e3c-94a9-4a3b-863a-c3bebc64b709)
:::

::::WorkflowBlockItem
**Login as a customer**
Finally, the customer can return to your website and visit the login page (e.g. `www.yourstore.com/account`). If you're using Shopify "Customer Accounts", the customer will be prompted to enter their email and then their 6-digit code. If you're using "Legacy Accounts", the customer can sign in with their email address and password..

They'll then see SparkLayer load and they can browse your store as a B2B customer!

:::hint{type="info"}
**Please note**
If they can't access this page, make sure you have [customer accounts enabled](https://admin.shopify.com/settings/customer_accounts).
:::
::::
:::::
::::::

:::::Tab{title="🔵 Using Wix"}
::::WorkflowBlock
:::WorkflowBlockItem
**Set up a customer record**
Within your Wix admin, you'll need to ensure you have an example customer record set up (either a new one or an existing). Most importantly, a customer must be associated with a label of `b2b` and be a Site Member. Any customer that has a label of `b2b` will automatically synchronise with SparkLayer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pclEA1XohgIVsFe-J6qgG_image.png)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/iKKqCk7rxlXCTSM6W-hBi_image.png)
:::

:::WorkflowBlockItem
**Invite your customers**
When you're ready to invite your B2B customers to begin using your store, there are a variety of ways you can do this. One of the easiest ways is to use the built-in Wix messaging system to simply notify your customer to sign in and begin placing orders.&#x20;

You can access this by going to your Wix Dashboard, clicking **Customers & Leads** and then **Contacts**. You'll see a tab called **Inbox** that allows you to send direct messages.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5kdTEgvaPekbMdybdqosS_image.png)

You could also think about sending a marketing newsletter to your customers to notify them of your new B2B store and to sign in. You can access this by going to your Wix Dashboard, clicking **Customers & Leads** and then **Contacts**. You can then search and filter your customers and click **Send Email Campaign** to send an email.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bQ8LaAASXrGmv2S4ESMlD_image.png)

We also have some example messaging you can use when inviting your customers and you can explore more below in **"Using our example "Welcome" email"**
:::
::::
:::::

:::Tab{title="🌐 Other platforms"}
Please refer to your platform for details.
:::
:::::::
::::::::

:::::ExpandableHeading
**👥  Inviting your customers in bulk**

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
- If you're looking to invite a set of B2B customers in one go, you can use third-party Shopify apps to streamline this for you. A popular option is [Matrixify](https://apps.shopify.com/excel-export-import?st_source=autocomplete) which has built-in tools to quickly create customer records and invite them.
- If you're looking to bulk invite customers but want to skip sending them emails, you can also try [BAIS Bulk Account Invite](https://apps.shopify.com/bulk-account-invite-sender?)
:::

:::Tab{title="🌐 Other platforms"}
Please refer to your platform for details.
:::
::::
:::::

:::::ExpandableHeading
**🤖  Automating the approval process**

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
**Automating the approval process**
To further automate the process, it's possible to allow customers to "apply for access" on your store that you can then moderate before granting them the ability to place B2B orders. We've detailed some great options in [our guide here](docId\:Gfc0UW7mJnMNpnNO6EdRl).&#x20;
:::

:::Tab{title="🌐 Other platforms"}
Please refer to your platform for details.
:::
::::
:::::



***

## 🚀 Launching

You've invited a range of customers and things are working well. What's next? We now recommend **fully launching** your new B2B store and inviting more customers to use it! We've a variety of handy resources you can use to speed up and optimise this process. &#x20;

:::::::ExpandableHeading
**⭐  Create an onboarding landing page to promote the benefits**

A great way to encourage your customers to use your new B2B store is to **explain the benefits**. To help you get started, you can use our ready-made "onboarding landing page" that gives a great overview of the features to your customers.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/4_tcO7rdfhTWX98AQBVLU_image.png)

::::::Tabs
:::::Tab{title="🛍️ Using Shopify"}
To install the onboarding landing page, please follow these steps:

::::WorkflowBlock
:::WorkflowBlockItem
In Shopify, go to **Online Store** and click **Pages** (or [go here](https://admin.shopify.com/pages))
:::

:::WorkflowBlockItem
Click the "Show HTML" button and then paste in the [code from here](https://gist.github.com/cm-sl/47d750425f90d527e1210efe3735dc7f)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zFOBIqABCi7DYG7Hy3-BO_image.png)
:::

:::WorkflowBlockItem
You can then customise the page title, URL, and any of the content as required.&#x20;

We recommend give the page a URL of `b2b-onboarding`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/N_E3EMEJe4Y7asWggYO1g_image.png)

Finally, set the page to "**Visible**" to publish it on your store and you can then click "**View**" to see the page.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/A9FsEBDR1BXEUli7HwRxQ_image.png)
:::

:::WorkflowBlockItem
To make customers aware of your new page, you could add this to your website navigation (such as your website header or footer). If you're using our ready-made [Shopify B2B Registration & Login](docId\:Gfc0UW7mJnMNpnNO6EdRl) you can also link to the page from there.
:::
::::


:::::

:::Tab{title="🌐 Other platforms"}
Please refer to your platform on how to set up custom landing pages.
:::
::::::
:::::::

:::ExpandableHeading
**✨  Create a dedicated B2B customer landing page**

Alongside the "onboarding landing page" detailed above, you could also create a **dedicated** landing page that you direct B2B customers to as soon as they sign in - whether it's to highlight specific products, show important information, or act as a central hub for your B2B store.

You can learn more in [our full guide here](docId\:iirMl1jUUXvRotG9fdhTp)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/NRjWAhD1FLCza4fVilYSY_shopify-b2b-landing-page.jpg)
:::

:::ExpandableHeading
**💌  Use our example "Welcome" email &#x20;**

To help with the process of inviting your customers, we've put together an example email you could send to them! Perhaps this could be sent in a newsletter or as a personal email from your B2B sales team.

***

<font color="#2166ae">Dear [Valued Partner],</font>

<font color="#2166ae">We’re excited to announce our new online B2B store and we’re excited to have you join!</font>

<font color="#2166ae">To ensure a smooth start, we’ve put together a guide to help you activate your account and start placing orders.</font>

<font color="#2166ae">**Account Activation: The First Step to Joining**</font>

- <font color="#2166ae">**Look Out for Our Email:** Keep an eye on your inbox for an email from [My Store] with the subject "Activate Your [My Store] Partner Account."</font>
- <font color="#2166ae">**Activate with a Click:** Within that email, you'll find the ‘Activate My Account’ button. Click it to move forward with your activation.</font>
- <font color="#2166ae">**Secure Your Login:** Follow the link to create your own secure password. After this, your account is all set and ready to go.</font>

<font color="#2166ae">**B2B Portal: Streamlining Your Business**</font>

- <font color="#2166ae">**Fast Track with Quick Order:** Speed is essential in business. That's why our ‘Quick Order’ feature offers a simple layout to place your orders quickly and efficiently - perfect for when you know exactly what you need.</font>
- <font color="#2166ae">**Explore Products in Detail:** Curious about a product? Visit the ‘Products’ page for an in-depth look at the benefits, and quickly add to your order</font>

<font color="#2166ae">**Effortless Account Management**</font>

- <font color="#2166ae">**Your Orders, Simplified**: By clicking on the ‘Account’ or ‘Cart’ icons, you can view your Order Summary, adjust account settings, and monitor your orders in real-time.</font>
- <font color="#2166ae">**Get a Shipping Quote:** Ready to finalize your order? Get live shipping costs right before you place your order</font>
- <font color="#2166ae">**Approval Before Payment:** If you need administrative approval, select 'Pay on Account' to submit your order and we'll take care of the rest.</font>

<font color="#2166ae">**Account Extras:**</font>

<font color="#2166ae">Within ‘My Account,’ you’ll also discover tools to:</font>

- <font color="#2166ae">Review your order history.</font>
- <font color="#2166ae">Save personalized shopping lists for quick reordering.</font>
- <font color="#2166ae">Update your shipping addresses whenever necessary.</font>

<font color="#2166ae">**We're Here for You**</font>

<font color="#2166ae">Should you have any questions or need assistance, our dedicated team is ready to help at [Your Support Email].</font>

<font color="#2166ae">Thank you for choosing [My Store] as your partner, we’re excited to have you on board!</font>

<font color="#2166ae">Warm regards,</font>

<font color="#2166ae">[Your Name]</font> <font color="#2166ae">[Your Position]</font> <font color="#2166ae">[My Store]</font> <font color="#2166ae">[Contact Information]</font>
:::

:::::ExpandableHeading
**🎨  Updates to your website**

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
Alongside the above recommendations, there are also a variety of "on site" updates you could think about to encourage your B2B customers to access your B2B store:

1. **Navigation:** Add a clear link to your navigation, e.g. in the header or footer. You can typically do this from your Shopify Admin, under "Online Store" and clicking "Navigation"
2. **Landing page:** Set up a landing page to entice new (and existing) customers. This could include graphics, some selling points of your B2B store, testimonials, featured products, and more
3. **Emails:&#x20;**&#x74;hink about how you can update any email marketing you have to promote your new B2B store!
:::

:::Tab{title="🌐 Other platforms"}
Please refer to your platform for details.
:::
::::


:::::



***

## 📚 Additional resources

Alongside the practical steps detailed above, we also regularly create publications to help you grow your B2B and wholesale business.&#x20;

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-helIWHvtf5gvZ7mOSkWYz-20250627-135246.jpg"}
[Micropaper - Unlocking customer Adoption](https://www.sparklayer.io/adoption/)

Devise and deliver a winning B2B customer adoption strategy.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-TnWtoGpkMeIYctdZ4-vTb-20250627-135257.jpg"}
[Micropaper - Reimagining B2B Operations](https://www.sparklayer.io/reimagine/)

Discover the cutting-edge wholesale tactics brands are using to stay ahead.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-edfo-azM9DuQlZt868Yis-20250627-135311.jpg"}
[Micropaper - Simplifying B2B Success](https://www.sparklayer.io/simplify/)

Discover the cutting-edge wholesale tactics brands are using to stay ahead.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-ztzQDK6a1ggPCI7-svihw-20250627-135601.jpg"}
[Video Series - Acquire, Onboard, Retain & Adopt.](https://www.sparklayer.io/b2b-journey/)

A free video series for brands, wholesalers, and distributors on mastering the B2B customer journey and driving sales.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-TXnCggSTbCcXVyjyuoIms-20250806-094722.jpg"}
[Love B2B eCommerce - by SparkLayer](https://www.sparklayer.io/love-b2b-ecommerce/)

A free tooklit - discover how to grow your B2B eCommerce business with expert videos, strategy guides, case studies, and 1:1 consultations.&#x20;
:::
::::




[title] Tax & Shipping
[path] Features/Configurations/

## Introduction

In the context of B2B, it's really important to understand the two types of pricing available to customers:&#x20;

| Price type | Tax setup                                                                                                           |
| ---------- | ------------------------------------------------------------------------------------------------------------------- |
| `Gross`    | The pricing will **include** tax. For example, if the price is $20.00, this price will include any tax calculations |
| `Net`      | The pricing will **exclude** tax. For example, if the price is $20.00, this price will exclude any tax calculations |

B2B customers typically make payments in one of these ways:&#x20;

- either with tax **included** (Gross Pricing)
- or tax **excluded**  (Net pricing)



***

## How SparkLayer calculates tax

Before diving into the details, here's a quick visual overview of how tax is calculated when your B2B customers place an order.

:::Iframe{iframeHeight="0" code="<style>&#xA;.sltx,.sltx *{margin:0;padding:0;box-sizing:border-box}&#xA;.sltx{font-family:Roboto,-apple-system,BlinkMacSystemFont,sans-serif!important;color:#1f2937!important;line-height:1.55;-webkit-font-smoothing:antialiased;background:#f9fafb!important;padding:16px 20px!important;border:1.5px solid #e5e7eb!important;border-radius:12px!important}&#xA;.sltx-hd{text-align:center;margin-bottom:10px}&#xA;.sltx-tags{display:flex;gap:6px;justify-content:center;margin-bottom:6px}&#xA;.sltx-h1{font-size:18px!important;font-weight:700!important;color:#111827!important;margin-bottom:2px!important;line-height:1.3!important}&#xA;.sltx-sub{font-size:13.5px!important;color:#6b7280!important;max-width:460px;margin:0 auto}&#xA;.sltx-dots{display:flex;align-items:center;max-width:360px;margin:0 auto 10px}&#xA;.sltx-dot{width:7px!important;height:7px!important;border-radius:50%!important;background:#e5e7eb!important;flex-shrink:0;cursor:pointer;border:none!important;transition:all .2s;position:relative;padding:0!important;font-size:0!important;line-height:0!important;outline:none}&#xA;.sltx-dot--on{width:9px!important;height:9px!important;background:#1a56db!important;box-shadow:0 0 0 3px #e8eefb}&#xA;.sltx-dot--dn{background:#1a56db!important}&#xA;.sltx-dot:hover::after{content:attr(data-t);position:absolute;bottom:calc(100% + 5px);left:50%;transform:translateX(-50%);background:#1f2937;color:#fff!important;font-size:10px!important;padding:2px 7px;border-radius:4px;white-space:nowrap;z-index:10;pointer-events:none;line-height:1.4!important}&#xA;.sltx-ln{flex:1;height:2px!important;background:#e5e7eb!important;transition:background .2s;border:none!important}&#xA;.sltx-ln--on{background:#1a56db!important}&#xA;.sltx-vp{display:flex!important;flex-direction:column!important;justify-content:center!important;height:auto!important}&#xA;.sltx-sl{display:none;animation:sltxF .15s ease}&#xA;.sltx-sl--on{display:block}&#xA;@keyframes sltxF{from{opacity:0}to{opacity:1}}&#xA;.sltx-cd{border:1.5px solid #e5e7eb!important;border-radius:10px!important;background:#fff!important;padding:14px 16px!important}&#xA;.sltx-tg{display:inline-flex!important;align-items:center!important;gap:4px;padding:2px 9px!important;border-radius:16px!important;font-size:10px!important;font-weight:600!important;letter-spacing:.3px;text-transform:uppercase;background:#e8eefb!important;color:#1a56db!important;line-height:1.4!important;margin-bottom:6px!important}&#xA;.sltx-tg--gn{background:#ecfdf5!important;color:#0d9488!important}&#xA;.sltx-tg-dot{width:5px!important;height:5px!important;border-radius:50%!important;display:inline-block!important;background:#1a56db!important;font-style:normal!important}&#xA;.sltx-tg--gn .sltx-tg-dot{background:#0d9488!important}&#xA;.sltx-h3{font-size:16px!important;font-weight:700!important;color:#111827!important;margin-bottom:4px!important;line-height:1.35!important}&#xA;.sltx-p{font-size:14px!important;color:#4b5563!important;line-height:1.6!important;margin-bottom:4px!important}&#xA;.sltx-p:last-child{margin-bottom:0!important}&#xA;.sltx-b{color:#1f2937!important;font-weight:600!important}&#xA;.sltx-code{background:#f3f4f6!important;padding:1px 5px!important;border-radius:3px!important;font-size:12px!important;font-family:'SF Mono',monospace!important;color:#374151!important;font-style:normal!important}&#xA;.sltx-np{display:inline-flex!important;align-items:center!important;gap:3px;background:#f3f4f6!important;padding:2px 7px!important;border-radius:4px!important;font-size:12.5px!important;font-weight:500!important;color:#374151!important}&#xA;.sltx-np-sep{color:#9ca3af!important;font-size:9px!important;font-weight:400!important}&#xA;.sltx-dc{border:1.5px dashed #fed7aa!important;border-radius:10px!important;background:#fffbf5!important;padding:14px 16px!important}&#xA;.sltx-dc-lb{font-size:9px!important;font-weight:600!important;letter-spacing:1.2px;text-transform:uppercase;color:#e8590c!important;margin-bottom:4px!important}&#xA;.sltx-opts{display:flex;gap:8px;margin-top:2px}&#xA;.sltx-opt{flex:1;padding:8px 10px!important;border-radius:7px!important;font-size:13.5px!important;font-weight:600!important;font-family:inherit;cursor:pointer;border:1.5px solid #e5e7eb!important;background:#fff!important;color:#374151!important;transition:all .15s;text-align:center;line-height:1.4!important;outline:none}&#xA;.sltx-opt:hover{border-color:#1a56db!important;color:#1a56db!important;background:#f0f4fe!important}&#xA;.sltx-opt--pk{border-color:#1a56db!important;background:#1a56db!important;color:#fff!important}&#xA;.sltx-rv{display:none;margin-top:10px;animation:sltxF .15s ease}&#xA;.sltx-rv--vs{display:block}&#xA;.sltx-rb{border-radius:7px!important;padding:10px 12px!important}&#xA;.sltx-rb--g{background:#ecfdf5!important;border:1px solid #a7f3d0!important}&#xA;.sltx-rb--b{background:#eef2fb!important;border:1px solid #c5d4f5!important}&#xA;.sltx-rb--o{background:#fff4ed!important;border:1px solid #fed7aa!important}&#xA;.sltx-rb .sltx-h4{font-size:14px!important;font-weight:600!important;color:#111827!important;margin-bottom:3px!important;line-height:1.35!important}&#xA;.sltx-rb .sltx-p{font-size:13px!important}&#xA;.sltx-cols{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}&#xA;.sltx-done{border:1.5px solid #a7f3d0!important;border-radius:10px!important;background:#ecfdf5!important;padding:14px 16px!important;text-align:center}&#xA;.sltx-nav{display:flex!important;justify-content:space-between!important;align-items:center!important;margin-top:10px!important;gap:8px}&#xA;.sltx-btn{display:inline-flex!important;align-items:center!important;gap:4px;padding:6px 14px!important;border-radius:7px!important;font-size:13.5px!important;font-weight:600!important;font-family:inherit;cursor:pointer;border:1.5px solid #e5e7eb!important;background:#fff!important;color:#374151!important;transition:all .15s;line-height:1.4!important;outline:none;white-space:nowrap}&#xA;.sltx-btn:hover{border-color:#d1d5db!important}&#xA;.sltx-btn--p{background:#1a56db!important;border-color:#1a56db!important;color:#fff!important}&#xA;.sltx-btn--p:hover{background:#1548be!important}&#xA;.sltx-btn:disabled{opacity:.3;cursor:not-allowed;pointer-events:none}&#xA;.sltx-cnt{font-size:12px!important;color:#9ca3af!important;font-weight:500!important;white-space:nowrap}&#xA;.sltx-rst{display:inline-flex!important;align-items:center!important;gap:4px;padding:4px 12px!important;margin-top:8px;border-radius:16px!important;font-size:11px!important;font-weight:500!important;font-family:inherit;cursor:pointer;border:1px solid #e5e7eb!important;background:#fff!important;color:#9ca3af!important;line-height:1.4!important;outline:none}&#xA;.sltx-rst:hover{color:#4b5563!important;border-color:#d1d5db!important}&#xA;@media(max-width:480px){.sltx-opts{flex-direction:column}.sltx-cols{grid-template-columns:1fr}}&#xA;</style>&#xA;<div class=&#x22;sltx&#x22; id=&#x22;sltxRoot&#x22;>&#xA;<div class=&#x22;sltx-hd&#x22;><div class=&#x22;sltx-tags&#x22;><span class=&#x22;sltx-tg&#x22;><span class=&#x22;sltx-tg-dot&#x22;></span>SparkLayer</span> <span class=&#x22;sltx-tg sltx-tg--gn&#x22;><span class=&#x22;sltx-tg-dot&#x22;></span>Shopify</span></div><div class=&#x22;sltx-h1&#x22;>How tax works</div><div class=&#x22;sltx-sub&#x22;>How your B2B customers see tax in SparkLayer, and how it flows through to your Shopify orders.</div></div>&#xA;<div class=&#x22;sltx-dots&#x22; id=&#x22;sltxDots&#x22;></div>&#xA;<div class=&#x22;sltx-vp&#x22; id=&#x22;sltxVp&#x22;>&#xA;<div class=&#x22;sltx-sl&#x22; data-i=&#x22;0&#x22;><div class=&#x22;sltx-cd&#x22;><span class=&#x22;sltx-tg&#x22;><span class=&#x22;sltx-tg-dot&#x22;></span>Start</span><div class=&#x22;sltx-h3&#x22;>Your B2B customer browses your store</div><div class=&#x22;sltx-p&#x22;>All prices shown by SparkLayer are <span class=&#x22;sltx-b&#x22;>excluding tax</span> - your customers always see the net price, no matter how your Shopify tax settings are configured.</div></div></div>&#xA;<div class=&#x22;sltx-sl&#x22; data-i=&#x22;1&#x22;><div class=&#x22;sltx-cd&#x22;><span class=&#x22;sltx-tg&#x22;><span class=&#x22;sltx-tg-dot&#x22;></span>SparkLayer</span><div class=&#x22;sltx-h3&#x22;>The B2B price comes from your price list</div><div class=&#x22;sltx-p&#x22;>The price your customer sees is the one you've set up in your SparkLayer price list. This is your <span class=&#x22;sltx-b&#x22;>wholesale price</span> and it's what appears on the product page.</div></div></div>&#xA;<div class=&#x22;sltx-sl&#x22; data-i=&#x22;2&#x22;><div class=&#x22;sltx-cd&#x22;><span class=&#x22;sltx-tg sltx-tg--gn&#x22;><span class=&#x22;sltx-tg-dot&#x22;></span>Checkout</span><div class=&#x22;sltx-h3&#x22;>Customer goes to checkout</div><div class=&#x22;sltx-p&#x22;>Your customer adds products to their cart and starts the checkout. At this point, <span class=&#x22;sltx-b&#x22;>SparkLayer works with Shopify</span> to figure out how much tax to add.</div></div></div>&#xA;<div class=&#x22;sltx-sl&#x22; data-i=&#x22;3&#x22;><div class=&#x22;sltx-dc&#x22;><div class=&#x22;sltx-dc-lb&#x22;>Does this apply to you?</div><div class=&#x22;sltx-h3&#x22;>Do you sell products with different tax rates?</div><div class=&#x22;sltx-p&#x22;>Some stores sell products taxed at different rates (e.g. food vs non-food). We have a special setting for this - <span class=&#x22;sltx-b&#x22;>contact our team to enable it.</span></div><div class=&#x22;sltx-opts&#x22;><button class=&#x22;sltx-opt&#x22; onclick=&#x22;sltxPk(3,'y',this)&#x22;>Yes - enabled by our team</button><button class=&#x22;sltx-opt&#x22; onclick=&#x22;sltxPk(3,'n',this)&#x22;>No - standard setup</button></div><div class=&#x22;sltx-rv&#x22; id=&#x22;sltxR3y&#x22;><div class=&#x22;sltx-rb sltx-rb--o&#x22;><div class=&#x22;sltx-h4&#x22;>We create the order early for accurate tax</div><div class=&#x22;sltx-p&#x22;>When your customer selects their shipping address, SparkLayer creates a <span class=&#x22;sltx-b&#x22;>preliminary order in Shopify</span> behind the scenes. This gets the exact tax rate per product <span class=&#x22;sltx-b&#x22;>before</span> showing the final total. You may see draft orders tagged <span class=&#x22;sltx-code&#x22;>b2b-pending</span>.</div></div></div><div class=&#x22;sltx-rv&#x22; id=&#x22;sltxR3n&#x22;><div class=&#x22;sltx-rb sltx-rb--b&#x22;><div class=&#x22;sltx-h4&#x22;>Tax is calculated at the end</div><div class=&#x22;sltx-p&#x22;>Tax is worked out as a single rate across the whole order. The order is only created in Shopify when the customer completes checkout.</div></div></div></div></div>&#xA;<div class=&#x22;sltx-sl&#x22; data-i=&#x22;4&#x22;><div class=&#x22;sltx-cd&#x22;><span class=&#x22;sltx-tg sltx-tg--gn&#x22;><span class=&#x22;sltx-tg-dot&#x22;></span>Shopify checks</span><div class=&#x22;sltx-h3&#x22;>Is this customer tax-exempt?</div><div class=&#x22;sltx-p&#x22;>Mark customers as tax-exempt in <span class=&#x22;sltx-np&#x22;>Customers <span class=&#x22;sltx-np-sep&#x22;>›</span> [Customer] <span class=&#x22;sltx-np-sep&#x22;>›</span> Manage tax exemptions</span></div><div class=&#x22;sltx-cols&#x22;><div class=&#x22;sltx-rb sltx-rb--g&#x22;><div class=&#x22;sltx-h4&#x22;>✓ Exempt</div><div class=&#x22;sltx-p&#x22;>No tax charged. The order total won't include any tax.</div></div><div class=&#x22;sltx-rb sltx-rb--b&#x22;><div class=&#x22;sltx-h4&#x22;>✗ Tax applies</div><div class=&#x22;sltx-p&#x22;>Shopify checks if <span class=&#x22;sltx-b&#x22;>Charge tax on this product</span> is on per product.</div></div></div></div></div>&#xA;<div class=&#x22;sltx-sl&#x22; data-i=&#x22;5&#x22;><div class=&#x22;sltx-cd&#x22;><span class=&#x22;sltx-tg sltx-tg--gn&#x22;><span class=&#x22;sltx-tg-dot&#x22;></span>Shopify</span><div class=&#x22;sltx-h3&#x22;>Tax rate based on shipping country</div><div class=&#x22;sltx-p&#x22;>Shopify applies the correct tax rate based on <span class=&#x22;sltx-b&#x22;>where the order ships to</span>. Manage this in <span class=&#x22;sltx-np&#x22;>Settings <span class=&#x22;sltx-np-sep&#x22;>›</span> Taxes and duties</span>.</div></div></div>&#xA;<div class=&#x22;sltx-sl&#x22; data-i=&#x22;6&#x22;><div class=&#x22;sltx-cd&#x22;><span class=&#x22;sltx-tg&#x22;><span class=&#x22;sltx-tg-dot&#x22;></span>SparkLayer</span><div class=&#x22;sltx-h3&#x22;>Your wholesale price is sent to Shopify</div><div class=&#x22;sltx-p&#x22;>SparkLayer <span class=&#x22;sltx-b&#x22;>replaces the standard retail price</span> with your B2B wholesale price. The customer always pays the price from your SparkLayer price list.</div></div></div>&#xA;<div class=&#x22;sltx-sl&#x22; data-i=&#x22;7&#x22;><div class=&#x22;sltx-dc&#x22;><div class=&#x22;sltx-dc-lb&#x22;>Your Shopify settings</div><div class=&#x22;sltx-h3&#x22;>Do your Shopify prices include tax?</div><div class=&#x22;sltx-p&#x22;>Check if <span class=&#x22;sltx-b&#x22;>Include sales tax in product price</span> is on in <span class=&#x22;sltx-np&#x22;>Settings <span class=&#x22;sltx-np-sep&#x22;>›</span> Taxes and duties</span>. Common for UK/EU stores.</div><div class=&#x22;sltx-opts&#x22;><button class=&#x22;sltx-opt&#x22; onclick=&#x22;sltxPk(7,'y',this)&#x22;>Yes - prices include tax</button><button class=&#x22;sltx-opt&#x22; onclick=&#x22;sltxPk(7,'n',this)&#x22;>No - prices exclude tax</button></div><div class=&#x22;sltx-rv&#x22; id=&#x22;sltxR7y&#x22;><div class=&#x22;sltx-rb sltx-rb--o&#x22;><div class=&#x22;sltx-h4&#x22;>Price list may need adjustment</div><div class=&#x22;sltx-p&#x22;><span class=&#x22;sltx-b&#x22;>Manual price lists:</span> no action needed - enter net wholesale prices as normal.</div><div class=&#x22;sltx-p&#x22;><span class=&#x22;sltx-b&#x22;>Automatic price lists:</span> tick <span class=&#x22;sltx-b&#x22;>adjust percentage to account for tax</span> when setting up the price list.</div></div></div><div class=&#x22;sltx-rv&#x22; id=&#x22;sltxR7n&#x22;><div class=&#x22;sltx-rb sltx-rb--g&#x22;><div class=&#x22;sltx-h4&#x22;>No special setup needed</div><div class=&#x22;sltx-p&#x22;>Your Shopify prices already exclude tax. Just set your wholesale prices in SparkLayer and you're good to go.</div></div></div></div></div>&#xA;<div class=&#x22;sltx-sl&#x22; data-i=&#x22;8&#x22;><div class=&#x22;sltx-cd&#x22;><span class=&#x22;sltx-tg&#x22;><span class=&#x22;sltx-tg-dot&#x22;></span>SparkLayer</span><div class=&#x22;sltx-h3&#x22;>Prices shown as net + tax</div><div class=&#x22;sltx-p&#x22;>Your customer <span class=&#x22;sltx-b&#x22;>always sees the net price with tax shown separately</span> as a line item. This is the case regardless of your Shopify tax settings.</div></div></div>&#xA;<div class=&#x22;sltx-sl&#x22; data-i=&#x22;9&#x22;><div class=&#x22;sltx-cd&#x22;><span class=&#x22;sltx-tg&#x22;><span class=&#x22;sltx-tg-dot&#x22;></span>SparkLayer</span><div class=&#x22;sltx-h3&#x22;>Customer completes their order</div><div class=&#x22;sltx-p&#x22;>The customer confirms their order. If different tax rates was enabled, the preliminary draft order is updated. Otherwise, a new order is created.</div></div></div>&#xA;<div class=&#x22;sltx-sl&#x22; data-i=&#x22;10&#x22;><div class=&#x22;sltx-done&#x22;><span class=&#x22;sltx-tg sltx-tg--gn&#x22; style=&#x22;margin-bottom:6px!important&#x22;><span class=&#x22;sltx-tg-dot&#x22;></span>Done</span><div class=&#x22;sltx-h3&#x22;>Order appears in your Shopify admin</div><div class=&#x22;sltx-p&#x22; style=&#x22;text-align:left&#x22;>Your order is now in Shopify. If &#x22;include tax in price&#x22; is on, Shopify shows prices as tax-inclusive with a tax summary - this looks different from checkout but the totals match. If it's off, prices show the same way as SparkLayer.</div></div><div style=&#x22;text-align:center&#x22;><button class=&#x22;sltx-rst&#x22; onclick=&#x22;sltxGo(0)&#x22;>↻ Start over</button></div></div>&#xA;</div>&#xA;<div class=&#x22;sltx-nav&#x22;><button class=&#x22;sltx-btn&#x22; id=&#x22;sltxPb&#x22; onclick=&#x22;sltxBk()&#x22;>‹ Back</button><span class=&#x22;sltx-cnt&#x22; id=&#x22;sltxCt&#x22;></span><button class=&#x22;sltx-btn sltx-btn--p&#x22; id=&#x22;sltxNb&#x22; onclick=&#x22;sltxNx()&#x22;>Next ›</button></div>&#xA;</div>&#xA;<script>&#xA;(function(){&#xA;var T=11,c=0,v={0:1};&#xA;var L=['Browse','Price list','Checkout','Tax rates?','Exempt?','By country','Price sent','Inc. tax?','Net+Tax','Complete','Done'];&#xA;function bd(){&#xA;var s=document.getElementById('sltxDots');if(!s)return;s.innerHTML='';&#xA;for(var i=0;i<T;i++){&#xA;if(i>0){var l=document.createElement('div');l.className='sltx-ln';l.setAttribute('data-l',i);s.appendChild(l)}&#xA;var d=document.createElement('button');d.className='sltx-dot';d.setAttribute('data-d',i);d.setAttribute('data-t',L[i]);&#xA;d.onclick=(function(x){return function(){sltxGo(x)}})(i);&#xA;if(i===0)d.classList.add('sltx-dot--on');s.appendChild(d);&#xA;}&#xA;}&#xA;function rn(){&#xA;var root=document.getElementById('sltxRoot');if(!root)return;&#xA;root.querySelectorAll('.sltx-sl').forEach(function(s){s.classList.toggle('sltx-sl--on',parseInt(s.getAttribute('data-i'))===c)});&#xA;root.querySelectorAll('.sltx-dot').forEach(function(d){&#xA;var i=parseInt(d.getAttribute('data-d'));&#xA;d.classList.remove('sltx-dot--on','sltx-dot--dn');&#xA;if(i===c)d.classList.add('sltx-dot--on');else if(v[i])d.classList.add('sltx-dot--dn');&#xA;});&#xA;root.querySelectorAll('.sltx-ln').forEach(function(l){&#xA;l.classList.toggle('sltx-ln--on',parseInt(l.getAttribute('data-l'))<=c);&#xA;});&#xA;document.getElementById('sltxPb').disabled=c===0;&#xA;document.getElementById('sltxNb').disabled=c===T-1;&#xA;document.getElementById('sltxCt').textContent='Step '+(c+1)+' of '+T;&#xA;}&#xA;window.sltxGo=function(i){c=i;v[i]=1;rn()};&#xA;window.sltxNx=function(){if(c<T-1)sltxGo(c+1)};&#xA;window.sltxBk=function(){if(c>0)sltxGo(c-1)};&#xA;window.sltxPk=function(s,ch,b){&#xA;var sl=b.closest('.sltx-sl');if(!sl)return;&#xA;sl.querySelectorAll('.sltx-opt').forEach(function(o){o.classList.remove('sltx-opt--pk')});&#xA;b.classList.add('sltx-opt--pk');&#xA;sl.querySelectorAll('.sltx-rv').forEach(function(r){r.classList.remove('sltx-rv--vs')});&#xA;var el=document.getElementById('sltxR'+s+ch);&#xA;if(el)el.classList.add('sltx-rv--vs');&#xA;};&#xA;bd();rn();&#xA;})();&#xA;</script>&#xA;"}

:::



***

## How SparkLayer handles pricing

SparkLayer will **always&#x20;**&#x6F;utput the prices in the Net amounts, regardless of the tax status you set on your website. In effect, when you upload your B2B pricing via SparkLayer, the customer will see the **exactly the same prices** on your website.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/iYole6STzq9EM5EOMcruJ_image.png)

When the customer then proceeds through the checkout, they will then see the tax calculations added.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/HWrBpR00MC6xtmXngciRH_image.png)

Simply put, SparkLayer calculates tax based on the setup you have on your website and you can see full information for specific platforms below.

::::::Tabs
:::::Tab{title="🛍️ Using Shopify"}
Before starting, there are two important resources to review:

1. Your specific Shopify store set up: by [visiting this link](https://admin.shopify.com/admin/settings/taxes/), you can see how your tax is setup
2. Shopify help guides: Shopify how their own guides on setting up tax, [please see here](https://help.shopify.com/en/manual/taxes/registration/setup).

Broadly speaking, Shopify lets you configure tax rules at a global level but also apply specific edits against customers and products.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/0RxVJYn8CtvuM5jXr-XQR_image.png)

To help set the scene, we've summarised some of the key ways you can configure tax below. Please note: If you're using SparkLayer to power your B2B store alongside your B2C (retail), you'll need to check carefully before making any edits. &#x20;

:::ExpandableHeading
**Setting a customer to be tax-exempt**

It's possible to set a customer within Shopify to be 'Tax exempt'. Within Shopify, click edit on a Customer and under '**Manage tax exemptions'&#x20;**&#x79;ou can untick "Collect tax". Once done, the customer will then be exempt from any tax charges on your website.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/RGG5NuSR5bf418zzDa5eJ_image.png)

In the context of SparkLayer, they'll see all your pricing as net and on the final step of the checkout, the tax will be set to zero.
:::

:::ExpandableHeading
**Setting up tax settings for products (including variants)**

Shopify has the ability to set tax rules on a product and product-variant basis, giving you a great deal of flexibility on how tax is charged. When editing a product, you'll see a checkbox 'Charge tax on this product' which, when ticked, will use the tax settings [you've configured here](https://admin.shopify.com/admin/settings/taxes/).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/l8jKIPVXcBggS_BmvsOoj_image.png)

You can also configure this on a product-variant level.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/4A9F2Fo2BB2Wxpv1vlHRB_image.png)

In the context of SparkLayer, if you have specific products that are set to not charge tax, this will be factored in when the customer gets to the final step of the checkout to see their overall tax charges.


:::

:::ExpandableHeading
**Setting up country-level tax settings**

It's also possible to set up country-level rules for tax which will apply to customers based on their shipping destination country. You can manage country-level tax settings from the [Markets](https://admin.shopify.com/settings/markets) area of Shopify.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/p41vJuXn-kOnVEa98mOut_image.png)

In the context of SparkLayer, if your store is setup to allow shipping to multiple countries, this will be factored in when the customer gets to the final step of the checkout to see their overall tax charges.
:::

:::ExpandableHeading
**Draft orders and collecting tax**

If you've set up SparkLayer to send orders into Shopify as "Draft Orders", it's also possible to change the tax charges against an order.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/mkD6dszyh-aQT74wwdWf6_image.png)

When tax is removed, this will adjust the "Estimated tax" calculation in the order totals for the Draft order.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/9IzMRR6YxuFieCmPsTVoF_image.png)

In the context of SparkLayer, if you remove tax against a draft order, this will only apply to the "Estimated tax" calculation. It will not retrospectively apply this against specific products in the order.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jVzgpPJjRD32cKvzCmSow_image.png)
:::

:::ExpandableHeading
**Displaying gross pricing (tax inclusive) and net pricing (tax exclusive)**

If there are circumstances where you do want to show Gross pricing **AND** Net pricing to your B2B customers, you can consider the following approach.

- By default, SparkLayer will **always** output the pricing as net pricing (see above to learn more). When a B2B customer sees pricing, it will always be tax exclusive
- Within your storefront theme, you could use custom coding to display a custom price on the page, shown only to logged in customers. This could use the **metafields** system available within platforms such as Shopify and BigCommerce.
- To show gross pricing, you could potentially make use of our [RRP (MSRP) feature](docId\:S_VTlJBorGmnwjjfSMom9) that lets you set a price independent to the B2B price. Note: this is not the intended use but can act as a workaround
:::

:::ExpandableHeading
**Displaying gross pricing**

If there are circumstances where you do want to show Gross pricing to your B2B customers, there is a potential way around this.

- It's possible to set a customer within Shopify to be 'Tax exempt' (see above). This would mean their order would be zero tax rated.
- In the price lists you upload to SparkLayer, set the prices to be the "gross" amounts (even though they don't technically include tax).
- As to reporting, you would need to report on the tax amounts after the fact (e.g. via your accounting system)
:::

::::ExpandableHeading
**"Line item tax" - handling products with differing tax rates**

If you have products within your Shopify store that have different tax rates, SparkLayer is able to support "line item" tax levels.

To check if you have this enabled within Shopify:

- Within your Shopify admin, go to **Settings** and click **Taxes and Duties** (or [click here](https://admin.shopify.com/store/settings/taxes))
- Ensure that the "Include sales tax in product price and shipping rate" setting is enabled

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/QgyToD0wPJWYr3hSon2s9_image.png)

If this setting is enabled and you have products in your store that have different tax rates within a single jurisdiction, you're able to enable a special SparkLayer setting that has handling for this. **Please speak to our team to assist you.**

:::hint{type="warning"}
**Please note the following:**

- When this setting is enabled, the draft will be created in Shopify when the customer reaches the shipping / payment method select step of the checkout, **before** they've clicked "complete order".
- At this point the draft order will have a tag of `b2b-pending`. Once the customer clicks "complete" the draft order is updated to have a tag of `b2b`
:::

**Why is this necessary?**

When an order is placed via SparkLayer we calculate a discount to be applied to each line item to yield the correct B2B price.

- When the "Include sales tax in product price and shipping rate" setting is <font color="#eb144c">**disabled**</font>, we calculate the difference between the Shopify price and the SparkLayer B2B price and apply that as a discount.&#x20;
- When the "Include sales tax in product price and shipping rate" setting is <font color="#3b9f0f">**enabled**</font> we must also compensate for tax. Historically SparkLayer used a single tax rate (the rate for the first line item) to calculate the discount for all line items.

The only way for SparkLayer to get the tax rates for each line item from Shopify is to create a draft order.

Here are some screenshots showing the difference between two identical orders created with and without the "Create draft order during calculation" feature enabled.

When the feature is disabled the second line item has the incorrect discount applied.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/6Xbp3RphE8qyocCvFxURj_image.png)

When the feature is enabled the second line item has the correct discount applied.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/F01wgga35XQi_INxc6-Ro_image.png)
::::
:::::

:::Tab{title="🌐 Other platforms"}
Please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
::::::



***

## ⚠️ Troubleshooting

:::::::hint{type="warning"}
**⚠️Tax shows as zero (e.g. $0.00)&#x20;**

When placing an order through SparkLayer, the tax is showing as zero (e.g. $0.00) in the SparkLayer checkout or when the order has come through into your website admin.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

Check that the customer account is **not** set as **Tax Exempt.** Go into the [customer record in Shopify](https://admin.shopify.com/store/customers), in the customer settings in the right hand side you are able to **Manage tax exemptions** as show below

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/u-r4t-99TAiJyWj8SKKq4_image.png)

***

Check if you are charging tax on the products or variants in your Shopify store. Go into the [product in your store](https://admin.shopify.com/store/products?selectedView=all) and scroll down the pricing to see the below and ensure the **Charge tax on this product** is ticked.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ru1gAVNkg2K7RkkB9VgNX_image.png)

***

Check if you you are charging tax in the country the customer is checking out with. Within the [Taxes and duties](https://admin.shopify.com/store/settings/taxes) section, navigate to the specific country and you'll see a "tick" if the country is collecting tax or not.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/n0uzl6qiTGzrnaCYBEe1M_image.png)
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Tax is being charged when it shouldn't be**

When going through the SparkLayer checkout, the customer is being charged tax when they shouldn't be.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

Check that the customer account is **not** set as **Tax Exempt.** Go into the [customer record in Shopify](https://admin.shopify.com/store/customers), in the customer settings in the right hand side you are able to **Manage tax exemptions** as show below

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/u-r4t-99TAiJyWj8SKKq4_image.png)
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Tax is&#x20;**<font color="#eb144c">***not***</font>**&#x20;being charged in the checkout when it should be**

When going through the SparkLayer checkout, the customer is **not** being charged tax when they shouldn't be.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

Check that the customer account is set as **Tax Exempt.** Go into the [customer record in Shopify](https://admin.shopify.com/store/customers), in the customer settings in the right hand side you are able to **Manage tax exemptions** as show below

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/u-r4t-99TAiJyWj8SKKq4_image.png)
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Prices are wrong when I check an order**

When placing and order through SparkLayer, the pricing in the SparkLayer checkout is different to the pricing being displayed in the Shopify order.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

Go to your Shopify settings and navigate to [Taxes and Duties](https://admin.shopify.com/store/settings/taxes). When scrolling to the bottom, check if you have **Include sales tax in product price and shipping rate** turned on as shown below.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/emD9eSDmEyLPp2d_xM1hG_image.png)

If this is turned **on**, when creating an [automatic price list](https://app.sparklayer.io/sparklayertrial/live/pricing/lists) you will need to ensure you click on the **Adjust percentage to account for tax** to ensure SparkLayer connects to Shopify with the correct pricing.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/dbYH6Ty7PJFzHd4t1wkDm_image.png)

***

In addition to this, we also recommend ensuring that the price of the product is **lower** in SparkLayer than it is in Shopify. One way to do this is to go the [Price Editor](https://app.sparklayer.io/pricing/editor) in the SparkLayer Dashboard and searching for the SKU.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7ATIsIKxRIw-POiYtqIYZ_image.png)

You can then compare this price to the price that you have in Shopify.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ismC-LbXPA6nKOnlBie34_image.png)

It's very important to note that if the Shopify price is **lower** than the SparkLayer price, when the customer goes through the SparkLayer checkout, it will default to the **lower** Shopify price.&#x20;

When checking your pricing, you'll also need to consider if the Shopify price is **including** tax or not. If the SparkLayer price is higher "after tax" than your Shopify price including tax then again it will revert to the lower Shopify price.
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Shipping to a different country shows the wrong tax amount&#x20;**

When a customer is placing an order to a different country from your "default" country in Shopify, the tax is not being calculated correctly.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

Check if you you are charging tax in the country the customer is checking out with. Within the [Taxes and duties](https://admin.shopify.com/store/settings/taxes) section, navigate to the specific country and you'll see a "tick" if the country is collecting tax or not.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/n0uzl6qiTGzrnaCYBEe1M_image.png)
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Tax is being charged twice in the checkout**

When a customer is placing an order, they are being charged tax "twice" on their order.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

If you're using a [manual price list](docId\:NX9Q00eWV_kbjxc3tg1ut), check that you haven't uploaded your prices as **gross** (i.e. including tax). In order for tax to be added correctly in the cart, all pricing must be uploaded at **net** pricing (i.e. excluding tax).

***

If you are using [automatic price lists](docId\:NX9Q00eWV_kbjxc3tg1ut) and you have [Include sales tax in price and shipping](https://admin.shopify.com/store/settings/taxes) switched on in Shopify, you'll need to ensure that your price list has the **Adjust for Tax** enabled. This will then reduce the price to the correct percentage, whilst taking into account tax charges.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/9VUCHEP-GRPsk7RMbROQC_image.png)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/dbYH6Ty7PJFzHd4t1wkDm_image.png)
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️  I need to charge tax for some products and not others**

I sell products that have different tax rates but the calculations are wrong when the customer checks out.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

By default, tax is charged on the overall subtotal of the customer's cart. We have a setting that will allow you tax individual line items, giving you more control over which items are taxed. Please [contact our support team](docId\:NNUw1G9z7eaJ4M78vk7t9) to enable this.

In order to make sure that you're no longer charging tax on specfic line items, you'll then need make sure that the **Charge Tax&#x20;**&#x69;s not selected on the variant in Shopify:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/8Ph5qtFqJIyv0ift-1lvu_image.png)


:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️  Shipping costs are not showing the correct amounts**

When a customer is checking out, they are not seeing the correct shipping costs as set up in the SparkLayer shipping system.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

When using SparkLayer [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m), the prices listed in the dashboard should always match the prices shown to the customer when checking out. If the shipping rate listed is different, please [contact our support team.](docId\:NNUw1G9z7eaJ4M78vk7t9)&#x20;
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️  Tax is being charged but I use a third-party tax app (e.g. Avalara, TaxJar)**

When placing an order through SparkLayer, tax is still being charged even though the customer is set to "Don't Collect Tax" in Shopify.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

If you use a third-party tax app such as Avalara or TaxJar to manage your tax calculations, these apps override Shopify's built-in tax settings. This means the Shopify customer setting alone is not enough - you also need to mark the customer as exempt within the tax app itself.

SparkLayer does not calculate tax directly. We display the net pricing and pass through whatever tax information Shopify and your tax app return. If a customer is seeing tax when they shouldn't be, the issue is almost always with the tax app configuration.

To resolve this:

1. Go to your third-party tax app and add the customer to its exemption list. For example, in Avalara, go to the Exemption Customer List and add the customer using their Shopify customer ID as the Customer Code.
2. Confirm that the customer is also set to "Don't Collect Tax" in Shopify - go to Customers, open the customer, and check Manage tax exemptions.

**Please note:** both settings are required. The Shopify customer exemption and the tax app exemption work independently - if either one is missing, tax may still be charged. If you're unsure how to configure exemptions in your specific tax app, we recommend checking their documentation or contacting their support team.
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::



***

## Adjusting the text for "tax"

For locations within the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) where the word "tax" is displayed, it's possible to customise this and adjust the wording.&#x20;

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "global.totals.tax": "Tax",
    "cart.tax-shipping-note": "Tax and shipping costs calculated during checkout",
    "cart.tax-shipping-message": "Tax and shipping costs shown on next step"
  }
},
/* End of code */
```



***

## Showing a tax information next to pricing

It's possible to *prefix* the pricing display on a product detail page with custom language such as `'Excludes tax'` or any other messaging you'd like to add to highlight tax details.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zR2CWkqbLcNDoiMS_RqN-_image.png)

Similarly, you can customise how pricing also shows in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) making the tax information clear to your customers.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/FE47u7yEs4-VWJOfqDPty_image.png)

To make these customisations, you can simply edit the language details within your Sparklayer setup, adjusting as necessary.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "pdp.price.from-prefix": "Excluding tax: ",
    "global.per-unit": "{price} per unit (ex. tax)",
  }
},
/* End of code */
```



***

## Collecting Tax ID for International Shipping

:::hint{type="warning"}
**Please note**
Tax ID formats and requirements vary by country. Make sure to check the regulations for each destination.&#x20;
:::

Some countries require you to collect your customer’s Tax ID or equivalent during checkout. This helps ensure orders comply with local tax laws and avoids delays or fines at customs.

If you sell to countries including *Brazil, Chile, Colombia, Costa Rica, Ecuador, Guatemala, Indonesia, Italy, Mexico, Malaysia, Peru, Portugal, Paraguay, and Turkey* your customers may need to provide a national tax number (e.g. CPF/CNPJ, RFC, or Resident ID). Collecting this information at checkout helps ensure that orders can be processed correctly and converted from draft to completed status in Shopify.

![](https://archbee-image-uploads.s3.amazonaws.com/RVgCGw6NuWxwjkLvPcIcT-amfS71_f1_SsZ5EgeQrOC-20250623-181153.png)

If you'd like to modify what is shown here, you can do so by updating the default language within your store.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "checkout.notes.tax-id-label": "Additional Tax ID",
    "checkout.notes.tax-id-placeholder": "Tax ID",
  }
}, 
/* End of code */
```

:::hint{type="info"}
**Please note**
If you're using [customer checkout fields](docId\:o3nDhZBCxisWH6M6satDt) to capture a Tax ID, we recommend turning this off
:::



***

## Shipping configurations

Please refer to our [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) guide for further information.


[title] Form versions
[path] Features/Forms/Form setup/

## Introduction

SparkLayer Forms uses versioning so you can safely update forms without interrupting live customer submissions.

Every change you make creates a new version behind the scenes — letting you test updates before publishing them live.&#x20;



***

## 🔄 Version states

Each form version has a clear status:

| State       | What it means                                             |
| ----------- | --------------------------------------------------------- |
| `Draft`     | Work-in-progress changes. Not visible to customers.       |
| `Published` | The live version used for new submissions.                |
| `Archived`  | Older versions kept for reference and historical entries. |

Only one version can be published at a time, and only one draft can exist per form.&#x20;



***

## ✏️ How versions work

The form builder interface has a version switcher UI at the top-right of the page:

![Version switcher](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/NOAi_RQ-ObD-PHk3Bn6YP_screenshot-2026-04-21-at-111005.png "Version switcher")

The version switcher allows easily switching between:

- **Draft version (editing):** this is where you can make any changes and preview the form before making the changes live to all users.
- **Published version (read only):** this is the live version used for forms embedded on your store. Published version is read only.

**Creating a draft**

When you edit a form:

1. A draft version is created from the current published version&#x20;
2. Your changes save automatically&#x20;
3. The live form remains unchanged&#x20;

This lets you experiment without affecting customers.&#x20;

**Publishing changes**

When you click **Publish**:

- Select what areas you want to publish changes to:
  - Form fields - the main form users will see
  - Internal fields - administrative internal fields against submissions
  - Workflows - automation setup and logic
- The draft becomes the new published version&#x20;
- The previous published version moves to archived&#x20;
- All new submissions use the latest version&#x20;

Existing submissions are not modified.&#x20;

**Preview before publishing**

You can preview a draft to test changes safely:

- Opens a preview of the form&#x20;
- Lets you test validation and logic&#x20;
- Preview entries are marked separately&#x20;

Use preview mode whenever you change structure, logic, or workflows.&#x20;



***

## 📊 How versions affect submissions

Understanding this helps avoid data issues when updating forms.

**New submissions**

- Always use the **current published version**&#x20;
- Follow that version’s fields, validation, and workflows&#x20;

**Existing submissions**

- Keep the version they were created with&#x20;
- Retain their original data structure&#x20;
- Continue to work with the workflows from that version&#x20;

**In-progress submissions**

If someone started filling out a form before you published changes:

- They continue on the version they began with&#x20;
- They’ll only see updates when starting a new submission&#x20;



***

## 💡  Best practices

- Where possible, publish changes to all affected areas in one go (Form fields, Internal Fields and workflows)
- Provide a clear changes summary in the Publish dialog - this is useful for audit purposes in the future
- Test new versions before sharing publicly
- If you want to completely rethink and rework a form, it is often better to make a new form rather than edit an existing one

[title] Entries
[path] Features/Forms/


[title] Storefront Options
[path] Dashboard/

## Introduction

You can now configure SparkLayer directly from the **Storefront >** **Options** page in your SparkLayer dashboard. Settings that previously had to be added by editing the core script in your theme (using JavaScript and JSON) are now fully managed in the dashboard, with no code required.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/mq_mA9d2-Y7UpzJxcZwVt_image.png)

This makes setting up and configuring SparkLayer far quicker and easier. Instead of editing your theme, you adjust everything visually, save it as a draft, and publish when you're ready.

:::hint{type="info"}
**Please note**
The Options page works alongside your existing core script - it doesn't replace it. You can manage settings in the dashboard and continue to use the core script at the same time, so existing setups keep working as they are.
:::



***

## Key benefits

- **No code required** - configure theme, pricing, checkout, account, and display settings visually, without touching your theme's core script.
- **Safe changes with draft and publish** - save your changes as a draft first, so nothing changes for customers until you publish.
- **Roll back at any time** - revert to your last published settings if you need to undo a change.
- **Everything in one place** - manage general settings, translations, checkout fields, payment methods, account sections, custom slots, and analytics from a single page.



***

## The draft and publish workflow

Changes you make on the Options page are saved as a draft first. They only go live for your customers once you publish them. This lets you make and review changes safely before they reach your store.

The following actions are available:

| Action              | What it does                                         |
| ------------------- | ---------------------------------------------------- |
| Save draft          | Saves your changes without making them live.         |
| Discard changes     | Discards any unsaved changes since your last save.   |
| Publish             | Deploys your saved settings to your live site.       |
| Revert to published | Rolls your draft back to the last published version. |
| Delete settings     | Removes the saved settings.                          |

The publishing status is shown at the top of the page. If nothing has been made live yet, it shows as "Not published".



***

## Settings reference

The Options page is organised into sections. Each one controls a different part of how SparkLayer looks and behaves.

### General Settings

General settings for theme, pricing, and account behaviour. Turn each one on or off with a toggle.

| Setting                                 | What it does                                                                                               |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| Enable dark theme                       | Renders SparkLayer's components using the dark colour scheme.                                              |
| Base savings on RRP                     | Calculates displayed savings against the RRP rather than the customer's own price.                         |
| Show the RRP toggle                     | Lets customers switch between seeing the RRP and their own prices.                                         |
| Show savings on price breaks            | Shows the amount saved next to each quantity price break.                                                  |
| Round price break percentages           | Rounds price break discount percentages to whole numbers.                                                  |
| Hide financial figures                  | Hides financial figures from customers. While enabled, the Financials section of My Account is hidden too. |
| Show shipping address in order list     | Shows each order's shipping address alongside it in the order list.                                        |
| Save address to address book by default | Saves the customer's address to their address book by default.                                             |

### Translation Overrides

Override SparkLayer's built-in text on a per-language basis. This gives you a visual way to change wording that previously had to be set in the core script.

To add an override:

1. Click **Add language** and choose the language code (for example, en).
2. Select the key you want to change (for example, cart.checkout.notes.label).
3. Enter your replacement text in the value field.
4. Add further overrides for that language with **Add override**, or add another language.

Turn on **Show translation keys** to see the underlying key names instead of the translated text. This debug mode helps you find the exact key you want to change.

### Checkout Fields

Manage the standard and custom fields shown at checkout. The standard fields are Customer reference, PO number, and Requested shipping date. Each can be set to show, hide, or be optional, and you can drag to reorder them.

To add your own field, click **Add custom field**.

You can learn more about the available checkout options in our [Cart & Checkout](docId\:o3nDhZBCxisWH6M6satDt) guide.

### Payment Methods Order

Drag to set the order in which payment methods appear at checkout. The available methods are Payment on account, Payment by invoice, Upfront payment, and Quote.

### My Account Sections

Drag to set the display order of the sections in a customer's My Account area, and toggle each one on or off to control whether it's visible.

The available sections are Recent Activity, Shopping Lists, Financials, My Details, Reports, and Address Book. A Custom Slot section is also available - this stays hidden automatically until the spark-slot-my-account slot is enabled under Custom Slots.

### Custom Slots

Custom slots let you display your own content in specific places across SparkLayer. Turn on the slots you want to use:

| Slot                    | Slot ID                            |
| ----------------------- | ---------------------------------- |
| My Account              | spark-slot-my-account              |
| My Cart                 | spark-slot-my-cart                 |
| Cart line item          | spark-slot-my-cart-line-item       |
| Order complete          | spark-slot-order-complete          |
| Cart shipping step      | spark-slot-cart-shipping-step      |
| Cart payment step       | spark-slot-cart-payment-step       |
| Purchase summary header | spark-slot-purchase-summary-header |
| Purchase summary footer | spark-slot-purchase-summary-footer |

You can learn more about adding your own content to these areas in our [Custom Slots ("Targets")](docId\:l_2ooHJiY-rAx2chBMgP2) guides.

### Analytics

Configure analytics providers and the events they should listen to. Click **Add provider** to get started.



***

## FAQ

**Do I still need to edit my theme code to configure SparkLayer?**

No. Settings that previously required editing the core script can now be managed entirely from the Options page in the dashboard.

**Does this replace my existing core script?**

No. The Options page works in parallel with your core script, so anything already configured there keeps working. You can start managing settings from the dashboard whenever you're ready.

**Will my changes go live as soon as I make them?**

No. Changes are saved as a draft and only deploy to your live site when you click Publish.

**Can I undo a change after publishing?**

Yes. Use Revert to published to roll your draft back to the last published version.

**Where do I find the Options page?**

Go to Storefront → Options in the SparkLayer dashboard.

**Which settings can I manage from the dashboard?**

General settings, translation overrides, checkout fields, payment method order, My Account sections, custom slots, and analytics providers - all from a single page.

[title] Frontend Interfaces
[path] Features/

## Introduction

The Frontend Interfaces are the specially optimised B2B "widgets" that get shown to your B2B customers once they log in. They are designed to make ordering and managing their account as easy and "self-service" as possible, helping them save time and automating many of the processes and activities you may have previously done manually.

:::hint{type="success"}
**🚀 Upgrading to the latest SparkLayer version**
To benefit from our latest updates, please upgrade your [SparkLayer Core Script](https://app.sparklayer.io/integrations/widgets/core). You can learn about how the Core Script works in [our guide here](docId\:QWXsYM9X5_pvIOGUteKcP).
:::

## Explore more

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Sl706YuPabeNu0KDqpauY_cart.jpg)

[My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-)

The SparkLayer My Cart Interface provides your B2B customers with a rapid way to build and place orders on your website. It replaces certain elements of your existing website, providing customers a seamless way to order from you.

:::

:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/XwNQFW-AL-A5DqPxHepcX_account.jpg)

[My Account Interface](docId\:lQXaNI7IVDqna09D9soAP)

When SparkLayer is installed on your website, it automatically replaces your website's existing my account area and allows your B2B customers to keep track of key information about their account, track orders and much more!
:::
::::

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/AGfUECzDPklEfyt9Nf6ru_image.png)

[Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT)

The Product Detail Interface lets your B2B customers quickly and easily add products to their order and automatically loads when a logged in B2B customer visits a product detail page on your website.
:::

:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qWR-wUx4bRzo8vpJbNZmg_image.png)

[Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv)

The Product Card Interface lets you display B2B pricing and the ability to add products to an order anywhere a "product card" is shown on your website. Typically this includes product collection (or "category") pages, and product upsells.

:::
::::

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-qGY2hdtXD-Nn-YPA9mqR_-20241024-080944.jpg)

[Product Matrix Interface](docId:8Go0NYHFDmYnwlJSNfO-S)&#x20;

The Product Matrix Interface lets your B2B customers see your products in a special "matrix table" view making it easy to quickly add products to an order.
:::

:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/OqOZGnuHjZnjFCQowZb-f_slots.jpg)

[Custom Slots ("Targets")](docId\:l_2ooHJiY-rAx2chBMgP2)

Custom Slots (or "Targets") allow you to enhance a range of the SparkLayer Frontend Interfaces
by adding your own custom code in predefined areas.
:::
::::


[title] Policies
[path] Useful Links/

## Introduction

Our security, privacy and legal documents are published in the SparkLayer Trust Center at [www.sparklayer.io/trust](http://www.sparklayer.io/trust/?v=1). That is the current version of each document and the place to send anyone doing a security or procurement review. If you have questions about any of them, email [contact@sparklayer.io](mailto\:contact@sparklayer.io).



***

## All Policies

[Privacy Policy](docId\:iMvKTODFVfM3md05eQpMj)&#x20;

[Security Policy](docId:0Q_CbPycSUNsd4VA_EqxT)&#x20;

[Business Continuity Planning](docId\:Uwmmj4AHbps574ENyKz4Z)&#x20;

[Incident Management Policy](docId\:I3j3sB-es_-AQTukotRLc)&#x20;

[Terms of Service](https://www.sparklayer.io/terms-of-service/)

[Refund Policy](docId:4hPoI8lFsfOSxeiAKxnSk)&#x20;




[title] Form embedding and styling
[path] Features/Forms/Form setup/

# Styling and Embedding Forms

Most Shopify merchants should use the SparkLayer Form block in the Shopify theme editor.

The block lets you select a form and configure common layout and styling options from the sidebar, without adding code manually.

Manual embeds are available for merchants or developers who need more control.

## Shopify Form Block

To add a form in Shopify:

1. Open the Shopify theme editor.
2. Add the SparkLayer Form block to the page or section.
3. Select the form you want to display.
4. Adjust styling in the block sidebar.
5. Save your changes.

## Manual Embed

Add the SparkLayer form script to your page:

`<script src="https://cdn.sparklayer.io/spark-form.v1.js"></script>`

Then place the form where you want it to appear:

:::BlockQuote
\<spark-form
&#x20; form-id="your-form-id"
&#x20; site-id="your-site-id">
\</spark-form>
:::

## Manual Embed Attributes

| Attribute          | Required | Description                                                  |
| ------------------ | -------- | ------------------------------------------------------------ |
| form-id            | Yes      | The ID of the form to display                                |
| site-id            | Yes      | Your SparkLayer site ID                                      |
| site-env           | No       | Use test to load from the test environment. Defaults to live |
| entry-id           | No       | Resume an existing form entry                                |
| entry-key          | No       | Authentication key for an existing entry                     |
| hide-title         | No       | Set to true to hide the form title                           |
| preview-version-id | No       | Preview a specific form version                              |

## Styling Manual Embeds

By default, embedded forms use the same SparkLayer core CSS variables as the rest of SparkLayer.

If the SparkLayer core script already defines --spark-\* variables on your storefront, the form will automatically use them.

You only need --spark-form-\* variables when you want to override styles for forms specifically.

**Style priority is:**

1. \--spark-form-\* form-specific variables
2. \--spark-\* global SparkLayer variables
3. SparkLayer default styles

**Example:**

spark-form \{
&#x20; \--spark-form-max-width: 680px;
&#x20; \--spark-form-button-color: #000000;
&#x20; \--spark-form-button-raised-background: #000000;
&#x20; \--spark-form-button-raised-color: #ffffff;
&#x20; \--spark-form-link-color: #000000;
&#x20; \--spark-form-border-radius-default: 4px;
}

## Available CSS Variables

| Form variable                               | Falls back to                          | Controls                           |
| ------------------------------------------- | -------------------------------------- | ---------------------------------- |
| --spark-form-max-width                      | None                                   | Maximum form width                 |
| --spark-form-button-width                   | None                                   | Button width, for example 100%     |
| --spark-form-font-default                   | --spark-font-default                   | Main font family                   |
| --spark-form-header-font                    | --spark-header-font                    | Heading font family                |
| --spark-form-button-font-family             | --spark-button-font-family             | Button font family                 |
| --spark-form-font-default-size-small        | --spark-font-default-size-small        | Base font size on smaller screens  |
| --spark-form-font-default-size              | --spark-font-default-size              | Base font size                     |
| --spark-form-input-font-size                | --spark-input-font-size                | Input font size                    |
| --spark-form-h1-fontsize                    | --spark-h1-fontsize                    | H1 size                            |
| --spark-form-h2-fontsize                    | --spark-h2-fontsize                    | H2 size                            |
| --spark-form-h3-fontsize                    | --spark-h3-fontsize                    | H3 size                            |
| --spark-form-h4-fontsize                    | --spark-h4-fontsize                    | H4 size                            |
| --spark-form-h5-fontsize                    | --spark-h5-fontsize                    | H5 size                            |
| --spark-form-h6-fontsize                    | --spark-h6-fontsize                    | H6 size                            |
| --spark-form-button-small-font-size         | --spark-button-small-font-size         | Small button font size             |
| --spark-form-button-font-size               | --spark-button-font-size               | Default button font size           |
| --spark-form-button-large-font-size         | --spark-button-large-font-size         | Large button font size             |
| --spark-form-font-weight-default            | --spark-font-weight-default            | Default font weight                |
| --spark-form-font-weight-medium             | --spark-font-weight-medium             | Medium font weight                 |
| --spark-form-font-weight-heavy              | --spark-font-weight-heavy              | Heavy font weight                  |
| --spark-form-header-font-weight             | --spark-header-font-weight             | Heading font weight                |
| --spark-form-button-font-weight             | --spark-button-font-weight             | Button font weight                 |
| --spark-form-header-text-transform          | --spark-header-text-transform          | Heading text transform             |
| --spark-form-header-letter-spacing          | --spark-header-letter-spacing          | Heading letter spacing             |
| --spark-form-button-text-transform          | --spark-button-text-transform          | Button text transform              |
| --spark-form-button-text-letter-spacing     | --spark-button-text-letter-spacing     | Button letter spacing              |
| --spark-form-border-radius-default          | --spark-border-radius-default          | Default border radius              |
| --spark-form-border-radius-button           | --spark-border-radius-button           | Button border radius               |
| --spark-form-input-padding                  | --spark-input-padding                  | Input padding                      |
| --spark-form-button-padding                 | --spark-button-padding                 | Button padding                     |
| --spark-form-product-card-button-padding    | --spark-product-card-button-padding    | Product card button padding        |
| --spark-form-lightest-color                 | --spark-lightest-color                 | Form background and light surfaces |
| --spark-form-default-body-color             | --spark-default-body-color             | Body text color                    |
| --spark-form-header-color                   | --spark-header-color                   | Heading color                      |
| --spark-form-primary-color                  | --spark-primary-color                  | Primary color                      |
| --spark-form-primary-color-light            | --spark-primary-color-light            | Light primary color                |
| --spark-form-primary-color-dark             | --spark-primary-color-dark             | Dark primary color                 |
| --spark-form-secondary-color                | --spark-secondary-color                | Secondary color                    |
| --spark-form-link-color                     | --spark-link-color                     | Link color                         |
| --spark-form-button-color                   | --spark-button-color                   | Button brand color                 |
| --spark-form-button-raised-color            | --spark-button-raised-color            | Primary button text color          |
| --spark-form-button-raised-background       | --spark-button-raised-background       | Primary button background          |
| --spark-form-button-raised-hover-background | --spark-button-raised-hover-background | Primary button hover background    |
| --spark-form-button-raised-border-color     | --spark-button-raised-border-color     | Primary button border color        |
| --spark-form-button-disabled-color          | --spark-button-disabled-color          | Disabled button text color         |
| --spark-form-button-large-color             | --spark-button-large-color             | Large button color                 |
| --spark-form-input-background               | --spark-input-background               | Input background                   |
| --spark-form-input-border-color             | --spark-input-border-color             | Input border color                 |
| --spark-form-input-text-color               | --spark-input-text-color               | Input text color                   |
| --spark-form-input-focus-border-color       | --spark-input-focus-border-color       | Focused input border color         |
| --spark-form-table-header-background-color  | --spark-table-header-background-color  | Table header background            |
| --spark-form-success-color                  | --spark-success-color                  | Success state color                |
| --spark-form-error-color                    | --spark-error-color                    | Error state color                  |
| --spark-form-warn-color                     | --spark-warn-color                     | Warning state color                |
| --spark-form-info-color                     | --spark-info-color                     | Info state color                   |
| --spark-form-agent-color                    | --spark-agent-color                    | Agent state color                  |
| --spark-form-company-users-color            | --spark-company-users-color            | Company users state color          |


[title] Useful Links
[path] /


[title] Favourites
[path] Features/

# Introduction

:::hint{type="info"}
**Please note**
To enable Favourites, please ensure your SparkLayer Core Script is on at least version 4.9. [Check your version here](https://app.sparklayer.io/integrations/widgets/core).
:::

Favourites let your B2B customers save products they're interested in as they browse, and come back to them later from the My Account area. Instead of searching for the same product again or leaving items sitting in the cart, customers click the heart icon on any product to save it, then return to their Favourites whenever they're ready to buy.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/iTY4CoRa3w7aOyEsLtDly_image.png)

Favourites are a lightweight way to keep track of products. They save the product itself - not a quantity or a specific variant - so they're ideal for customers browsing a large catalogue who want a quick way to mark products for later without building a full order.

Favourites are personal to each logged-in customer. A customer only ever sees their own list, and it isn't shared with other users or accounts.

:::hint{type="success"}
**Want to test out Favourites?** Head over to our [B2B demo store](https://demo.sparklayer.io/) and give it a go!
:::



***

## Key features

- **Save products as you browse** - a heart icon on product pages and collection pages lets customers save a product in one click, without interrupting what they're doing.
- **Lightweight and simple** - Favourites save just the product, with no quantities, variants, or pricing to manage. There's nothing to configure or keep up to date.
- **Everything in one place** - saved products appear in a dedicated Favourites section in My Account, right alongside Shopping Lists.
- **Add to the cart in a few clicks** - customers select the favourites they want, choose their options and quantities, and add them straight to the cart.
- **Keep the list relevant** - customers can remove a favourite at any time, and removing it never affects the product or their Shopping Lists.



***

## Favourites vs Shopping Lists

Favourites and [Shopping Lists](docId\:AQJJjc8wJrskIYivjIZrG) work side by side, but they're designed for different jobs.

|                        | Favourites                                          | Shopping Lists                                               |
| ---------------------- | --------------------------------------------------- | ------------------------------------------------------------ |
| **Best for**           | Marking products to come back to later              | Building and reordering a specific order                     |
| **What's saved**       | The product only                                    | Products with their variants and quantities                  |
| **Structure**          | One simple list per customer                        | Multiple named lists per customer                            |
| **Adding to the cart** | Select products, then choose options and quantities | Add the whole list, or selected items, with saved quantities |

If a customer knows exactly what they want to reorder, a Shopping List is the better fit. If they're browsing and want to remember products for later, Favourites is the quicker option. You can learn more in our Shopping Lists guide.



***

## How it works

### Adding a product to Favourites

Customers can favourite a product from two places:

- **From a product page** - click the heart icon next to the Add to cart button.
- **From a collection page** - click the heart icon shown on each product card.

The heart icon updates to show the product has been saved, so it's always clear which products are already in Favourites. Favouriting a product that's already saved won't create a duplicate.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/BiKMMXM5HRKDSL5F1k1To_image.png" size="100" isUploading="false" width="1616" height="810" darkWidth="1616" darkHeight="810" showCaption="true"}

:::hint{type="info"}
**Please note**
Favourites save the product itself rather than a specific variant or quantity. Customers choose their options and quantity when they add a favourite to the cart.
:::

### Viewing Favourites in My Account

Saved products appear in a Favourites section on the My Account overview, showing a preview of the most recently saved items. Hovering over a product shows its name, and clicking **View all** opens the full Favourites page.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jYI9HbJaHHzgiRUECt2ID_image.png)

The Favourites page lists every saved product with its image, name, and SKU, along with the total number of favourites in the heading.

If a customer hasn't saved anything yet, the page explains how to get started using the heart icon on products.

### Adding favourites to the cart

When a customer is ready to buy, they can add favourites to their cart directly from the Favourites page:

1. Click **Select & add to cart**.
2. Select one or more products from the list.
3. For each product, click **Choose options** to pick the variant and set the quantity. Current pricing and stock are shown for each option.
4. Add the selected products to the cart.

Only the products the customer selects are added. Adding favourites to the cart doesn't remove them from Favourites, so customers can keep coming back to the same products.

:::hint{type="info"}
**Please note**
Adding favourites to the cart follows the same availability and quantity rules as adding a product anywhere else in SparkLayer. If a product can no longer be added - for example, if it's no longer available - the customer is shown a clear message.
:::

### Removing a favourite

To remove a product from Favourites, customers click the remove icon next to it on the Favourites page. The product is removed straight away.

Removing a favourite only affects the customer's Favourites list. It doesn't change the product, and it has no effect on any Shopping Lists.

### Turning Favourites off

Favourites are on by default. If you'd prefer not to offer them to your customers, you can turn them off from the SparkLayer dashboard:

1. Go to [Storefront → Options](https://app.sparklayer.io/storefront/options).
2. Open the **My Account Settings** section.
3. Turn off the **Show favourites** toggle.
4. Click **Save & publish** to apply the change to your live site.

Once turned off, the heart icon no longer appears on product or collection pages, and the Favourites section is removed from My Account. You can turn Favourites back on at any time from the same place.



***

## FAQ

:::ExpandableHeading
**What's the difference between Favourites and Shopping Lists?**

Favourites are a lightweight way to mark products to come back to later - they save just the product. Shopping Lists are for building and reordering a specific order, and save products with their variants and quantities. Both are available side by side in My Account.
:::

:::ExpandableHeading
**Can a customer save a specific variant or quantity as a favourite?**

No. Favourites save the product itself. Customers choose the variant and quantity when they add a favourite to the cart, so they always see current options, pricing, and stock.
:::

:::ExpandableHeading
**Can customers favourite products from collection pages?**

Yes. The heart icon appears on product cards on collection pages as well as on product pages, so customers can save products as they browse.
:::

:::ExpandableHeading
**Are Favourites shared with other users or accounts?**

No. Favourites are personal to each logged-in customer. A customer only sees their own list, and it isn't shared with other customers or users.
:::

:::ExpandableHeading
**Does adding a favourite to the cart remove it from Favourites?**

No. Products stay in Favourites after being added to the cart, so customers can return to them again and again.
:::

:::ExpandableHeading
**What happens if a favourited product is no longer available?**

The product still appears in the customer's Favourites, but it can't be added to the cart. The customer is shown a clear message explaining this, and can remove the product from their list.
:::

:::ExpandableHeading
**Does removing a favourite affect my Shopping Lists?**

No. Removing a product from Favourites only affects that customer's Favourites list. Shopping Lists are completely separate.
:::


[title] Archive
[path] Useful Links/What's New!/

:::hint{type="info"}
Our archive includes a summary of updates to SparkLayer in previous years
:::

## April, 2024

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Product Customisations**

If you sell products that require "customisations" such as custom text or any other unique requirements, you'll like our latest update! We've just released the ability to support customised products via the SparkLayer [JavaScript SDK](docId:315uNbM85_FWnh6FU9KkK). You can see how it works in our video below.

::embed[]{url="https://www.youtube.com/embed/zmT9xmfy_iI"}

This allows your B2B customers to add customised text to products within their order and the information is sent through to your eCommerce platform when an order is placed.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/QCSsrtneVwx9KFPwtRXfS_image.png)

:::hint{type="warning"}
**Please note**
This is an advanced configuration of SparkLayer and will require a developer to implement on a store that requires this feature. Please refer to our [JavaScript SDK](docId:315uNbM85_FWnh6FU9KkK) for full details.
:::

**"Draft order" visibility in My Account**

We've just released a major improvement to the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) that gives your B2B customers much better visibility on orders they place. Previously, if a customer placed an order via payment methods such as "Pay on Account" or "Pay by Invoice" these wouldn't show in the My Account until the order was marked as "Completed". Now, as soon as an order is placed, these will show with a new status "Awaiting Merchant".&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/cJrmRy32xZ7ql8ypl4dw9_image.png)

When you (the merchant) completes the order, these will then change to standard order statuses such as "Processing", "Shipped", etc. You can learn more about order status in [our guide here](docId\:lQXaNI7IVDqna09D9soAP).

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Purchase numbers to support new order types**
  Inline with the "Draft order visibility in My Account" above, you can now set "Purchase numbers" to indicate orders that are currently in review.  [Learn more](docId\:gznStzTqCRffLFZSTAw0N)
- **Support for Shopify web pixels**
  SparkLayer now supports the new [Shopify web pixel tracking system](https://admin.shopify.com/settings/customer_events). This will in time replace the need to use the [SparkLayer checkout script](https://app.sparklayer.io/configuration/frontend/checkout) when implementing SparkLayer on Shopify.
- **Language support for Japanese**
  We've added Japanese as an option in our available [languages](docId\:kLrS7wtxn3WnCDy8z5Zvu).



***

## March, 2024

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Company Order Approvals**

We're excited to announce a major update to our [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ) functionality: order approvals that let teams set role-based permissions!&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/0ToIywFTwT_hM1o0kcqNm_image.png)

Via our [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ) feature, B2B customers can invite colleagues and set powerful role-based controls on what they can and can’t do (e.g. some can add items to an order, whereas others can complete the order to be fulfilled). *Please note, this feature will be launched later in March.*

**Sales agent order history**

We've released a much requested improve to our [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) feature. Sales Agents can now view recent order history pertaining to customer accounts they manage. When a sales agent logs in, they'll see this new section on the sales agent search interface.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/EIsu6tJA-FqV7RArXGgF1_image.png)

**Sales Agent - Setting overwrites**

It's now possible for Sales Agents (with "Administrator" access) to overwrite product settings such as pack sizing and min/max product quantities. When signed in as a customer, free form quantities can be entered to increment or decrement the line item level quantities. [Learn more](docId\:Uw8mDbMEfwWKqZrVB5CqX).

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/sales-agent-settings.mp4?v=345&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

**My Cart - CSV file upload**

If your customers make use of the [CSV file upload feature](docId\:efevur-A3yCJXUHvrR7t-), they can now upload CSVs using a **barcode** as the primary identifier. This works in addition to use a SKU.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/LiCLtWQqbR7WaBfAUAPTr_image.png)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **My Cart - show stock status**
  If you've configured SparkLayer to [show stock levels](docId\:Gj_Ao_gQ6oA-jx0D27Hys), the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) will automatically show the stock status for any items added. It's a great way to give customers more visibility of the specific inventory levels of items in their order.
- **Product Card - Hide Prices**
  It's now possible to hide the total price from showing on the [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) if you'd prefer to keep this hidden. [Learn more](docId\:m3DF4f0Eyc2rM-vUaRG9H)
- Product Stock - Hide inventory count
  If you have [Stock Display](docId\:Gj_Ao_gQ6oA-jx0D27Hys) turned on, you can now selectively hide the specific inventory count from showing. [Learn more](docId\:Gj_Ao_gQ6oA-jx0D27Hys)
- **Dashboard Price List - upload multiple CSV files**
  It's now possible to upload multiple CSV price lists at once when managing your B2B price lists. [Learn more.](docId\:NX9Q00eWV_kbjxc3tg1ut)
- **Cin7 Core integration - multi-currency**
  We've upgraded our Cin7 Core integration to now better support stores that have a multi-currency setup. Please contact our support team to learn more.
- **Loading interfaces**
  We've improved the loading interfaces that show when the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) first load on a page, making for a smoother experience.



***

## February, 2024

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Dashboard usability improvements**

As part of our ongoing improvements to the [SparkLayer Dashboard](https://app.sparklayer.io/), we've released our first major update to make managing your B2B configurations even easier. For the [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) and [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) sections of the dashboard, you'll see a new and improved way to create and manage your settings with our new "slide out" feature.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/dashboard-modal.mp4?v=345&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

In the very near future, we'll be rolling out a brand new [Customers](docId:5_lWMNohhjBJJppg9E6Vh) section that will bring some major improvements to how you manage your B2B customers. Stay tuned!

**"Purchase status" improvements**

Under the hood, we've made some major improvements to how SparkLayer handles "purchases" (essentially orders that can have different statuses). This will allow SparkLayer to handle purchase types such as orders that may require review (e.g. a Draft order), orders that may require approval, and a range of other statuses that may be relevant to your B2B operation. In next month's update, we'll be sharing how this works and what it will unlock for our customers!

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Frontend interfaces - "Cart" terminology**
  We've updated the terminology for "Order" to "Cart" to make it more obvious to customers that products are added to a shopping list. This change will apply to any buttons and titles used in the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa). This text can also be modified should you want to adjust to anything else. [Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu)
- **Frontend Interfaces - Notifications**
  We've improved the display of notifications within the frontend interfaces for actions such as "success", "information", and "warning" messages, ensuring a more consistent look and feel.



***

## January, 2024

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Purchase history reports**

Our headline update this month is the release of our new My Account reporting tool that gives your B2B customers even easier (and faster!) ways to place B2B orders!

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/purchase-report.mp4?v=345&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

The first report we've released is the new "Purchase history by time period" which gives customers a breakdown of all products they've purchased over a period of time (e.g. by quarter, by month, by week). The best part? In a matter of clicks, they can re-order an entire range of products and then proceed through the checkout to complete their order.&#x20;

It's a great way to allow your customers to more rapidly repeat-order and easily see products they've purchased from your store. [Learn more](docId\:lQXaNI7IVDqna09D9soAP)

**Custom payment method messaging**

On the final step of the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), Review & Pay, it's now possible to display a "custom payment messages" that let you add additional details about a payment method.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/JDHHIkn-7h-9qi-cqa0Qr_image.png)

For example, if a customer is paying by "Pay by Invoice", you could add some additional text to inform them on how this process works. [Learn more](docId\:o3nDhZBCxisWH6M6satDt)

**Improved messaging within the My Account and My Order**

When your B2B customers haven't completed certain actions (e.g. placed an order, saved a shopping list), we've improved the messaging and how this looks to give a more consistent feel and experience. You'll see the same style of "empty state" messaging appear in both the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) and [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/8a4vHZxR_rvdxXxZLvL2o_image.png)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Sales Agents -  "Recently Access Accounts"**
  When a sales agent logs in, they can now see their most recently accessed accounts, making it easier to login as a customer (this works based on their browser session).
- **Sales Agents - Search improvements**
  We've extended the sales agent customer search to now include additional data sources: the default billing postcode (Zip code), first line of address, and city
- **Sales Agents - Customers created by sales agents**
  When a sales agent now creates a new customer on the fly, this will automatically assign any "b2b" tags assigned to the sales agent themselves. This now makes it easier to filter and segment by sales agent created customers within Shopify or BigCommerce.
- **My Account - Order History "RRP" pricing**
  When viewing an order within the My Account area, if a product has [RRP pricing](docId\:S_VTlJBorGmnwjjfSMom9) configured, you'll see this show next to the main B2B price.
- **Price Lists - support for 4 decimal places**
  When setting up an automatic price list (e.g. 50% off your retail prices), you can now specify up to 4 decimal places (e.g. 24.1245%)
- **Product Cards - selectively hide variant drop-downs**
  By default, the [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) will show any variants (such as colour and size) and allow the customer to change them. If you'd prefer, you can now hide specific variant groups you don't want to show, giving you more flexibility on what's shown to your customers. [Learn more](docId\:m3DF4f0Eyc2rM-vUaRG9H)



***

## December, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Barcode support**

We're pleased to announce the launch of one of our most highly requested features, barcode support! If you're using barcodes within your eCommerce platform (e.g. Shopify), you can now display these to customers via our [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) and even allow customers to search by barcode in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/YEdho7w3dOxZLajnYVeAC_image.png)

You can also take this a step further and integrate SparkLayer with your barcode scanning system, to really automate the creation of B2B orders. Check out our video below to see this in action!

::embed[]{url="https://www.youtube.com/embed/BGnL56nZ8Jk"}

To learn more about activating barcodes, [read our guide here](docId\:m3DF4f0Eyc2rM-vUaRG9H).

**Unit of measure pricing**

SparkLayer now supports the option to configure your pricing with **units of measure**, allowing you to offer discounted prices based on specific purchasing quantities.&#x20;

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/uom.mp4?v=345&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

It's a great way to allow customers to order in pre-defined units such as boxes, pallets, or cases. When setting these up, you can then specify how pricing works for these specific units, as well as handle units that 'fall outside' these. [Learn more](docId\:t2cEaOsmeOHmgZStjCnhe)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Quantity price display in the My Order widget**
  If you have [quantity pricing](docId\:t2cEaOsmeOHmgZStjCnhe) set up, customers can now see the details of how quantity pricing works directly from the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-)
- **My Order CSV Import**
  You can now overwrite the default column headers in the CSV file import available to customers in the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP). This allows you to overwrite the default `sku` and `qty` that is currently available. [Learn more](docId\:efevur-A3yCJXUHvrR7t-)
- **Product percentage savings**
  If you're using [quantity pricing](docId\:t2cEaOsmeOHmgZStjCnhe), you can now customise how the "Savings" column handles percentage savings with the option to add additional decimal places (e.g. 33.12% off instead of 33% off)
- **Messaging consistency**
  We've improved messaging within the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) so that any actions that add items to an order (e.g. a CSV file import, a shopping list), the customer will be shown a notification message informing them if any products cannot be added



***

## November, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Custom shipping messages**

A common use-case we see with our customers is shipping rates needing updating after an order is placed. Perhaps you need to perform your own checks on the order or negotiate the final shipping cost. Our latest update to our shipping system allows you to set "custom messages" against shipping rules, allowing you to give more visibility to your B2B customers should the shipping costs need amending.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/u0rBD8r_61HaqJDTLchrf_image.png)

You can learn more about how custom shipping messages work in [our guide here](docId\:CfZ_ZpGw2umOVAo73Lc5m).

**Product Page "All Variants" Mode**

If your products come in multiple variant types (e.g. colour and size), you're going to like this update! You can now enable a special "All Variants" mode on the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) that allows your B2B customers to see all available variants in one go. [Learn more](docId\:m3DF4f0Eyc2rM-vUaRG9H) about how this works.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/pdp-all-variants.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

**Order Limits by Quantity**

Alongside the ability to set [order total limits](docId:5_lWMNohhjBJJppg9E6Vh) for your B2B customers, you can now set **order quantity limits**! For example, you may require customers to have a minimum of 100 items in their order before they can checkout, or they cannot purchase more than 1,000 items.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/4Deqy4vMNuhxlAmu7KvYS_image.png)

Our latest update allows you to set order quantity limits for any of your [Customers](docId:5_lWMNohhjBJJppg9E6Vh) and you can even combine order quantity and order total rules! [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **CSV Import - messaging**
  We've improved the feedback messaging customers see if not all items in a [CSV file import](docId\:efevur-A3yCJXUHvrR7t-) can be added to an order, allowing them to scroll the list of affected products if the list is very long
- **Price Lists - auto-assigning**
  If you're creating a price list for the first time, you can choose to 'auto-assign' the price list to your default B2B customer group
- **Product widgets - RRP text styling**
  You can now additional text styling to the [RRP price](docId\:S_VTlJBorGmnwjjfSMom9) such as adding a strike-through or customising the colour. You can now use new CSS variables `--spark-pricing-rrp-decoration `and `--spark-pricing-rrp-color`



***

## October, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**BigCommerce Integration**

It's here... the SparkLayer & [BigCommerce](docId:6zLPH9x8-qEUITCHs2obE) integration! Now BigCommerce merchants can integrate SparkLayer into their eCommerce stores and benefit from our feature-rich B2B solution. We're very excited to be part of the BigCommerce ecosystem and continue our mission to help brands grow their B2B businesses! [Learn more](docId:6zLPH9x8-qEUITCHs2obE) about our integration.

::embed[]{url="https://youtu.be/6QCPV7_V_Ps"}

**Sales Agents Improvements**

We’re pleased to announce a range of major updates to our Sales Agent tool, that now makes it an even more powerful tool for B2B sales teams to use. And for merchants looking at levelling-up their B2B processes, it’s now even easier to onboard their sales team and bring more automation to their B2B processes. Let’s dive into the new features!

*1.Inline Price Editing*

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/sales-agent-edit-prices.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

Our built-in powerful B2B pricing engine lets customers see their exact B2B pricing rules when they login. However, what if a Sales Agent needs to make an ad-hoc change to a price or apply a discount to a range of products in one go? With our instant price editing feature, Sales Agents can now edit pricing “inline”, allowing them to edit prices in real-time before placing an order. [Learn more](docId\:Uw8mDbMEfwWKqZrVB5CqX)

*2. Create new customers*

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/sales-agent-add-customer.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

This new feature lets Sales Agents rapidly add a new customer and begin placing orders for them right away. It’s particularly useful if a Sales Agent is on the road meeting new customers, or at a trade show needing to place orders there and then with a customer. [Learn more](docId\:Uw8mDbMEfwWKqZrVB5CqX)

*3. Place Sales Agent Orders*

Now, Sales Agents can not only add products to their personal orders but also complete the checkout process independently. Whether it's for buying a product for an upcoming customer demonstration or making a personal purchase at a preferential rate, this update now gives them the ability to do this!&#x20;

:::hint{type="info"}
**Please note**
The above [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) updates are available to all customers on the Growth, Pro, and Enterprise plans.
:::

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Product widgets - Dark Mode**
  We've extended the available design customisations for customers using the [dark mode](docId\:qCt2Zk8wjhYIV2ZbVBJYy) look and feel for the SparkLayer product page widgets
- **Shipping - Percentage of Net Total**
  You can now set shipping rates based on a percentage of the customer's order total, e.g. 20%
- **Dashboard - Team Invitations**
  We've made inviting team members easier with a new, streamlined process for becoming part of a team. [Learn more](docId\:r9NG74uJdtyWlvGbpnB5u)
- **My Order - Product SKU search**
  We've updated the user interface for the SKU search on the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) to display a new icon (a plus symbol instead of a search icon)
- **Error messages now have reference codes**
  If you ever encounter an error saying "Sorry, an unknown error has occurred", this will now include a reference code number. You can see the list of common error codes in [our guide here](docId\:BlCEkkx3I30nkUcglsfw7)/



***

## September, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Shopify Onboarding Dashboard**

If you're using your Shopify admin to keep tabs of your SparkLayer installation process, you'll like our latest update!

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/shopify-dashboard.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

We've now greatly improved the interface, making it easier to see the key onboarding steps, learn about available features, and quickly access the main [SparkLayer Dashboard](https://app.sparklayer.io/) to complete your onboarding process.

**Restricting billing address modifications**

By default, you can allow customers to [edit and manage addresses](docId\:xXiWZ30EfVbKXnuF3j1G8) via their My Account area. If you'd prefer to restrict them from editing their billing address, you can now enable this via the [Configurations area](https://app.sparklayer.io/configuration/settings/general) of the SparkLayer Dashboard.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ESu4K5HSS4qkg0j2-GywX_image.png)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Product widgets - single variant products**
  If you have single variant products on your website, you can now display the full variant name in the [table-view mode](docId\:m3DF4f0Eyc2rM-vUaRG9H)
- **CSS styling controls**
  We've now added the ability to customise the "Order Complete" checkmark icon colour that shows to customers once an order is placed
- **Price Lists admin**
  If you now try to download a "manual price list" that hasn't had prices uploaded, you'll be prompted with a message (rather than downloading a blank file previously)



***

## August, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Checkout address editing**

We're pleased to announce one of our most requested features - checkout address editing! Customers can now add new addresses directly from the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), making it even faster to choose shipping addresses and complete an order&#x20;

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/checkout-address.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

This new feature can also help streamline and compliment any drop-shipping activities your customers may be doing. To learn more about how it works, [see our guide here.](docId\:efevur-A3yCJXUHvrR7t-)

**Set minimum and maximum order limits**

To add more flexibility to your ordering rules, we've now released the ability to set both minimum and maximum order requirements for your customer groups.&#x20;

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/dashboard-order-limits.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

Based on the rules you set, you can now more easily restrict customers from being able to checkout until they meet the order requirements. To learn more, see [our full guide here](docId:5_lWMNohhjBJJppg9E6Vh).

**Custom checkout message**

On the final step of the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), Review & Pay, it's now possible to display a "custom checkout message" that lets you inform customers of any special notes or information they need to be aware of.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bazPYJbuvnW_mUJCUzoD8_image.png)

It's a great way to highlight information about shipping, payment, or anything else! [Learn more](docId\:o3nDhZBCxisWH6M6satDt).

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **My Order - displaying RRP price**
  If you've set up [rrp pricing](docId\:S_VTlJBorGmnwjjfSMom9) for your products, you can now display the RRP price within the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-)
- **My Order - selecting a payment method**
  If a customer has pre-selected a payment method (e.g. Pay by Invoice) and subsequently makes changes to their order, the payment method will now be pre-selected (rather than resetting back to the default payment method)
- **Product widgets - handling for "Unavailable"**
  If all variants of a product are set as "Unavailable" (i.e. they have no B2B pricing set), the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) and [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) will now hide the "Add to Order" button from showing to a customer
- **Product cards - improved handling for variants**
  If your products have multiple levels of variants (e.g. colour and size), the [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) will now only show available variants based on availability and "disable" variants that cannot be added to an order
- **My Account - "Financials" section**
  If you have [credit terms](docId\:yWm70oQUosyKOoIqb4Z4G) set up for your B2B customers but you'd prefer to hide the "Financials" section from the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP), you can now do this via a new configuration. [Learn more](docId\:lQXaNI7IVDqna09D9soAP)
- **Dashboard - Shipping**
  You can now more easily edit and delete shipping rules directly from the [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) area of the SparkLayer Dashboard



***

## July, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Display custom fields within the My Account**

Within the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP), it's now possible to show "custom fields" allowing you to add additional information that you want your B2B customers to see. For example, you may want to include details of their sale agent contact, website address, or anything else!

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-OKmXgtJaTXpm0zeQTuOl_my-accountarea.gif)

Setting custom fields for the My Details area works in a very similar way to the [custom checkout fields feature](docId\:o3nDhZBCxisWH6M6satDt) and you can learn more in our [full guide here](docId\:xXiWZ30EfVbKXnuF3j1G8).

**Upload invoices to an order**

When viewing an order, in addition to the order details (such as products ordered, order status, address), it's now possible to attach an invoice against an order that the customer can subsequently download.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vJdmCGu2mbJi2OEJRzCjz_order.gif)

Once the invoice has been uploaded, your customers can then view the invoice by viewing their order details within the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP).

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2F9VvbGw3V1ivMIj38UXGA%2Fimage.png?alt=media\&token=ed9a3454-07ce-41e2-84e4-f534aea1806d)

You can learn more about how to set this up in [our guide here](docId\:yWm70oQUosyKOoIqb4Z4G).

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Price lists - clearing prices**
  You can now "clear" price lists within the [SparkLayer Dashboard ](https://app.sparklayer.io/pricing)for any price lists that you've manually uploaded (via a CSV). This is especially useful if you want to remove existing price list data and re-upload it.
- **My Order - uploading CSV data**
  Within the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), you can now paste in CSV data to quickly populate an order. This works alongside the existing CSV file upload feature. [Learn more](docId\:efevur-A3yCJXUHvrR7t-).
- **Product cards - display stock level and SKU**
  Within the [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv), you can now optionally display a live stock level and SKU (product code). [Learn more](docId\:m3DF4f0Eyc2rM-vUaRG9H)
- **Checkout validation**
  You can now define more granular rules for validating whether a customer is allowed to proceed to checkout. Learn more in out [JavaScript SDK](docId\:EBoyUfHfFJKXXo5D0nXWP).



***

## June, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Integration with experience platform, Pack**

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FLfRHPBu6OOYJHkF7B1u8%2Farticle-pack.jpg?alt=media\&token=c9a0ae96-a918-48e1-9179-9d0a5bdd6a97)

Speed and performance have always been at the heart of how we’ve built SparkLayer: from how we manage the complexities of B2B pricing in a scalable way, through to ensuring that the end B2B customer gets the smoothest possible experience when placing orders online.Today, we're thrilled to announce our latest partnership that takes this a step further, as we launch our official integration with Pack! [Learn more about](https://www.sparklayer.io/blog/2023/05/18/sparklayer-pack-headless-shopify-b2b/) our partnership.

**Configure net payment terms more easily**

We've just made setting customer net payment terms even easier! If you're using the SparkLayer "Pay on Account" payment method, you can now set up specific net payment terms for a customer and have this automatically populate the payment terms in Shopify.&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FH1RKXgigWVAAUUnRgpfo%2F2023-05-20%2008.38.15.gif?alt=media\&token=ccec538d-55a8-47b8-a647-49d24f888f8c)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Address book - phone numbers**

  When adding an address in the My Account area, you can now optionally make customers specify a phone number. This will then be included in the customer's details if they proceed to place an order
- **Address book - billing & shipping address**

  When adding an address in the My Account area, customers can now specify if they want the address to be their default Billing and/or default Shipping address. This is useful if they require different addresses when placing an order



***

## May, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**The new B2B Price Engine**

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2F7QZofBjhX6gdUWKtRmjr%2Farticle.jpg?alt=media\&token=49039563-97b2-40a9-91b2-50c61369fc26)

We’re excited to announce the launch of one of our most anticipated updates, our new Price Engine that gives SparkLayer customers powerful new ways to automate and streamline their B2B pricing rules!

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FSmOYnOIvOrPc9mJJbkNF%2FPrice%20List.gif?alt=media\&token=d2860413-ce87-4613-b808-71b7648276d5)

Previously, SparkLayer gave customers the ability to manage pricing via CSV uploads and, for more complex integrations, automating pricing via the SparkLayer API. With the new Price Engine, SparkLayer customers can now:

- Use pricing from their eCommerce platform (e.g. Shopify) to create automatic B2B pricing (e.g. set B2B prices to be 20% off Shopify prices)
- Set up automatic pricing  based off other price lists (e.g. 50% off your default price list)
- Quickly download price lists to make edits and then easily re-upload
- Edit pricing “inline" with our Price Editor Tool
- Import manual prices more quickly, with a major performance boost

Learn more in our [recent announcement](https://www.sparklayer.io/blog/2023/04/17/b2b-pricing-system/) or see how it works in [our guide here](docId\:s8XcbZGxQpgdeIGWtXseT).

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Product widgets**
  You can now optionally display the RRP prices anywhere on your storefront with our new RRP price widget
- **Performance improvements**
  We've made a range of improvements under the hood to speed up the process of importing pricing into SparkLayer



***

## April, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**The new Price Editor**

The **Price Editor** tool compliments the pricing import tool, allowing you to easily add and edit pricing in a more "adhoc" manner. For example, perhaps you need to edit a single price for product and add a new one, and you'd prefer not to upload a new CSV file to do this.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FG3lbraPYNSr1sPCCtdgs%2F2023-04-03%2008.32.12.gif?alt=media\&token=8f80c528-c4ab-4190-ad06-503c5c0d2d77)

The Price Editor tool works by letting you search for a product SKU and then edit and add pricing inline, allowing you to rapid modify your B2B pricing. Our team has been busily working on our major pricing engine update (coming soon!) and we've also released the following improvements.

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Languages**
  We've added support for Hebrew and Georgian to the SparkLayer Frontend. See all  languages we support.
- **SDK updates**
  If you're using our JavaScript SDK  to build more custom interfaces, you can now reference the total weight of an order. This is useful if you want to hide/show messaging based on a customer's order contents reaching a certain weight threshold.
- **Performance improvements**
  We've made a range of improvements under the hood to speed up the process of importing pricing into SparkLayer



***

## March, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Checkout Custom Fields**

Checkout Custom Fields give you the ability to capture additional information from the customer when they checkout. We've released two enhancements that give even more flexibility to how you set these up as well as new ways to display this data to customers.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FtkCJietdQmGteTRBH3O9%2Fimage.png?alt=media\&token=ab9dde3c-97d6-4009-a606-b55459ec3fcb)

It's now possible to set validation rules within Checkout Custom Fields allowing you to apply restrictions to fields such as dates (for example, blocking customers from selecting a weekend).&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FsxJWz8HOvWGkla1N7KIa%2Fimage.png?alt=media\&token=015493e7-516f-45e1-b9a0-494954c78138)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Data Sync area**
  We've released a new area to the SparkLayer Dashboard called Data Sync that combines both product and customer data sent from Shopify.
- **Payment methods**
  It's now possible to change the order that payment methods show during the checkout as well as set the default.&#x20;
- **Stock level key**
  You can now display the stock level key on desktop by using the CSS variable&#x20;
  `--spark-pdp-stock-key-desktop: flex`
- **Cart notification**
  You can optionally hide the progress bar by using the CSS variable
  `--spark-toast-animation-display: none`



***

## February, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Company Users**

It's here! One of our most anticipated product updates, Company Users, is now available! Company Users is a brand new tool that’s designed to improve the B2B purchasing and account management flow within an organisation. Sometimes referred to as "B2B account management", it allows companies to create teams of users (i.e. *Company Users*) that can share specific actions within their account.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2F0P8rwdlIoKR2v5jG1bP4%2Farticle-b2b-company-users.jpeg?alt=media\&token=cdb9e0cb-4c33-4966-a018-9e9ee6a385ae)

From placing orders and tracking their status, repeat ordering previous orders, through to creating shopping lists and sharing address books. What sets the SparkLayer Company Users tool apart is how simple it is to use. Inline with our approach to make the B2B experience self-service, customers themselves can create their own teams right from within their My Account area. There’s no need to request the store owner to manage this on their behalf, the customers themselves have full control over the process. Learn more about [Company Users](#).

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Multi-currency support**
  We've made some major improvements to how SparkLayer works with Shopify Markets/multi-currency meaning you can manage this all within a single Shopify store.&#x20;
- **My Account Re-ordering**
  When viewing a completed order in the My Account area, it's now possible to re-order items on a product-by-product basis.
- **The SparkLayer Dashboard**
  We've made a number of interface improvements including the ability to edit and delete Customer Groups.&#x20;



***

## January, 2023

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**DEAR Systems Integration**

We’re pleased to release our latest integration with DEAR Systems. DEAR Systems has long held the reputation as being the system of choice for established and fast-growing brands, providing a centralised location to manage inventory, orders, warehousing, fulfilment, accounting, and more.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FYbAXC0hDAXuqoDyC0Jqr%2Fdear.png?alt=media\&token=3d88b944-285e-4c15-88fc-16af01c8005a)

The SparkLayer integration works by connecting to the merchant's DEAR Systems account to access B2B data such as product pricing and price lists as well as synchronising B2B customer data.&#x20;

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **SparkLayer Quick Order**
  Customers will now see a running total of ‘lines’ and ‘items’ next to the sub-total. This makes it easier for them to see the size of their B2B order
- **Dark mode**
  For merchants using a ‘dark’ theme, we’ve Improved support for dark mode on collection pages
- Right-to-Left mode: SparkLayer now supports countries/languages that require “right-to-left” (or RTL)
- **Language editing**
  We’ve made it easier to manage language updates with a simpler way to add text overwrites within your storefront
- **Language translation support**
  We’ve added support for Romanian and Arabic.



***

## December, 2022

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**1-click Shopify B2B theme install**

If you're using SparkLayer on Shopify, you may be aware of Shopify's latest theme, [Dawn](https://themes.shopify.com/themes/dawn/styles/default). With our new 1-click B2B theme install, any merchant using SparkLayer can now *instantly* install our B2B-optimised version of the Shopify Dawn theme and get up and running with their B2B store in a matter of minutes. Best of all, **no code changes are required** to set this up.&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FGeB47PEYQpRMAVn13zNX%2Fimage.png?alt=media\&token=20704e86-0756-4f09-acc2-b94789b294ea)

It's a great way to test how SparkLayer works before installing it on a live Shopify theme or you could even use it as the basis for your next B2B store! To get started, go to the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/frontend/core).

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Product page widget**
  The product page widget currently shows a special 'table' view for products that have variants (e.g. size, colour). You can now render the same 'table' view for single variant products by adapting the product widget code.&#x20;
- **Product settings**
  We've updated our documentation on product settings including how it's possible to set products (and variants) to not be "sellable" to B2B customers and even how to fully hide products (and variants) from showing with a special "display" setting.&#x20;
- **Tiered pricing**
  By default, if you have tiered pricing set up, the pricing will be applied across all variants of a product. You can now set this to only apply to specific variants via a new setting within the SparkLayer Dashboard.
- **Pack sizing**
  The product detail page widget now supports a 'Pack price' that gives customers a cost for all products within a pack.
- **Product widgets customisations**
  We've enabled additional design customisation settings including button and input styling.&#x20;
- **Line item limits**
  With Shopify's line item limit of \~ 250 items, we've now included special notifications within the SparkLayer Quick Order if customers exceed this limit
- **Dashboard product data**
  You can now search by SKU within the Data look up tool in the SparkLayer Dashboard.
- **Brightpearl integration**
  We've made improvements to the handling of customer address syncing for BrightPearl, including phone numbers and company names.&#x20;



***

## November, 2022

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Configure "custom dates" for backorder products**

With support already for backordering/pre-ordering built into SparkLayer, we’re excited to announce our latest update, "custom dates" that can be set for backorder products."Custom dates" allow you to set an exact date when the product is expected to be available. It’s a great way to give the end customer better visibility of when to expect receipt of the products on order, and helps deliver an overall better customer experience.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2Fp8T3kPY8RAGmQPQMANS9%2Fbackorder-due-date-pdp.jpeg?alt=media\&token=96d8ef01-58c5-47e5-b1aa-b86bc0e35124)

Use-cases could include:

- Setting a "due in" date of when you're expecting the product to be in stock
- Setting an "estimated shipping" date of when you're expecting the product to ship

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Product page tiered pricing**
  If you're using tiered pricing, the information table shown to customers on a product page will now include pack sizing. For example, if your tiered pricing starts at 6 units, this will be shown as the first in the list.
- **Product page widget**
  We've improved the interface of the product page widget to hide the initial variant dropdown if a product only has a single option within it.
- **Product card variants**
  If a product has variants that don't have prices assigned, these will be shown last in the purchasing dropdown on the product card widget
- **My account area**
  If you're using our account balance feature, you can now optionally hide any reference to 'credit' if you don't set a credit limit against a customer.
- **CSV import**
  The SparkLayer Quick Order Interface  now has improved messaging for customers using the CSV import tool, making it clearer when a product isn't able to be imported due to stock limitations.



***

## October, 2022

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Custom Fields during the checkout**

Our latest update includes the much anticipated 'custom fields' feature that allows you to add **additional** data capture fields during the checkout process.&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FamTuD1AKYPuAoGSAU2zL%2Fimage.png?alt=media\&token=bb9205a1-dabf-4c63-947c-15f8c1cbb504)

Use-cases could include:

- A date capture field, e.g. "Shipping" or "Delivery" date
- Purchase order number (PO number)
- Additional Shipping requests

Custom fields has support for the following types of data capture: Text entry fields, Select menus (i.e. drop downs), Date selection, Email, Phone, and more.&#x20;

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Price lists deletion**
  You can now delete price lists directly from the SparkLayer price list admin
- **Total quantity of items**
  The SparkLayer Quick Order Interface  will now show the total units in a customer's order (i.e. total quantity) before checking out
- **Customer credit and payment on account**
  If you have customer credit enabled, you can now allow customers to optionally be able to checkout using Payment on Account (previously this was blocked for customers who exceed their credit limit)
- **We've partnered with Balance payments** to offer Buy Now and Pay Later for B2B merchants using Shopify. Learn more



***

## September, 2022

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Quick Buy Mode**

Our new Quick Buy Mode gives you a new way to display the SparkLayer product widget on your collection pages with an optimised 'table' view.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FBmCdTLYWY3kpCyh0HIjo%2Fimage.png?alt=media\&token=4ee26d96-ff81-48d3-98b1-7af4605d28e0)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Back-order, minimum stock level**
  If you're using the backorder feature, it's now possible to set granular minimum stock levels at a product variant level giving you more flexibility on how many units you allow to be sold to customers.&#x20;
- **Product variant images**
  If you've product images within Shopify that are assigned to a product variant (e.g. colour), it's now possible to change the images shown to a customer when a variant is selected via SparkLayer. This is a manual change, if you would like this enabled please contact us
- **Cart line item limit**
  We've increased the maximum line items available in a single order from 100 to 250, with customer-friendly messaging should customers exceed this.
  Languages: we've added support for new languages, Norwegian and Finnish



***

## August, 2022

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**B2B shipping rules**

If you've set up SparkLayer on your B2C (DTC) website and need to create different shipping rules for your B2B customers, you can now do this via the SparkLayer shipping tool.&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FWvkGv7ZAVDoGXpxPv4b2%2Fimage.png?alt=media\&token=7bc787ec-227a-4d38-a840-e321b769a4ba)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Address display**
  We've improved visibility of shipping addresses and customers can now see their selected address just before they complete their order. The address summary will show in the final order totals section of the SparkLayer Quick Order Interface
- **CSV importing**
  We've made improvements to our CSV import tools, with handling for different currency formats. For customers uploading price lists in Euros for example, the import will now support comma formats for pricing (such as 19,99)
- **Performance**
  We've released a big performance improvement to the frontend, with a more rapid login process. We've re-engineered how our user authentication works and merchants should now see a much quicker log in process when a B2B customer signs in.



***

## July, 2022

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Show product settings**

If you've configured your products to work with settings such as pack sizing or minimum and maximum quantities, you can now display this to customers anywhere where you show the SparkLayer product interface. Once enabled, this will show a new 'Qty rules apply' message that will show all associated product rules you've set up.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2F8B1WbXUABYoTrqdb1EVD%2Fimage.png?alt=media\&token=a8dc4081-e4d3-47e2-bf7e-664ff897dfa8)

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FfJFjPbZgBRpNICQWBwmq%2Fimage.png?alt=media\&token=d421b607-1f20-454a-be68-83e65936a94f)

**Show order notes from My account overview**

If customers place an order and include a special note (e.g. PO number), this can now be viewed from the My account overview page

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FW9fRtkVumuok808w468q%2Fimage.png?alt=media\&token=b2554891-49ed-4d34-9c25-6960826cfd92)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Shopping list names**
  If a customer creates a new shopping list and uses the same name as an existing one, this will now fully overwrite it instead of creating a duplicate
- **My account ship-to address**
  You can now show the shipping address for an order from the My account overview page.



***

## June, 2022

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Show tiered pricing on product cards**

If you're using tiered pricing, you can now display the discount summary within the product card widget. The product card will now *optionally* display the cheapest price to the customer as well as the maximum discount they could receive. The customer can also mouse-over the widget to see a fully summary of the tiered pricing available. You can test out how it works [on our demo store](https://shopify-demo.sparklayer.io/pages/b2b-login-register)

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FrKj0rRVVWWeqwLNckQgR%2Fimage.png?alt=media\&token=571f656a-2f3f-4c35-b2ce-0a477b3baa44)

**My Account order tracking information**

If you supply shipping information against a customer's order within Shopify, this will now be shown within the SparkLayer My Account interface when viewing an order. The tracking information includes

- A link to the shipping company's own tracking page&#x20;
- The specific tracking number for the customer's visibility

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FnwZHgwZeeEuB7tkgGD1L%2Fimage.png?alt=media\&token=3ce0d28e-dfc7-452a-8db6-72b34a64184f)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Address searching**
  If B2B customers have large numbers of addresses saved against their address book, they can now use a special search box to more easily select their preferred address.
- **Multi-currency support**
  For merchants using a custom ERP solution, we can now enable multi-currency on the same Shopify instance. This is currently restricted only to manual payments only (e.g. Payment by Invoice, Request for Quote) and does require technical investigation before enabling.&#x20;
- **JavaScript SDK**
  For merchants using our SKD, we've added some additional events including 'on cart update'.


[title] JavaScript SDK & Headless
[path] Frontend/

:::hint{type="success"}
**Get started**
To explore more about the SparkLayer JavaScript SDK, please refer to our [SparkLayer JavaScript SDK](https://docs.sparklayer.io/tech-docs/javascript-sdk) documentation.
:::

## Introduction

With the [SparkLayer JavaScript SDK](https://docs.sparklayer.io/tech-docs/javascript-sdk), you can enhance your frontend development and create more customised experiences for your users. The SDK provides a range of straightforward functions to access data stored within SparkLayer, as well as granting access to the GraphQL API and a cart update function.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ASvR3txlNK79ZjCvAfrd2_image.png)

## Example use-cases

The SparkLayer SDK empower developers to build more advanced and dynamic applications on top of the SparkLayer platform. Use-cases can include:

| Functionality                            | Description                                                                                                                                                                                                     |
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Accessing Data and APIs`                | Provides functions to access data within SparkLayer and utilize the GraphQL API, enabling the development of advanced and dynamic applications.                                                                 |
| `Manual Initialization`                  | Allows manual initialization of the SDK, useful in headless commerce implementations                                                                                                                            |
| `Customizing User Experiences`           | Allows calculation of pricing data, updating the shopping cart and retrieving updated cart information, customisation of the look and feel                                                                      |
| `Product Variant Image Updating`         | Custom code can be added to update product images when a variant is selected, enhancing user shopping experience by providing visual feedback.                                                                  |
| `Custom Checkout Validation`             | Enables custom validation logic at checkout for personalized API calls to verify cart contents and manage checkout permissions based on custom rules (e.g., managing one-time discounts, product quota limits). |
| `Adding Custom Attributes to Cart Items` | Offers a method to include custom attributes with cart items, ensuring customizations are visible under the product SKU and persist through to past orders.                                                     |

## Explore more

To explore more about the SparkLayer JavaScript SDK, please refer to our [SparkLayer JavaScript SDK](https://docs.sparklayer.io/tech-docs/javascript-sdk) documentation.

:::hint{type="warning"}
**Please note**
If you're looking to extend your SparkLayer integration by using the SDK, we do strongly recommend speaking to our technical team to ensure it can meet your requirements. Please [contact us here](docId\:NNUw1G9z7eaJ4M78vk7t9)
:::

## Error Codes

Below is a list of error codes that are shown in the SparkLayer Core Script frontend widgets if on of the custom SparkLayer Options hooks fails:

:::hint{type="danger"}
- **OPTIONS\:HOOK\:OR** - window\.sparkOptions.onReady hook failed
- **OPTIONS\:HOOK\:OCL** - window\.sparkOptions.onCartLoad hook failed
- **OPTIONS\:HOOK\:OCU** - window\.sparkOptions.onCartUpdate hook failed

If these errors are reported by customers, please review your store's sparkOptions configuration for the relevant hook and ensure the errors are resolved.

**NOTE:&#x20;**&#x54;he specific JS error is logged to the browser's Console.&#x20;
:::



***

## Headless implementations (Composable Commerce)

SparkLayer has been designed and built to be a fully headless (composable) eCommerce platform and there are a variety of ways it can be extended. To learn more, please see our [headless guide](https://docs.sparklayer.io/tech-docs/headless) for what's possible.

[title] Stock Display
[path] Features/Configurations/

## How stock ("inventory") works

SparkLayer works by taking the inventory (stock) data from your eCommerce store (e.g. Shopify) and showing the **same inventory** to your B2B customers. Whether you're managing inventory manually or via a backend system (e.g. ERP), SparkLayer will simply display the inventory you've set up via these methods.

:::hint{type="info"}
**Setting up stock locations per customer**
SparkLayer also supports Stock locations ("inventory locations"), allowing you to specify which locations you want specific customer groups to use stock from. You can learn more in [our guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::



***

## Show stock levels (inventory)

Stock levels are retrieved automatically from your eCommerce platform (or integration if you're using the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT)) and you can choose to display these to your customers as well as customise the status messages. &#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/KKE1o4XBEg-9NH1GnTohD_image.png)

To get started, you'll need to ensure you're using the latest version of SparkLayer (2.0 and above) and you can check this [in our guide here](docId\:QWXsYM9X5_pvIOGUteKcP). Once setup, within the SparkLayer Dashboard, go to [Customer Groups](https://app.sparklayer.io/customers/groups) and you can then configure how you want your stock display to work.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/QRgXFKPDRe_xAHMlmfsI4_image.png)

You can read our full guide on how these configurations work in [our guide here](docId:5_lWMNohhjBJJppg9E6Vh). &#x20;

::::ExpandableHeading
**For versions of SparkLayer before 2.0&#x20;**

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
display: {
stock: {
  show: true,
  max: 50,
  last: 5,
  low: 15,
},
},
/* End of code */
```

You can adjust the rules of the status messages shown to customers by changing the variables in the configuration code above.&#x20;

| Status | Details                                                                | Behaviour                                                       |
| ------ | ---------------------------------------------------------------------- | --------------------------------------------------------------- |
| `max`  | The maximum stock level you want to show to customers.                 | <font color="#3b9f0f">Stock displays as "XX+ available"</font>  |
| `last` | Let your customers know that the stock level is down to its last items | <font color="#eb144c">Message shows as red"Last stock"</font>   |
| `low`  | Let your customers know that stock level is low                        | <font color="#fcb900">Message shows as orange"Low stock"</font> |


::::

On smaller screens, if you have variants enabled with stock display, the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) will display a "stock key" indicating to the customer the stock status shown in the table above.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7TYCR7MQyoHRrQJexNxKH_image.png)

You can also make this display on desktop (larger) screens by adding the below CSS variable to your SparkLayer CSS.

```css
--spark-pdp-stock-key-desktop: flex;
```

### Setting a maximum stock level

If you're wanting to set a maximum stock level that your customers see, you can configure this via the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/settings/general).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/dd25I14SIaJg-GxEnOUC-_image.png)

For example, if you set the limit to `100`, it will display as `100+` to the customer if the stock level exceeds this.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/dciIRVyvx2mlg5qzxQ81Y_image.png)

### Showing stock on product cards

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GvKqz31iOzQ9yQ-SxqsiT_image.png)

You can also display live stock levels in the [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv)*.&#x20;*&#x54;o enable this please [read our guide](docId\:m3DF4f0Eyc2rM-vUaRG9H).



***

## Pre-order & back-order products

SparkLayer has full support for different stock status messages and it's possible to set up products as pre-order / back-order. This will allow products to be added to an order and concurrently show the pre-order / back-order messaging to the customer.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/L2UFNihsBeXVSDTuLv1H5_image.png)

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/krqGTlDEBAjyTuD5im5ta_image.png)

To enable this within Shopify

- Set the product as '**Continue selling when out of stock**'&#x20;
- Set a stock level of zero (or less)

:::hint{type="info"}
**Please note**
Activating "Continue selling when out of stock" will also take affect to non-B2B customers, allowing them to purchase additional inventory. If you'd prefer to restrict this, you may want to create specific products that only show for your B2B customers and we've a [guide here](docId\:ddIv5TDAnCayWTOJ0Vyb7) of some recommended approaches.
:::
::::

:::Tab{title="🌐 Other platforms"}
Please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "pdp.messaging.back-order": "Pre-order",
    "product-card.messaging.back-order": "Pre-order",
  }
},
/* End of code */
```

### Setting pre-orders / back-orders at a variant level

It's also possible to configure pre-ordering / back-ordering at a variant level, allowing you to set an exact amount of stock you want to allow customers to be able to pre-order / back-order.

To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

::::::Tabs
:::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                                                              |
| ------------------ | -------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields)                                 |
| `Metafield type`   | This must be set as an `integer`                                                                                     |
| `Namespace`        | This must be set as `sparklayer`                                                                                     |
| `Key`              | This must be set as `min_stock_level`                                                                                |
| `Value`            | This must be set as <font color="#eb144c">**a negative integer**</font>, e.g.                    `-6, -12, -20, etc` |

If you're using [stock locations](docId:5_lWMNohhjBJJppg9E6Vh), you can also set reserve stock levels on a per-location basis.&#x20;

::::ExpandableHeading
**View example metafield configuration&#x20;**

| Item               | Details                                                                                                                                                                                                                                                                                                                |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields)                                                                                                                                                                                                                                   |
| `Metafield type`   | This must be set as an `json`                                                                                                                                                                                                                                                                                          |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                                                                       |
| `Key`              | This must be set as `stock_location_data`                                                                                                                                                                                                                                                                              |
| `Value`            | This must be set per location with the location\_id taken from your eCommerce platform.<br />:::BlockQuote
\[&#xA;    \{&#xA;        "location\_id": "123",&#xA;        "min\_stock\_level": -99999999,&#xA;    },&#xA;	\{&#xA;       "location\_id": "789",&#xA;       "min\_stock\_level": -150,&#xA;    }&#xA;]
::: |


::::
:::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                                                                                              |
| ------------------ | -------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | Variant-level (products)                                                                                             |
| `Metafield type`   | This must be set as an `integer`                                                                                     |
| `Namespace`        | This must be set as `sparklayer`                                                                                     |
| `Key`              | This must be set as `min_stock_level`                                                                                |
| `Value`            | This must be set as <font color="#eb144c">**a negative integer**</font>, e.g.                    `-6, -12, -20, etc` |

For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
::::::

### Setting a custom "restock" date&#x20;

"Custom dates" allow you to set an exact date when the product is expected to be available. It’s a great way to give the end customer better visibility of when to expect receipt of the products on order, and helps deliver an overall better customer experience.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/x-T8bVog3qb8MahjWGE8c_image.png)

Use-cases could include:

- Setting a "due in" date of when you're expecting the product to be in stock
- Setting an "estimated shipping" date of when you're expecting the product to ship

To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

::::::Tabs
:::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                              |
| ------------------ | ------------------------------------------------------------------------------------ |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields) |
| `Metafield type`   | This must be set as an `date`                                                        |
| `Namespace`        | This must be set as `sparklayer`                                                     |
| `Key`              | This must be set as `restock_date`                                                   |
| `Value`            | This must be set in the appropriate date format, e.g. `17/11/2022` (for the UK)      |

If you're using [stock locations](docId:5_lWMNohhjBJJppg9E6Vh), you can also set restock dates on a per-location basis. In this case, the restock date must be in the format: `YYYY-MM-DD`.

::::ExpandableHeading
**View example metafield configuration&#x20;**

| Item               | Details                                                                                                                                                                                                                                                                                                                   |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields)                                                                                                                                                                                                                                      |
| `Metafield type`   | This must be set as an `json`                                                                                                                                                                                                                                                                                             |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                                                                          |
| `Key`              | This must be set as `stock_location_data`                                                                                                                                                                                                                                                                                 |
| `Value`            | This must be set per location with the location\_id taken from your eCommerce platform.<br />:::BlockQuote
\[&#xA;    \{&#xA;        "location\_id": "123",&#xA;        "restock\_date": "2023-12-12"&#xA;    },&#xA;	\{&#xA;        "location\_id": "789",&#xA;        "restock\_date": "2024-12-12"&#xA;    }&#xA;]
::: |


::::
:::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                                                         |
| ------------------ | ------------------------------------------------------------------------------- |
| `Custom data type` | Variant-level (products)                                                        |
| `Metafield type`   | This must be set as an `date`                                                   |
| `Namespace`        | This must be set as `sparklayer`                                                |
| `Key`              | This must be set as `restock_date`                                              |
| `Value`            | This must be set in the appropriate date format, e.g. `17/11/2022` (for the UK) |

For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
::::::

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "pdp.messaging.back-order-due": "Due {restockDate}",
  }
},
/* End of code */
```

### Managing "pre-order" / "back-order" products

If you're running a store that combines both retail (DTC) and B2B, you may want to offer your B2B customers the option to purchase special "pre-order" / "back-order" products that regular retail customers cannot purchase. Perhaps you need your B2B customers to order "pre-season" or you have a special range of products that aren't available to regular customers.&#x20;

::::::Tabs
:::::Tab{title="🛍️ Using Shopify"}
**Setting up pre-order / back-order products&#x20;**

Out of the box, Shopify doesn't allow you to specify products to hide or show based on a specific customer type. One of the most effective ways to "restrict" products is to use the following approach:

- Create a brand new product (or range of products) and set this up as normal (e.g. with images, description, etc).
- Using a third-party app (such as [Locksmith](https://apps.shopify.com/locksmith)), you can then configure the product to **only** show on your website on certain conditions (e.g. the customer logged in has the tag `b2b` set against them)
- Via SparkLayer, you can then configure your B2B pricing and any settings required (e.g. [Quantity Rules](docId\:CmxfrPgjQxfz9vJzTVv0D)) allowing your B2B customers to then purchase them

When a regular customer (i.e. **not** a B2B customer) visits your store, they won't see any of the special products you've set up via the method above nor will they be able to purchase them.

Whilst this approach does require duplicating data, it can be an effective way to manage "pre-order" / "back-order" products that you only want your B2B customers to see.

**Managing orders with pre-order / back-order products**

Alongside setting up pre-order / back-order products (as detailed above), it's also possible to add automations to streamline the **management of orders&#x20;**&#x74;hat have these products within them.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TUYi99yqNbOFQ5lnCfSz__image.png)

One way is to use built-in Shopify automations to do this using the [Shopify Flow app](https://apps.shopify.com/flow) and the process broadly works as follows:

1. Tag products that are on pre-order / back-order with a special tag
2. When an order is placed with a product that has this tag, add a tag to the order itself
3. Within Shopify, add a filter to segment any orders that have this tag

To get started, you can follow these steps:

::::WorkflowBlock
:::WorkflowBlockItem
First, within your Shopify catalogue, add a tag of `b2b-pre-order` to any product(s) that you want to make pre-orders / back-orders.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/uNfq9C1KXvTVL4ipUs67F_image.png)
:::

:::WorkflowBlockItem
Next, download the [Shopify Flow app](https://apps.shopify.com/flow) and upload the below sample files. When run, orders and draft orders that have pre-order / back-order products within them with have a special tag added `b2b-pre-order`

::File{src="https://archbee-doc-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/JRCsUHQE0Xlgs47IDhU6v_draft-order-tag-an-order-if-products-have-b2b-pre-order-tag-assigned.flow" label="[DRAFT ORDER] Tag an order if products have b2b-pre-order tag assigned.flow"}

::File{src="https://archbee-doc-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/9d0cqyfqYTovmVa_WtS1u_order-tag-an-order-if-products-have-b2b-pre-order-tag-assigned.flow" label="[Order] Tag an order if products have b2b-pre-order tag assigned.flow"}
:::

:::WorkflowBlockItem
Finally, within the Shopify Orders admin, you can set up a basic filter to segment all orders that have the tag `b2b-pre-order.` You can then use this to manage your internal workflows (e.g. how you fulfil items)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/20fhJCZFRS89xMT_XHgBo_image.png)
:::
::::
:::::

:::Tab{title="🌐 Other platforms"}
For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
::::::

### Hiding pre-order and back-order messaging

SparkLayer will by default show products as pre-order if they match the criteria set within your store. There are two ways you can disable pre-order showing on your website.

**Hiding via the SparkLayer Dashboard**

Within the SparkLayer Dashb**oard, go to the Customers section and edit a customer group. Within Stock Display Settings** simply tick 'Hide pre-order' and this will hide this from showing in the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) &#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/xV0lpgI8j-k4RFrsoFjbL_image.png)

**Hiding via your eCommerce platform**

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
SparkLayer will show the pre-order stock message based on the following criteria:

- On a product (or variant) level, "Track quantity" is enabled
- The product (or variant) is set to "Continue selling when out of stock"
- The inventory (Quantity) is 0 or less

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/krqGTlDEBAjyTuD5im5ta_image.png)

To disable the message showing in SparkLayer, you can apply the following:

- Turn off "Track Quantity"
- Turn off "Continue selling when out of stock"
:::

:::Tab{title="🌐 Other platforms"}
For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
::::



***

## Stock locations ("inventory locations")

Stock locations allow you to specify which stock (or "inventory") locations you want specific customer groups to see stock display settings from. If your B2B store is set up with multiple stock locations (e.g. by geography), it's a great way to ensure your B2B customers are viewing stock disaply settings from the relevant location.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/J55OoOzaP93oXlQHLTC5-_image.png)

:::hint{type="info"}
**Looking to enable stock locations?**
You can learn more about how this works in [our guide here.](docId:5_lWMNohhjBJJppg9E6Vh)
:::



***

## Reserving stock&#x20;

If you're installing SparkLayer on a single website and you are looking to run both DTC **and** B2B at the same time, it will be necessary to use the same stock pool behind the scenes. From an inventory point of view, this essentially means that both DTC and B2B customers will be ordering from the **same stock source** which can pose challenges.&#x20;

For example, your B2B customers could place large orders which inhibit DTC customers from being able to order. SparkLayer has a way to solve this using a special setting called "Reserve stock quantity". It works as follows:

- A product is set up within your store with a Reserve Stock Quantity, e.g. `50`
- Both DTC and B2B customers can order this product via your store
- When the total stock level reaches `50`, B2B customers will be **prevented** from adding the item to their order
- DTC customers can continue to order the item, thus reserving stock for them

To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
To learn more about how to configure metafields on Shopify for SparkLayer, please refer to [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                              |
| ------------------ | ------------------------------------------------------------------------------------ |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields) |
| `Metafield type`   | This must be set as an `integer`                                                     |
| `Namespace`        | This must be set as `sparklayer`                                                     |
| `Key`              | This must be set as `reserve_stock_quantity`                                         |
| `Value`            | This must be set as an integer, e.g. `50`                                            |
::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                      |
| ------------------ | -------------------------------------------- |
| `Custom data type` | Variant-level (products)                     |
| `Metafield type`   | This must be set as an `integer`             |
| `Namespace`        | This must be set as `sparklayer`             |
| `Key`              | This must be set as `reserve_stock_quantity` |
| `Value`            | This must be set as an integer, e.g. `50`    |

For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::



***

## Stock status messaging

Within the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa), SparkLayer will display the "stock status" of a product (and its variants), allowing customers to easily see the inventory availability. Providing you have the "Show stock levels (inventory)" configuration enabled, you can then adjust the messaging that is shown by overwriting the default language settings.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "pdp.messaging.back-order": "Pre-order",
    "pdp.messaging.back-order-due": "Due {restockDate}",
    "pdp.messaging.out-of-stock": "Out of stock",
    "pdp.messaging.low-stock": "Low stock",
    "pdp.messaging.last-stock": "Last stock",
    "pdp.messaging.in-stock": "In stock",
    "pdp.messaging.un-sellable": "Unavailable",
  }
},
/* End of code */
```


[title] Data Sync
[path] Dashboard/

## Introduction

The **Data Sync** section is the heartbeat of your SparkLayer integration and gives you visibility of the product and customer data being synchronised from your online store. It's largely used as a way to diagnose any issues and is also useful to review the data being sent from your online store to SparkLayer.

There are a number of reasons why data is synchronised:

::::WorkflowBlock
:::WorkflowBlockItem
**Product Sync**
By synchronising product data, SparkLayer knows what product pricing to display when a B2B customer is signed in and visits a product page on your store. Learn more
:::

:::WorkflowBlockItem
**Customer Sync**
By synchronising customer records, SparkLayer can recognise when a B2B customer signs into your store (and subsequently display the correct B2B information to them).
:::
::::



***

## Products Sync

Once you've connected your platform via the **Integrations** section of the SparkLayer Dashboard, you'll see your product feed appear in the 'Products Sync' tab.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/1buVh0ruYTP5SOnZRq3N3_image.png)

At the top, the status box will notify you of the following states:

| Status     | Description                                                       |
| ---------- | ----------------------------------------------------------------- |
| `🟢 Green` | Products are successfully syncing and data being received         |
| `🟠 Amber` | Products are successfully syncing, **but** errors have been found |
| `🔴 Red`   | No product data being received and configuration is required.     |

From within the interface, clicking the product feed status box will show further details, such as:

- Products synchronised
- Last import time
- Errors with the feed

:::hint{type="info" attributes="[object Object]"}
**Please note**
By default, SparkLayer will synchronise all products from your online store. Please note, products won't be purchasable until you've set up [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) for your products.

SparkLayer will by default perform feed refreshes every 10 minutes, however, if you want to manually trigger a refresh, you can do so by clicking the **Refresh** button. This is useful if you've updated data on your eCommerce platform and want to ensure SparkLayer is synchronised more rapidly.
:::

:::hint{type="warning"}
**⚠️ Having technical issues?**
If you're having issues with setting this up or are experiencing error messages, please refer to our [Troubleshooting](docId\:BlCEkkx3I30nkUcglsfw7) guide or contact our [Support](docId\:NNUw1G9z7eaJ4M78vk7t9)
:::

### Product Data Lookup

The product data lookup is a handy tool that lets you inspect and diagnose the product data you're sending to SparkLayer. The search results will display all relevant data, allowing you to drill into more detail.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/R3iFwpFYbf9R35XlyqCL-_image.png)

To use the Product data lookup tool, you can search by either of the following:

::::Tabs
:::Tab{title="🌐 General"}
| Type              | Details                                                                                                                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Variant SKU`     | Within your product catalogue you will likely have SKUs (Stock Keeping Units) assigned to your products and variants. For example, a product may come in 3 variants with SKUs:<br />* ABC-1
* ABC-2
* ABC-3 |
| `Product ID`      | You can search by an external product ID. For details on how to find this, click your platform type above                                                                                                   |
| `Product name`    | You can search by the product name (or part of the full product name)                                                                                                                                       |
| `Description`     | You can search by the product description as set within your eCommerce platfom                                                                                                                              |
| `Barcode`         | You can search by barcode (if specified)                                                                                                                                                                    |
| `Variant options` | You can search by variant option, e.g. "Red", "Green" etc                                                                                                                                                   |
:::

:::Tab{title="🛍️ Shopify-specific"}
| Type         | Details                                                                                                                                                                                                                                                                                                                                         |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Product ID` | For third-party platforms such as Shopify, you can  find this ID in the URL when navigating a product within the admin. <br />For example, the URL in your browser may look something like this:<br />`https://your-shopify-store-url.com/admin/products/7356521840875 `<br />In this example, the external Product ID would be `7356521840875` |
:::
::::

**Stock**

Under the product data lookup, you can view the stock data for the selected variant. This can be in 3 states:

| State                     | Description                                                                                                                                                                 |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Stock data found`        | You have stock information configured for this product. A table of stock information for each location will be shown here                                                   |
| `Stock data not found`    | There is no data about stock in our system. Variants without stock data **cannot** be purchased                                                                             |
| `Stock not being tracked` | Stock/inventory tracking has been disabled on this variant within your e-commerce platform. We therefore have no stock information. This variant **can** still be purchased |



***

## Customers Sync

SparkLayer automatically syncs your B2B customer data from your connected platform. This ensures that when a tagged B2B customer signs into your store, SparkLayer recognises them and displays the correct B2B information.
At the top of the Customers page, the customer feed status box will notify you of the current sync state:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/P1mVPFyXlYFCKyVQ5nsNx_image.png)

The feed status box will notify you of the following states:

| Status     | Description                                                        |
| ---------- | ------------------------------------------------------------------ |
| `🟢 Green` | Customers are successfully syncing and data being received         |
| `🟠 Amber` | Customers are successfully syncing, **but** errors have been found |
| `🔴 Red`   | No customer data is being received and configuration is required.  |

From within the interface, clicking the customer feed status box will show further details, such as:

- Customers synchronised
- Last import time
- Errors with the feed

:::hint{type="info"}
**Customer data&#x20;**&#xA;It's important to note that SparkLayer will **only** import customer data that has been specially tagged as a `b2b` customer or sent through with metafields with the namespace of 'sparklayer'. This is to ensure that you have control over the types of customers that get imported.

**Customer data from Shopify**
For third-party platforms, such as **Shopify**, this is set up within the platform itself and you can [Data Mapping and Metafields](docId\:LJ6VIeqqBgVAVMGiKhX_7) on how this works.
:::

:::hint{type="warning"}
**⚠️ Having technical issues?**
If you're having issues with setting this up or are experiencing error messages, please refer to our [Troubleshooting](docId\:BlCEkkx3I30nkUcglsfw7) guide or contact our [Support](docId\:NNUw1G9z7eaJ4M78vk7t9)
:::

### Viewing customer data

To check the data SparkLayer is syncing for a specific customer, go to Customers in the SparkLayer dashboard and click **View** on the customer you want to inspect. Their detail page shows all synced information, including basic details, customer group, financial settings, role, and addresses.

This is the easiest way to confirm a customer is syncing correctly and to review the data being received from your platform.

::::Tabs
:::Tab{title="⚫ Using Wix"}
You can also if your customer record is syncing by using the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. Within Wix, navigate to a Contact record that has a label of b2b. Within the URL, you'll see a unique ID at the end of the URL. In the example below, the unique ID is `66b4c99a-3431-47d6-995d-309e4e8c5908`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GVKla6zDdNg2IEVmcqV7m_image.png)

With this unique ID, you can then paste this into the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. If the search results show the customer details, this confirms the customer is synchronosing correctly.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/c5I3ypE5OwwZzNDGPMsaV_image.png)
:::

:::Tab{title="🌐 Other platforms"}
Please refer to your platform for how to find the customer ID
:::
::::




[title] Test Mode
[path] Dashboard/

## Introduction

The SparkLayer **Test mode** is a handy way to test SparkLayer without affecting your live website. It allows you to effectively have a  test and a live environment under a single account and easily switch between the two as necessary. Common use-cases include:

- You want to enable a test account on your live store to test pricing and customer data
- You want to enable SparkLayer on a development (or sandbox) store before going live

:::hint{type="info" attributes="[object Object]"}
**Please note:**
Test mode is only available on the Pro and Enterprise plans.
:::



***

## How it works

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/KiDxAmNZP-KFuOzxGrEM3_image.png "You can access Test mode from the left hand menu")

Test mode works by simply **switching the data** you see in the SparkLayer Dashboard between two environments that you specify: one environment being your live store (**production**), and one environment being your test store (sometimes referred to as **staging**). Once enabled, every section is re-loaded with the corresponding data and you can perform actions independent of one another.



***

## Configuring your environments

When you create a SparkLayer account for the first time, you'll be asked to go through the [Configuration](docId\:ISj3O3OS27G_4KjuCsX72). Your environments are specified within the [Configuration](docId\:ISj3O3OS27G_4KjuCsX72) section and from here you can specify your two environments (i.e. live and test).

**Live environment:** Ensure Test mode is set to **OFF** in the left hand menu and then enter your live store address

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pDZgqjFSuXCS4tg2Dmj7D_image.png "Specifying the live store URL")

**Test environment:** Ensure Test mode is set to **ON** in the left hand menu and then enter your test store address if it isn't already pre-populated.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/6A9OAOEQQJF81ni3uoKNE_image.png "With Test mode switched on; specifying the test store URL")

In each instance, you'll be redirected to Shopify and asked to authorise the SparkLayer Shopify app.

:::hint{type="info" attributes="[object Object]"}
If you're setting your Shopify store up in test mode, you'll be able to skip the billing step
:::

Once the Platform has been configured, you can then proceed with the remaining onboarding steps for your test environment.



***

## When to add Test mode

When installing SparkLayer for the first time, our recommendation is to configure the store initially for your live environment and then to add your test site **afterwards**. It's important to note that setting up Test mode is optional and can be added or edited at any point.

:::hint{type="info" attributes="[object Object]"}
**Transferring accounts**
If you've already installed SparkLayer on a store and want to benefit from Test mode, we recommend the following steps:

- Log into the Shopify store that has SparkLayer installed
- In your Shopify admin. go to **Settings > Apps & Sales Channels** and remove SparkLayer
- Log into your [SparkLayer account](https://app.sparklayer.io/)
- Go to the [Integrations area](https://app.sparklayer.io/configuration/integrations/platform) in SparkLayer and connect to your live Shopify store and re-select the **Pro** plan. Once completed, this will re-link your SparkLayer account to your live store
- To add your Test store, simply click '**Test mode'** on the left and then go to the [Integrations area](https://app.sparklayer.io/configuration/integrations/platform) and enter the Shopify store URL of your test store.
:::


[title] Pricing
[path] Dashboard/

## Introduction

The Pricing tool within the SparkLayer Dashboard lets you manage your B2B price lists and gives you a powerful way to set pricing the way you want for your B2B customers. From activating automatic B2B pricing (e.g. 50% off retail prices) or uploading exact B2B prices via our CSV file import tool, you can configure your pricing rules in a variety of ways!

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/x5CIKpTOFD1bt1kOxNCaS_image.png)

In this guide, you'll learn how to get started with Price Lists.

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[Supported Pricing Rules](docId\:FHHF5tHnVS2jg4lCUVAS2)

Pricing types and rules support by SparkLayer
:::

:::LinkArrayItem
[Managing Pricing](docId\:NX9Q00eWV_kbjxc3tg1ut)

How to set up automated and manual price lists
:::

:::LinkArrayItem
[The Price Editor](docId\:fWW4Oh09nSO1-G9TXUTOP)

Using the Price Editor to make ad-hoc changes
:::

:::LinkArrayItem
[Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe)

Setting up quantity discounts and "unit of measure" pricing
:::

:::LinkArrayItem
[Diagnosing Issues](docId\:zUNntq7Ptmr5HLQvIfwMZ)

Investigating and solving common pricing issues
:::

:::LinkArrayItem
[Pricing FAQs](docId\:smlS3A5lRCGShNu_XLuNN)

See our most commonly asked questions about managing B2B pricing
:::
::::


[title] Pricing FAQs
[path] Dashboard/Price Lists/

## Frequently Asked Questions&#x20;

### Automatic Price Lists

:::ExpandableHeading
**How do I set up automatic price lists (based off my DTC pricing with a discount)?**

Please refer to [our guide here](docId\:NX9Q00eWV_kbjxc3tg1ut).
:::

:::ExpandableHeading
**How can I override pricing for some products if I'm using an automatic price list?**

It's possible to combine manual price lists and automatic price lists! This is a great way to automate your pricing and give you the flexibility to manually specify pricing for specific products.&#x20;

- Once you've created your price list using "automatic" rules, simply click "Options" and then "Upload CSV"&#x20;
- You can manually upload any additional prices you want to assign to the price list.

You can then easily check these via the [Price Editor](https://app.sparklayer.io/products/price-editor).
:::

:::ExpandableHeading
**If I change a product's price in my admin, how long will it take to automatically update in SparkLayer?**

If you're using automatic pricng, this will update instantaneously from your platform into SparkLayer
:::

### Manual Price Lists

:::ExpandableHeading
**How do I remove a price for a product for manually uploaded price lists?**

There are a variety of ways to remove pricing from a product:

- From the [Price Editor](https://app.sparklayer.io/products/price-editor), search for a SKU and then remove any entries you see
- From [Price Lists,](https://app.sparklayer.io/products/price-lists) under "Options" next to a price list, click the "Clear" button. This will remove all pricing for all products
- From [Price Lists](https://app.sparklayer.io/products/price-lists), upload a CSV file with just the SKU(s) you want to remove. In the "**price**" column, leave this blank
:::

:::ExpandableHeading
**How do I clear (empty) a price list for manually uploaded price lists?**

From [Price Lists,](https://app.sparklayer.io/products/price-lists) under "Options" next to a price list, click the "Clear" button. This will remove all pricing for all products
:::

:::ExpandableHeading
**How do I see prices I’ve already uploaded?**

When you upload pricing via the [SparkLayer Dashboard](https://app.sparklayer.io/products/price-lists), there are a variety of ways you can see the pricing you've uploaded:

- You can download the contents of your price list as a CSV file. Simply click "Options" then "Download CSV"
- You can log into your website and view the product page you need to check. You'll need to follow [this guide](docId:5_lWMNohhjBJJppg9E6Vh) to ensure you are logged in correctly as a B2B customer.
- Use the [Price Editor](https://app.sparklayer.io/products/price-editor) within the SparkLayer Dashboard to quickly search by SKU. Learn more about the [Price Editor](docId\:zi2EaFxu8l_7PIFJxlS35)
:::

### Quantity pricing

:::ExpandableHeading
**How do I set up quantity (tiered) pricing?**

Please refer to [our guide here](docId\:t2cEaOsmeOHmgZStjCnhe)
:::

:::ExpandableHeading
**Do I need to specify a price for a single unit if using quantity pricing?**

Yes. When importing a price list that includes tiered pricing, please ensure that you include a tier for the price for a single unit, as demonstrated in the example below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Yabgq17moY4Ww5dnyoqlG_image.png)
:::

### Price configuration

:::ExpandableHeading
**Do I need product SKUs when uploading pricing?**

In terms of product SKUs, SparkLayer relies on these being added to your products within Shopify so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.
:::

:::ExpandableHeading
**Why isn't my B2B pricing showing on my website?**

&#x20;If you're not able to see the B2B pricing, this could be due to one of the following:

- Check that you've imported a [price list](https://app.sparklayer.io/products/price-lists) and assigned to a [customer group](https://app.sparklayer.io/customers/groups)
- Check that all your products have **unique SKUs** assigned
- Check that the product in your website admin has been set to Product Status "**Active**". Currently SparkLayer will only import prices for products that are active (versus in "Draft" status)
- Check th&#x65;**&#x20;SKU exists** within your product catalogue
:::

:::ExpandableHeading
**How do I show the gross price?**

In the context of SparkLayer, SparkLayer will **always&#x20;**&#x6F;utput the prices in the Net amounts, regardless of the tax status you set on your website. In effect, when you upload your B2B pricing via SparkLayer, the customer will see the **exactly the same prices** on your website.&#x20;

If there are circumstances where you do want to show Gross pricing to your B2B customers, there is a potential way around this.

- It's possible to set a customer within your eCommerce platform (e.g. Shopify) to be 'Tax exempt'. This would mean their order would be zero tax rated.
- In the price lists you upload to SparkLayer, set the prices to be the "gross" amounts (even though they don't technically include tax).
- As to reporting, you would need to report on the tax amounts after the fact (e.g. via your accounting system)
:::

:::ExpandableHeading
**How do I show RRP (MSRP) pricing?**

Please refer to [our guide here](docId\:S_VTlJBorGmnwjjfSMom9).
:::

:::ExpandableHeading
**How do I setup and manage multiple currencies?**

SparkLayer supports multiple currencies by default and you can easily configure different currencies for your customer. To learn more about how to set this up, please refer to our platform-specific guides:

- [Shopify Markets & Currencies](docId\:vex5XjFlT6Pvb0AzhlKQD)
:::

:::ExpandableHeading
**Can I set B2B pricing to be higher than my DTC prices**

Yes! In this scenario, you may be looking to set up B2B pricing that is higher than the pricing you have set up for your regular (DTC) customers. With SparkLayer, you can set prices to be higher than the "retail" prices in your eCommerce platform should you require.
:::

:::ExpandableHeading
**Can I set up different automatic pricing rules based on product collections?**

SparkLayer has no built in way to automatically selection which collections (or categories) to apply B2B pricing to, however we do have a suggested workaround if this is a requirement:

- Create a [separate price list](https://app.sparklayer.io/products/price-lists) for each collection you require (Collection A, Collection B, etc)
- In your [customer groups](https://app.sparklayer.io/customers/groups), assign each price list you want to show for your specific customer groups and you can even assign **multiple** price lists to a customer group


:::

### Discounts

:::ExpandableHeading
**How do I set up discount promotional codes at checkout?**

It's possible to set up discount codes that customers can use during the checkout process. For example, you could set up a discount coupon that gives them 10% off their order.

To learn how discounts work, please see [our guide here.](docId\:WrejPw9URyjQwiQeKs_Cg)
:::

:::ExpandableHeading
**How do I set up discounts to apply across a product range?&#x20;**

Within the SparkLayer [Discounts](docId\:WrejPw9URyjQwiQeKs_Cg), using the "Advanced requirements and rewards", you can setup discounts to apply to products with specific tags setup within your store (e.g. in Shopify). For example, you could set the discount to only apply if products within the cart have a tag of `dog-toy` applied, or match a broad term of `dog`. This allows you to setup discounts to apply to collections and product ranges easily.

There are also other workarounds without using discounts:

- You could create a brand new product in your website catalogue and set up a range of variants within it (e.g. all the products you want to offer within the discount)
- We have a special setting called *minimum product quantity* ([See our guide here](docId\:CmxfrPgjQxfz9vJzTVv0D)) which forces the customer to order at least X of the product (e.g. 3)
- Using the [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe), you can then set up your discounted rates (e.g. buy 3 and the price is 10% cheaper)
- Within Shopify, you could make these products 'hidden' from standard B2C customers simply by not associating them to a collection
:::

:::ExpandableHeading
**How do I set up discounts based on an order total?**

It's possible to set up discounts that apply based on a certain threshold, e.g. the order total or the number of items in a cart. To learn more about discounts, see [our guide here](docId\:WrejPw9URyjQwiQeKs_Cg)
:::

### Customer configuration

:::ExpandableHeading
**Can I assign multiple price lists to one customer group and/or customer?**

****

From the [SparkLayer Dashboard](https://app.sparklayer.io/customers/groups), you can assign multiple price lists to a customer group if you want to set up more sophisticated pricing. From the "Update Price Lists" screen, simply click "Add new" to select a price list. In terms of pricing, if a product SKU exists in multiple price lists, SparkLayer will search through all available price lists and use the first one it finds.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/XZicTzb_fXz0y-YSqTEJt_image.png)
:::

:::ExpandableHeading
**How do I assign a price list to a specific customer?**

Please refer to [our guide here](docId\:v8dVUcJ7Ju0fH7BvINrEw).


:::


[title] Discounts
[path] Dashboard/

# Introduction

Are you looking to setup discounts and promotions for your B2B customers? The SparkLayer Discount Engine gives you a powerful way to customise promotions that also work alongside any [B2B price list](docId\:s8XcbZGxQpgdeIGWtXseT) rules you have set up. It's a great way to offer incentives and rewards that can play an important part in helping increase sales and customer retention for your B2B business!&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-lY1cb1Dp2E_ivhSLm1m6V-20240806-085010.jpg)

:::hint{type="success" attributes="[object Object]"}
**Want to try out discounts?**&#x20;
Head over to our [B2B Demo store](https://demo.sparklayer.io/pages/b2b-login-register) and give it a go! Once signed in, add some products to your cart and use coupon code `SAVE10`
Looking to try SparkLayer for the first time? [Speak to our team](https://www.sparklayer.io/?demo#contact)
:::

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/discount-codes.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::



***

# Types of discounts available

SparkLayer currently supports the following range of discount configurations.&#x20;

| Item                    | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Discount Example`      | - **Order total:&#x20;**&#x41;pplying a discount (percentage or fixed) based on the order total&#xA;<font color="#3b9f0f">*e.g. 10% off when the order exceeds $500+*</font>
- **Order items:&#x20;**&#x41;pplying a discount (percentage or fixed) based on the number of items in an order&#xA;<font color="#3b9f0f">*e.g. 10% off if 100+ line items are added*</font>
- **Shipping:&#x20;**&#x41;pplying a discount (percentage or fixed) based on the shipping method used&#xA;<font color="#3b9f0f">*e.g. free shipping over $500*</font>&#x20;                                                 |
| `How they are applied`  | * **Automatic:** being able to *automatically* apply a discount&#x20;
* **Manual**: being able to apply a discount *manually* via entry of a coupon code                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `Specific requirements` | - **Minimum requirements: &#x20;**&#x53;etting minimum requirements the customer must meet before qualifying<font color="#3b9f0f">
  *e.g. the customer must spend $500*</font>
- **Maximum requirements:&#x20;**&#x53;etting minimum requirements the customer must meet before qualifying&#xA;<font color="#3b9f0f">*e.g. the customer must not spend more than $5,000*</font>
- **Advanced requirements:&#x20;**&#x73;pecifying the SKUs or tags of products that must be in the cart to qualify&#xA;<font color="#0e903e">*e.g. the customer must have items from the "coffee" collection*</font> |
| `Eligibility`           | * **Customer groups:** being able to apply discounts to specific customer groups&#xA;<font color="#3b9f0f">*e.g. only apply a discount to VIP B2B customers*</font>                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `Scheduling & timing`   | - **Scheduling:** being able to specific when a discount starts and ends&#xA;<font color="#3b9f0f">*e.g. expire the discount on X date*</font>                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `Advanced Settings`     | * **Customer usage limits**: how many times a discount can be used by a customer&#xA;<font color="#3b9f0f">*e.g. customer can only use the discount one time*</font>                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `Combinations`          | - **Combination rules:** optionally being able to "combine" the discount with other discounts&#xA;<font color="#3b9f0f">*e.g. the discount cannot be used with another discount*</font>                                                                                                                                                                                                                                                                                                                                                                                                               |



***

# Getting started

To get started with using discounts, please go to **Pricing** and click the [Discounts](https://app.sparklayer.io/discounts) section of the SparkLayer Dashboard. If you're viewing this for the first time, you can simply click **"Create Discount"** to start setting up a discount.

Once you begin adding discounts, you'll see an overview of all your discounts in one central location.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GdHNwe-OVvDI6P1SpLi_u_image.png)

You can also quickly see any discount requirements you've set by mousing over the icons within the **"Discount Requirements"** column.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qJEU6WbLXMaBpdNKYN3SP_image.png)

## Active versus Inactive

The Discount section will categorise your discounts by "Active" and "Inactive" allowing you to easily see which discounts can be used by your customers.

| Type       | Details                                                                                                                                                 |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Active`   | These are discounts that:<br />* Are set as "Enabled"&#x20;
* If they have scheduling configured, <font color="#3b9f0f">**have not yet expired**</font> |
| `Inactive` | These are discounts that:<br />* Are set as "Disabled" *and/or*
* If they have scheduling configured,<font color="#eb144c"> **have expired**</font>     |

## How discounts are applied

Discounts can be applied in one of two ways:

| Method      | Details                                                                                                                                                                                                                |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Automatic` | The discount is **automatically applied** to the customer's order based on the configurations you've set (e.g. spend over $200 and get $50 off)                                                                        |
| `Manual`    | The discount is applied when the customer enters a **coupon code** during the [checkout process](docId\:efevur-A3yCJXUHvrR7t-). If the discount is applicable, the rewards will be applied to the order (e.g. $10 off) |

:::hint{type="info"}
**Learn more about coupon codes**
You can learn more about how coupon codes work and what can be customised in our guide, [Cart & Checkout](docId\:o3nDhZBCxisWH6M6satDt)
:::

## Discount applications

At this time, it is only possible to **apply one discount at a time** to a customer's order. If you have multiple discounts setup that are applicable to a customer, the first one shown within the [discounts section](https://app.sparklayer.io/discounts) will be applied.

## Sub-totals and tax

It's important to note that when a discount is set up that applies an **"amount off an order",&#x20;**&#x74;his will apply against the **sub-total** of the customer's B2B order.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/WK4Ln1byMpHGz93CXg78j_image.png)

In our example above, the sub-total is $200.00 and the discount is applied against this total (e.g. $100 off, 20% off). This total is **"net" of tax** and any applicable tax calculations will be applied during the final step of the checkout.

:::hint{type="info"}
**Please note**
Discounts will be applied to a customer's order regardless of which payment method is selected
:::



***

# Configuring discounts

If you're creating a new discount or editing an existing, you'll be presented with a range of options to customise how your discount works.

## Summary

The **Summary** section allows you to set up the basic information for your discount.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bsGUfyomu5LClEA4AuQoQ_image.png)

| Item                     | Details                                                                                                                                             |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Status`                 | You can set a discount as enabled or disabled. If disabled, the discount cannot be applied to the customer's order                                  |
| `Discount internal name` | This is the name used for your internal purposes and only ever shown in the SparkLayer Dashboard                                                    |
| `Discount public name`   | This is the name shown to customers when the discount is applied to their order and shows in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-). |

You can optionally add a **discount description** that shows to your customers when a discount is successfully applied to their order.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/othHf7uHSmo2Wrl-8rT0S_image.png)

It works by adding a special language string to your website that you can customise as required.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* [discount-id] should be replaced with the string 
shown in the discount summary. */
translations: {
  en: {
    "discount.[discount-id].message": "Include a description here",
  }
},
/* End of code *
```

## Discount Type

The **Discount Type** section allows you to specify how you want your discount to work. Based on the options you select, this will then allow you to set rewards and configurations as required. You can select from the following discount types:

| Type                                | Details                                                                                                                                                                 |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Give an amount off an order`       | This will apply a discount that reduces the "sub-total" of the customer's B2B order, either by a percentage discount or a fixed amount discount                         |
| `Give a free product`               | This will apply a discount that adds a specific product to an order at 0.00 cost (free).                                                                                |
| `Give a percentage off products`    | This will apply a discount that reduces the cost of chosen products, either by a percentage, or fixed amount                                                            |
| `Give a shipping reward`            | This will apply a discount that reduces the shipping cost by a percentage, fixed amount off, or by setting it to a fixed charge                                         |
| `Advanced requirements and rewards` | This will apply a discount based on the customer meeting more advanced requirements such as SKUs within the cart and more granular and multiple rewards can be selected |
| `Advanced free products`            | This will apply discounts based on specific product(s) being within the order (e.g. based on SKU or tag), and discounts can be set in a recursive fashion.              |

## Discount Reward

Based on the discount type selected (see above), you can then specify the "Reward Type" you would like to apply to the customer's order.&#x20;

### Give an amount off an order

If you've selected "Give an amount off an order", you can then choose what type of reward to give the customer, with a choice between a **percentage** or **fixed amount discount**.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/YBNS4xqcr5rOulWipRMw4_image.png)

:::hint{type="info"}
**Please note the following on "Give an amount off an order"**

- The discount reward will be applied against the sub-total of the order, exclusive of tax and shipping.
:::

### Give a free product

If you've selected "Give a free product", you can specify which product SKU you want to be added to the customer's order. Once added, this will then show at 0.00 cost (i.e. free) within their order.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/BQx26qgUbUtIcMqmCekUP_image.png)

:::hint{type="info"}
**Please note the following on "Give a free product"**

- A valid SKU must be specified for it to apply to the customer's order
- When the customer is redeeming the free product, it must be a different product to what is already within the customer's order
:::

### Give a percentage off products

The "Give a percentage off products" reward type lets you specific specific SKUs you want to discount when the discount is applied. Simply enter the SKU and the percentage off and this will then reflect in the customer's order when they checkout.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/sYY3gHhSM45enLROMGdRG_image.png)

:::hint{type="info"}
**Please note the following on "Give a percentage off products"**

- You can have a maximum of 25 SKUs
:::

### Give a shipping reward

If you've selected "Give a shipping reward", you can then choose what type of reward to give the customer, with a choice between a percentage, fixed amount off discount, or setting the charge to a fixed amount.&#x20;

| Type                               | Details                                         |
| ---------------------------------- | ----------------------------------------------- |
| `Percentage discount`              | A percentage of the shipping amount to take off |
| `Fixed amount discount`            | A fixed amount to take off the shipping amount  |
| `Set the charge to a fixed amount` | Change the shipping amount to this price        |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-Uvnu-1U739d_gtv6JHeT_pika-1738755781261-1x.png)

:::hint{type="info"}
**Please note the following on "Give a shipping reward"**

- This reward type can only be used if you're using [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) rules managed by SparkLayer (i.e. not your eCommerce platform).
- The discount reward will be applied against the net shipping price, exclusive of tax.
:::

### Advanced requirements and rewards

If you've selected "Advanced requirements and rewards", you can set up your discount to activate based on more comprehensive configurations. For example, it's a great way to set discounts to trigger based on a product with a specific tag  being within the customer's cart, and more than one reward can also be set up.

When selecting this option, you'll be prompted to configure the following:

| Type                    | Details                                                                                   |
| ----------------------- | ----------------------------------------------------------------------------------------- |
| `Advanced Requirements` | This is where you set what criteria the customer must meet before the discount is applied |
| `Advanced Rewards`      | This is where you set what reward(s) are then applied                                     |

When setting "Advanced Requirements", you can choose from the following requirements and how you want to match against them using "Operators" ("must equal", "must contain", etc). You can also set multiple requirements within the same discount.

These requirements can be configured in a number of different ways.&#x20;

**Requirements can be configured to contain multiple conditions:**

In the below example, either condition can be matched in order for the discount to apply its rewards. For example, a user can add COFFEE-01 OR COFFEE-02 to their cart, and the discount will trigger.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Rj9dk3_T4ep9RJCIxkUT1_image.png)

**You can add multiple requirements to enforce multiple conditions being met.**

In the below example, both COFFEE-01 and COFFEE-01 must be in the basket for the discount to be rewarded.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/mhhlGByf8hqxrhiS_TkcY_image.png)

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
| Requirement      | Details                                                                                                                           |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `SKU`            | Which SKUs must be in the customer's cart, e.g. ABC-1, ABC-2                                                                      |
| `Shopify Vendor` | Which Shopify Vendor is applicable to products within the customer's cart, e.g. products that have a vendor of "Dog Brand 1" set. |
| `Shopify Tags`   | Which Shopify Tags is applicable to products within the customer's cart, e.g. products that have a tag of "dog-treat" set.        |
:::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
::::

Using operators, you can broaden your requirements easily. For example, if you want to apply the discount to all products that have a tag that contains "dog", you can use the "Contains" operator.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5IOjBVSD7_WZPF7dutQia_image.png)

"Advanced Rewards" let you specify the rewards a customer gets when their cart matches the "Advanced Requirements" set above. You can choose from the following:

| Type           | Details                                                                                                                                                                                                                                                                    |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Sub-total`    | A percentage or a fixed amount off the cart sub-total                                                                                                                                                                                                                      |
| `Shipping`     | A percentage or fixed amount to take off the shipping amount, or setting an explicit shipping cost                                                                                                                                                                         |
| `Requirements` |  A percentage or fixed amount off of the requirements specified in "Advanced requirements". For example, if a discount requires a product with SKU of COFFEE-01, then all products with SKU of COFFEE-01 will be discounted with the specified percentage or fixed amount. |
| `Cart Lines`   | A percentage or fixed amount off the cart lines based a range of criteria: SKU, tags (or labels), vendor.                                                                                                                                                                  |

It's also possible to apply multiple "Advanced Rewards" within a discount. When doing so, you can also choose whether to apply all the rewards, or only the highest or lowest value awards (with a specific number being applicable).

### Advanced free products

"Advanced free products" allows you to give more comprehensive free product rewards based on specific configurations being met. For example, you may want to give away free product(s) based on the customer having a range of products that have a specific tag, or you may want to provide a “Buy One Get One Free” style discount that rewards additional free product(s) when a user adds the product to the basket.

:::hint{type="info"}
**Please note**
Unlike the Type "Give a free product", with "Advanced free products" you can also set **multiple** products to be added to the customer's cart.
:::

When selecting this option, you'll be prompted to configure the following:

| Type                                 | Details                                                                                   |
| ------------------------------------ | ----------------------------------------------------------------------------------------- |
| `Advanced Free Product Requirements` | This is where you set what criteria the customer must meet before the discount is applied |
| `Advanced Free Product Rewards`      | This is where you set which free products are added and how you want this to behave.      |

When setting "Advanced Free Product Requirements", you can choose from the following requirements and how you want to match against them using "Operators" ("must equal", "must contain", etc). You can also set multiple requirements within the same discount.

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
| Requirement      | Details                                                                                                                           |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `SKU`            | Which SKUs must be in the customer's cart, e.g. ABC-1, ABC-2                                                                      |
| `Shopify Vendor` | Which Shopify Vendor is applicable to products within the customer's cart, e.g. products that have a vendor of "Dog Brand 1" set. |
| `Shopify Tags`   | Which Shopify Tags is applicable to products within the customer's cart, e.g. products that have a tag of "dog-treat" set.        |
:::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
::::

Using operators, you can broaden your requirements easily. For example, if you want to apply the discount to all products that have a tag of "dog", you can use the "Equals" operator.

"Advanced Fee Product Rewards" let you specify the rewards a customer gets when their cart matches the  requirements set above.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/iRjSZOxiwTu7BVeR3al8P_image.png)

Once you’ve specified the products to be rewarded, you can then choose how you want to apply them.

| Type          | Details                                                                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Once only`   | The free product(s) will be added only one time to the customer's cart when the required product and quantity are added.                                                 |
| `Recursively` | The free product(s) will be added each time the customer adds the required products and quantity to the cart with no limit to how many rewarded products can be added. . |
| `Limited`     | Similar to the above, this lets you specify a limit to how many times the rewarded product will be added to the cart. .                                                  |

:::hint{type="info"}
**Please note the following on "Advanced free products"**

- When this is enabled, this replaces the "Rules" (or "Order rules") configuration
:::

## Order rules

:::hint{type="success"}
**Advanced order rules**
It's also possible to setup more advanced order rules for your discounts, e.g. triggering them based off the "tags" of products. See "Advanced requirements and rewards" above to learn more.
:::

Order rules let you set specific requirements that the customer must meet before the discount is applied.&#x20;

Currently, SparkLayer supports the ability to set "Product Rules" that allow you to apply discounts based on the customer having specific product(s) within their order. To get started, click the "New Product Rule" button and then add the SKUs you'd like the discount to apply against.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qd8InU7hVwFe9-ErStNQZ_image.png)

Once you've specified the SKUs, you can then set the total quantity the customer must have before the discount applies. This quantity can apply to any combination of the SKUs you've entered. For example, you may have entered:

- SKU: `abc`
- SKU: `xyz`
- Required quantity of `2`

The customer could meet the discount requirements with any of the following combinations:

- 2 x `abc`
- 2 x `xyz`
- 1 x `abc` and 1 x `xyz`

:::hint{type="info"}
**Please note the following on "Order Rules"**

- Valid SKUs must be specified for the discount to apply to the customer's order
- You can have a maximum of 10 order rules
- You can have a maximum of 10 SKUs per order rule
:::

## Customer Groups

By default, discounts will be applied to **all** **customers** however it's possible to restrict your discount to specific [Customers](docId:5_lWMNohhjBJJppg9E6Vh).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/1Vzo901p6odPeb7caGxpu_image.png)

The Customer groups section lets you select which customer groups are applicable to your discount and will have the discount reward applied.&#x20;

You can also select **multiple customer groups i**f you'd like the discount to be used by more than one customer group.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/kEGgx3T7E73O9ZyhBD9Ex_image.png)

## Scheduling

If you want to set up a time-based discount, you can set a "Schedule" for the discount.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/1byA4WF5b72jprFTmmIKd_image.png)

There are two dates that can be selected, both of which are optional:

| Item                      | Details                                                        |
| ------------------------- | -------------------------------------------------------------- |
| `Start date of discount`  | This is the date and time the discount will be applicable from |
| `Expire date of discount` | This is the date and time the discount will expire             |

:::hint{type="info"}
**Please note the following on time configurations**

- The scheduling will use the timezone of your specific computer. For example, if you are based in Germany but you're setting up a discount for Canada, please be aware that you will need to change the date and time accordingly.
- Selecting a time of `00:00` will start the discount at the beginning of the date selected
- Selecting a time of `23:59` will start the discount at the end of the date selected
:::

## Coupon codes

Coupon codes allow you to specify a unique code that the customer must enter in order to qualify for the discount reward. This is termed a "manual discount" in that the customer won't have the discount automatically applied by default, unless they manually add the coupon code.

To add a coupon code, you can simply type in your coupon code reference into the field below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TR8mODNn6hc3IJXYMQb5E_image.png)

Once you've added a coupon code, this will then be required to apply the discount. When the customer then goes through the checkout, they can simply apply the coupon to their order. When the order comes through to your website, you'll then see the coupon codes used within the order's "Additional notes".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Mlf1M5qyrDTdd4wNW0oia_image.png)

:::hint{type="info"}
**Please note the following on coupon codes**

- Coupon codes will automatically be saved in uppercase. For example, if you type in `Code-Abc`, this will be saved as `CODE-ABC`
- You can save **multiple coupon codes** against a discount. For example, you may have the same discount promoted in different locations but you want to set up different codes. For example, you could add `CODE-ABC` and` CODE-123`
- On your website, the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) will only allow the customer to apply a **maximum of 3 coupon codes** against an order. For example, if a customer has 3 coupons applied to their order and they add a 4th, the most recently added coupon will not be applied.
:::

## Order sub-total limits

It's possible to set "order sub-total limits" that allow you to specify th&#x65;**&#x20;sub-total rules** the customer must meet before being able to qualify for the discount. For example, you may want the customer to reach a certain amount before they can qualify for a discount (e.g. spending over $400 and getting 5% off).&#x20;

Once enabled, you'll see the option to enter a minimum and maximum sub-total.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/8iNkhR0Pn3IMq9HHom313_image.png)

:::hint{type="info"}
**Please note the following on order sub-total limits**

- When setting this up, please bear in mind the discount is calculated based on the sub-total of the customer's order. The is the total **without** tax and shipping costs being added to the order.
:::

## Order item limits

Order item limits allow you to set requirements on how many items the customer must have in their order to qualify for the discount. There are two ways to define the order item limits:

| Type                             | Details                                                                                                                                                                                                                                                |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Quantity across all line items` | This is the **total quantity of items** within the customer's order across all products. For example, the customer may have:<br />`1 x Red Shoe`<br />`5 x Blue Shoe`<br />`4 x Green Shoe`<br />SparkLayer would calculate this as a quantity of `10` |
| `Number of line items`           | This is the **total unique items** within the customer's order across all products. For example, the customer may have:<br />`1 x Red Shoe`<br />`5 x Blue Shoe`<br />`4 x Green Shoe`<br />SparkLayer would calculate the number of line items as `3` |

For each option selected, you can then define the minimum and maximum number that the customer must have within their order to qualify.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/nHhkL6XhgCtBjuRIB6Cc1_image.png)

## Usage limits

The usage limits configuration lets you define how often a customer can qualify for the discount. For example, you may want to restrict the discount to only be used once by a customer, or a specific number of times.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/r2pTVVmkybDUcgO0IrwB7_image.png)

:::hint{type="info"}
**Please note the following on usage limits**

- The limit will apply to the specific customer placing the order and is applied against their specific customer record.&#x20;
:::

## Exclude customers

You can exclude specific customers from a discount by entering customer email addresses or accounting IDs, separated by commas. The discount won’t apply to any customers included in this list.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/653CNCcZqruTATahhVy3O-20260121-162113.png)

## Currency

If you've set your discount to "Get an amount off an order" with a "Fixed amount discount", you can also specific the currency that the discount should be applicable to.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Zwalf3e2wBrFECEdvilm7_image.png)

:::hint{type="info"}
**Please note the following on currency**

- By default, this configuration will automatically set the currency as the "default" currency of your store (e.g. USD, GBP, EUR)
- If you have multiple currencies setup for your [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) which are then assigned to a customer, the currency must match the currency the customer is placing orders in.
:::



***

## Compatible discounts

When you create a discount it will be able to be used in conjunction with all other discounts by default.

If you would prefer to restrict which discounts can be used alongside others, you can enable this within the "Compatible discounts" section of the discount edit screen.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/FwCX5obhNUoSU5j0iOFrn_image.png)

Once enabled, you can then select the discounts that you wish to be compatible by selecting them from the menu.

:::hint{type="info"}
**Please note the following on compatible discounts**

- You can set the priority in which they apply against a customer's order by using the "Discount priorities" feature (see below).
- There are some limitations to this.&#x20;
:::





***

## Discount priorities

By default, customers can apply a maximum of **one discount** to their order. If you have multiple discounts setup that are applicable to your customers, you may want to specify the order in which they get applied. This is particularly useful if you have multiple "competing" discounts and you need to ensure your customers have the right one applied.&#x20;

When you have more than one discount setup, you'll see a **Manage Priorities** button within the Discounts section . To get started, click this button and you'll then see all discounts listed.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/MSdOWbM67fDPpkW_XaNMF_image.png)

You can then simply drag the discounts up and down in the priority you'd like them to apply. When a customer then qualifies for a discount, it'll use the highest one in the list.

If you have discounts that aren't active (see above "Active versus Inactive"), you can also manage the priority of these within the list.

**Priority Limitations:**

What priority *does*

- It decides which discount gets first pick of the items in the basket.
- It settles clashes where discounts are not compatible (the higher-priority discount wins, lower ones are ignored).
- It determines who consumes any per-order limits first (e.g. “can only apply once per order”).

What priority *does not* do

- It does **not** change the way savings are calculated. All discounts that share the same “calculation phase” (see below) are worked out from the *same* pre-discount totals; their savings are simply added together.
- It does **not** make the second discount work on the already-discounted price of the first. To create true “discount-on-discount” behaviour the second discount must be placed in a later calculation phase.


:::hint{type="info"}
**Please note**
You can also manage which discounts are compatible by editing a discount and going to "Compatible discounts" (see below).
:::





***

# Updating the default text

If you'd like to update the text shown to customers in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), you can update the default language strings on your store.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Mlf1M5qyrDTdd4wNW0oia_image.png)

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
     "cart.checkout.coupons.apply": "Apply",
     "cart.checkout.coupons.input-placeholder": "Enter discount code here and click 'Apply'",
     "cart.checkout.coupons.not-found": "Discount code ''{couponCode}'' not found",
     "cart.checkout.coupons.already-applied": "Discount code ''{couponCode}'' already applied",
     "cart.checkout.coupons.successful-apply": "You've successfully added discount code ''{couponCode}''!",
     "cart.checkout.coupons.max-reached": "You can only add a maximum of 3 discount codes",
     "cart.checkout.discount.cta": "Enter a discount here or view discounts",
     "cart.checkout.discount.success-message": "Discounts have successfully been applied to your order",
     "cart.checkout.discount.totals-row-text": "Discounts Applied",
     "cart.checkout.discount.no-of-discounts-applied": "{numberOf} {numberOf, plural, =1 {discount applied} other {discounts applied}}"
  }
},  
/* End of code */
```



***

# Duplicate Discounts

You can now create **duplicate discounts** in SparkLayer - these are discounts that share the same structure, rules, and logic of a existing one. This is useful when you want to run the same discount for different customer groups, sales campaigns, or pricing scenarios without rebuilding each one from scratch.&#x20;

To duplicate a discount, simply click the '⋯' next to the discount you want to copy, then select 'Duplicate'. A new discount will be created with the same setup.&#x20;

By default:

- The **Discount Public Name** will remain the same unless edited
- The **Discount Internal Name** will have “\_copy” added to the end

You can then edit any details as needed before saving. Each duplicate discount is treated as a separate entry in your system which means you can assign different coupon codes to each duplicate.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/RVgCGw6NuWxwjkLvPcIcT-XdowzNpWcjJXq-pZ7pVxO-20250710-140146.jpg)



***

# Data & backend

When a customer uses a discount, this will store a range of data against the order that will give you further details about the discount that has been applied. This data includes:

- The coupon codes applied
- The IDs/Handles of the discounts applied (discount slugs)
- The cost of the order pre discount
- The amount taken off by the discount

:::hint{type="info"}
**Please note:**
All monetary values are in the currency the customer used to place the order.
:::

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
The discount data is stored in the **"Additional Details"** section of the Shopify Order. From the Shopify API this is called `note_attributes`  and you'll see the following:&#x20;

- `B2B Discount Coupon Codes` - a comma separated list of the coupon codes used. This is separate so you can easily view it at a glance
- `sparkDiscountData` - the rest of the discount data, stored in a JSON string including SKUs order, net pricing, and the internal "ID" of the discount.

If you need to access this data through code, you can use the Shopify API to access the order data ([learn more](https://shopify.dev/docs/api/admin-rest/latest/resources/order)).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/uU6RabE0cTekrL_QrcHJA_image.png)
:::

:::Tab{title="Using BigCommerce"}
The data is stored in the **"Staff Notes**" section of the BigCommerce Order. We add two lines to these notes for each order with a discount:

- `B2B Discount Coupon Codes` - a comma separated list of the coupon codes used. This is separate so you can easily view it at a glance
- `B2B Discount Data` - the rest of the discount data, stored in a JSON string

You can access this by clicking the 3 dots under "Action" in your orders table, then click "View notes"

If you need to access this data through code, you can use the BigCommerce API to access the order data ([learn more](https://developer.bigcommerce.com/docs/rest-management/orders))

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/i0cTC4fTmXq0MNmZK-ofn_image.png)
:::

:::Tab{title="Other platforms"}
Please refer to out Technical Docs for further information.
:::
::::



***

# Reporting on discounts

Currently, there isn't built-in reporting with SparkLayer to analyse your discounts usage however, we have some recommended approaches that we have included below.

::::::Tabs
:::::Tab{title="🛍️ Using Shopify"}
Shopify has a built in automation tool called [Shopify Flow](https://apps.shopify.com/flow). Using Shopify Flow, it's possible to perform actions based on discounts being used by your B2B customers.&#x20;

Our [example Shopify flow](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Tag_B2B_order_with_discount_if_used.flow?v=1723118334) works as follows:

::::WorkflowBlock
:::WorkflowBlockItem
An order is created by the customer (e.g. draft order)
:::

:::WorkflowBlockItem
The Flow detects if a discount has been applied by searching the "B2B Discount Data" field applied to an order. You'll see this when viewing an order in Shopify under "Additional details".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/6VWz_ReaIs19FQWkSm7X9_image.png)
:::

:::WorkflowBlockItem
If the "B2B Discount Data" field includes a specific discount ID (within the `discountSlugs` data), it will then automatically add a tag to the order. In our example above, the `discountSlugs` is set to `free-product-test` and this subsequently adds a tag of `b2b-free-product-test` to the order.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/O7w-uIbI-Utplu0YJxBYv_image.png)

You can find the ID of a discount within SparkLayer by editing a discount and viewing "Discount Handle (or ID)".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/cy9CImsgOuqE5oYIDUusJ_image.png)
:::

:::WorkflowBlockItem
Once a tag has been added to a B2B order, within Shopify you can then easily segment order data by this. Either by going to the [Analytics section ](https://admin.shopify.com/store/dashboards)or by filtering within the [Orders section](https://admin.shopify.com/store/orders?tag=b2b-discount-id) in Shopify
:::
::::
:::::

:::Tab{title="Other platforms"}
Not applicable
:::
::::::

:::hint{type="success"}
**Get started with Shopify Flow**
You can download and edit our [sample discount-specific Shopify flow here](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Tag_B2B_order_with_discount_if_used.flow?v=1723118334).
:::



***

# Troubleshooting

:::ExpandableHeading
**I don't see the discount coupon box on the checkout**

The coupon code box will only show for your customers if there is a "Active" discount code that is "Enabled". If you don't see the discount coupon box, check your discounts in the [SparkLayer Dashboard](https://app.sparklayer.io/discounts).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qaI5i9fKHuDfwY56izG1c_coupon-code-box.png)
:::

:::ExpandableHeading
**How do I see discount details within an order in my store**

When a customer places an order and uses a discount, you'll see special data show against the order when you view it within your store (e.g. Shopify or BigCommerce). To learn more, see "Data & backend" above.
:::

:::ExpandableHeading
**How should I inform my customers about discounts?**

There are a variety of ways you could inform your customers about discount codes:

| Method                | Details                                                                                                                         |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `Email Notifications` | Send personalised emails to your B2B customers highlighting the discount codes, their benefits, and usage instructions.         |
| `Website Banner`      | Display a banner on your website’s homepage or relevant pages to announce the availability of discount codes.                   |
| `Order Confirmation`  | Add a note in order confirmation emails or invoices, reminding customers of any applicable discount codes for future purchases. |
| `Sales Reps`          | Ensure your sales team informs B2B customers about discount codes during interactions or negotiations.                          |
| `Printed Materials`   | Include discount codes in printed B2B marketing materials.                                                                      |

Implementing these methods will effectively communicate discount opportunities to your B2B customers, encouraging increased engagement and sales.&#x20;
:::



***

# Limitations

The SparkLayer discount system will be subject to many ongoing improvements, however please be aware of the following limitations currently.

| Item                             | Description                                                                                                                                                                                                                                    |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Discount usage`                 | At this time, it is only possible to **apply a maximum of 4 discounts at a time** to a customer's order. If you have multiple discounts setup that are applicable to a customer, you can use the "Discount Priority" feature to set the order. |
| `Payment-specific discounts`     | It is not possible to set discounts based on the payment methods the customer uses. For example, $10 if the customer pays by "Pay Online by Card"                                                                                              |
| `Applying a discount via a URL`  | It is not possible to apply a discount via the customer entering a URL. For example, $100 if visiting mystore.com/?discount=ABC                                                                                                                |



***

# Available on the Growth plan and above

By default, [all plans](https://www.sparklayer.io/pricing/) benefit from our Discount functionality and there are some additional features that are available on our **Growth** plan and above. These include:

- Give a free product
- Give a percentage off products
- Order rules
- Usage limits
- Compatible discounts
- Advanced requirements and rewards (e.g. tag based discounts) - Pro plan
- Advanced free products (multiple free products, tag based, and more) - Pro plan

**






[title] Shopify Customisations
[path] Integrations/Shopify/

## Introduction

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/y72eBDgptPGHShhbMVewq_image.png)

Once SparkLayer is installed, you can immediately allow your B2B customers to login and start placing orders. Beyond the initial SparkLayer installation, you may also want to apply some further modifications to really customise the B2B experience.&#x20;

In our guide below, we've detailed a range of suggested customisations that will supercharge your Shopify B2B store!&#x20;

::::LinkArray
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-xrelmh2HotG2vOK1xg-YL-20250228-125249.png"}
[Shopify B2B Registration & Login](docId\:Gfc0UW7mJnMNpnNO6EdRl)&#x20;
How to setup up a B2B registration form and customise your login page for B2B.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-EymfhHCxjNkVanKt2ndju-20250228-125256.png"}
[Shopify B2B-only Content](docId:30hMTg4Cqqv69EhqNvpnf)&#x20;
How to hide products, hide prices, display B2B-only content (e.g. a navigation), and more.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-cDU6DcNV7ecwgFqOfLuzD-20250228-125429.png"}
[Shopify Flow for B2B](docId\:uvXV1kUg_VsZEPr5Dlb2z)&#x20;
How to automate B2B-specific actions within your Shopify store such as email notifications.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-AWdkYVg6OVwjcGN1jzyUB-20250228-125639.png"}
[Shopify B2B Store Setup](docId\:zNk5YTvGU44GeS3ZQhZ4q)&#x20;
How to configure your Shopify store for "hybrid" DTC and B2B, or setup a standalone store just for B2B.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-AfSoBljbjt52ZmSD9LZLO-20250228-125501.png"}
[Shopify Payment Methods](docId:1URFSnTr0MDOfFUxel3Wc)
How to customise the Shopify checkout payments for B2B customers.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-vbTkJf0FPGzWRN5YZOowA-20250228-125602.png"}
[Shopify Email Notifications](docId\:FAW11UwvEk1KN06woxik0)&#x20;
How to customise your Shopify emails (notifications) for B2B customers (e.g. hiding content)
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-CR4nviykSl5QEIwzZVW5P-20250228-125621.png"}
[Shopify Reporting & Filtering](docId\:BVgBU-uvqQVyoLoGmlG6B)&#x20;
How to report on B2B sales in your Shopify store.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-_tr8bOs_-DsD_D6x_IX_6-20250806-074101.png"}
[Shopify B2B Landing Page](docId\:iirMl1jUUXvRotG9fdhTp)
Create a landing page to give B2B customers a tailored experience.&#x20;
:::
::::




[title] Integrations
[path] /

## Introduction

SparkLayer works with a growing number of technology partners: from eCommerce platforms, ERP and operations systems, payment solutions, right through to tools that streamline the B2B customer experience. You can deliver a world-class B2B solution with our ready-made partner integrations!

:::hint{type="info"}
**Custom integrations**
Looking to build your own integration with SparkLayer? Learn more in [our guide here](docId\:CmZj_EmE3vX8bU3J-xt3L).
:::



***

## eCommerce Platforms

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/PIEXshl0tG1QL9mwDUrSZ_shopify.png"}
[Shopify](docId:7TmhkOEHbgEGGFdd6EMr1)
⚙️ Integrates Directly

eCommerce Platform
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/MfTGR03MBhkc_usK1Rlo3_bigcommerce.png"}
[BigCommerce](docId:6zLPH9x8-qEUITCHs2obE)
⚙️ Integrates Directly

eCommerce Platform
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-AHbuSveltgWw9xRDwxWOk-20250210-144900.png"}
[Wix](docId\:vEqgPapEA8X0X60U6ZWZe)&#x20;
⚙️ Integrates Directly

eCommerce Platform
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/xefZOKa2547cO9TNCWDyS-20251006-133942.png"}
[WooCommerce](docId:2afrfuiZMXgapD6ToK-5L)&#x20;
⚙️ Integrates Directly

eCommerce Platform
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/tOSCISThJB_W31lHQ4F9p-20260224-055123.png"}
[Magento](docId\:oGbycENjv56tYL5qa6Hu5)&#x20;
⚙️ Integrates Directly

eCommerce Platform
:::
::::



***

## ERPs & Operations

::::LinkArray
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Vk2mT_ntWt6lPDP5BAjqb_brighpearl.png"}
[Brightpearl](docId\:UdCRf8baae6izSgXo5uPB)
⚙️ Integrates Directly

Multi-channel eCommerce
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7mm9NPLs7kyK4R8IiJWXL_cin7a.png"}
[Cin7 Core](docId\:L2xOOZGjB4uqMK5L2EDp3)
⚙️ Integrates Directly

ERP Software
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/xfNiGBSgEn4kQgHpgIuNy_linnworks.png"}
[Linnworks](docId\:ZvLT9mGlh1mVn8xHM4JIQ)
⚙️ Integrates Directly

Multi-channel eCommerce
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/sXyIVQX8jqcgyBLnlwuR2_unleashed.png"}
[Unleashed](docId:83JVcRRNGWsKjpUzf-WYm)
⚙️ Integrates Directly

Inventory Management
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ceApPKUYZPfAcAeLjXgt8_katana.png"}
[Katana](docId\:goIlaInwUK3DbAJ0snj6t)&#x20;
⚙️ Integrates Directly

Inventory Management
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/C8m2i3Hp3fLgqCGIVek-i_patchworks.png"}
[Patchworks ](https://www.sparklayer.io/partners-patchworks/)↗
✅ Trusted Partner

iPaaS solution
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/YTgjfLnAuv9ufeGE5bRvi_zynk.png"}
[Zynk ](https://www.sparklayer.io/partners-zynk/)↗
✅ Trusted Partner

iPaaS solution
:::
::::



***

## Payments

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/XK7wbxwqgb_6TSQUcXmna_balance.png"}
[Balance ](https://www.sparklayer.io/partners-balance/)↗
✅ Trusted Partner

Buy Now, Pay Later for B2B
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DrzxLSJwqPwu_ZvrAGrM4_billiet.png"}
[Billie ](https://www.sparklayer.io/partners-billie/)↗
✅ Trusted Partner

Buy Now, Pay Later for B2B
:::
::::



***

## Accountancy

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/SgPkgyz2M87ioKZl5xGrS-20251202-152201.jpg"}
[Xero](docId\:WGhH4d8L-ys8zjOQmEoVx)
⚙️ Integrates Directly

Create invoices and import payments
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/wBbAtWJv_p1-if-cpch7e-20260203-050948.png"}
[QuickBooks Online](docId\:fDAlz0ggia651N47ICR2z)&#x20;
⚙️ Integrates Directly

Create invoices and import payments
:::
::::



***

## Customer Experience

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/F5usKmg_-6xRtRJXj0TU__sufio.png"}
[Sufio Invoicing](docId\:qlBasATpzOCOF5eXC99O3)
⚙️ Integrates Directly

Professional invoices
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-Sv5L43Yj_sdqbBSwRWZw--20241121-141344.png"}
[Locksmith](https://docs.sparklayer.io/locksmith)
✅ Trusted Partner

Restrict content
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-tqfB4hdlhBIZadLAKFqRu-20250214-094403.png"}
[Intuitive Shipping](docId\:ZkesmMUAWX2SQQ7j6as07)&#x20;
⚙️ Integrates Directly

Advanced shipping
:::
::::


[title] Invoices
[path] Features/

## Introduction&#x20;

Are you looking to create invoices for your B2B customers? SparkLayer offers a variety of ways to allow invoices to be sent, streamlining your B2B operations:

| Method                             | Details                                                                                                                                 | Use-case                                                                                                                                                                   |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SparkLayer Invoices`              | Customers can view & download invoices directly via SparkLayer.                                                                         | Your invoicing requirements are relatively simple and you don't want to use additional third-party apps. *Learn more in the guide below.*                                  |
| `Metafield and attaching invoices` | Add custom invoice details within your store using special metafields that can be associated with an order (manually or automatically). | You have an existing system that is already generating invoices for your store and you can access these as files (e.g. a PDF). [Learn more](docId\:yWm70oQUosyKOoIqb4Z4G)  |
| `Third-party app`                  | Tools such as Sufio allow you to automatically integrate their solution into SparkLayer.                                                | You require invoicing beyond B2B (e.g. for your regular customers also) and need more design customisation. [Learn more](docId\:qlBasATpzOCOF5eXC99O3)                     |

*Please note: this guide focuses on SparkLayer's own invoicing solution.&#x20;*



***

## Sending invoices via SparkLayer

:::hint{type="info" attributes="[object Object]"}
**Please note**
SparkLayer Invoices is only available on the SparkLayer *Growth,* *Pro,* and *Enterprise* plan. You can [change your plan here](https://app.sparklayer.io/settings/plan) or [learn more](https://www.sparklayer.io/pricing/) about our how pricing works.
:::

The SparkLayer Invoice feature allows you to automatically generate professional invoices that your customers can easily download, directly from their My Account.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-jM4TmsYUU5TvMDKJIq7oR-20250215-112728.png)

SparkLayer's invoicing feature removes the need for third-party invoicing tools or apps and offers a seamless way to manage and share invoices with your B2B customers.

Want to see how invoices look before reading on? Click our *Example Invoice* below:&#x20;

::File{src="https://archbee-doc-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-Gm77zkemwdDqLh0pEbl_C-20250215-112744.pdf" label="Example Invoice (via SparkLayer).pdf"}



***

## Getting started

To get started with Invoices, you'll need to enable the feature. Within the SparkLayer Dashboard, go to the [Settings area](https://app.sparklayer.io/configuration/settings/general) and switch on "Enable Invoices".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/CwijA_COqkhekuAE2nE1D_image.png)

Once enabled, you'll then see an option to edit **Invoice Settings&#x20;**(such as the content that shows when viewing an invoice). Please see [Customising invoices](docId\:NKh8H14Ffna5DD71SwwNd) below for full details on how this works.&#x20;



***

## How invoices work

Once you've enabled invoices via the setting detailed above, the process for viewing and downloading invoices is simple for your customers. Watch our short video below to see:

::embed[]{url="https://www.youtube.com/embed/-LeGyR2E3F0"}



The process works as follows:

::::WorkflowBlock
:::WorkflowBlockItem
Your B2B customer (or sales agent) **places an order** via your online store.
:::

:::WorkflowBlockItem
After an order is placed and in a "Processing" status, an invoice is **automatically generated** and prefilled with your company details, items within the order, and any other additional information you've included (see "Customising invoices" below).&#x20;
:::

:::WorkflowBlockItem
Your B2B customer (or sales agent) can then login at any time and, when viewing a specific order, they'll see a button to **"View & Download Invoice"**. When clicking this button, the invoice will load and they can then download as a PDF if they require.
:::
::::



***

## Important items to note

When using SparkLayer invoices, please note the following:

| Item           | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Order status` | - Invoices are available when an **order** is created (e.g. an order with a status of "Processing")
- If you're using Draft orders or an order needs to be approved via [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ), the invoice will **not** be created until the order is completed.
- Invoices are not available for orders that have a **refund** or **cancellation** applied
- Invoices are not compatible with orders that have "split shipments" (e.g. part of the order was fulfilled before being completely fulfilled). The invoice will just display all products from the order.&#x20; |
| `Order edits`  | * **❌ Editing a completed order**&#xA;If you're making edits to a completed order (i.e. an order that is "Processing" but not yet fulfilled), these changes will **not** reflect on the invoice generated.
* **✅ Editing a "draft" order**&#xA;If you're making an edit to an order that is in draft status, these changes will apply once the order has been completed (i.e. set to "Processing).                                                                                                                                                                                                  |



***

## Customising invoices

It's possible to make customisations to your invoices directly within SparkLayer and the built-in tooling allows you to make changes in a variety of ways.&#x20;

:::hint{type="info"}
**Please note**
When you make customisations to your invoices, these will take effect for **all invoices** that are downloaded via SparkLayer.
:::

| Content          | Details                                                                                                                                                                                                                                                   |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Content Zones`  | Content Zones allow you to add content into 'predefined sections' of the invoice such as payment terms, bank details, terms and conditions, or anything else you may require.                                                                             |
| `Default Fields` | SparkLayer automatically captures a range of default fields such as your company name, phone number, and address. These will automatically show on invoices and can also be edited.                                                                       |
| `Theming`        | SparkLayer also allows an advanced option with "themes" that can be modified to give you complete control over how the invoice looks. Please note, this does require advanced coding experience and documentation must be reviewed before making changes. |

### Content Zones

Content Zones are **predefined sections** of text that automatically show on the invoices  your customers see. It's a great way to add content such as payment terms, bank details, additional information, and anything else you need your customers to be aware of when viewing an invoice.&#x20;

To get started with Content Zones, go to the [Settings area](https://app.sparklayer.io/configuration/settings/general) and ensure "Enable Invoices" is switched on. Next, within "Invoice Settings" click the **Edit** button. You'll then see the option to modify three separate content zones, each with a field for title and a description.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/i6wENie4esGxKR9HTD8lK_image.png)

| Field         | Details                                                     |
| ------------- | ----------------------------------------------------------- |
| `Title`       | This will show in larger, bold text within the Content Zone |
| `Description` | This will show in smaller text, below the title.            |

When a Content Zone is populated, it will then show at the bottom of the invoice. If you've included "line breaks" in your content (i.e. starting a new line for a sentence), this will display as you've entered it on the invoice.

:::hint{type="info"}
**Please note**
It's **not** necessary to populate all three Content Zones.&#x20;
You can choose which Content Zones you'd like to use with the title and description both being optional.
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/62PXsWFLmBIqNc9nGVwu7_image.png)

In our example below, we've illustrated how you could use a Content Zone to specify the payment details your B2B customers must use.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/lc5fdZ1m9UGUiwqTDIfQW_image.png)

**Including advanced data in Content Zones**

If you're using additional fields during the checkout process, you can also include more advanced content within Content Zones. For example, you may be using [custom checkout fields](docId\:o3nDhZBCxisWH6M6satDt) to capture data such as a "Shipping date" or a "PO number".&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/oxqezaJdbehMt3q9sAa07_image.png)

We've included some ready made code samples below that can simply be copied and pasted into a Content Zone field.

::::ExpandableHeading
**Show "Additional Information" field (e.g. Purchase Order)**

:::hint{type="info"}
**Please note**
Before adding this code, you'll need to make sure you have the "Additional Information" field enabled during the checkout. [Learn more](docId\:o3nDhZBCxisWH6M6satDt)&#x20;
:::

```html
{% if purchase.customer_reference %}
Customer Reference: {{ purchase.customer_reference }}
{% endif %}
```


::::

::::ExpandableHeading
**Show the payment type**

:::hint{type="info"}
**Please note**
This will show the payment type used on the order. [Learn more](docId\:ibIKczvHM085BkeJIfFYv)&#x20;
:::

```html
{% if purchase.payment_method == "upfrontPayment" %}
A message for Pay Online by Card
{% elsif purchase.payment_method == "paymentOnAccount" %}
A message for Payment On Account
{% elsif purchase.payment_method == "paymentByInvoice" %}
A message for Pay By Invoice
{% elsif purchase.payment_method == "quote" %}
A message for Quote
{% else %}
{{ purchase.payment_method }}
{% endif %}
```


::::

::::ExpandableHeading
**Show the invoice due date**

:::hint{type="info"}
**Please note**
Before adding this code, you'll need to make sure you have a the Net Terms set up on your customer metafield for due dates to be assigned to invoices.&#x20;
:::

```html
{% if data.purchase.dates.payment_due_at %}
<p>
Due Date: {{ data.purchase.dates.payment_due_at | ldate }}
</p> 
{% endif %}
```


::::

::::ExpandableHeading
**Show a custom "Shipping date"**

:::hint{type="info"}
**Please note**
Before adding this code, you'll need to make sure you have a custom "Shipping date" field added via [custom checkout fields](docId\:o3nDhZBCxisWH6M6satDt). The `field.name` should match the `name` you are using for your custom checkout field.
:::

```html
{% for field in purchase.custom_fields %}
{% if field.name == "delivery-date" %}
Shipping Delivery Date: {{ field.value }}
{% endif %}
{% endfor %}
```


::::

::::ExpandableHeading
**Show a custom "Order Notes"**

:::hint{type="info"}
**Please note**
Before adding this code, you'll need to make sure you have a custom "Order Notes" field added via [custom checkout fields](docId\:o3nDhZBCxisWH6M6satDt). The `field.name`should match the `name` you are using for your custom checkout field.
:::

```html
{% for field in purchase.custom_fields %}
{% if field.name == "order-notes" %}
Order Notes: {{ field.value }}
{% endif %}
{% endfor %}
```


::::

::::ExpandableHeading
**Show a custom "Tax ID"**

:::hint{type="info"}
**Please note**
Before adding this code, you'll need to make sure you have a custom "Tax ID" field added via [custom checkout fields](docId\:o3nDhZBCxisWH6M6satDt). The `field.name` should match the `name` you are using for your custom checkout field.
:::

```html
{% for field in purchase.custom_fields %}
{% if field.name == "tax-id" %}
Tax ID: {{ field.value }}
{% endif %}
{% endfor %}
```


::::

::::ExpandableHeading
**Show an Accounting ID ("Tax ID") from metafield&#x20;**

:::hint{type="info"}
**Please note**
Before adding this code, you'll need to make sure you have the Account ID metafield set up on your store (see below).

Only the Account ID metafield can be displayed in the invoice - no other SparkLayer or custom metafield can be displayed.
:::

| Item               | Details                                                                                                                                                                                                                                                                                 |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields)                                                                                                                                                                                                         |
| `Metafield type`   | This must be set as a `single line text` string                                                                                                                                                                                                                                         |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                                        |
| `Key`              | This must be set as `accounting_id`                                                                                                                                                                                                                                                     |
| `Use-case`         | This can be used to specify a unique accounting ID for a customer. For example, if you're using an ERP or accounts package, you can associate a unique account ID against a customer record.When an Accounting ID is set, this will be added to the eCommerce platform orders metadata. |

```html
{% if purchase.customers.sparklayer.accounting_id %}
<p>{{ purchase.customers.sparklayer.accounting_id }}</p>
{% endif %}
```


::::

### Default Fields

Default fields are pre-configured for invoices and include data such as your company name, phone number, address and more.&#x20;

You can manage the default fields via the SparkLayer Dashboard by going to [Settings](https://app.sparklayer.io/configuration/settings/general) and clicking **Edit** within "Store Details". To learn more about how this works, please see [our full guide here](docId\:gznStzTqCRffLFZSTAw0N).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/oHZjxRqyz1u09eP6T_gj__image.png)

When set, these will show at the top of your invoice, displayed clearly to the customer.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/y1XS6v8wXOrdj576yDkP8_image.png)

### Theming&#x20;

:::hint{type="info"}
**Please note**
Theming is only available on the SparkLayer *Pro,* and *Enterprise* plan.
Powering the themes is a special programming language that does require a technical understanding before making modifications. We strongly recommend engaging a web developer should you wish to make use of this feature.
:::

SparkLayer supports full "theming" of your invoices, giving you total control over how the invoice looks such as its layout, typography, colour scheme, and anything else you may wish to edit. You can access this within the [SparkLayer Dashboard here](https://app.sparklayer.io/configuration/theme) and learn more about how it works [in our guide here](docId\:gznStzTqCRffLFZSTAw0N).&#x20;

To help get you started, we've included some example customisations you can do using theming.

:::ExpandableHeading
**Output the product image on an invoice**

In the `<thead>` adjust the code by adding a new`  <th>  `at the start

```html
<thead>
<tr>
<th style="width: 10%"></th>
<th style="width: 60%">{{ "pdf.quote.section.line_items.table.headings.item" | t }}</th>
<th style="width: 10%">{{ "pdf.quote.section.line_items.table.headings.quantity" | t }}</th>
<th style="width: 15%" class="text-right">{{ "pdf.quote.section.line_items.table.headings.unit_price" | t }}</th>
<th style="width: 15%" class="text-right">{{ "pdf.quote.section.line_items.table.headings.total" | t }}</th>
</tr>
</thead>
```

In the `<tbody>`, add a new `<td> `at the start

```html
<td>
<img src="{{ line.image_url }}&height=160" height="80">
</td>
```
:::

:::ExpandableHeading
**Output a logo on an invoice**

At the start of the template file, find the below code

```html
{% if data.merchant.store_name %}
 <h1>{{ data.merchant.store_name }}</h1>
{% endif %}
```

You will need to host the image logo you'd like to use and you can then use the following.

```html
{% if data.merchant.store_name %}
 <img src="path-to-your-hosted-image-file" style="width: 200px; height: auto">
{% endif %}
```
:::



***

## How to test and view invoices

When you make modifications to invoicing (as detailed in "Customising invoices" above), these will immediately show when customers subsequently view an invoice online.

Currently, there is no built-in way to test and view an invoice within the SparkLayer Dashboard but we've a simple way to let you review changes.&#x20;

::embed[]{url="https://www.youtube.com/embed/T67PBaoAy9w"}

The process works as follows:

1. **Create a test order**
   On your website, login as a B2B customer (or as a sales agent) and proceed to place an order. The order will need to be in a "Processing" state in order to generate an invoice (i.e. not a "Draft" order).
2. **View your order**
   Next, within the My Account area of SparkLayer, find and view the order you just placed
3. **Download the PDF**
   On the order details page, you will see a **"View & Download Invoice"** button. When you click this, the invoice will then load in your web browser and can then be downloaded.
4. **Iterate with any edits**
   Once you've viewed the PDF, you may want to make edits. Within the SparkLayer Dashboard, you can then follow the options within "Customising invoices" above with any changes you'd like. These will then automatically take effect the next time you view an invoice.

Whilst this process does require a degree of manual intervention, it will allow you to verify how your invoices appear and make any necessary adjustments.



***

## Compliance

Staying compliant with local invoicing regulations is essential for running a professional business. Every country has unique rules, from mandatory fields to tax details and legal statements. SparkLayer provides the flexibility to meet these requirements.

With **Content Zones**, you can customise your invoices during setup, adding payment terms, bank details, or unique legal requirements. This flexible solution ensures your invoices align with local standards.&#x20;

:::hint{type="warning"}
SparkLayer equips you with the tools to support compliance but is not an accounting or legal service provider. We are not liable for ensuring your invoices meet local regulations. Please consult a professional to verify compliance.&#x20;
:::



***

## Frequently Asked Questions&#x20;

:::ExpandableHeading
**What SparkLayer plan do I need to be on to enable invoices?**

Invoices is only available on the SparkLayer *Growth,* *Pro,* and *Enterprise* plan. You can [change your plan here](https://app.sparklayer.io/settings/plan) or [learn more](https://www.sparklayer.io/pricing/) about our how pricing works.
:::

:::ExpandableHeading
**How do I turn on invoices?&#x20;**

Please see "Getting started" above. Please also note, Invoices is only available on the SparkLayer *Growth,* *Pro,* and *Enterprise* plan. &#x20;
:::

:::ExpandableHeading
**How do I view changes I make to invoices?**

Please see "How to test and view invoices" above.
:::

:::ExpandableHeading
**How do multiple currencies work?**

The invoice feature automatically detects the currency used for each order based on your customer’s location or your store’s settings. This ensures that the invoice is generated in the correct currency.&#x20;
:::

:::ExpandableHeading
**How does tax work on invoices?**

Tax is calculated based on the settings you have configured within your store. To learn about how SparkLayer handles tax, please see [our guide here](docId\:ZSsXG6FjRLCod_GxoluTN).&#x20;
:::

:::ExpandableHeading
**I can't download an invoice. What am I doing wrong?**

If you’re unable to download an invoice, try the following:

- Ensure the order is in a "Processing" status - this will ensure the invoice has been generated correctly and is available to download in the My Account section.&#x20;
- Check your browser's settings to ensure PDFs are being downloaded correctly.
- You can also [contact our support team](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to assist.
:::

:::ExpandableHeading
**If I edit an order, will the changes reflect on the invoice?**

**❌ Editing a completed order**
If you're making edits to a completed order (i.e. an order that is "Processing" but not yet fulfilled), these changes will **not** reflect on the invoice generated.

**✅ Editing a "draft" order**
If you're making an edit to an order that is in draft status, these changes will apply once the order has been completed (i.e. set to "Processing).
:::

:::ExpandableHeading
**Can I show custom checkout fields on an invoice?**

Yes, you can display [custom checkout fields](docId\:o3nDhZBCxisWH6M6satDt) on your invoice (e.g. Tax ID number), please see "Customising Invoices' above.
:::

:::ExpandableHeading
**How do I set payment terms and how do they show on invoices**

You can set payment terms using the Content Zones feature (see above). This allows you to enter "freeform" text that could detail any information you need customers to be aware of when making payments.

In our example below, we've illustrated how you could use a Content Zone to specify the payment details your B2B customers must use.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/YaG9qK9NIZgEZI0fw0U20_image.png)
:::

:::ExpandableHeading
**How do I turn off my other invoicing system?**

SparkLayer supports a direct integration with invoicing app, Sufio. If you're using this with SparkLayer, you can easily turn it off via the [Partner Integrations area](https://app.sparklayer.io/configuration/integrations/partners).&#x20;

If you're using SparkLayer to fully replace an invoice app you're using on your online store, you can follow standard methods to uninstall the app from your store.&#x20;
:::

:::ExpandableHeading
**How do I fully customise how the invoice looks?**

If you need to extend how your invoice looks beyond the Content Zones, SparkLayer does offer an option for [Theming](https://app.sparklayer.io/configuration/theme). Please note, this will require a web developer to assist with and we recommend speaking with [our support team](docId\:NNUw1G9z7eaJ4M78vk7t9).&#x20;
:::

:::ExpandableHeading
**Can I use my own invoices instead of the invoices from SparkLayer?**

Yes. If you'd prefer to use invoices from another system, we've [a full guide here](docId\:yWm70oQUosyKOoIqb4Z4G) on how to set this up.
:::

:::ExpandableHeading
**How does a customer share an invoice?**

The easiest way for a customer to share an invoice is for them to sign into their account, view an order, and then download the invoice. This will then generate a PDF file that can then be shared via their preferred means e.g. via emai.
:::

:::ExpandableHeading
**Can I use invoices for my regular (non-B2B) customers?**

At this time, it's only possible to use this feature for logged-in B2B customers that are configured via SparkLayer.


:::



***

## Limitations

The SparkLayer Invoice feature will be subject to many ongoing improvements, however please be aware of the following limitations currently.&#x20;

| Item                              | Description                                                                                                                                                                                                                                                                                                                |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Line-item tax`                   | It is not currently possible to show line-item tax breakdowns within an invoice                                                                                                                                                                                                                                            |
| `Refunds, returns, cancellations` | It is not currently possible to show these order status types within an invoice.                                                                                                                                                                                                                                           |
| `Supported languages `            | We currently support the following languages: English, French, and Spanish.  <br />Invoices will only be downloaded in the default store language, even if your store is set up with multiple languages.<br />If you need support for another language, please contact  [our support team](docId\:NNUw1G9z7eaJ4M78vk7t9).  |
| `Part Fulfilment `                | Unfortunately we do not currently support **Part Fulfilled** orders. The SparkLayer invoice will display all products on the order if they have been fulfilled or not.                                                                                                                                                     |



***

## Feedback

We've love to know if you have feedback on this feature. Let our team know by emailing **product\@sparklayer.io&#x20;**


[title] Quantity Rules
[path] Features/Configurations/

## Product pack sizing

SparkLayer has full support for pack sizing (sometimes called *quantity increments*), that lets you configure the quantities your customers have to order products in (e.g. units of 3, 6, 9, etc). Once set up, when your customers add an item to their order, the quantities will automatically update based on the pack size settings you've configured.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/8Ug1GmikbErFDfUDZUvDI_product-pack-sizing.gif)

To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                              |
| ------------------ | ------------------------------------------------------------------------------------ |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields) |
| `Metafield type`   | This must be set as an `integer`                                                     |
| `Namespace`        | This must be set as `sparklayer`                                                     |
| `Key`              | This must be set as `pack_size`                                                      |
| `Value`            | This must be set as an integer, e.g. `6`                                             |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/i1u99RfjAD6atexKyoUFw_image.png)
::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                  |
| ------------------ | ---------------------------------------- |
| `Custom data type` | Variant-level (products)                 |
| `Metafield type`   | This must be set as an `integer`         |
| `Namespace`        | This must be set as `sparklayer`         |
| `Key`              | This must be set as `pack_size`          |
| `Value`            | This must be set as an integer, e.g. `6` |

For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::

### Pack size pricing

:::hint{type="info"}
**Unit of measure pricing**
Looking to set up more advanced rules for your pack sizes, e.g. cases or pallets? Read our [guide here](docId\:t2cEaOsmeOHmgZStjCnhe) on how you can set up "unit of measure pricing"
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/HtKPhNS1Gm8b_Yc98M2hi_image.png)

By default, if you have pack sizing enabled, the product page widget will display a "pack price" that takes the unit price multiplied by the items within a pack. If you'd like this hidden, simply add the below CSS to your [CSS overwrites](docId\:qCt2Zk8wjhYIV2ZbVBJYy).

```css
--spark-pdp-pack-size: none;
```

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
   "pdp.price.pack-size": "Pack ({packSize}): {price}",
  }
},
/* End of code */
```

### Customer-specific pack sizing rules

By default, pack sizing will apply to all customers, however it's possible to set up customer-specific pack sizing rules. For example:

- For your default B2B customers, they're able to buy a product in `units of 1`
- For other B2B customers, they have to purchase in `units of 6.`

To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields)                                                                                                                                                                                                                                                                                                                                                                                           |
| `Metafield type`   | This must be set as an `JSON`                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `Key`              | This must be set as `settings`                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `Value`            | This is then set per customer group you want to apply the pack size rules to. <br />E.g. for the default B2B customer group:`[{"customer_group":"base","pack_size":6}]`<br />For an additional customer group that had an internal ID of `tier-2`, you would use:`[{"customer_group":"base","pack_size":6}, {"customer_group":"tier-2","pack_size":12}]`<br />You can find the internal ID from the [Customers](docId:5_lWMNohhjBJJppg9E6Vh) area of the SparkLayer Dashboard. |
::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Custom data type` | Variant-level (products)                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `Metafield type`   | This must be set as an `JSON`                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `Key`              | This must be set as `settings`                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `Value`            | This is then set per customer group you want to apply the pack size rules to. <br />E.g. for the default B2B customer group:`[{"customer_group":"base","pack_size":6}]`<br />For an additional customer group that had an internal ID of `tier-2`, you would use:`[{"customer_group":"base","pack_size":6}, {"customer_group":"tier-2","pack_size":12}]`<br />You can find the internal ID from the [Customers](docId:5_lWMNohhjBJJppg9E6Vh) area of the SparkLayer Dashboard. |

For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::



***

## Minimum & maximum quantities

SparkLayer has support for a variety of different quantity product settings including:

| Type                | Details                                                                                                                    |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `Minimum - Variant` | Minimum product quantities at a variant level (e.g. products that have colours)                                            |
| `Minimum - Product` | Minimum product quantities at a parent level (specifies the minimum quantity across all variants required before ordering) |
| `Maximum - Variant` | Maximum product quantities at a variant level                                                                              |
| `Maximum - Product` | Maximum product quantities at a parent level (specifies the maximum quantity across all variants required before ordering) |

:::hint{type="info"}
**Setting order-level quantities**
You can also set order-level minimum and maximum rules. [Customers](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;
:::



### Minimum product quantities

It's possible to set **'minimum product quantities**' for any SKU within your Shopify catalogue, meaning that customers must meet this minimum quantity before being able to purchase a product.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/awSMgOX2_3JXwtCHhlBno_min.gif)

To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

**Minimum product quantities: variant-level**

| Item               | Details                                                                              |
| ------------------ | ------------------------------------------------------------------------------------ |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields) |
| `Metafield type`   | This must be set as an `integer`                                                     |
| `Namespace`        | This must be set as `sparklayer`                                                     |
| `Key`              | This must be set as `min_order_quantity`                                             |
| `Value`            | This must be set as an integer, e.g. `6, 12, 20` etc                                 |

**Minimum product quantities: product-level**

| Item               | Details                                                                              |
| ------------------ | ------------------------------------------------------------------------------------ |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields) |
| `Metafield type`   | This must be set as an `integer`                                                     |
| `Namespace`        | This must be set as `sparklayer`                                                     |
| `Key`              | This must be set as `min_order_parent_quantity`                                      |
| `Value`            | This must be set as an integer, e.g. `6, 12, 20` etc                                 |
::::

::::Tab{title="🌐 Other platforms"}
**Minimum product quantities: variant-level**

| Item               | Details                                              |
| ------------------ | ---------------------------------------------------- |
| `Custom data type` | Variant                                              |
| `Metafield type`   | This must be set as an `integer`                     |
| `Namespace`        | This must be set as `sparklayer`                     |
| `Key`              | This must be set as `min_order_quantity`             |
| `Value`            | This must be set as an integer, e.g. `6, 12, 20` etc |

:::hint{type="info"}
**BigCommerce** merchants can also use the [BigCommerce Minimum and Maximum Order Quantity](https://support.bigcommerce.com/s/article/Minimum-Maximum-Purchase-Quantity) product setting. Please note that the setting will apply per variant, meaning that each variant will get it's own minimum quantity requirement even though the setting in BigCommerce is set at a product level.
:::



**Minimum product quantities: product-level**

| Item               | Details                                              |
| ------------------ | ---------------------------------------------------- |
| `Custom data type` | Variant                                              |
| `Metafield type`   | This must be set as an `integer`                     |
| `Namespace`        | This must be set as `sparklayer`                     |
| `Key`              | This must be set as `min_order_parent_quantity`      |
| `Value`            | This must be set as an integer, e.g. `6, 12, 20` etc |

For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
::::
:::::

### Maximum product quantities

As with minimum product quantities above, you can also set maximum product quantities to apply.

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

**Maximum product quantities: variant-level**

| Item               | Details                                                                              |
| ------------------ | ------------------------------------------------------------------------------------ |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields) |
| `Metafield type`   | This must be set as an `integer`                                                     |
| `Namespace`        | This must be set as `sparklayer`                                                     |
| `Key`              | This must be set as `max_order_quantity`                                             |
| `Value`            | This must be set as an integer, e.g. `6, 12, 20` etc                                 |

**Maximum product quantities: product-level**

| Item               | Details                                                                              |
| ------------------ | ------------------------------------------------------------------------------------ |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields) |
| `Metafield type`   | This must be set as an `integer`                                                     |
| `Namespace`        | This must be set as `sparklayer`                                                     |
| `Key`              | This must be set as `max_order_parent_quantity`                                      |
| `Value`            | This must be set as an integer, e.g. `6, 12, 20` etc                                 |
::::

::::Tab{title="🌐 Other platforms"}
**Maximum product quantities: variant-level**

| Item               | Details                                              |
| ------------------ | ---------------------------------------------------- |
| `Custom data type` | Variant                                              |
| `Metafield type`   | This must be set as an `integer`                     |
| `Namespace`        | This must be set as `sparklayer`                     |
| `Key`              | This must be set as `max_order_quantity`             |
| `Value`            | This must be set as an integer, e.g. `6, 12, 20` etc |

:::hint{type="info"}
**BigCommerce** merchants can also use the [BigCommerce Minimum and Maximum Order Quantity](https://support.bigcommerce.com/s/article/Minimum-Maximum-Purchase-Quantity) product setting. Please note that the setting will apply per variant, meaning that each variant will get it's own maximum quantity requirement even though the setting in BigCommerce is set at a product level.
:::

**Maximum product quantities: product-level**

| Item               | Details                                              |
| ------------------ | ---------------------------------------------------- |
| `Custom data type` | Variant                                              |
| `Metafield type`   | This must be set as an `integer`                     |
| `Namespace`        | This must be set as `sparklayer`                     |
| `Key`              | This must be set as `max_order_parent_quantity`      |
| `Value`            | This must be set as an integer, e.g. `6, 12, 20` etc |

For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
::::
:::::

:::hint{type="info"}
**Setting order quantity rules**
It's also possible to set minimum and maximum "order-level" quantity rules on a customer-group basis. [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)
:::



***

## Quantity pricing (tiered pricing)

SparkLayer can support quantity pricing rules (e.g. buy 1 for $10, buy 10 for $8). To learn more, please see [our full guide here](docId\:t2cEaOsmeOHmgZStjCnhe).



***

## Unit of measure pricing

Are you looking to set up pricing based on "units of measure" such as boxes, cartons, or pallets? Please refer to our [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe) guide to learn more.



***

## Quantity rules display

By default, if a product has quantity rules set, it will display a message **'Qty rules apply'&#x20;**&#x74;hat a customer can interact with.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/xLiwNA_AU-fWv49mDa-hu_screenshot-2023-07-18-at-170213.png)

If you'd prefer to not show this, you can hide this by adding the below CSS to your [CSS overwrites](docId\:qCt2Zk8wjhYIV2ZbVBJYy).

```css
--spark-product-qty-rules-display: none;
```



***

## Order Limit Rules

You can also set order limits that allow you to set rules on the criteria a customer needs to meet before they can checkout. [Learn more](docId:5_lWMNohhjBJJppg9E6Vh).



***

## 1-click ordering (product bundles)

It's possible to create special buttons on your store that allow customers to add collections of products to an order, rather than having to add them all individually. [Learn more](docId\:m3DF4f0Eyc2rM-vUaRG9H)

[title] Diagnosing Issues
[path] Dashboard/Price Lists/

:::hint{type="info"}
**Troubleshooting common issues**
Please refer to our full guide on [Troubleshooting](docId\:BlCEkkx3I30nkUcglsfw7)
:::

## Price list data

You can check if price list data has been assigned to an individual product by using the [Data Sync](docId:8XClbafeyxHtt5begKM58) tool or [The Price Editor](docId\:fWW4Oh09nSO1-G9TXUTOP). Simply enter the SKU (or external ID) and you can then see full details of price list data that is setup. If you're using the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT), you can also drill into the JSON detail

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/RL8s-qZU3j-KDCsuEfrGL_image.png)


[title] Metafields
[path] Backend/

## Introduction

Metafields help you to customise the functionality and appearance of your store by letting you save specialised information that isn't usually captured within your eCommerce store. You can use metafields for internal tracking, or to display specialised information on your online store in a variety of ways.

In the context of SparkLayer, metafields are used to capture additional B2B data that you can then use in a variety of ways:

| Type                  | Details                                                                                                                                                                                             |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Product metafields`  | Updating the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) by adding configurations such as [pack sizing](docId\:CmxfrPgjQxfz9vJzTVv0D), [RRP prices](docId\:S_VTlJBorGmnwjjfSMom9), and more |
| `Customer metafields` | Updating a customer's information by adding information such as [credit limits](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                       |
| `Order metafields`    | Updating an order with [invoicing information](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                                                        |

The following guide serves as an overview of all available metafields that can be configured within SparkLayer.

:::hint{type="info"}
**Platform-specific metafields**
You can learn more about metafields in the following guides:

- [Shopify Metafields & Data Mapping](docId\:BxWnGB6b1n7QFfhTnu7pk)
- [BigCommerce Metafields & Data Mapping](docId\:bkHor8d6QhgZX_yxsdt56)
:::



***

## Automatically configure metafields

Within the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/integrations/platform), you can speed up the creation of metafields using our built-in tool to automatically configure them.

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
To get started, go to **Integrations, Platform Connection** and click **Configure** within the **Configure metafields** section. You'll then see all available metafields that can be configured for **Product** and **Customer** data.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/77PPtnle394bKNefuREm4_screenshot-2025-03-07-at-060054.png)

When a metafield is enabled, this will automatically be added to the [Custom Data](https://admin.shopify.com/settings/custom_data) section of your Shopify admin and will be 'pinned' for easy access when configuring metafields for products or customers.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/U8TldaNsA4KK5Zvo_vfGB_image.png)

Any metafields automatically created by SparkLayer in this way will be prefixed with `B2B - [name]` for example `B2B - Pack Size`

Should you need to modify or remove metafields, you can manage this via the [Custom Data](https://admin.shopify.com/settings/custom_data) section within your Shopify store.
:::
::::



***

## Product metafields

Please note that all product metafields must be applied at the variant level.

| Details                                                                                                                                                                                                                                                                             | Key                         | Type      |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | --------- |
| **Recommended Retail Price (RRP)**<br />Allows you to set a RRP ("MSRP") price for products at a variant level<br />[Learn more](docId\:S_VTlJBorGmnwjjfSMom9)                                                                                                                      | `rrp`                       | `json`    |
| **Pack Size**<br />Allows you to configure pack size rules for products, e.g. 6, 12, 18<br />[Learn more](docId\:CmxfrPgjQxfz9vJzTVv0D)                                                                                                                                             | `pack_size`                 | `integer` |
| **Minimum Purchasable Quantity (variant-level)**<br />Allows you to specify the required minimum quantity of the variant customers can purchase.<br />[Learn more](docId\:CmxfrPgjQxfz9vJzTVv0D)                                                                                    | `min_order_quantity`        | `integer` |
| **Maximum Purchasable Quantity (variant-level)**<br />Allows you to specify the maximum quantity of the variant customers can purchase.<br />[Learn more](docId\:CmxfrPgjQxfz9vJzTVv0D)                                                                                             | `max_order_quantity`        | `integer` |
| **Minimum Purchasable Quantity (product-level)**<br />Allows you to specify the required minimum quantity across all variants customers can purchase.<br />[Learn more](docId\:CmxfrPgjQxfz9vJzTVv0D)                                                                               | `min_order_parent_quantity` | `integer` |
| **Maximum Purchasable Quantity (product-level)**<br />Allows you to specify the maximum quantity across all variants customers can purchase.<br />[Learn more](docId\:CmxfrPgjQxfz9vJzTVv0D)                                                                                        | `max_order_parent_quantity` | `integer` |
| **Reserve stock for products**<br />Reserves a specified amount of stock that is not available for regular purchase. Useful for holding inventory for specific customers, events, or direct-to-consumer sales.<br />[Learn more](docId\:Gj_Ao_gQ6oA-jx0D27Hys)                      | `reserve_stock_quantity`    | `integer` |
| **Control product visibility and selling**<br />Controls whether a product variant is visible on the storefront. If disabled, the variant won’t appear to customers, even if it remains purchasable through other means.<br />[Learn more](docId\:m3DF4f0Eyc2rM-vUaRG9H)            | `display`                   | `boolean` |
| **Enable or disable purchasing**<br />Determines if a product variant can be added to the cart and purchased. When disabled, the product remains visible but cannot be bought, useful for showcasing upcoming or unavailable items.<br />[Learn more](docId\:m3DF4f0Eyc2rM-vUaRG9H) | `sell`                      | `boolean` |
| **Customer Group Product Rules**<br />Allows you to specify B2B product rules (e.g. pack size & orderable quantities) for specific customer groups<br />[Learn more](docId\:Cm9B1I6Cz0vOlc67g-fJI)<br /><font color="#ff6900">*This "supercedes" the above metafields*</font>       | `settings`                  | `json`    |
| **Reserved DTC Stock Quantity**<br />Allows you to specify a stock quantity to reserve for your DTC customers<br />[Learn more](docId\:Gj_Ao_gQ6oA-jx0D27Hys)                                                                                                                       | `min_stock_level`           | `integer` |
| **Restock Date**<br />Allows you to specify an exact date when a product in a pre-order status is expected to be available<br />[Learn more](docId\:Gj_Ao_gQ6oA-jx0D27Hys)                                                                                                          | `restock_date`              | `date`    |
| **Stock Location Settings**<br />Allows you to specify B2B stock settings (e.g. minimum stock level & restock date) for specific stock locations<br />[Learn more](docId\:Gj_Ao_gQ6oA-jx0D27Hys)                                                                                    | `stock_location_data`       | `json`    |

:::hint{type="info"}
**Learn more**
It's also possible to set **customer-specific product** metafields and you can learn more in [our guide here](docId\:Cm9B1I6Cz0vOlc67g-fJI).
:::



***

## Customer metafields

| Details                                                                                                                                                                                                                                                                               | Key                              | Type                                           |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---------------------------------------------- |
| **Customer Title**<br />Captures the customer’s title (e.g., Mr., Ms., Dr.), which can be used for personalisation in invoices, emails, and account records, ensuring a professional and customized experience.<br />[Learn more](docId\:xXiWZ30EfVbKXnuF3j1G8)                       | `title`                          | `single line text`                             |
| **Company Name**<br />Allows you to specify the name of the company associated to a customer<br />[Learn more](docId\:xXiWZ30EfVbKXnuF3j1G8)                                                                                                                                          | `company_name`                   | `single line text`                             |
| **Assigned Groups**<br />Allows you to specify the group assigned to a customer<br /><font color="#ff6900">*This "supercedes*</font>"<font color="#ff6900"> any tags assigned to the customer</font>                                                                                  | `group`                          | `single line text`                             |
| **Customer Specific Price Lists**<br />Allows you to specify the price lists assigned to a customer<br />[Learn more](docId\:v8dVUcJ7Ju0fH7BvINrEw)<br /><font color="#ff6900">*This "supercedes*</font>"<font color="#ff6900"> any price lists assigned to the customer group</font> | `price_lists`                    | `json`<br />`single_line_text`                 |
| **Enable invoice payment&#x9;**<br />Stores JSON settings that define whether a customer can pay via invoice. Useful for B2B transactions, allowing approved customers to complete purchases without immediate payment.<br />[Learn more](docId\:yWm70oQUosyKOoIqb4Z4G)               | `payment_by_invoice`             | `json`                                         |
| **Credit Limit and Account Balance**<br />Contains the customers credit limit and account balance details<br />[Learn more](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                                                             | `payment_on_account`             | `json`                                         |
| **Accounting ID**<br />Allows you to specify a unique accounting ID for a customer<br />[Learn more](docId\:xXiWZ30EfVbKXnuF3j1G8)                                                                                                                                                    | `accounting_id`                  | `single line text`                             |
| **Additional Percentage Discount**<br />Allows you to specify a flat discount percentage to be applied in addition to other discounted pricing<br />[Learn more](docId\:v8dVUcJ7Ju0fH7BvINrEw)                                                                                        | `discount_percentage`            | `single line text`<br />`integer`<br />`float` |
| **Assign customer to sales agents**<br />Lists the sales agent groups assigned to a customer, helping manage accounts through dedicated representatives.<br />[Learn more](docId\:Uw8mDbMEfwWKqZrVB5CqX)                                                                              | `sales_agent_groups`             | `list.single_line_text`                        |
| **Link customer to parent account**<br />Links a customer to a parent customer account, useful for businesses with hierarchical structures. Supports multi-level accounts, sub-customers, and centralised purchasing.[Learn more](docId:_WwfeWVJY9xrSuNCQlFoZ)                        | `parent_customer_id`             | `single line text`                             |
| **Assign customer role**<br />Defines the customer's role in their company or store interactions. Helps segment users, apply permissions, or provide tailored shopping experiences based on their job function or authority.<br />[Learn more](docId:_WwfeWVJY9xrSuNCQlFoZ)           | `role`                           | `single line text`                             |
| **Default Shipping Address ID**<br />Allows you to specify which shipping address to use as the default for orders<br />[Learn more](docId\:xXiWZ30EfVbKXnuF3j1G8)                                                                                                                    | `shipping_address_id`            | `single line text`                             |
| **Default Billing Address ID**<br />Allows you to specify which billing address to use as the default for orders****<br />[Learn more](docId\:xXiWZ30EfVbKXnuF3j1G8)                                                                                                                  | `billing_address_id`             | `single line text`                             |
| **Store multiple shipping addresses**<br />Stores JSON data listing all shipping addresses available for a customer. Useful for businesses with multiple delivery locations, franchises, or multi-site logistics.<br />[Learn more](docId\:xXiWZ30EfVbKXnuF3j1G8)                     | `available_shipping_address_ids` | `json`                                         |

:::hint{type="info"}
**Please note**
If you're looking to use our advanced metafields, please [speak to our team](docId\:NNUw1G9z7eaJ4M78vk7t9) to learn more about how it works.
:::



***

## Order metafields

| Details                                                                                                                                                                                                                                                                                                                                   | Key                | Type                                                                   |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------- |
| **Store invoice link for orders**<br />Provides a URL to an invoice linked to an order. Helps businesses offer quick access to digital invoices for record-keeping, payments, and compliance with accounting processes.<br />[Learn more](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                   | `invoice_url`      | `url`<br />`list.url`<br />`file_reference`<br />`list.file_reference` |
| **Track imported orders**<br />A flag indicating whether an order was imported into SparkLayer. Useful for tracking external order sources, ensuring data consistency, and managing integrations effectively.[Learn more](docId\:BxWnGB6b1n7QFfhTnu7pk)                                                                                   | `sparkOrderImport` | `boolean`                                                              |
| **Visible ID**<br />This allows a custom order ID ("Visible ID") to be used instead of the platform default (e.g. Shopify). Typical use case could include showing the ERP order number ensuring its a consistent ID across all systems. Please note, this is only applicable to Shopify.<br />[Learn more](docId\:BxWnGB6b1n7QFfhTnu7pk) | `visible_id`       | `single line text`                                                     |


[title] Support
[path] Useful Links/

## Ways to contact us

We're here to help! If you need technical support, such as assistance in configuring SparkLayer on your website, you can either:&#x20;

- Email [support@sparklayer.io](mailto\:support@sparklayer.io) or&#x20;
- Click the message icon within the [SparkLayer Dashboard](https://app.sparklayer.io/) or on the bottom right of this page.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FGdHfvRZedRevesrWVQ9j%2Fimage.png?alt=media\&token=bc7e2240-e09f-4cfd-ba81-f24207395bfa "You'll see this icon in your SparkLayer Dashboard")

So that we can best help, please ensure you provide key details including:

- What your query is about
- Any screenshots that may help us resolve your query as quickly as possible.&#x20;

:::hint{type="info"}
**Support Hours:**

Our team is available during these hours:

- Monday: **24 hour coverage**&#x20;
- Tuesday: **24 hour coverage**&#x20;
- Wednesday: **24 hour coverage**&#x20;
- Thursday: **24 hour coverage**&#x20;
- Friday: **24 hour coverage**&#x20;

We operate with a distributed team, allowing us to provide support across **a full 24-hour period&#x20;**&#x64;uring the working week. While responses may not always be immediate, we aim to respond to all queries within 24 hours. For Enterprise customers, we have an additional Service Level Agreement (SLA) in place. Please contact us for more details.&#x20;
:::

:::hint{type="warning"}
**Messaging via our chat system**
It's possible to message our support team via the [SparkLayer Dashboard](https://app.sparklayer.io/) and via the button on the bottom right of this page. Please note, our support is not always available on an immediate 'live chat' basis so we can't always provide a real-time response to your queries. Our support team is normally very responsive and we do tend to reply to queries with a resolution very quickly.
:::



***

## Onboarding support

We can assist in the SparkLayer installation process such as adding the frontend widgets to your website or walking you through the data set up process. As with Technical support, just click the message icon to contact our team. If you'd prefer to book a video call, you can arrange an [onboarding call here](https://book.sparklayer.io/)&#x20;

**Installing SparkLayer on your store**

In order to use SparkLayer, your website will require the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) to be installed. Our team offers a free service to do this for you, ensuring everything is setup ready for you to begin using. The process works as follows:

1. Via the SparkLayer Dashboard, you can begin the process by [requesting installation](https://app.sparklayer.io/help)
2. Our team will then request access to your website to allow us to edit your code
3. Our team will then proceed to install all the necessary SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa)  and then perform our own internal tests to ensure everything works
4. We'll then notify you that everything is ready to go and you can proceed to test with our [Launching SparkLayer](docId\:YUfghEGoxe_h7uJfcshna). You'll also be given the option to request a free onboarding call to talk with our expert team and discuss any questions you may have.



***

## Scope of our support

✅ Our support covers queries about our apps' **functionality, integration&#x20;**&#x61;n&#x64;**&#x20;installation,** help wit&#x68;**&#x20;configuring app settings,** and addressing any observed bugs.

❌ Our support does not cover **issues caused by third-party plugins**, or those which fall under the scope of support of your theme developers, such as **native theme settings and design-decisions**.&#x20;

In these cases, we will try to refer you to the best support source for your query



***

## Support team location

Our head office is located in the beautiful English city of Bath and our team is all based in close proximity. You can learn more [about our story here](https://www.sparklayer.io/our-story/index.html)!&#x20;

Since we're UK based, we typically operate our support on UK timezones (Monday to Friday, 9am to 5pm GMT) however we are able to accommodate specific requests should you require assistance outside of these hours. Please speak to our team and we'll be happy to advise.

[title] Troubleshooting
[path] Useful Links/

## Introduction

When you're setting up SparkLayer, our team is on-hand to give you the support you need and you can [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) at any time. We've also detailed a number of common issues that are a useful starting point if you're looking to troubleshoot yourself.   &#x20;



***

## Pricing

:::hint{type="info"}
**See all our pricing FAQs**
For further troubleshooting for pricing, please refer to [Pricing FAQs](docId\:smlS3A5lRCGShNu_XLuNN)
:::

:::::::hint{type="warning"}
**⚠️ Prices aren't showing on the product pages or saying "Unavailable"**

You've logged in as a B2B customer but prices aren't showing on your product pages or the product shows as 'Unavailable'.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

- Check that you've installed the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa)
- Check that you've imported a [price list](docId\:s8XcbZGxQpgdeIGWtXseT) that includes the product you are having issues with and you're signed in with a valid customer group. For example, if you have a [price list](https://app.sparklayer.io/pricing/lists) "Base", make sure you have a [customer group](https://app.sparklayer.io/customers/groups) that is assigned this price list. You can also check your pricing in the [Price Editor tool](https://app.sparklayer.io/pricing/editor).
- Check that you've assigned the correct customer tags to the customer record you are logging in with. The customer must have a tag of `b2b` by default and any additional tags that give them additional [customer rules](https://app.sparklayer.io/customers/groups)
- Check that you have **SKUs** for products. If you don't already have SKUs in Shopify, it's relatively quick to do. You can either edit individual products and add them manually, or you can use Shopify's 'Import' or 'Edit products' feature to do this in bulk.
- Check that the product is set to "**Active**" within the Shopify admin (i.e. not "Draft" or "Pending"). SparkLayer will only import "Active" products.
- SparkLayer will only import pricing for SKUs that are assigned to the **SparkLayer B2B & Wholesale** channel within Shopify. Make sure you have **SparkLayer B2B & Wholesale&#x20;**&#x63;hannel selected in Shopify.
- If you're setting up tiered pricing, make sure that you've specified a price for a single unit for all products in your CSV.&#x20;
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Price are showing different to what I am expecting**

When logged in as a B2B customer you are not seeing the correct pricing that you've set up within the SparkLayer Dashboard.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

**On Product Page**

When it comes to your pricing, SparkLayer will always output pricing in **NET&#x20;**(excluding tax). You may need to check that you have the below Shopify store setting turned on in your [Taxes and Duties](https://admin.shopify.com/settings/taxes)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/EMpwF4KEQM9nDp1ko_ctt_image.png)

When you are creating an automatic price list you must make sure you click  **"Adjust percentage to account for tax"**. This only needs to be clicked once and this will then remove the tax from your Shopify price to then apply the additional discount that you have decided on.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7g38agHY_djNwwkfBQwZu_image.png)

***

When creating a new automatic price list,  if you have select a different currency to the native currency on your store, please bare in mind that this **will** convert your Shopify prices to this currency at the live conversion rate.

If you do not wish for this to be the case you would need to use a manual price list and manually specify the price you want to sell the SKU for (as shown below).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/BIYVihwTe4dyu7nne6qoi_image.png)

***

**In the Cart**

Go to your Shopify settings and navigate to [Taxes and Duties](https://admin.shopify.com/store/settings/taxes). When scrolling to the bottom, check if you have the **Include sale tax in product price and shipping rate&#x20;**&#x74;urned on shown below.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fiBdHVbdxwgJx7vRvjuqg_image.png)

If this is turned **ON**, when creating an [automatic price list](https://app.sparklayer.io/pricing/lists) you will need to ensure that you click on the **Adjust percentage to account for tax** to ensure SparkLayer connects to Shopify with the correct pricing.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/UyjNIKqgHezw0vxaUDB1J_image.png)

***

If you are using a [manual price list](https://docs.sparklayer.io/managing-pricing#QYPMk), check that you haven't uploaded your prices as **gross&#x20;**(i.e. including tax). In order for tax to be added correctly in the cart, all pricing myst be uploaded at **net&#x20;**&#x70;ricing (i.e. excluding tax).

***

By default, tax is charged on the overall subtotal of the customer's cart. We have a setting that will allow you tax individual line items, giving you more control over which items are taxed. Please [contact our support team](docId\:NNUw1G9z7eaJ4M78vk7t9) to enable this.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/g7u6YkGR7NxH78Qk4t2uF_image.png)
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ I'm getting errors in the Price List import&#x20;**&#xA;You've imported a CSV file but it's showing errors once you've uploaded it.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

- Check that all your products in Shopify have **unique SKUs** assigned.&#x20;
- If your product has variants (e.g. small, medium, larger), make sure there are **no duplicates** in your SKUs&#x20;
- Check that you've configured the price list CSV file as per the guides within [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) (e.g. ensuring no currency symbols in the **price** column)
- Check that the product in Shopify has the B2B ordering channel ticked under 'Sales Channels'. SparkLayer will only import pricing for SKUs that are assigned to the **SparkLayer B2B & Wholesale&#x20;**&#x20;channel within Shopify.
- Check that the product in Shopify has been set to **Product Status "Active".** Currently SparkLayer will only import prices for products that are active in Shopify (versus in "Draft" status)
- Check the SKU exists within your Shopify catalogue
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Tiered pricing isn't showing when I upload a price list**

You've logged in as a B2B customer and when you go to a product page, you can't see the tiered pricing you've uploaded.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

- When you upload your CSV for your price list, make sure the `qty` field is correctly populated.&#x20;
- SparkLayer will only import pricing for SKUs that are assigned to the B2B Ordering channel within Shopify.
- Make sure that you've specified a price for a single unit for all products in your CSV.&#x20;
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ I'm using an Automatic price list but cannot select a "Source"**

You've created a new price list and you've selected "Enable automatic pricing" but you cannot select a price list from the list of "Sources". &#x20;

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

If you're trying to set up an Automatic price list and you can't select a pricing source, it is likely because SparkLayer cannot find SKUs on your store. &#x20;

SKUs are required in order for SparkLayer to synchronise product and pricing data from your store.

- Please ensure SKUs are specific for the products you wish to make available to your B2B customers. SparkLayer will only import pricing for SKUs that are assigned to the B2B Ordering channel within Shopify.
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::



***

## Data Sync

::::::hint{type="warning"}
**⚠️ I'm getting errors in the Product Data Sync**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/knlG7WNWlzWBr3ybBCsEm_image.png)

If you're viewing the product data sync and you see a warning sign, there could be a number of reasons for this.&#x20;

:::::ExpandableHeading
**✅ View possible resolutions**

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
First of all, we recommend clicking the warning box to see the issues flagged. The issues are typically data-related (e.g. missing a field) and the good news is they can be easily remedied. We've highlighted what the messages mean.

| Error message                                        | Diagnosis                                                                                                                                                                                                                                                                                       |
| ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Check SKUs are assigned to all variants in Shopify` | For this specific product, within Shopify you are likely missing a SKU next to each variant or the main product itself. If you open the product in Shopify, you can add this under Inventory. Note: SparkLayer will only successfully import products that have SKUs assigned for all variants. |
:::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
::::
:::::
::::::

:::::::hint{type="warning"}
**⚠️ The Product Data Sync says "This product cannot be found"**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/HOB7-_2Y2iOaIKb6c-5Rg_image.png)

If you're searching for a product in the Product Data sync and it doesn't return any results, this could be due to a number of reasons.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

- Check that you have valid **SKUs** for products. If you don't already have SKUs in Shopify, it's relatively quick to do. You can either edit individual products and add them manually, or you can use Shopify's 'Import' or 'Edit products' feature to do this in bulk.
- Check that the product is set to "**Active**" within the Shopify admin (i.e. not "Draft" or "Pending"). SparkLayer will only import "Active" products.
- SparkLayer will only import pricing for SKUs that are assigned to the **SparkLayer B2B & Wholesale&#x20;**&#x63;hannel within Shopify. Make sure you have "B2B ordering" selected in Shopify for any products you want to show to B2B customers

If you're still having issues, please contact our support team and we'll be happy to help.
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ I'm getting errors in the Customer Data Sync**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7uyDbrLDYNK7tcFJJ3VzY_image.png)

If you're viewing the customer data sync and you see a warning sign, there could be a number of reasons for this.&#x20;

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
First of all, we recommend clicking the warning box to see the issues flagged. The issues are typically data-related (e.g. missing a field) and the good news is they can be easily remedied. We've highlighted what the messages mean.

| Error message                                                                                  | Diagnosis                                                                                                                                                                                                                                                                                                                      |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Address - The Country assigned is incomplete or invalid`                                      | Please make sure the customer record within Shopify has a Country assigned (e.g. United States of America). Please note: this must apply to all addresses within the customer's address book                                                                                                                                   |
| `Address - The City is missing and is a required field`                                        | Please make sure the customer record within Shopify has a City assigned. Please note: this must apply to all addresses within the customer's address book                                                                                                                                                                      |
| `Address - The address needs a first line added (Line 1)`                                      | Please make sure the customer record within Shopify has the first line of the address assigned. Please note: this must apply to all addresses within the customer's address book                                                                                                                                               |
| `Address - the Post/Zip code is invalid and is a required field`                               | Please make sure the customer record within Shopify has the postal or zip code assigned. Please note: this must apply to all addresses within the customer's address book                                                                                                                                                      |
| `{"code":"resource-id-not-found","message":"Invalid customer group "tier-1".","....":"group"}` | Please check your customer tags in Shopify. It may be because the customer has a previously used tag which no longer corresponds to the tags in your Customer Groups. E.g. if they have a tag of `b2b-tier-1` but the `b2b-tier-1` customer group doesn't exist in the SparkLayer dashboard any more, it will show this error. |

:::hint{type="success" attributes="[object Object]"}
**In general, we always recommend the following:**

- Check the customer has a **fully completed address,** including Country, Line 1 address, City, and Zip/Post code
- Check the customer **doesn't have additional addresses that are incomplete** in Shopify&#x20;
- Check the customer hasn't had their email address recently changed. Whilst this shouldn't cause an issue, sometimes it can cause issues when syncing data
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ The Customer Data Sync says "This Customer ID cannot be found"**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/3UdB7Y2uFBHRc_8cK2e1q_image.png)

If you're searching for a customer in the Customer Data sync and it doesn't return any results, this could be due to a number of reasons.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
| Area                     | Diagnosis                                                                                                                                                                                                                                                                                                                          |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Check the customer ID`  | You can also find this ID in the URL when navigating a customer within the Shopify Customers admin. For example, the URL in your browser may look something like this:<br /><br />`https://your-shopify-store-url.com/admin/customers/5917633347819`<br /><br />In this example, the external customer ID would be `5917633347819` |
| `Check the customer tag` | SparkLayer relies on the customer tag feature within Shopify. For a customer to sync with SparkLayer, they must have a tag of `b2b` set within their customer record in Shopify. Without this, their record will not sync to SparkLayer.                                                                                           |

:::hint{type="success" attributes="[object Object]"}
**In general, we always recommend the following:**

- Check the customer has a tag of `b2b` assigned

If you're still having issues, please contact our support team and we'll be happy to help.
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::



***

## Website

:::::::hint{type="warning"}
**⚠️ A message saying 'An unknown error occurred' shows**

You've logged in as a B2B customer and when you go through the checkout, you see an error message showing on the top right of your browser. &#x20;

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="danger"}
**Error codes:**

If you're using the [latest version](docId\:WDCEwpeMoHPbrR96TaYCL) of SparkLayer, you'll see the following error codes.

- **SHOPIFY:001&#x20;**&#x59;ou've assigned a price list in a specific currency (e.g. AUD) to a B2B customer but this currency has not been enabled in your [Shopify Markets & Currencies](docId\:vex5XjFlT6Pvb0AzhlKQD). In a market that includes multiple countries / regions, there is a setting to "Show prices to customers in their local currency". SparkLayer does not currently support this setting and **it will need to be disabled** for B2B customers in this market to successfully place orders.
- **SHOPIFY:002** You've assigned a price list in a specific currency (e.g. AUD) to a B2B customer but the destination shipping country isn't set up in your [Shopify Markets & Currencies](docId\:vex5XjFlT6Pvb0AzhlKQD).
- **SHOPIFY:003** There's an issue with your product data such as a missing variant SKU for the product in your order. Try removing the affected product from the order.
- **SHOPIFY:005&#x20;**&#x54;he email being used for the order is failing "DNS checks" by Shopify and is being restricted from checking out. Try checking the email address to ensure it is valid.
- **SHOPIFY:006&#x20;**&#x59;ou're trying to checkout with a shipping address in a country that is not in any of your store's configured Shopify Markets. Please ensure all available shipping countries have an associated Shopify Market set.
- **SHOPIFY:007** You're trying to checkout but your customer record is missing either an email address, shipping phone number, or shipping address. These are all required for stores using Managed Markets.
- **PRICING:001&#x20;**&#x54;he B2B customer has two price lists assigned to their customer group with different currencies (e.g. GBP and USD). Try changing their customer group settings to ensure only one currency type is assigned.
:::

:::hint{type="success" attributes="[object Object]"}
**Other possible resolutions:**

- Check that the products in your order don't have prices of **0.00** set in Shopify. In general, SparkLayer relies on the Shopify price being higher than the B2B price in order to place an order with the correct calculations. Prices of 0.00 will throw an error and prevent checking out
- If you're using multiple-currencies, make sure you've configured Shopify Markets as per [our guide here](docId\:vex5XjFlT6Pvb0AzhlKQD). You'll need to ensure each market has currencies and shipping methods correctly set
- If you're placing an order as a [sales agent](docId\:Uw8mDbMEfwWKqZrVB5CqX), make sure the email address of the customer you're placing an order for is valid. Any invalid emails (e.g. an incorrect domain name) may prevent an order being placed due to Shopify rejecting the details.
- Within your [core script](docId\:QWXsYM9X5_pvIOGUteKcP), make sure the `siteId` variable matches that shown in the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/frontend/core).
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Nothing happens when I log in as a B2B customer on my store**

You've logged into your Shopify store with a customer account but nothing happens and you don't see the SparkLayer Frontend widgets load

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

- Check that you've assigned the correct customer tags to the customer record you are logging in with. The customer must have a tag of `b2b` by default and any additional tags that give them additional customer rules
- Check that your B2B customers have a valid address assigned to them. From the Customer Import, you can see if any customers don't
- Check that there are no syncing issues for the customer in the Data Sync tool. If you see a message such as `"code":"resource-id-not-found","message":"Invalid customer group"` it could indicate that the customer has been assigned a tag in Shopify that doesn't correspond to the tags in your [Customer Groups](https://app.sparklayer.io/customers/groups)
- Check that you've installed the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa)
- Check that you are testing on the correct Shopify storefront theme (e.g. you may have installed SparkLayer on a backup theme)
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ The SparkLayer frontend widgets aren't loading on my product pages**

You've logged in as a B2B customer and the SparkLayer My Account shows but no B2B prices show on product pages

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

- Check that you've installed the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa)
- Check that you have **SKUs** for products. If you don't already have SKUs in Shopify, it's relatively quick to do. You can either edit individual products and add them manually, or you can use Shopify's 'Import' or 'Edit products' feature to do this in bulk.
- Check that the product is set to "Active" within the Shopify admin (i.e. not "Draft" or "Pending"). SparkLayer will only import "Active" products.
- Check that there are no syncing issues for the customer in the Data Sync tool for the customer you are testing with.
- SparkLayer will only import pricing for SKUs that are assigned to the **SparkLayer B2B & Wholesale&#x20;**&#x63;hannel within Shopify. Make sure you have "B2B ordering" selected in Shopify for any products you want to show to B2B customers
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::





***

## Tax

:::::::hint{type="warning"}
**⚠️Tax shows as zero (e.g. $0.00)&#x20;**

When placing an order through SparkLayer, the tax is showing as zero (e.g. $0.00) in the SparkLayer checkout or when the order has come through into your website admin.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

Check that the customer account is **not** set as **Tax Exempt.** Go into the [customer record in Shopify](https://admin.shopify.com/store/customers), in the customer settings in the right hand side you are able to **Manage tax exemptions** as show below

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/u-r4t-99TAiJyWj8SKKq4_image.png)

***

Check if you are charging tax on the products or variants in your Shopify store. Go into the [product in your store](https://admin.shopify.com/store/products?selectedView=all) and scroll down the pricing to see the below and ensure the **Charge tax on this product** is ticked.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ru1gAVNkg2K7RkkB9VgNX_image.png)

***

Check if you you are charging tax in the country the customer is checking out with. Within the [Taxes and duties](https://admin.shopify.com/store/settings/taxes) section, navigate to the specific country and you'll see a "tick" if the country is collecting tax or not.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/n0uzl6qiTGzrnaCYBEe1M_image.png)
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Tax is being charged when it shouldn't be**

When going through the SparkLayer checkout, the customer is being charged tax when they shouldn't be.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

Check that the customer account is **not** set as **Tax Exempt.** Go into the [customer record in Shopify](https://admin.shopify.com/store/customers), in the customer settings in the right hand side you are able to **Manage tax exemptions** as show below

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/u-r4t-99TAiJyWj8SKKq4_image.png)
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Tax is&#x20;**<font color="#eb144c">***not***</font>**&#x20;being charged in the checkout when it should be**

When going through the SparkLayer checkout, the customer is **not** being charged tax when they shouldn't be.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

Check that the customer account is set as **Tax Exempt.** Go into the [customer record in Shopify](https://admin.shopify.com/store/customers), in the customer settings in the right hand side you are able to **Manage tax exemptions** as show below

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/u-r4t-99TAiJyWj8SKKq4_image.png)
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Prices are wrong when I check an order**

When placing and order through SparkLayer, the pricing in the SparkLayer checkout is different to the pricing being displayed in the Shopify order.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

Go to your Shopify settings and navigate to [Taxes and Duties](https://admin.shopify.com/store/settings/taxes). When scrolling to the bottom, check if you have **Include sales tax in product price and shipping rate** turned on as shown below.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/emD9eSDmEyLPp2d_xM1hG_image.png)

If this is turned **on**, when creating an [automatic price list](https://app.sparklayer.io/sparklayertrial/live/pricing/lists) you will need to ensure you click on the **Adjust percentage to account for tax** to ensure SparkLayer connects to Shopify with the correct pricing.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/dbYH6Ty7PJFzHd4t1wkDm_image.png)

***

In addition to this, we also recommend ensuring that the price of the product is **lower** in SparkLayer than it is in Shopify. One way to do this is to go the [Price Editor](https://app.sparklayer.io/pricing/editor) in the SparkLayer Dashboard and searching for the SKU.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7ATIsIKxRIw-POiYtqIYZ_image.png)

You can then compare this price to the price that you have in Shopify.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ismC-LbXPA6nKOnlBie34_image.png)

It's very important to note that if the Shopify price is **lower** than the SparkLayer price, when the customer goes through the SparkLayer checkout, it will default to the **lower** Shopify price.&#x20;

When checking your pricing, you'll also need to consider if the Shopify price is **including** tax or not. If the SparkLayer price is higher "after tax" than your Shopify price including tax then again it will revert to the lower Shopify price.
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Shipping to a different country shows the wrong tax amount&#x20;**

When a customer is placing an order to a different country from your "default" country in Shopify, the tax is not being calculated correctly.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

Check if you you are charging tax in the country the customer is checking out with. Within the [Taxes and duties](https://admin.shopify.com/store/settings/taxes) section, navigate to the specific country and you'll see a "tick" if the country is collecting tax or not.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/n0uzl6qiTGzrnaCYBEe1M_image.png)
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Tax is being charged twice in the checkout**

When a customer is placing an order, they are being charged tax "twice" on their order.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

If you're using a [manual price list](docId\:NX9Q00eWV_kbjxc3tg1ut), check that you haven't uploaded your prices as **gross** (i.e. including tax). In order for tax to be added correctly in the cart, all pricing must be uploaded at **net** pricing (i.e. excluding tax).

***

If you are using [automatic price lists](docId\:NX9Q00eWV_kbjxc3tg1ut) and you have [Include sales tax in price and shipping](https://admin.shopify.com/store/settings/taxes) switched on in Shopify, you'll need to ensure that your price list has the **Adjust for Tax** enabled. This will then reduce the price to the correct percentage, whilst taking into account tax charges.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/9VUCHEP-GRPsk7RMbROQC_image.png)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/dbYH6Ty7PJFzHd4t1wkDm_image.png)
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️  I need to charge tax for some products and not others**

I sell products that have different tax rates but the calculations are wrong when the customer checks out.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

By default, tax is charged on the overall subtotal of the customer's cart. We have a setting that will allow you tax individual line items, giving you more control over which items are taxed. Please [contact our support team](docId\:NNUw1G9z7eaJ4M78vk7t9) to enable this.

In order to make sure that you're no longer charging tax on specfic line items, you'll then need make sure that the **Charge Tax&#x20;**&#x69;s not selected on the variant in Shopify:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/8Ph5qtFqJIyv0ift-1lvu_image.png)


:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️  Shipping costs are not showing the correct amounts**

When a customer is checking out, they are not seeing the correct shipping costs as set up in the SparkLayer shipping system.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

When using SparkLayer [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m), the prices listed in the dashboard should always match the prices shown to the customer when checking out. If the shipping rate listed is different, please [contact our support team.](docId\:NNUw1G9z7eaJ4M78vk7t9)&#x20;
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️  Tax is being charged but I use a third-party tax app (e.g. Avalara, TaxJar)**

When placing an order through SparkLayer, tax is still being charged even though the customer is set to "Don't Collect Tax" in Shopify.

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

If you use a third-party tax app such as Avalara or TaxJar to manage your tax calculations, these apps override Shopify's built-in tax settings. This means the Shopify customer setting alone is not enough - you also need to mark the customer as exempt within the tax app itself.

SparkLayer does not calculate tax directly. We display the net pricing and pass through whatever tax information Shopify and your tax app return. If a customer is seeing tax when they shouldn't be, the issue is almost always with the tax app configuration.

To resolve this:

1. Go to your third-party tax app and add the customer to its exemption list. For example, in Avalara, go to the Exemption Customer List and add the customer using their Shopify customer ID as the Customer Code.
2. Confirm that the customer is also set to "Don't Collect Tax" in Shopify - go to Customers, open the customer, and check Manage tax exemptions.

**Please note:** both settings are required. The Shopify customer exemption and the tax app exemption work independently - if either one is missing, tax may still be charged. If you're unsure how to configure exemptions in your specific tax app, we recommend checking their documentation or contacting their support team.
:::
::::

:::Tab{title="🌐 Other platforms"}


Not applicable
:::
:::::
::::::
:::::::



***

## Orders

:::::::hint{type="warning"}
**⚠️ Orders aren't showing in the Orders admin**

You've placed an order via the SparkLayer Quick Order cart but it's not showing up in your Shopify admin

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

- Check that the order has been placed as a B2B customer. You can check this from the "**Notes**" field within the order in Shopify
- Unless the order is placed via 'Upfront Payment' (i.e. by card payment), the order will appear as a **Draft order** within Shopify by default. You can access this by clicking Orders and then Draft Orders within the Shopify admin. If you'd prefer for all orders to arrive in Shopify as completed orders (i.e. not draft orders), you can [enable this here](https://app.sparklayer.io/configuration/settings/general).
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Orders show as "Awaiting Merchant"**

As a customer, you've placed an order via the SparkLayer Quick Order cart and it shows an order status of "Awaiting Merchant" when you review your orders.&#x20;

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Notes:**

- For orders that are placed via "manual" payment methods such as **Pay by Account** or **Pay by Invoice**, these will initially show in the My Account area with a status of "Awaiting Merchant". When the order is transitioned into a "Completed" order, the status will then update to the appropriate status such as "Processing", "Shipped" etc. [Learn more](docId\:lQXaNI7IVDqna09D9soAP)
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::



***

## Checkout

:::::::hint{type="warning"}
**⚠️ Customers can't place orders because of incomplete addresses**

A signed in B2B customer is trying to complete their order but it says their addresses are incomplete

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

- Make sure that all address fields for the customer are completed within their customer record in Shopify
- Make sure they have no incomplete addresses saved against their account
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::

:::::::hint{type="warning"}
**⚠️ Shipping methods aren't showing for customers**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/1LCbkJcLjU6pGzrniT8Ok_image.png)

You've logged in as a B2B customer and when you get to the Shipping Method, you can't see a shipping method to select

::::::ExpandableHeading
**✅ View possible resolutions**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="success" attributes="[object Object]"}
**Possible resolutions:**

- If you're using SparkLayer's built-in shipping, make sure that you've set up your [shipping rules](https://app.sparklayer.io/configuration/settings/shipping-rates) correctly, e.g. by country or by customer group. If the customer doesn't match any of the rules you've set, no shipping method will be shown. Look out for rules you've set based on "weights" or which customer groups are assigned to the shipping rule
- If you're using Shopify to set your shipping methods, make sure you have a shipping country specified for your shipping methods, e.g. if the customer is from United Kingdom, ensure that your shipping methods have United Kingdom as an option
- If you're using Shopify Markets, make sure that you have [shipping profiles](https://help.shopify.com/en/manual/shipping/setting-up-and-managing-your-shipping/shipping-profiles) set up for your destination countries.
:::
::::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
:::::
::::::
:::::::




[title] What's New!
[path] Useful Links/

## Introduction

Each month, we release new features to SparkLayer and you can see our latest updates below.&#x20;

:::hint{type="success"}
**🚀 Upgrading to the latest SparkLayer version**
To benefit from our latest updates, please upgrade your [SparkLayer Core Script](https://app.sparklayer.io/integrations/widgets/core). You can learn about how the Core Script works in [our guide here](docId\:QWXsYM9X5_pvIOGUteKcP).
:::

## September, 2026

### Version 4.10

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Dark mode is now universally enabled**

In our latest version of SparkLayer, you can now enable dark mode on all the SparkLayer interfaces. Previously, this was limited to just the product pages - with our latest update dark mode now works in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-)  and the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) to give a much more cohesive experience. To enable dark mode, see [our guide here.](docId\:qCt2Zk8wjhYIV2ZbVBJYy)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/RmOwVN-qOHotd7F2JCGYD_image.png)



***

## August, 2026

### Version 4.9

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Add to Favourites**

Your B2B customers can now save products as they browse by clicking the heart icon on any product or collection page!&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/cFknc2LVltGDQ5kb6pZ80_image.png)

Saved products live in a new [Favourites](docId\:BXlogKI2-m4jlJtwji_gQ) section in My Account, right alongside Shopping Lists, where customers can return to them any time and add them straight to the cart. It's a lightweight way to mark products for later - no quantities or variants to manage - and it's personal to each customer.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jYI9HbJaHHzgiRUECt2ID_image.png)

Learn more in [our full guide here](docId\:BXlogKI2-m4jlJtwji_gQ).&#x20;

**Tax-inclusive price display**

You can now show your B2B prices with tax included, clearly labelled "inc. tax", so buyers who think in gross terms see exactly what they expect. It's built for markets where gross pricing is the norm - common in Australia and across trade sectors selling to smaller businesses - and gives you far more flexibility in how you present pricing across different markets.

Importantly, this changes presentation only. Your prices are still stored, uploaded, and transacted net, and the tax your buyer actually pays is still calculated by your store's checkout at the point of purchase. Only the figure shown on your storefront changes.

- **Show the price your buyers expect** - display gross prices without changing how you upload or transact your pricing.
- **Control it per price list** - turn it on for the price lists that need it and leave the rest showing net, so you can serve different markets from one store.
- **Set your own rate per product** - supply a display tax rate per SKU, so reduced-rate and zero-rated products show correctly alongside standard-rate ones.
- **Clearly labelled throughout** - gross prices and the "inc. tax" label appear across product pages, cart, checkout, and order history, so there's no ambiguity about what a buyer is seeing.

Tax-inclusive display is enabled by the SparkLayer team, so simply [contact our team](docId\:NNUw1G9z7eaJ4M78vk7t9) if you'd like it turned on for your store. [Learn more](docId\:S_VTlJBorGmnwjjfSMom9)&#x20;

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **My Account discount display**
  When an order is placed with discounts applied, you can now see the discount total breakdown when viewing the order in the My Account.
- **A refreshed look across the dashboard**
  We've given several dashboard pages a visual update as part of standardising the experience - Price Editor, Product Sync, Discounts (including create and edit), and the Configurations pages all now share a cleaner, more consistent design.



***

## July, 2026

### Version 4.7

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Configure SparkLayer from the Dashboard - no code required**

Settings that previously had to be added to your theme's core script using JavaScript and JSON can now be managed visually from the new Options page in your SparkLayer dashboard.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/mq_mA9d2-Y7UpzJxcZwVt_image.png)

Adjust general settings, translations, checkout fields, payment method order, My Account sections, custom slots, and analytics, then save as a draft and publish when you're ready. It works alongside your existing core script, so nothing you've already set up changes. [Learn more](docId\:TlYOdygHE8taYqbi81JJa)

**Standard checkout fields**

Customer Reference, PO Number, and Requested Shipping Date are now available as standard checkout fields.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Xy-ixWiLkycCtYFvzVdUJ_image.png)

Because each one uses a known field ID, it maps to a structured place in your orders - the native Shopify PO Number field, a dedicated shipping date field, and the order notes - so they integrate more cleanly with Shopify, appear in your theme and template editor, and can be searched and filtered. [Learn more](docId\:o3nDhZBCxisWH6M6satDt)&#x20;

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Wix dashboard and onboarding experience**
  We've redesigned our Wix dashboard to make it even easier for merchants to get setup! From right within Wix, you can now view available features, sync health & analytics, manage customer groups, manage price lists, and a new 'Quick Setup' page to get merchants live super fast
- **Upload Excel files to AI file upload**
  You can now upload Excel (.xlsx) files directly to AI file upload, alongside the existing CSV and PDF support. Customers and sales agents can turn a spreadsheet of products straight into an order, without converting it first. [Learn more](docId\:rIAcYwzOMfwSomd5KB5p8)&#x20;
- **More accurate quantity detection in uploaded files**
  AI file upload is now better at identifying the correct quantities in the files customers upload, making order creation from documents quicker and more reliable.
- **Duplicate forms in one click**
  You can now duplicate any form from within [SparkLayer Forms](https://app.sparklayer.io/forms)
- **Hide the Intelligent Cart features&#x20;**&#xA;If you'd prefer not to use the [Intelligent Cart (AI)](docId\:rIAcYwzOMfwSomd5KB5p8) features within the SparkLayer Cart, you can now hide these by going to the [Setttngs > Configurations](https://app.sparklayer.io/configuration/settings/general) section of the SparkLayer Dashboard.



***

## June, 2026

### Version 4.6

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Shopping Lists just got a major upgrade**

::embed[****]{url="https://www.youtube.com/embed/rhuLyeKaMQY"}

Managing Shopping Lists is now faster and far more flexible! Products can be saved to a list straight from any product page, and lists can be fully managed from within the My Account area - including previewing, adding, and editing their contents. Your B2B customers and sales agents can also export any list as a CSV, making it easier to share and reorder across teams. [Learn more](docId\:AQJJjc8wJrskIYivjIZrG)&#x20;

**Orders API - build and manage orders**

:::hint{type="info"}
**Please note**
Orders API is currently in beta - if you'd like to be invited, please email support\@sparklayer.io and our team will be happy to help.
:::

We've extended our Core API with a new Orders API, giving developers a programmatic way to build and manage orders. The new endpoints let API users create and manage shopping carts and turn them into SparkLayer orders in code - opening up use cases such as creating orders through external integrations, for example drop shipping. Any store with API access has this automatically. See the [API documentation](https://docs.sparklayer.io/tech-docs/create-cart) and the [usage guide](https://docs.sparklayer.io/tech-docs/ordering-api) to get started.

**Fetch customer-specific pricing via the API**

As part of the same release, a new endpoint lets API users fetch customer-specific pricing for products, so integrations can pull the exact prices a given customer sees. Learn more in the [API documentation](https://docs.sparklayer.io/tech-docs/get-customer-specific-pricing).

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **My Account / My Cart - Expand button moved to the user menu**
  The "Expand" button now lives in the user dropdown menu, freeing up space for more important actions within each page.
- **Clearer impersonation view for sales agents**
  When viewing as a sales agent, you can now see exactly which customer you're impersonating on every page, making it easier to keep track when ordering on a customer's behalf.



***

## May, 2026

### Version 4.5

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Export Purchase History to CSV**
You can now export orders (including quotes and any other purchase types) directly from the Activity view as a CSV file, ready for Excel or Google Sheets. Choose between an order-level summary or a full breakdown with every line item, and any filters you've applied carry through to the export. Available from the customer or sales agent view. Learn more [here](docId\:lQXaNI7IVDqna09D9soAP). (Requires Spark-JS Version 4.4 and above)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/P1E2YAQJqse8gUjyZyw7A_pika-1780500436153-1x.png)

**Reply Directly from Your Inbox**
No more logging in just to reply to a message. You and your customers can now respond to order communications straight from your email inbox, with replies automatically captured in SparkLayer's Timeline. It works across all order types, making it effortless to keep conversations going - especially on mobile, when you're on the go. Learn more [here](docId\:Kf-Gd3nHSXlrn2zZvla1Y).  (Requires Version 4.3 and above)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

**Customer & Order Data in Forms**
You can now pull customer and order data (including quotes and any other purchase types) directly into your SparkLayer forms. Great for cases like returns forms, where shoppers can select from their previous orders and items without re-entering details, and sales agents can request customer data to be updated. Learn more [here](docId\:BbZC4JyoiO3LbySWcLdVx).

**Address improvements**
Entering addresses just got easier - especially for international buyers. Address forms now adapt their layout and name ordering to the selected country, and offer address search and auto-fill. The result is faster, more accurate data entry wherever your customers are based. Learn more [here](docId\:lQXaNI7IVDqna09D9soAP). (Requires Version 4.5 and above)

**Improvements to Sales Agent Activity Filtering**
Sales agents get the same export options across all their customers, and, similar to the customer view, they can now filter by the new purchase type and quote status filters. Making it easy to reconcile orders, forecast inventory, or plan pre-orders. (Requires Version 4.4 and above)

:::hint{type="warning"}
**Internal Customer API upgrades:&#x20;**&#x57;e've released V2 of our Customer API, now available to all Shopify stores (and in June we'll move the other platforms over). For customers who are already using the V1 Customers API, you can continue to use the V1 API for the next 6 months till the 1st of December 2026. The upgrade path is straightforward, and we’ll provide more information about the changes soon.
:::



***

## April, 2026

### Version 4.4

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**A better way to onboard customers.**

SparkLayer Forms is a flexible way to capture, review, and manage B2B information at every stage of the customer lifecycle — from first enquiry through to ongoing account management or even a contact form for your site.

::embed[]{url="https://www.youtube.com/embed/_M4QphRF9_k"}

It includes a powerful workflow editor (available for pro plan customers) which provides functionality for automatically tagging, API calls to push your new customers to your ERP or even automatically approve customers where the tax ID is validated. Learn more [here](docId\:nn5qnfmfGkXlyUmAMpSnq).

**Catalogs**

[B2B Catalogs](https://apps.shopify.com/sparklayer-b2b-catalogs) is a free SparkLayer app (for Shopify) that gives you control over which products are visible to different types of customers on your Shopify store. Whether you want to hide specific products from B2C customers, restrict certain items to B2B customers only, or show different product ranges to different customer groups - B2B Catalogs makes it easy to manage from your Shopify admin.

![](https://images.archbee.com/kxppJrvFK15E9wXbMKaTP/M5xa-1yz19lg3eiXhSi8e-20260415-044949.jpg?format=webp)

**Sales agents' roles.**

Sales agent roles let you control what each sales agent can see and do in SparkLayer - so the right people have the right level of access. Instead of managing permissions individually, you can create reusable roles and assign them across your team. Available for anyone with sales agents. Learn more [here](docId\:Uw8mDbMEfwWKqZrVB5CqX).

![](https://images.archbee.com/kxppJrvFK15E9wXbMKaTP/d1VWkt2IhlVzrFq5Omnbs_image.png?format=webp)

**Custom email domain**

Improve brand recognition and deliverability with support for custom "from" email addresses (e.g. [store@mail.yourstore.com](mailto\:you@yourstore.com)), helping ensure notifications match your brand. Available on Pro and Enterprise plans. Learn more [here](docId\:Kf-Gd3nHSXlrn2zZvla1Y).

![](https://images.archbee.com/kxppJrvFK15E9wXbMKaTP/ZJHA1PEvgt0gL2IbIRthy-20260401-105203.png?format=webp)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Dashboard Customers and Sales Agent page** - New and improved visibility for customers, customers syncing and sales agents.
- **Disable specific email templates -&#x20;**&#x54;hrough a minor template change, it is possible to disable a email template and this could be actioned based on logic. Learn more [here](docId:8A4OpNIndUyfs3Pup-tuo).
- **Package level invoicing for Xero/Quickbooks** - Invoices are now shown at package level rather than multiple invoices shown at the order level.
- **Company Users** is now available for all plans.



***

## March, 2026

### Version 4.3

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Shopify Company support -&#x20;**&#x53;parkLayer will automatically place orders under the correct Shopify company when a customer is attached to one. Learn more in our full guide, [Shopify Companies](docId\:wrzSu8adFvbXOkF50hX5I)&#x20;
- **Multilingual Shopify Shipping support -** Support for multilingual shipping names when using Shopify shipping.



***

## Feburary, 2026

### Version 4.1

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Payment Visibility within SparkLayer**

Cut down on support admin by letting your customers check their financial standing themselves.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DBzcyD3RwVEjepHjjObPH_image.png)

This new feature provides real-time account balances, payment statuses, and transaction histories directly in the My Account area. To read more see [Payment Methods](docId\:ibIKczvHM085BkeJIfFYv).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/lQn9AK_HGVoUVFgf8eEZM_image.png)

The key elements:

- Payment status is now visible within the order listing and the order details tab (Paid, Unpaid, Partially Paid)
- Transactions are now visible within the timeline section of the order.
- The balance shown in the Account section has now been updated based on payments.

This feature can be enabled easily via the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/settings/general). Compatible with Shopify, Xero, and QuickBooks Online.

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Speed, Polish, and Performance Upgrades&#x20;**(Version 4+)
  - **Speed Boost:** Enjoy snappier loading for products, carts, and accounts thanks to smarter caching.
  - **Visual Polish:** A cleaner, more refined look across the interface with improved layouts, spacing, and typography.
  - **Better Shopping Flows:** More reliable cart updates, smoother reordering, and a simplified quantity selector.
  - **Accessibility & Fixes:** Upgraded screen reader support, better right-to-left (RTL) language layouts, and a solid round of bug squashing.
- **Dashboard Price Lists and Customer Groups page** - New and updated design for the price lists and customer groups page, we'll be rolling out more pages in this design over the coming months.
- **Improved Product Selection Dropdowns -** Invalid selections on Product Details Page dropdowns are now hidden rather than disabled, creating a cleaner interface for your customers. (Version 3.17.0+)



***

## January, 2026

### Version 3.15

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Discounts - Exclude Specific Customers**
  Discounts can now exclude specific customers using email addresses or accounting IDs, giving more control over who can use each promotion. [Learn more](docId\:WrejPw9URyjQwiQeKs_Cg) &#x20;
- **Quotes - New Email Notifications**
  We’ve added three new quote emails that the customer will receive, to make it clearer when a quote has been created or updated:&#x20;
  - First response from a Sales Agent to a quote request&#x20;
  - Subsequent quote updates made by a Sales Agent&#x20;
  - New quote created by a Sales Agent and sent to a customer&#x20;

:::Paragraph{indent="1"}
See the complete list of Quoting emails and their triggers [here](https://docs.sparklayer.io/quoting?_gl=1*1bx4hi3*_gcl_au*MTk0MDY4MDY5OC4xNzY5MDEwMDc2#email-notifications-sent).&#x20;
:::



***

## December, 2025

🚀<font color="#6366F1">**COMING SOON**</font>

We're excited to announce that the **SparkLayer Xero and Quickbooks** integration is launching in March!&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/mKR781rURC597M3D3-QAg-20251212-105928.jpg)

For early access, you can sign up to our [beta here](https://sparklayer.notion.site/27fddfba557a80f2869cd07e669ed17e?pvs=143).

To learn more about how SparkLayer works with Xero, explore [our guide here.](docId\:WGhH4d8L-ys8zjOQmEoVx)&#x20;



***

### Version 3.14

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Timeline & Communications&#x20;**

Timeline & Communications has expanded beyond Quotes and is now available across **all supported order types**. Messages, internal notes and order updates are brought together in one clear, chronological timeline, giving your team and customers a unified place to track communication and activity as orders progress.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://cdn.shopify.com/videos/c/o/v/7370c91db365426d97fcfd02a997d521.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::


The result is a consistent, streamlined experience - whether you’re managing standard B2B orders, quotes, or draft orders created by Sales Agents. Learn more in [our guide here](docId\:Kf-Gd3nHSXlrn2zZvla1Y)**.&#x20;**



***

## November, 2025

### Version 3.14

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Dashboard Design Updates**

We’ve refreshed the SparkLayer dashboard with a streamlined sidebar that makes navigation simpler, faster, and more organised.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-3g7TeY2-OVKA-nhqYqNj_image.png)

- **Customer and Product Sync** now sit under **Integrations**, alongside Platform Connection, Partner Integrations, and Widgets.&#x20;
- **Discounts** is now grouped with **Pricing**, alongside Price Lists and Price Editor, reducing clutter and keeping pricing tools together.&#x20;

The result is a **cleaner layout** and **clearer structure** that lets you focus on what matters most - your store’s performance.&#x20;

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Stock Display - Option to hide pre-order status**
  A new configuration within Customer Groups allows you to hide the “pre-order” stock status from customers.&#x20;



***

## October, 2025

### Version 3.14

<font color="#9900ef">**🎉 NEW FEATURES** </font>

**Quote Status Improvements**

You can now **filter quotes by individual status**, giving you greater granularity and control when managing quotes. Previously shown in a single view, quotes can now be broken down by stage for easier tracking and follow-up.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/uswOX18KUz0dpTyK2o-7j-20251105-144324.jpg)

Custom statuses are automatically included, and a new chevron indicator shows when more filters are available to scroll through. Statuses have also been reordered to reflect logical quote progression for a smoother workflow.

**Shipping Restrictions by State/Province**

You can now limit shipping methods to specific **states or provinces&#x20;**&#x77;ithin the US, Australia and Canada, allowing more precise regional control. This makes it easier to tailor delivery options, manage exclusions, and align shipping availability with your operational areas.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/RV7NaShd1gC6VDGAS_NRA-20251028-152712.jpg)

You can configure this directly under **Settings → Shipping Methods.&#x20;**

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Quotes - CC Notifications to Child Company Users**
  Quote notifications sent to parent company users now CC child company users to keep both informed.
- **AI Cart Import - Support for Multiple SKU Columns**
  AI Cart Import now supports files with multiple SKU columns (e.g. vendor SKU and product SKU) and auto-detects the correct one.
- **Cart - Display Unit of Measure**
  Products with a single unit of measure now show it directly on the cart line item, without needing to hover.&#x20;



***

## September, 2025

### Version 3.12

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Shopify - Languages: support for product data translations**
  SparkLayer now has the ability to sync product data translations and show product data in the customer's language. This is currently only supported for Shopify stores. Please contact us if you'd like us to enable it on your store. [Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu)&#x20;
- **Shopify - Number of Cart Lines Supported**
  Previously we had a limit of 250, we now support 350 line items or 500 line items (by request due to the performance of the Shopify APIs).
- **BigCommerce - Support for Combined Order Limit Rules**
  You can now use both SparkLayer’s product minimum and maximum order limit rules alongside the native BigCommerce rules, giving greater order management flexibility.
- **BigCommerce - Support for Custom Order Visible ID**
  You can now use a custom order ID instead of the standard BigCommerce-generated ID. This is useful for matching order numbers with back-office systems (e.g. ERP) to ensure consistency across platforms.
- **BigCommerce - Discount Rules Based on Product Properties**
  Discount rules can now check additional BigCommerce product properties when determining if a discount should be applied, such as; categories, brand ID, condition, UPC and search keywords.&#x20;
- **Wix - Removal of RRP Field from Sync**
  The RRP field has been removed from syncing to prevent it from displaying on frontend widgets. A product resync will be required for the change to take effect.
- **Barcodes - Available on Invoices, Quotes & Emails**
  You can now add barcodes on Invoices, Quote PDFs and emails.&#x20;
- **Sales Agent - “Submit Quote” button update**
  Sales Agents will now see a “Submit Quote” button instead of “Request Quote” during the quoting process, making the action clearer.&#x20;
- **SparkLayer Core Script - Enhanced Error Codes**
  Error codes have been added for custom SparkLayer Options hook issues, making it easier for you to identify and resolve the cause of errors more quickly.&#x20;
- **Activity Section - Quote Status Update**
  The Activity section now shows the “Quote Status” instead of “Quote”, with the column below displaying the actual status (e.g. *Awaiting merchant”*).&#x20;
- **ERP Integration updates - Cin7, Brightpearl, Linnworks & Unleashed**
  Our ERP integrations have been improved so you can now view connection status, last sync, and any issues via **Settings → Integrations → Partner Integrations**, making it easier to resolve data syncing problems.&#x20;



***

## August, 2025

### Version 3.10&#x20;

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

**Use custom order IDs**

It's now possible to use a **custom order ID** instead of the standard order ID generated from Shopify. A typical use-case is customising the Order ID to match order numbers generated from a back-office system (e.g. an ERP), ensuring consistency across systems.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5d6xB53DfFAoDBhsTL_mI_image.png)

When the "Visible ID" is set, this will then take effect when the customer views their orders from the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP). To enable this, please see [our guide here.](docId\:BxWnGB6b1n7QFfhTnu7pk)&#x20;

**Show a message at a cart line-item level**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/BA15Alj4v_qy566_CT4v0_image.png)

Extending upon our [Custom Slots ("Targets")](docId\:l_2ooHJiY-rAx2chBMgP2) , you can now display a custom slot on a cart line-item level, such as a message that references the product name and ID ("slug"). This gives a powerful new way to add further customisation to the shopping cart for your B2B customers.



***

## July, 2025

### Version 3.10&#x20;

<font color="#9900ef">**🎉 NEW FEATURES** </font>

**Discount Engine Improvements**

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-Kn0YV9zXguVBursDD4OmW-20250721-110750.jpg)

We're excited to announce a range of major improvements to the SparkLayer [Discount Engine](docId\:WrejPw9URyjQwiQeKs_Cg), including the ability to:

- Set advanced requirements and rewards. [Learn more](docId\:WrejPw9URyjQwiQeKs_Cg)
- More extensive "free products" promotions. [Learn more](docId\:WrejPw9URyjQwiQeKs_Cg)

The updates now allow you to configure discounts that apply on more advanced criteria such as matching a specific "tag" or "vendor" (within Shopify), and the ability to set rewards that include multiple free products. These changes now position SparkLayer as having one of the most advanced B2B promotions engines available - we look forward to seeing how creative our customers will be using this! [Learn more](docId\:WrejPw9URyjQwiQeKs_Cg)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Invoices - Option to display RRP**
  You can now choose to show the Recommended Retail Price (RRP) on SparkLayer [Invoices](docId\:NKh8H14Ffna5DD71SwwNd), giving your customers greater visibility on pricing.&#x20;
- **Cart - Clearer messaging when stock is limited**
  Customers will now see clearer messaging if they try to add more items to their cart than are available in stock, helping reduce confusion during the ordering process.



***

## June, 2025

### Version 3.9&#x20;

<font color="#9900ef">**🎉 NEW FEATURES** </font>

**Katana Integration**

We're excited to announce our official integration with Katana, a leading inventory management solution!

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-TGn0yJ2eE6VnBjSZW86sT-20250604-124134.jpg)

If you're using Katana to manage your back-office operation, you can now integrate your B2B pricing and customer data directly with SparkLayer. [Learn more](docId\:goIlaInwUK3DbAJ0snj6t)&#x20;

**Onboarding Landing Page**

A great way to encourage your customers to use your new B2B store is to **explain the benefits**. To help you get started, you can use our ready-made "onboarding landing page" that gives a great overview of the features to your customers. [Learn more](docId\:YUfghEGoxe_h7uJfcshna)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/4_tcO7rdfhTWX98AQBVLU_image.png)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **My Account - Tax Display**
  When a customer places an order, they can now see their full tax breakdown when viewing their order details within the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP)&#x20;
- **Shopify - New Customer Accounts URL redirect**
  If you're using Shopify Customer Accounts, you can now configure which URL to send a customer to directly via your Shopify admin. In your Shopify admin, go to Settings, Checkout, and within [Configurations](https://admin.shopify.com/settings/checkout#checkoutprofiles), click "Customize" and you'll see a new field "Redirect Path" within the "B2B Customers Redirect" extension.
- **Checkout – Support for Tax ID Requirements**
  Merchants can now collect the required tax ID details at checkout, ensuring orders to countries with strict import rules can be completed in Shopify. [Learn more](docId\:o3nDhZBCxisWH6M6satDt)&#x20;
- **CSV file upload**
  When importing a CSV file into the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), products will be added to the cart in the same order as listed in the CSV file.&#x20;
- **New Languages**
  We now have support for Latvian on the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa)&#x20;
- **Duplicate Discounts**
  It's now possible to create multiple discounts with the same configurations, making setup faster for similar pricing rules. [Learn more](docId\:WrejPw9URyjQwiQeKs_Cg)&#x20;
- **Checkout - Option to disable**
  You can now fully disable the checkout process and only show the "Request Quote" option, ideal for quote-only workflows. [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;
- **Sales Agent - Auto sign-in after Customer Creation**
  Sales agents are now automatically signed in as the customer after creating them, removing the need to search and impersonate separately. ****




***

## May, 2025

### Version 3.9&#x20;

<font color="#9900ef">**🎉 NEW FEATURES** </font>

**SparkLayer Intelligent Cart**

SparkLayer Intelligent Cart introduces a revolutionary new way for your B2B customers and sales teams to build orders quickly and effortlessly using the power of AI.

::embed[]{url="https://www.youtube.com/embed/IhpfEUwKZXI"}

The magic lies in its simplicity: files and emails containing order details (such as SKUs, barcodes, and quantities) can be uploaded or emailed directly to SparkLayer, instantly creating a shopping cart. In addition, live barcode scanning is supported, providing powerful, fast ways to build orders without manually browsing and searching for product. Learn how Intelligent Cart works in [our guide here](docId\:rIAcYwzOMfwSomd5KB5p8).&#x20;

### Version 3.8&#x20;

<font color="#9900ef">**🎉 NEW FEATURES** </font>

**Cart Search**

We've just given our search tool a massive upgrade, making it even easier for your customers to add items to an order!

::embed[]{url="https://www.youtube.com/embed/61IRiGBcR6Q"}

The Search tool allows customers to **search by a range of criteria** including product name, product SKU, product variant name, SKU, and barcode.

The tool also handles mis-spellings and "partial matching", ensuring results are delivered where possible and allowing for a more user-friendly search. To learn more about how it works and how to enable it, see  [our full guide here](docId\:efevur-A3yCJXUHvrR7t-).&#x20;



***

## April, 2025

### Version 3.7&#x20;

<font color="#9900ef">**🎉 NEW FEATURES** </font>

**The SparkLayer Quoting Engine**

We’re excited to announce the launch of the new [SparkLayer Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo) , designed to transform how your sales team and wholesale customers manage quotes.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-6wzPfQy98oz0ZjrJDIcgl-20250412-131624.jpg)

Built to simplify the entire "quote-to-order" process, it helps reduce manual work, speed up order conversion, and create a better buying experience.

With the [SparkLayer Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo), you can:

- Let customers build and submit quote requests directly from your store
- Enable your sales team to edit quotes, apply discounts, and set expiry dates
- Keep all communication in one place with a shared conversation timeline
- Seamlessly convert approved quotes into ready-to-process orders
- Notify customers and sales teams automatically with emails and special workflows
- ... and a lot more!

Whether you’re handling high-volume B2B orders or need more control over pricing negotiations, the [SparkLayer Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo)[ ](https://docs.sparklayer.io/quoting)brings everything into one streamlined flow, all designed to save time, reduce friction, and strengthen customer relationships.

::embed[]{url="https://www.youtube.com/embed/Lmjwg4RK0r8"}

If you'd like to give it a try, head over to the [plan page here](https://app.sparklayer.io/settings/plan) where you can add it to an existing plan or as an exclusive addon. You can also learn more about how it works in [our guide here](docId:8A4OpNIndUyfs3Pup-tuo).

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Integration with Intuitive Shipping**
  We've released our new integration with shipping application, [Intuitive Shipping](docId\:ZkesmMUAWX2SQQ7j6as07) making it even easier to connect SparkLayer to their dynamic shipping rate solution
- **Pre-orders and stock display**
  We've improved how stock is shown in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) when a product is on pre-order. If a customer orders more than is in active stock, it will now clearly show what stock is available and what is on pre-order

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/sP4wShUNqTLrgRFeiGUbB_image.png)



***

## March, 2025

### Version 3.7&#x20;

<font color="#9900ef">**🎉 NEW FEATURES** </font>

**SparkLayer Analytics**

We're excited to announce a major advancement in how you can report on your B2B sales and performance! We’ve partnered with the leading analytics experts, Conjura, to add unparalleled operational and sales visibility to your SparkLayer account.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/PQNBpZZ3r24R0AHGS8kMP_sparklayer-screen.jpg)

[Learn more](https://www.sparklayer.io/analytics/) about how this works and you can also arrange a demo to see how it can fit your business needs.

**Automatic metafield creation**

Metafields are a powerful way to customise the functionality of your B2B store, allowing you to configure additional data such as [pack sizing](docId\:CmxfrPgjQxfz9vJzTVv0D), [rrp prices](docId\:S_VTlJBorGmnwjjfSMom9), and much more. With our latest update, we've made it really easy to quickly add metafields to your Shopify store without needing to manually configure them within your Shopify admin.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/RTdWvqfwMWgwUpe271zwn_sparklayer-metafields.jpg)

To get started, head over to the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/integrations/platform) or learn more in [our guide here](docId\:OTLHhi8sQ6oS4PAt23-8H).&#x20;

**Improved Shopify B2B Login Page**

We've greatly improved our free [Shopify B2B Registration & Login](docId\:Gfc0UW7mJnMNpnNO6EdRl) template, making it really easy for you to add a login and signup form to your Shopify store.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/FH3wGV31qcvn1RRbCYGe6_sparklayer-screen.jpg)

The improvements include full control over the design and content, the ability to set different actions when a customer applies, and much more! [Learn more](docId\:Gfc0UW7mJnMNpnNO6EdRl)&#x20;

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- We've added the following additional [Custom Slots ("Targets")](https://docs.sparklayer.io/custom-slots#BvdCT)
  - Cart Shipping Step
  - Cart Payment Step
  - Account > Purchase Summary Header
  - Account > Purchase Summary Footer
- For our SDK, we've added a `onCartLoad`as an additional function that can be used when the cart is loaded. Read more [here](https://docs.sparklayer.io/tech-docs/javascript-sdk).

### Version 3.6&#x20;

<font color="#9900ef">**🎉 NEW FEATURES** </font>

**Sales Agents - Add custom item**

We've released a major improvement to our [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) tool that your sales team are going to love - the ability to add custom items to a B2B order!

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Wd0D6iZgJbn9n173DsQpT_sparklayer-screen.jpg)

Our new "Add custom item" feature lets your sales agents add additional items to a customer's order that sit outside of your general product catalogue. Use-cases could include adding custom instructions or details specific to an order, additional products (that don't have a specific SKU), or any custom item that needs to be associated with an order. Items can be added at a specific cost or at a zero cost value. [Learn more](docId\:Uw8mDbMEfwWKqZrVB5CqX)&#x20;

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **My Account - Order details**
  When viewing an order from the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP), products that have variants (e.g. colour, size) will show the full variant information (previously this wasn't visible).



***

## February, 2025

### Version 3.5&#x20;

<font color="#9900ef">**🎉 NEW FEATURES** </font>

**SparkLayer Invoices**

It's here... one of our most requested features of all time has arrived: *SparkLayer Invoices!*

The [SparkLayer Invoices](docId\:NKh8H14Ffna5DD71SwwNd)  feature allows you to automatically generate professional invoices that your customers can easily download, directly from their My Account.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-VwIZ0lWyo92YpyPy7v2Fu-20250215-114518.jpg)

SparkLayer's invoicing feature **removes the need** for third-party invoicing tools or apps and offers a seamless way to manage and share invoices with your B2B customers. Once you've enabled invoices via the setting detailed above, the process for viewing and downloading invoices is simple for your customers. Watch our short video below to see:

::embed[]{url="https://www.youtube.com/embed/-LeGyR2E3F0"}

Interested in trying out SparkLayer Invoices? Learn more in [our guide here](docId\:NKh8H14Ffna5DD71SwwNd).&#x20;

### Version 3.3&#x20;

<font color="#9900ef">**🎉 NEW FEATURES** </font>

**Shipping discounts&#x20;**

It's now possible to set shipping discounts when using SparkLayer [Discounts](docId\:WrejPw9URyjQwiQeKs_Cg)! This has been one of our most requested features for our Discount Engine, and it gives you the option to set a range of different shipping discount types. From percentage off and fixed discounts, through to setting a specific shipping cost when the discount is applied.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/eni9dL0gWyEgR9qvFsaNe_sparklayer-screen.jpg)

Using this feature does require enabling the SparkLayer [shipping system](docId\:CfZ_ZpGw2umOVAo73Lc5m) and you can learn more in [our guide here.](docId\:WrejPw9URyjQwiQeKs_Cg)&#x20;

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Sales Agents - Creating New Customers**
  For Sales Agents with "Adminstrator" priveleges, when inviting a new customer via SparkLayer, it's now possible to disable the "Invite" email that is sent to the customer. This is available for all merchants using Shopify. [Learn more](docId\:Uw8mDbMEfwWKqZrVB5CqX)&#x20;

### Version 3.2&#x20;

<font color="#9900ef">**🎉 NEW FEATURES** </font>

**Show RRP prices only (for in-store shopping)**

If you manage orders in physical locations with customers (e.g. in store), it's possible to enable a setting that sets the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) to **only** show the RRP (or "MSRP) prices when browsing and adding items to an order.&#x20;

This is especially useful if you need to "obscure" your B2B prices from view and you only want to show the full retail prices.&#x20;

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://cdn.shopify.com/videos/c/o/v/0d4ca2d2d8e54cf68d23604223ff4f8d.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

Use-cases could include:

- In-store customer visits where an order needs to be placed and the customer must only be able to see the retail (RRP) prices
- Sales teams who are placing orders on behalf of customers (e.g. on the road) and only the retail (RRP) prices must be seen

Learn more about how this works in [our guide here](docId\:S_VTlJBorGmnwjjfSMom9).



***

## January, 2025

### Version 3.1

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Sales agents - custom shipping methods**

One of the most requested features for our [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) tool is to allow sales agents to make changes to the shipping costs during the checkout. We've now released the ability for sales agents to set custom shipping prices for any orders they place on behalf of their customers.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://cdn.shopify.com/videos/c/o/v/43e6aae0e2424c1483de7369271389e5.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

To learn more about how this works, see [our guide here](docId\:Uw8mDbMEfwWKqZrVB5CqX).&#x20;

**Order searching and filtering by date**

It's now possible for B2B customers to search and filter orders by date range within the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP). This is a great way to quickly see orders based on specific criteria and time period, making it easier to keep track of order activity.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Q3TfjscnLWqly70XHCflr_image.png)

To see this in action, click "View All" within "Recent Activity" and you'll see the option to search and filter your orders.

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

**Mobile layout improvements**

We've made improvements to the [Cart & Checkout](docId\:o3nDhZBCxisWH6M6satDt) to better support smaller (mobile) devices. When a B2B customer is using SparkLayer on these devices, the interface will now show more line items and offer an easier way to navigate between checkout steps.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bdj6Xg7WewCWY5pK588SA_image.png)

**Shopify - improved handling of B2B prices**

:::hint{type="info"}
**Please note**
From 1st February 2025, this feature is enabled by default. If you started using SparkLayer before this date and you'd like to enable this on your Shopfy store, please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and our team will action this for you.&#x20;
This is an optional feature and it is not mandatory to enable.
:::

We've improved how SparkLayer handles pricing in Shopify, removing the need for B2B pricing to be applied as a "discount". When a B2B customer now places an order, the price shown against a product will exactly match the B2B pricing you set via SparkLayer [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT).&#x20;

To iillustrate the difference, the screenshot below shows how pricing was calculated previously (using a discount against the line item product price)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/udYZrac9ZLRmUXay8Joe2_image.png)

With the latest change, the price shown will exactly match your B2B pricing without needing to apply a discount.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ieIqumgtDFBTqZjsZGl3w_image.png)

**Shopify - support for new customer accounts**

If you're using [Shopify](docId:7TmhkOEHbgEGGFdd6EMr1) and you'd prefer to use Shopify's new "Customer Account" feature, SparkLayer is now fully compatible. This means that SparkLayer can now work with Shopify stores that use either new "Customer Accounts" or classic "Legacy Accounts". To learn more, read [our guide here](docId:687ZiSnQ7rsITCGjjKFyb).&#x20;



***

## December, 2024

### Version 2.1.0

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Change ownership status in the Dashboard**

If you have multiple users invited to your [Dashboard](docId\:nzsx6U_DAWtzVzSehf4oR), you can now easily transfer ownership to another user. This is especially useful if you're initally setting up SparkLayer and you want another user to manage the ongoing account management.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/yDCVP_GM3Q_u6It50PQ5g_image.png)

To learn more about how this works, head over to [our guide here](docId\:r9NG74uJdtyWlvGbpnB5u).&#x20;



***

## November, 2024

### Version 2.1.0

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Integrating Google Analytics with SparkLayer**

If you're looking to track key events in Google Analytics (GA4) or Google Tag Manager (GTM) through SparkLayer, you can now set this up directly in your integration. This will help you capture valuable B2B events like "add to cart" "checkout," and "purchase" actions. [Learn more](docId\:qD08Q-eiJ2-8k1MweLqca)&#x20;

**New Email Notifications for Company Users**

We've now added the ability for Company Users to receive emails when "Limited Users" submit an order for a review. Email notifications are sent to both the "main" and "limited" Company Users at key stages of the order review process, without requiring them to be logged in. You can learn more about how this works in [our guide here](docId:_WwfeWVJY9xrSuNCQlFoZ)&#x20;



***

## October, 2024

### Version 2.0.8

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Product Matrix Interface**

We've introduced a major update to our [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) that now lets you convert your product pages into a special "product matrix" table view, making it even easier for your customers to order products!

::embed[]{url="https://www.youtube.com/embed/cloM8_DJ7eg"}

If your products come in multiple variant types (e.g. colour and size), it's a great way to allow customers to quickly see all variants available and purchase them. To learn more about how this works, please see [our guide here](docId:8Go0NYHFDmYnwlJSNfO-S).

**Order details**

When viewing an order within the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP), if an order has more than 10 unique items, a "View all" link will now show allowing the customer to see all items in one go.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/hb7kS3ks4cqewRoKplrip_image.png)



***

## September, 2024

### Version 2.0.2

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Custom checkout fields - support for new fields**

If you need to collect additional data from your B2B customers during the checkout, our [custom checkout fields](docId\:o3nDhZBCxisWH6M6satDt) now supports the ability to add drop-down menus ("select" menus).

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/checkout-select.mp4?v=345&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

For example, you may want to give customers a list of options to choose from to include in their order and it's even possible to group the options with different headings. You can learn more about how this works in [our guide here.](docId\:o3nDhZBCxisWH6M6satDt)&#x20;

**Stock display improvements**

:::hint{type="info"}
**Please note**
This feature requires being on the latest version of SparkLayer. To benefit from our latest updates, please upgrade your [SparkLayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
:::

It's possible to display [stock levels](docId\:Gj_Ao_gQ6oA-jx0D27Hys) to your B2B customers when they browse your store, giving them visibility of your inventory. Our latest update now gives you even more flexibility and has a number of major improvements.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/8pF5qksnd0rE_MmlokTV3_image.png)

Firstly, it's now possible to display stock levels on a per-customer group basis. For example, you may have some customer groups that you don't want to show inventory to or you may want to configure specific stock settings.&#x20;

You can also now hide and show the specific inventory count and just show a stock status (e.g. `In stock` versus `In stock [100 available].`) Beyond this, we've also simplified how you can manage max/low/last stock levels and you can learn more in [our full guide here](docId:5_lWMNohhjBJJppg9E6Vh).&#x20;

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **My Account Addresses**
  When adding or editing an address within the My Account area, the `First Name` and `Last Name` fields are now mandatory.



***

## August, 2024

### Version 1.36.16

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**Line Item Tax Support**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/aVI52kDQLJcUEM8azzM0o_screenshot-2024-08-27-at-190553.png)

If you sell products that have different tax requirements, you'll like our latest update! We've just released full support for "line item tax", ensuring your B2B customers see fully accurate tax calcualtions when checking out.&#x20;

This feature is ideal if you have more complex tax requirements for your catalogue (e.g. you're selling coffee, children's clothing, or products that have varying tax obligations).

You can see a full overview of how it works in [our full guide here](docId\:ZSsXG6FjRLCod_GxoluTN).

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Sales Agents within the SparkLayer Dashboard**
  Based on customer feedback, we've made it easier to access Sales Agents within the SparkLayer Dashboard. You'll see this in the main navigation when signing in, or you can [access it here](https://app.sparklayer.io/sales-agents).



***

## July, 2024

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**B2B Discount Engine!**

It's here... our most request feature EVER! The [SparkLayer Discount Engine](docId\:WrejPw9URyjQwiQeKs_Cg).

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/discount-codes.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

Our new Discount Engine immediately unlocks a range of discount rules, with more to come in the future. Right now, you'll be able to set up:

- **Order-level discounts:** eg, spend $1,000 and get 10% off, spend $2,000 and get 15% off
- **Percentage and fixed discounts:&#x20;**&#x65;g, 20% off an order total, $100 off an order total 
- **Coupon codes:** eg, enter code NEWCUSTOMER and get 5% off
- **Scheduled discounts:** eg, start discount today and end it on a specific date and time
- **Customer-specific discounts:** eg, only allow customer group ‘b2b-vip’ qualify for the discount 

You can see a full overview of what’s possible in [our guide here](docId\:WrejPw9URyjQwiQeKs_Cg).

**Custom slots (add custom code)**

Custom slots have arrived! You can now add custom code to a range of the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) allowing you to customise the B2B experience for your customers. &#x20;

::embed[]{url="https://www.youtube.com/embed/pAfXYvYnY2M"}

It's a great way to further enhance your B2B customer experience and use-cases could include displaying promotional messages, links to pages within your store, and much more! [Learn more](docId\:l_2ooHJiY-rAx2chBMgP2)

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Purchase history re-ordering**
  When viewing the Purchase History in the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP), you can now add individual items directly to any order



***

## June, 2024

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**File uploads (checkout and product-level)**

We're excited to announce the launch of one of our top 5 most requested features, file uploads! As of today, your B2B customers can now upload file attachments during the checkout process, allowing you to capture additional information such as Purchase Orders, custom files (e.g. for personalisation) and much more.

::embed[]{url="https://www.youtube.com/embed/UgmP800AdKw"}

And there's more! In addition to file uploads during the checkout, you can now configure product-level file uploads! Learn more in [our guide here](docId\:o3nDhZBCxisWH6M6satDt).

**Stock location support ("inventory locations')**

As brands scale their operations and build out more advanced inventory management processes, it’s very common to see multiple ‘locations’ where inventory is managed. This could be based on geographic location (eg by country) or by more niche use cases specific to a brand’s internal workflows, like routing stock based on what type of customer is ordering.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/AMK_EQLp7gSNSTtqyf8bw_image.png)

Stock locations allow you to specify which stock (or "inventory") locations you want your B2B customers to use stock from. If your B2B store is set up with **multiple stock locations** (e.g. by geography), it's a great way to ensure your B2B customers are purchasing stock from the correct locations. Learn more in [our guide here](docId:5_lWMNohhjBJJppg9E6Vh)



***

## May, 2024

<font color="#9900ef">**🎉 NEW FEATURES**</font>

**New Customer Groups interface&#x20;**

We've just released a major improvement to the [Customers](docId:5_lWMNohhjBJJppg9E6Vh) area of the [SparkLayer Dashboard](https://app.sparklayer.io/customers/groups), making it easier to manage your B2B customer rules! We've completely reworked how your customer groups are displayed with a new and improved way to quickly manage all your customer groups settings from one place.

The update also includes new visibility of "customer group inheritance", allowing you to see which rules are being used from another customer group. Check our video below or head on over to the new [Customer Groups area](https://app.sparklayer.io/customers/groups)!

::embed[]{url="https://www.youtube.com/embed/BWRQiC7wL20"}

**🛠️&#x20;**<font color="#2166ae">**IMPROVEMENTS**</font>

- **Price list improvements:**
  It's now possible to set up a price list to support a 100% discount against an automatic price source (e.g. your Shopify retail prices). This is useful if you have a requirement to allow specific B2B customers to purchase products at a zero-rated cost (e.g. $0.00)
- **My account credit limits now support multi-currency**
  If you're store is set up to allow multiple currencies for your B2B customers and you're using [credit limits and account balances](docId\:yWm70oQUosyKOoIqb4Z4G), you can now configure these specific to the customer's currency (e.g. GBP, EUR, USD)



***

:::hint{type="success"}
You can also browse previous years of SparkLayer updates in the [Archive](docId\:PrMonZpQ1alqecIArYRWb)&#x20;
:::






[title] Refund Policy
[path] Useful Links/Policies/

## Introduction

This policy applies to all SparkLayer services across all supported eCommerce platforms and apps. Before requesting a refund, we encourage you to contact us at **support\@sparklayer.io** if you encounter billing questions, technical issues, or need development help.

Our team aims to respond within **24 hours on weekdays** and **48–72 hours over weekends**. Refund requests are considered in full once we have reviewed and attempted to resolve the reported issue.



***

## Eligibility

Refunds are issued specifically for significant technical problems that cause data loss or major disruption, and only when a fix cannot be provided.

- **Monthly Subscriptions:** Requests must be made within **5 days** of the current billing period.
- **Annual Subscriptions:** Requests must be made within **7 days** of the current billing period.
  - If you cancel an annual plan mid-term, approved refunds are calculated by taking the total paid, subtracting the months used (at the original monthly rate), and subtracting any Shopify processing fees.
- **Trial Overrun:** If you forget to cancel before a trial ends, you may receive **50% off** the first billing cycle if requested within 5 days (monthly) or 7 days (annual).



***

## Non-refundable scenarios

As we provide a free trial for evaluation, refunds are not offered for the following:

- Change of mind or accidental purchases.
- Apps purchased at a reduced price or used only for testing.
- Lack of technical ability to use the app.
- Requests for goodwill, previous billing periods, or custom development services.
- Conflicts caused by third-party themes or other apps.



***

## How to request a refund

1. **Contact Support:** Email us at **support\@sparklayer.io**.
2. **Provide Evidence:** Include screenshots, videos, or URLs to help us diagnose the issue.
3. **Keep the App Installed:** Do not uninstall the app before reaching out. We can only investigate issues while the app is installed; once uninstalled, data is removed and we cannot assist.



***

## Processing and Shopify Billing

- **Approval:** If approved, refunds are processed immediately if you have already been charged. If the charge is pending, you may need to wait for the eCommerce provider to complete the cycle.
- **Shopify Users:** App billing and refunds are managed by Shopify’s system, not SparkLayer. We cannot directly stop future Shopify charges. Refunds via Shopify can only be issued after the current billing cycle is complete. You may also contact Shopify directly regarding charges.



***

## Before you uninstall

If you plan to remove SparkLayer, please contact us first. We can help remove any remaining app code and ensure the uninstall doesn't affect your store's performance

[title] Security Policy
[path] Useful Links/Policies/

:::hint{type="info"}
This policy has moved to the SparkLayer Trust Center. The current version is at [www.sparklayer.io/trust/security](http://www.sparklayer.io/trust/security). It covers hosting, encryption, authentication, access control, secure development, backups and review.
:::


[title] FAQs
[path] Useful Links/

## Introduction

Looking to better understand how SparkLayer works? We've included some of our most common questions below!&#x20;

### ℹ️ General

:::ExpandableHeading
**What can I do with SparkLayer?**

SparkLayer gives you an easy way to enable B2B (wholesale) on your existing website. You don't need to create a new store or spend time and money trying to customise your B2B experience. SparkLayer does all this for you and, once you're set up, you'll be able to:

- Enable custom pricing for your B2B customers
- Give your B2B customers a self-service ordering experience
- Accept B2B payments, such as "net payments" and "payment on account"
- Allow your sales team (sales reps) to place orders on behalf of B2B customers using [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX)&#x20;
- Configure more advanced pricing rules, such as pack sizing and quantity price price-breaks
- Enable rapid re-ordering, making it easy for your customers to repeat order
- Manage the full "quote to order" process using our [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo)&#x20;
- Allow your B2B customers to save shopping lists
- Configure pre-ordering and back-ordering rules
- Allow your B2B customers to create company teams

And so much more! SparkLayer has over 100 B2B features right out of the box. Plus our team can get everything set up for you with our free onboarding service.
:::

:::ExpandableHeading
**Do you have a demo store to test SparkLayer?**

Yes! Please see [Try our Demo](docId:87ILO_vHmG3XUXKecOLXv)
:::

:::ExpandableHeading
**Which eCommerce platforms and systems does SparkLayer integrate with?**

SparkLayer works Shopify and BigCommerce with more platforms coming soon! For Shopify, our officially approved 5-star rated SparkLayer Shopify App means you can integrate with SparkLayer with total confidence.

SparkLayer also integrates with a range of other systems, from payment gateways to multi-channel operations platforms.&#x20;
:::

:::ExpandableHeading
**How does SparkLayer compare to other B2B solutions?**

A good question! There are many B2B solutions on the market and each offer a variety of benefits that may suit specific use-cases or customer types. Beyond functionality and features, there is one major benefit of SparkLayer that makes it compelling - you get to use your existing website and SparkLayer simply 'layers' on top (hence the name, SparkLayer!). Many other solutions are built as 'web portals' meaning customers have to use an entirely separate website. Whilst this may be useful, if you already have an existing website (e.g. for your DTC retail customers) or you use an eCommerce platform you're already familiar with, you'll need to manage multiple systems and tools which can add operational complexity.

We'd be happy to discuss this in more detail!
:::

:::ExpandableHeading
**How much does SparkLayer cost?**

Please refer to our [pricing](https://www.sparklayer.io/pricing/) for more details.
:::

:::ExpandableHeading
**What support do you have and where are you based?**

Our head office is located in the beautiful English city of Bath and our team is all based in close proximity. Since we're UK based, we typically operate our support on UK timezones (Monday to Friday, 8am to 6pm GMT) however we are able to accommodate specific requests should you require assistance outside of these hours. Please speak to our team and we'll be happy to advise.
:::

### 🛠️ Setup & Installation

:::ExpandableHeading
**How do I enable SparkLayer on my store?**

For Shopify and BigCommerce, you'll simply need to install our official [Shopify](https://apps.shopify.com/sparklayer) or [BigCommerce](https://www.bigcommerce.com/apps/sparklayer-b2b-wholesale/) app and go through our simple onboarding process.

When your SparkLayer account is created, our online onboarding process guides you through all the elements of installing SparkLayer on your store and we're here to help if you require assistance.
:::

:::ExpandableHeading
**How long does SparkLayer take to set up?**

If you're using our built-in tools to manage your pricing and customers, it's possible to set up SparkLayer in a matter of hours (or less!). Our team is on-hand to guide you through the set up process and can even help set up on your Shopify store for you.

For most extensive integrations - typically merchants using our Enterprise plan that require backend connections - set up times vary and we'll work closely with you to create a full project plan.
:::

:::ExpandableHeading
**Do I need to hire a developer to integrate the SparkLayer?**

No! SparkLayer is really simple to install and we have full step-by-step instructions once you sign up. If you have access to your Shopify storefront theme, it's possible for anyone to do. If you like, we can even install for you if you require any assistance.
:::

:::ExpandableHeading
**Can I run my B2C store alongside my B2B store?**

Yes! It's possible to install SparkLayer onto your existing B2C store (i.e. retail), meaning you can run both B2C and B2B on the same store. We call this a 'hybrid setup'.

When your B2B customers sign in, they simply see the special SparkLayer frontend widgets that allow them to see their prices and place orders.
:::

:::ExpandableHeading
**Can I use SparkLayer on a custom platform?**

Yes, providing you're able to integrate your platform with an external API. Learn more about the [SparkLayer API](https://docs.sparklayer.io/sparklayer-technicals/the-sparklayer-api)
:::

:::ExpandableHeading
**Can I customise how the SparkLayer Frontend looks?**

Yes, you're able to change styling such as fonts, colours (e.g. of buttons) and spacing easily via CSS to match your current eCommerce store and typically you can get SparkLayer to fit seamlessly with your website look and feel.&#x20;
:::

:::ExpandableHeading
**Do I manage my online product catalogue within SparkLayer?**

No, the product catalogue and category management is done through your existing eCommerce platform. SparkLayer simply 'overlays' your existing product catalogue with the B2B-specific data such as product pricing and pack sizes. It does this by associating data to the specific product SKU behind-the-scenes and then showing the appropriate content to the customer.
:::

:::ExpandableHeading
**Will SparkLayer slow my website down?**

No. For performance, the SparkLayer Frontend only loads when a valid B2B customer successfully logs into a website; for your standard (B2C) customers, no code is loaded at all. When a B2B customer logs in, all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.
:::

:::ExpandableHeading
**Does SparkLayer work across different devices?**

Yes, SparkLayer is fully compatible with mobile, tablet, and desktop devices.
:::

### ⭐ Features

:::ExpandableHeading
**How do I learn more about the SparkLayer features?**

You can learn more in [Frontend](docId\:OgKfvQX13dHW2582D57kJ)
:::

:::ExpandableHeading
**Does SparkLayer process payments?**

No, SparkLayer does not handle payment processing and instead simply uses the payment methods set up within your eCommerce platform, e.g. Shopify. It's possible to set up both offline payment methods for your B2B customers (e.g. Pay on Account or Pay by Invoice) as well having them pay online via card.
:::

:::ExpandableHeading
**Do I need to have an ERP, PIM, CRM or iPaaS integration to use SparkLayer?**

No. With our powerful import tools, you can configure pricing and customer rules all through the SparkLayer Dashboard without the need to have a backend system in place.

If you are looking to use a backend system, SparkLayer works by connecting directly to your central data sources to retrieve your B2B data. If you're using an iPaaS solution (integration platform as a service), SparkLayer can connect directly to this instead, negating the need to connect to an ERP directly.

If you have the technical expertise, the SparkLayer API lets you connect to any system and we also have a range of 'ready-made' integrations
:::

:::ExpandableHeading
**I have an ERP integration already, will SparkLayer work with it?**

The short answer, it depends! If your online store is already connected to your ERP system, there's a good chance that no further integration work is required to connect SparkLayer. When orders are placed via SparkLayer, they'll simply be created like any other which your ERP system can then subsequently import. The same also applies to product stock data, SparkLayer will use stock levels already available on your eCommerce store. If you're looking for a more in-depth integration, such as synchronising B2B pricing, this would require an integration&#x20;
:::

:::ExpandableHeading
**Can I create custom price lists within SparkLayer?**

Yes. Within the SparkLayer Dashboard, you can manually create price lists and upload pricing data for each one you create. You can learn more in [Pricing FAQs](docId\:smlS3A5lRCGShNu_XLuNN)
:::

:::ExpandableHeading
**Can I automate B2B pricing, e.g. a discount off my store's retail prices?**

Yes. SparkLayer's powerful pricing engine lets you create automated rules for your B2B price lists. For example, if you're using Shopify, you can easily set up a B2B price list that applies 20% off your Shopify prices.&#x20;
:::



***

## Explore more

You can also explore more FAQs in the following guides:

- [Shopify FAQs](docId\:P-7titr2d20hXBeixvKBZ)
- [BigCommerce FAQs](docId\:KZrw-fFscozjvGMLwPoIB)
- [Pricing FAQs](docId\:smlS3A5lRCGShNu_XLuNN)


[title] Product Settings
[path] Features/Configurations/

## Introduction

Whilst it’s possible to configure product settings for all customers across your website (e.g pack sizes, reserve stock quantities), you can also apply these product settings t&#x6F;**&#x20;specific customer groups**, giving you a high degree of control over what product options are available to your customers.



***

## Available product settings

You can apply any of the following product settings to customer groups:

| Name                        | Type              | Description                                                                                                                           |
| --------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `customer_group`            | `string`          | Customer Group - settings will be applied to this customer group                                                                      |
| `pack_size`                 | `integer or null` | Only allow the product to be purchased in multiples of x<br />`Default: 1`                                                            |
| `reserve_stock_quantity`    | `integer or null` | Reserve stock quantity - always ensure x amount of stock is left (generally used to ensure DTC has availability)<br />`Default: null` |
| `min_order_quantity`        | `integer or null` | Only allow the product to be bought in a minimum of x<br />`Default: null`                                                            |
| `max_order_quantity`        | `integer or null` | Only allow the product to be bought in a maximum of x<br />`Default: null`                                                            |
| `min_order_parent_quantity` | `integer or null` | Only allow the product to be bought in a minimum of x across all variants<br />`Default: null`                                        |
| `max_order_parent_quantity` | `integer or null` | Only allow the product to be bought in a maximum of x across all variants<br />`Default: null`                                        |
| `display`                   | `boolean or null` | Allow the product to display on the frontend<br />`Default: null`                                                                     |
| `sell`                      | `boolean or null` | Allow the product to be added to the cart<br />`Default: null`                                                                        |



***

## Settings Configuration

To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

| Item               | Details                                                                                                                                                                                                                                                         |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Variants](https://admin.shopify.com/store/oversoles/settings/custom_data/productvariant/metafields)                                                                                                                                                            |
| `Metafield type`   | This must be set as an `JSON` string                                                                                                                                                                                                                            |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                |
| `Key`              | This must be set as `settings`                                                                                                                                                                                                                                  |
| `Value`            | This must be set up in this format<br />`[{"customer_group": "base","pack_size": 1,"reserve_stock_quantity": 10,"min_order_quantity": 5,"max_order_quantity": 50,"min_order_parent_quantity": 5,"max_order_parent_quantity": 50,"display": true,"sell": true}]` |

:::hint{type="warning" attributes="[object Object]"}
**Please note**

- You can find the value for `customer_group` in your [dashboard](https://app.sparklayer.io/customers/groups) in the "Name" column, e.g. `Base`&#x20;
- When setting a `customer_group`, always enter it as lowercase. E.g. `Base` becomes `base`
- See table *Available settings to apply to customer groups* above for accepted inputs for each `Value`
- In the metafield `Value`, you only need to include the settings that you actually want to set - you can either remove the unused settings, leaving only `customer_group` and the settings you wish to configure, or leave them set to `null`
- Make sure that every line ends with a comma, **except for the last line**
:::

For example, if you only wanted to configure minimum order quantity of 5 and a maximum order quantity of 50 for the customer group 'Gold tier', the `Value` would look like this:

```javascript
[
    {
        "customer_group": "gold-tier",
        "min_order_quantity": 5,
        "max_order_quantity": 50
    }
]
```



***

## Example use cases

::::ExpandableHeading
**Example 1: Exclusive products**

Company X has two customer groups:

1. Base (standard B2B customers)
2. Gold tier (a group of preferred customers who have access to discounted pricing and exclusive products)

As part of their preferential terms, Gold tier customers have access to a range of exclusive products which are not available to Base customers.

```javascript
[
    {
        "customer_group": "base",
        "display": false,
        "sell": false
    }
]
```

:::hint{type="info" attributes="[object Object]"}
**Please note**
Product variants that have this metafield applied will only be visible to Gold tier customers. By default all products are visible to all customer groups, we do not need to explicitly make these products visible to Gold tier customers, instead we simply need to hide them from Base customers.&#x20;
:::

Please make sure that you add the following metafield to the variants you wish to remain showing to the base group:

```javascript
[
    {
        "customer_group": "base",
        "display": true,
        "sell": true
    }
]
```
::::

::::ExpandableHeading
**Example 2: Customer group specific pack sizes**

Company X has two customer groups:

1. Wholesale customers (other businesses who stock their products)
2. Influencers (people who advertise their products on social media)

Their influencers only need to order single units to showcase their products on social media, whereas their wholesale customers need to order large quantities for their stock.

Company X wants to configure their products to be sold individually to the influencer customer group, and in pack sizes of 50 to the wholesale customer group.

```text
[
    {
        "customer_group":"base",
        "pack_size":50
    },
    {
        "customer_group":"influencer",
        "pack_size":1
    }
]
```

:::hint{type="info" attributes="[object Object]"}
**Please note**
When the customer group is set to “base”, this applies to all customer groups. In the second array, we specify that the specific customer group “influencer” is set with a pack size of 1.
:::


::::








[title] Product Card Interface
[path] Features/Frontend Interfaces/

## Introduction

The Product Card Interface lets you display B2B pricing and the ability to add products to an order anywhere a "product card" is shown on your website. Typically this includes product collection (or "category") pages, and product upsells.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ZytuhPaPXCLSbbwlBgWZg_image.png)

:::hint{type="success"}
**SparkLayer Interactive Demo**
You can explore how the SparkLayer Product Page Interfaces work in [our interactive demo](https://www.figma.com/proto/5FPCY5hSGl7mlwjsjMZI2t/SparkLayer-Interfaces?page-id=0%3A1\&type=design\&node-id=86-36708\&viewport=554%2C-398%2C0.33\&t=34VlPwbCqpvQOTsh-8\&scaling=min-zoom\&starting-point-node-id=35%3A7920\&hide-ui=1).
:::



***

## How it works

The Product Card Interface replaces your existing website's product card pricing and "add to cart" area with a specially-optimised layout. Once set up, it provides B2B customers an easy way to see their pricing and begin adding products to their order. The interface can show the following information:

| Item               | Details                                                                                              |
| ------------------ | ---------------------------------------------------------------------------------------------------- |
| `Product pricing`  | Their specific B2B pricing and, optionally, RRP pricing                                              |
| `Variants`         | A drop down list of available variants                                                               |
| `Quantity`         | The ability to select the quantity of a product using [Quantity Rules](docId\:CmxfrPgjQxfz9vJzTVv0D) |
| `Add to order`     | The ability to add items to an order                                                                 |
| `Quantity pricing` | Visibility of quantity pricing available                                                             |
| `Stock level`      | The stock status of a product (e.g. pre-order)                                                       |
| `SKU`              | The product code (SKU)                                                                               |



***

## Integrating the code

To add the Product Card Interface to your website, you just need to add a single line of code to the product cards that display on your collection pages.

```javascript
<spark-product-card parent-id="{{ product.id }}"></spark-product-card>
```

Once this is added, the interface will display for all logged in B2B customers and they can begin placing orders.

:::hint{type="info"}
**Please note**
Based on the platform you're using, the variable `product.id` will need to be adjusted to the appropriate setting.&#x20;
:::

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
SparkLayer's Product Card Interface can be installed in three ways on Shopify:

1. **Automatic install** - on [supported themes](https://docs.sparklayer.io/installing-shopify-sparklayer#installing-the-frontend-widgets), the interface is added automatically as a Shopify app block, no code changes required.
2. **Manual install via app block** - on any Online Store 2.0 theme, you can add the SparkLayer Product Card app block directly through your Shopify theme customiser. Go to **Online Store → Themes → Customize**, navigate to a collection or product page, and add the **SparkLayer - Product Card** app block where you'd like it to appear.
3. **Manual install via code** - if your theme doesn't support app blocks, or you'd prefer a code-based install, add the code snippet above to the file that renders product cards on your collection pages.

Our team is also happy to install this for you - see the [Theme setup page](https://app.sparklayer.io/configuration/onboarding) in the SparkLayer dashboard to request a free install.
:::

:::Tab{title="🌐 Other platforms"}
Please refer to guide above
:::
::::



***

## Configurations

SparkLayer supports a wide range of configurations you can apply to the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa). Please see our [full guide](docId\:m3DF4f0Eyc2rM-vUaRG9H) on what's possible!

[title] Form setup
[path] Features/Forms/Form setup/

## Introduction

SparkLayer Forms are built using a simple structure that helps you organise fields, create multi-step experiences, and manage complex data — without making forms difficult to maintain.

This guide explains how forms are structured and how the main components work together.



***

## 🔎 How forms are organised

Every form follows the same structure:

| Level    | Description                                 |
| -------- | ------------------------------------------- |
| `Form`   | The main container                          |
| `Pages`  | Sections within your form                   |
| `Fields` | Individual inputs customers complete        |
| `Groups` | Nested fields used to organise related data |

Forms can be simple single-page layouts or multi-step workflows depending on your needs.&#x20;



***

## 📄 Pages

Pages divide your form into logical sections.

### Single-page forms

Best for shorter forms where customers can see everything at once.

### Multi-page forms

Use multiple pages when:

- You have lots of fields&#x20;
- You want clearer progress through the form&#x20;
- You want to break content into manageable steps&#x20;

### Page properties

| Property     | What it controls           |
| ------------ | -------------------------- |
| `Title`      | Heading shown to customers |
| `Page order` | Controls the form flow     |



***

## 🧩 Fields

Fields are the core building blocks of your form — each one collects information from the customer.

### Common field properties

| Setting         | Description                   |
| --------------- | ----------------------------- |
| `Label`         | Field name shown to customers |
| `Description`   | Optional help text            |
| `Required`      | Makes the field mandatory     |
| `Placeholder`   | Hint text inside the field    |
| `Default value` | Pre-filled content            |
| `Read-only`     | Prevents editing              |
| `Validation`    | Rules applied to input        |

Fields can be:

- **Top-level** — placed directly on a page&#x20;
- **Nested** — inside groups or containers&#x20;
- **Repeatable** — allowing multiple entries&#x20;



***

## 🗂️ Groups & nested fields

Groups help organise related information together.

Example:

:::BlockQuote
Contact Information
\- First Name
\- Last Name
\- Email
:::

### Why use groups?

- Keep layouts clean
- Structure complex data
- Easily apply display logic to multiple fields in one go
- Improve form readability&#x20;

### Repeatable groups

Repeatable groups allow customers to add multiple items — useful for things like:

- Order lines&#x20;
- Locations&#x20;
- Team members&#x20;

Customers can:

- Add new entries&#x20;
- Remove entries&#x20;
- Reorder entries&#x20;



***

## 🔤 Field IDs (advanced)

Every field has an internal ID used for:

- Conditional logic&#x20;
- Workflows&#x20;
- Data references&#x20;

Best practice:

- Use clear, consistent naming&#x20;
- Keep IDs simple and readable
- Prefer short IDs which helps to keep template references short



***

## 📊 How form answers are stored

When a customer submits a form, answers follow the structure you created.

Examples:

| Structure          | Example                                                                                                          |
| ------------------ | ---------------------------------------------------------------------------------------------------------------- |
| `Simple field`     | email                                                                                                            |
| `Nested field`     | contact.first\_name                                                                                              |
| `Repeatable group` | items\[instance1].quantity<br />items\[instance1].sku<br />items\[instance2].quantity<br />items\[instance2].sku |

You typically won’t need to manage this directly — but it helps when building workflows or automations.&#x20;



***

## 💡 Best practices

To keep your forms easy to manage:

- Group related fields together&#x20;
- Avoid overly long pages&#x20;
- Avoid multiple levels of nested groups
- Use consistent naming

[title] Account Credit Request Form
[path] Features/Forms/Use Cases/

Use an account credit request form to let logged-in B2B customers request credit for one or more items from a recent purchase.

This is useful when customers need to report damaged items, missing items, incorrect products, quality issues, pricing issues, or other order problems.

With SparkLayer Forms, you can collect the request from the customer, ask for the right supporting details, review the request internally, and trigger follow-up actions such as emails or API requests.

## What You’ll Build

In this guide, you’ll create a form that lets customers:

- Select a recent purchase
- Add one or more line items they want credit for
- Choose a reason for each line item
- Provide extra details depending on the reason
- Upload photos or supporting files
- Submit the request for review

You’ll also create internal fields so your team can:

- Track the request status
- Assign the request to a team member
- Approve or decline the request
- Record approved credit amounts
- Add internal notes
- Trigger actions when a request is approved or declined

## How the Process Works

A typical account credit request process looks like this:

1. The customer opens the credit request form.
2. The customer selects the purchase they want to query.
3. The customer adds each affected line item.
4. The customer chooses a reason for each line item.
5. The form shows extra fields based on the selected reason.
6. The customer uploads photos or files if needed.
7. The customer submits the request.
8. Your team reviews the request internally.
9. The request is approved, declined, or sent to another system for action.

You can start with a simple version and add more automation later.

A simple version might only collect the request and notify your team.

An advanced version might also use internal approval buttons, automatic credit application to the account on approval, and send data to other systems.

## Before You Start

This setup works best when customers are logged in before opening the form.

That allows SparkLayer to identify the customer and, where available, use their customer data, purchase data, and customer group data.

Before building the form, decide:

- Which purchase or order data customers should be able to select from
- Which credit reasons you want to support
- What evidence is required for each reason
- Who reviews requests internally
- Whether customers should receive confirmation emails
- What should happen after approval or decline

For example, approval might send the request to your ERP, helpdesk, finance system, or customer support team.

:::hint{type="info"}
Please note that as we will use the logged in customer in this form to show the relevant data, it is important to test this form by embedding it on a page (which could initially be private/hidden) on your eCommerce store where SparkLayer Core Script is available and works. The form builder Preview tab will not be able to show the right dynamic purchases options as there is no logged in customer context available.
:::



## Build the Customer Form

Create a new form called **Account Credit Request**.



::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/nVYByWEdqN_Dfz2g7usrb_image.png" size="70" width="1398" height="902" position="center" darkWidth="1398" darkHeight="902" showCaption="false"}

In the form builder, go to **Form** and add the main customer-facing fields.

Recommended fields:

| **Field**                        | **Type**        | **Notes**                                                                               |
| -------------------------------- | --------------- | --------------------------------------------------------------------------------------- |
| Purchase / Order                 | Select          | Let the customer choose the purchase this request relates to.                           |
| Credit request items             | Field Group     | Mark this group repeatable so customers can add multiple line items.                    |
|                                  |                 |                                                                                         |
| **Sub-fields inside the group:** |                 |                                                                                         |
| Reason category                  | Select or Radio | Example reasons: Damaged, Missing, Incorrect item, Quality issue, Pricing issue, Other. |
| Line item                        | Select          | Options should come from the selected purchase.                                         |
| Quantity affected                | Number          | Useful when only part of a line item needs credit.                                      |
| Reason for credit request        | Long text       | Let the customer explain the issue.                                                     |
| Supporting files                 | File upload     | Use for photos, delivery notes, or other evidence.                                      |
| Preferred resolution             | Select or radio | Optional. Example: Credit note, replacement, contact me.                                |

For the repeatable group:

1. Add a **Group** field.
2. Name it **Credit request items**.
3. Enable **Repeatable**.
4. Add the line item, reason, quantity, description, and file upload fields inside the group.

A repeatable group is useful here because one purchase can have more than one item that needs credit.

At this point, the form field setup might look like this:



![Example form fields setup](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VNSj3rj4bHPrbaYVf_Z9T_image.png "Example form fields setup")

## Add Purchase and Line Item Options

The **Purchase / Order** field should use a data source instead of manual options.

For the **Purchase / Order** field:

1. Select the field.
2. Open **Options**.
3. Choose **Data source:**

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/dGeWsH-ySkDUC_rARU4NV_image.png" size="72" width="928" height="484" position="center" darkWidth="928" darkHeight="484" showCaption="false" indent="3"}

4. Click on *"Select data source..."*, then in the reference picker popup click *"See advanced options"* to see all options and not just the form fields:&#x20;

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TetWpKAHafFkV6E31pA0A_image.png" size="92" width="1396" height="806" position="center" darkWidth="1396" darkHeight="806" showCaption="false" indent="3"}

5. Add a reference from SparkLayer purchase data for the current entry customer
   1. `SparkLayer -> Purchasing -> Entry Customer's Purchases` (click Select)
6. Then, choose a clear label, by clicking on "Option label field" reference. For instance you might want to use the `Purchase Identifiers -> Visible ID` field.

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/NODzOLRj-WTKFXrOfrHB3-20260602-135020.png" size="64" width="924" height="318" position="center" darkWidth="924" darkHeight="318" showCaption="false" indent="3"}

For the **Line item** field inside the repeatable group:

1. Select the line item field.
2. Open **Options**.
3. Choose **Data source**.
4. Find the reference for the selected purchase (under advanced options again):
   1. SparkLayer -> Purchasing
   2. Then under "Specific Purchase by SparkLayer ID" input click Reference
   3. Select the Purchase / Order field you setup previously

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/88TaL3mi_grFpRc-8srAG-20260602-135311.png" size="100" width="1410" height="1388" darkWidth="1410" darkHeight="1388" position="center" showCaption="false" indent="4"}

5. Now scroll down and click the Select button for the "All Packages' Line Items" option

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/geN27FkOSOo9QSa5Klm2E-20260602-135433.png" size="90" width="1346" height="682" position="center" darkWidth="1346" darkHeight="682" showCaption="false" indent="3"}

6. Then, choose a clear label for the line item select by clicking on "Option label field" reference button. A good option might be "Line item Identifiers -> SKU".

## Optional: Show Extra Questions Based on Reason

Use display logic to show only the fields that matter for each reason.

Examples:

| Reason                  | Extra fields to show                       |
| ----------------------- | ------------------------------------------ |
| Damaged item            | Photo upload, damage description           |
| Missing item            | Missing quantity, delivery note upload     |
| Incorrect item received | Expected item, item received, photo upload |
| Quality issue           | Description, photo upload                  |
| Pricing issue           | Expected price, explanation                |
| Other                   | General explanation                        |

To set this up:

1. Select the field you want to show conditionally.
2. Open **Display logic**.
3. Add a rule based on **Credit reason**.
4. Choose when the field should be shown.

Example:

Show **Damage photos** when **Credit reason** equals **Damaged item**.



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/dMau5c5-YN2-K3Y0Ltxpa_image.png)

## Add Validation

Add validation rules for important fields.

Recommended validation:

| Field             | Validation                                     |
| ----------------- | ---------------------------------------------- |
| Purchase / Order  | Required                                       |
| Line item         | Required                                       |
| Credit reason     | Required                                       |
| Quantity affected | Required, greater than 0                       |
| Description       | Required for “Other” or complex reasons        |
| Supporting files  | Required for damaged or quality issue requests |

Fields can be marked as required by clicking the checkbox in the Basic Properties tab:

::Image[]{src="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/d6gSDHyEn_QGGsaeMyhW5_image.png" size="54" width="950" height="938" position="center" darkWidth="950" darkHeight="938" showCaption="false"}

To add more advanced validation, use the [Validation Rules](docId\:IjhTAqJO7CzJCRi98gSxf) feature.

## Optional: Add Internal Review Fields

You might handle the review and approval of credit requests in your ERP or other existing system, and in that case you might not need internal admin fields.

However, if you want to manage internal processes for this form inside SparkLayer, you can utilise the Internal Fields feature.

Internal fields are for the administrative users who will be reviewing and working with the form submissions. They are not shown to the customer.

Internal fields show up next to each form submission entry in the SparkLayer dashboard.

Go to **Internal fields** and add fields such as:

| Internal field         | Type           | Purpose                                       |
| ---------------------- | -------------- | --------------------------------------------- |
| Review status          | Select         | New, In review, Approved, Declined, Actioned  |
| Assigned to            | Text or select | Who is handling the request                   |
| Decision               | Select         | Approved or declined                          |
| Approved credit amount | Number         | Amount approved by the reviewer               |
| Reviewer notes         | Textarea       | Internal comments                             |
| External reference ID  | Text           | Ticket, ERP, or finance system reference      |
| Approval button        | Button         | Used to trigger the approval workflow         |
| Decline button         | Button         | Optional button to trigger a decline workflow |



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/2w-2H0p9u9BTE_chdgzKn_image.png)

Internal fields keep the customer-facing form simple while giving your team a structured administrative info fields area.

Customers do not see these internal review fields.

## What Happens After Submission

After the customer submits the form, the request appears as a form entry.

Your team can open the entry, review the submitted details, check uploaded files, and update the internal fields.

A typical internal process might be:

1. Review the request.
2. Set **Review status** to **In review**.
3. Add reviewer notes.
4. Set a decision.
5. Enter an approved credit amount if approved.
6. Click an internal approval or decline button.
7. Let a workflow handle the next action.

## Notify Your Team on Submission

When we created the form, we ticked the "Receive new submission notifications?" toggle. This creates a *"New submission notifications"* workflow which by default sends out new submission email notifications to the store administrator email automatically.

## Optional: Send the Customer a Confirmation

You may also want to send the customer a confirmation email.

You can do this by modifying the "New submission notifications" workflow and adding an extra Email step. See the [Workflows & Automations](docId\:KFk4KgojUGQV3Bolye--b) documentation for more information.

## Optional: Keep Dependent Fields Clean

If the line item options depend on the selected purchase, clear the selected line items when the purchase changes.

This prevents customers from selecting an order, choosing line items, then changing the order while keeping line items from the old order.

Create a workflow called **Reset credit items when purchase changes**.

**Setup:**

| Part          | Value                |
| ------------- | -------------------- |
| Trigger       | Answer updated       |
| Watched field | Purchase / Order     |
| Step 1        | Clear answer         |
| Target        | Credit request items |

**Flow:**

:::BlockQuote
Trigger: Answer updated
↓
Purchase / Order changed
↓
Clear answer: Credit request items
↓
Customer selects line items again from the new purchase
:::

This is a good example of using workflows to keep dependent fields clean and accurate.



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qJo66DCdEH43qr2gybDIt_image.png)

## Approve Requests

Once your team has reviewed a request, you can use a workflow to handle the next action.

For example, clicking an internal approval button can send the approved request to another system, email the customer, and update the entry status.

Create a workflow called **Credit request approved**.

Option A: use an internal button

| Part    | Value                     |
| ------- | ------------------------- |
| Trigger | Internal button clicked   |
| Button  | Approval button           |
| Step 1  | Condition                 |
| Step 2  | API request or Send email |
| Step 3  | Update entry or row       |

Option B: use a status field

| Part          | Value                         |
| ------------- | ----------------------------- |
| Trigger       | Internal field updated        |
| Watched field | Review status                 |
| Condition     | Review status equals Approved |
| Step 1        | API request or Send email     |
| Step 2        | Update entry or row           |

Common approval actions:

- Send the approved request to an ERP or finance system using the API Request step
- Create a support ticket by calling an external API
- Email the customer
- Update the review status to Actioned
- Update the Customer record using the Update Customer step

Please see the [Workflows & Automations](docId\:KFk4KgojUGQV3Bolye--b) documentation for more information.

## Decline Requests

If you want a structured decline process, create a second workflow.

Create a workflow called **Credit request declined**.

Setup:

| Part      | Value                                              |
| --------- | -------------------------------------------------- |
| Trigger   | Internal button clicked, or Internal field updated |
| Condition | Decision equals Declined                           |
| Step 1    | Send email                                         |
| Step 2    | Update entry or row                                |

Common decline actions:

- Email the customer
- Update review status to Declined
- Add an internal note
- Store the date the request was declined

Keep the customer message simple and clear.

If the request needs a personal explanation, ask the reviewer to fill in an internal note and include it in the email.

## Optional: Send Approved Requests to Another System

If your finance, ERP, helpdesk, or support system accepts API requests, you can send approved credit requests to that system automatically.

Use an **API request** workflow step after approval.

The API request can include:

- Customer details
- Purchase or order details
- Requested line items
- Reasons
- Uploaded file references
- Approved amount
- Reviewer notes
- Entry link
- External reference ID

Use the template editor and Reference picker to build the API request payload and insert the right values. You do not need to type reference paths manually - use the [Data References](docId\:Bj9Tb3GN_VYbi1-Ehm4Rd) system.

You can use the template editor Loop function to loop over a list of credit request item repeatable group field, and output the data for each item in the API request JSON payload.

For more advanced use-cases, conditional logic inside the template is also supported.

Here is an example of a JSON request template that you might setup, though it will depend on your specific requirements:

```json
{
    "purchase_id": "{{sparklayer:purchases.purchases[purchase_identifiers.sparklayer={entry:current.answers.order_id}][0].purchase_identifiers.platform}}",
    "returns": [{% for item in {{entry:current.answers.returns}} %}
        {
            "sku": "{{item.sku}}",
            "quantity": "{{item.quantity}}",
            "reason": "{{item.reason}}",
            "images": [{% for img in item.images %}"{{img}}"{% if not forloop.Last %},{% endif %}{% endfor %}]
        }{% if not forloop.Last %},{% endif %}
{% endfor %}]
}
```

Please note that for file attachments, the value of each file will be the SparkLayer file ID. Your external system can use the SparkLayer's [Files API](https://docs.sparklayer.io/tech-docs/get-bulk-files) endpoints to then fetch the actual files in a secure way.

## Publish, Embed, and Test

When the form, internal fields, and workflows are ready, publish your changes.

Then decide where customers should access the form.

Common options:

- Add it to an account page
- Link to it from an order or support page
- Share the form link with selected customers

Use the **Preview** tab to check the customer experience before publishing. Please note that in this case the Preview tab is less useful as it won't have the logged in customer context and so in this case and with any more advanced form, you will need to first embed the form on your eCommerce store within a page where the SparkLayer Core Script is available and customers can login and see the SparkLayer account and cart widgets.

To embed the form, you can use the various options outlined on the **Embed** tab.

## Testing Checklist

Before launching, test the full process.

Check that:

- A logged-in customer can open the form
- The purchase field shows the expected options
- The line item field updates based on the selected purchase, where available
- Changing the purchase clears old line item selections
- Reason-specific fields show and hide correctly
- Required fields block incomplete submissions
- File uploads work as expected
- A submitted request appears as an entry
- The correct internal administrative submission fields are visible next to entries
- Submission notification emails are sent
- Approval and decline workflows run correctly
- API requests send the expected data, if used

Test with more than one customer account if customer-specific purchase data is used.

## Best Practices

- Keep the customer-facing form short. Ask for the purchase, affected line items, reason, and evidence.
- Use a repeatable group for line items. This avoids asking customers to submit separate forms for each item.
- Use display logic for reason-specific fields. Only show extra questions when they are needed.
- Use file upload for evidence. Photos are especially useful for damaged or quality-related requests.
- Use internal fields for review. Do not expose admin-only statuses, notes, or approval decisions to customers.
- Clear dependent fields when source fields change. If line item options depend on the selected purchase, clear line items when the purchase changes.
- Use workflows for background logic, repeatable admin steps and automation. Notifications, approvals, API requests, and status updates are good workflow use cases.
- Start simple. You can launch with manual review first, then add API integrations later.
- Test with real customer accounts. Make sure purchase and line item options show the expected data.

[title] Form Entries
[path] Features/Forms/Entries (submissions)/

## Introduction

Entries are the submissions customers send through your SparkLayer Forms. From the **Entries** area, you can review responses, update data, add any admin internal information against the entry, monitor automation workflows, and manage the full lifecycle of each submission.

Entries remain linked to the form version they were created with — helping ensure data consistency even when forms evolve over time.&#x20;



***

## 👀 Viewing entries

To access submissions:

1. Open the Forms listing page in SparkLayer&#x20;
2. Click **View Entries** in the row matching the form you want

You’ll see a table listing all submissions for that form.

### Entry table overview



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/e0tHX3sltSVxU-bM3hhro_screenshot-2026-04-21-at-160219.png)

The entries table can be configured using Views.

Views allow setting up saved filters and other options to control what entries are shown in the table. You can add as many different views as is needed for different purposes.

By default, each form comes with two views:

**Default View:** shows the Submitted At date-time, and first three fields in each entry.

**All Fields:** shows all columns - this is mostly used for exporting data as a CSV.

You can create a new view or edit existing ones to modify what columns are shown, as well as apply filter criteria to find specific entries.

For example, you might want to setup a "Awaiting Review" view for your registration form.

### Opening an entry

Click any row to open the full entry view. This shows:

- All field responses grouped by page&#x20;
- System metadata&#x20;
- Workflow activity&#x20;
- Attached files&#x20;
- Revision history

The entry view reflects the form version used when it was submitted, so fields always appear in the correct structure.



***

## 🔄 Entry lifecycle & statuses

Entries start with a status of "draft", and remain in that status until the entry is validated, and submitted. At this point the entry changes into the final "complete" status.

For tracking other status information against entries, you can add administrative Internal Fields to your form by going to the Internal Fields form builder tab.

### Logged in SparkLayer customer information

If the form is filled out by a logged in customer (i.e. a customer that has been synced to SparkLayer and has logged in at the time of filling out the form), this customer ID is attached to the entry, and is accessible in form field display logic, default values, as well as  workflow automations.



***

## ✏️ Editing entries

Admins can edit entries after submission — useful for correcting mistakes, updating account details, or continuing internal workflows.

### How to edit

1. Open the entry&#x20;
2. Click **Edit**&#x20;
3. Update any editable fields&#x20;
4. Save your changes&#x20;

### What happens when an entry is edited

When you save changes:

- Field validation runs again&#x20;
- Conditional logic re-evaluates&#x20;
- Related workflows may trigger (depending on setup)&#x20;
- A new revision is created for audit purposes

It is highly recommended to always add a message to specify the reason for the admin edit of an entry.

### Editing restrictions

Some fields cannot be modified:

- Read-only fields&#x20;
- System-generated values&#x20;
- Calculated or derived fields&#x20;
- Locked workflow outputs&#x20;

If a field appears disabled, it is likely controlled by the form configuration or automation logic.



***

## 🧾 Entry revisions

SparkLayer tracks changes made to entries by admin edits automatically.

Revisions help you:

- See who made changes&#x20;
- Restore previous values&#x20;
- Understand workflow updates over time&#x20;

Each revision records:

| Data captured   | Example                  |
| --------------- | ------------------------ |
| `Editor`        | Admin or system          |
| `Timestamp`     | When the change occurred |
| `Field updates` | Previous vs new values   |

This is particularly useful for B2B onboarding or approval workflows where entries evolve over time.



***

## ⚡ Entry actions

### Delete an entry

Removes the submission permanently.

⚠️ Deleting an entry will:

- Remove associated files&#x20;
- Delete workflow history&#x20;
- Cannot be undone&#x20;

Export data first if you may need it later.



***

## 📎 Files & attachments

If your form includes file upload fields:

- Uploaded files appear inside the entry&#x20;
- Click to preview or download&#x20;
- File details include name, type, and size&#x20;

Files remain linked to the entry and follow the same permission rules.

Deleting the entry removes all associated files.&#x20;



***

## 📊 Entry metadata

Each submission stores system-level information.

| Metadata       | Description                                               |
| -------------- | --------------------------------------------------------- |
| `Entry ID`     | Internal unique identifier                                |
| `Entry key`    | Key required to see and edit the entry in the form client |
| `Form version` | Version used at submission time                           |
| `Created at`   | Draft entry creation date - when user started filling out |
| `Updated at`   | Last change timestamp                                     |
| `Submitted at` | When user submitted the entry                             |
| `Status`       | Current entry state                                       |



***

## 🔎 Workflow runs & debugging

The entry view includes a history of workflow runs.

You can see:

- When a workflow started&#x20;
- Whether it succeeded or failed&#x20;
- Duration and logs&#x20;
- Step-level outputs&#x20;

If a workflow fails:

1. Open the failed run&#x20;
2. Check which step failed&#x20;
3. Review input data and error messages&#x20;
4. Correct the entry or workflow and re-run&#x20;

This helps diagnose issues without needing developer access.



***


[title] Features
[path] /

## Introduction

The SparkLayer Frontend comprises a variety of interfaces (or "widgets") that are installed on your website. Once set up, your logged in B2B customers then get an optimised "self-service" experience that makes ordering and managing their account a breeze!&#x20;

:::hint{type="success"}
**🚀 Upgrading to the latest SparkLayer version**
To benefit from our latest updates, please upgrade your [SparkLayer Core Script](https://app.sparklayer.io/integrations/widgets/core). You can learn about how the Core Script works in [our guide here](docId\:QWXsYM9X5_pvIOGUteKcP).
:::

## Frontend Interfaces

The [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) are the specially optimised B2B "widgets" that get shown to your B2B customers once they log in. They are designed to make ordering and managing their account as easy and "self-service" as possible, helping them save time and automating many of the processes and activities you may have previously done manually.

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Sl706YuPabeNu0KDqpauY_cart.jpg)

[My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-)

The SparkLayer My Cart Interface provides your B2B customers with a rapid way to build and place orders on your website. It replaces certain elements of your existing website, providing customers a seamless way to order from you.

:::

:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/XwNQFW-AL-A5DqPxHepcX_account.jpg)

[My Account Interface](docId\:lQXaNI7IVDqna09D9soAP)

When SparkLayer is installed on your website, it automatically replaces your website's existing my account area and allows your B2B customers to keep track of key information about their account, track orders and much more!
:::
::::

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/AGfUECzDPklEfyt9Nf6ru_image.png)

[Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT)

The Product Detail Interface lets your B2B customers quickly and easily add products to their order and automatically loads when a logged in B2B customer visits a product detail page on your website.
:::

:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qWR-wUx4bRzo8vpJbNZmg_image.png)

[Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv)

The Product Card Interface lets you display B2B pricing and the ability to add products to an order anywhere a "product card" is shown on your website. Typically this includes product collection (or "category") pages, and product upsells.

:::
::::

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-qGY2hdtXD-Nn-YPA9mqR_-20241024-080944.jpg)

[Product Matrix Interface](docId:8Go0NYHFDmYnwlJSNfO-S)&#x20;

The Product Matrix Interface lets your B2B customers see your products in a special "matrix table" view making it easy to quickly add products to an order.
:::

:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/OqOZGnuHjZnjFCQowZb-f_slots.jpg)

[Custom Slots ("Targets")](docId\:l_2ooHJiY-rAx2chBMgP2)

Custom Slots (or "Targets") allow you to enhance a range of the SparkLayer Frontend Interfaces
by adding your own custom code in predefined areas.
:::
::::



***

## Features & Addons

Alongside the built-in Frontend Interfaces and customisations, SparkLayer has a number of major features that unlock powerful features for your B2B customers and internal teams.

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/g45guuw88M6ukW-GjPfnu_sales-agents2.jpg)

[Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX)

Sales Agent Ordering is a powerful feature of SparkLayer that lets certain users (Sales Agents) place orders and manage accounts on behalf of your B2B customers.&#x20;
:::

:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/H4kf0K2mSafPaIOY7rY-N_company-users.jpg)

[Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ)

Company Users allows companies to create "teams" of users that can share specific actions within their account, optimising company B2B purchasing.


:::
::::

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-zKk9sCFKzkzbEJnNycb-I-20250321-061508.jpg)

[Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo)&#x20;

The SparkLayer Quoting Engine introduces a unified solution that streamlines the entire "quote-to-order" process for your sales team and B2B customers.
:::

:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fEZAze1iCSqyaIX4P633w-20260224-060955.jpg)

[Forms](docId\:nn5qnfmfGkXlyUmAMpSnq)&#x20;

SparkLayer Forms gives you a simple way to capture, review, and approve wholesale customers - directly from your existing eCommerce store.
:::
::::

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/QWO42aqSwSyyyEMRURWT3-20260430-140131.jpg)

[B2B Catalogs](docId\:plxT_QlDSepZu2YqVuicC)&#x20;

Control which products your B2B and B2C customers see in your store. Tag products as B2B-only or B2C-only, and create tailored catalogs for specific customer groups - free with every plan.
:::

:::VerticalSplitItem

:::
::::



***

## Configurations & Customisations

SparkLayer has support for a wide range of additional [configurations and customisations](docId\:SBEaOaCq_A7FfbTatX8bD)  that you can apply to tailor the B2B experience for your customers.

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[Quantity Rules](docId\:CmxfrPgjQxfz9vJzTVv0D)

Product pack sizing
Minimum quantities
Maximum quantities
:::

:::LinkArrayItem
[Pricing Display](docId\:S_VTlJBorGmnwjjfSMom9)

RRP (MSRP) pricing
Quantity pricing
Unit cost pricing
:::

:::LinkArrayItem
[Stock Display](docId\:Gj_Ao_gQ6oA-jx0D27Hys)

Live stock levels
Pre-order & backorders
Reserving stock
:::

:::LinkArrayItem
[Product Display](docId\:m3DF4f0Eyc2rM-vUaRG9H)

Layout customisations
Product customisations
Quick-buy mode
1-click ordering
:::

:::LinkArrayItem
[Payment Methods](docId\:ibIKczvHM085BkeJIfFYv)

Enable B2B payments
Setting the defaults
Renaming payment methods
Request for quotes
:::

:::LinkArrayItem
[Cart & Checkout](docId\:o3nDhZBCxisWH6M6satDt)

Custom checkout fields
Custom file uploads
Terms & conditions
Customising text
:::

:::LinkArrayItem
[Tax & Shipping](docId\:ZSsXG6FjRLCod_GxoluTN)

B2B-only shipping
Free shipping rules
Tax handling
Product tax rules
:::

:::LinkArrayItem
[Account & Addresses](docId\:xXiWZ30EfVbKXnuF3j1G8)

Custom account fields
Address editing
Address display
Sales statistics
:::

:::LinkArrayItem
[Credit, Net Terms, & Invoicing](docId\:yWm70oQUosyKOoIqb4Z4G)

Credit limits
Account balances
Net terms
Attaching PDF invoices
:::

:::LinkArrayItem
[Customer Pricing](docId\:v8dVUcJ7Ju0fH7BvINrEw)

Customer discounts
Customer price lists
:::

:::LinkArrayItem
[Languages & International](docId\:kLrS7wtxn3WnCDy8z5Zvu)

Supported languages
Locale support
Text overwrites
:::

:::LinkArrayItem
[Automation & Workflows](docId:7kxW1S6TBM57MlpLJn_Uk)

Update order statuses
Sending notifications
:::

:::LinkArrayItem
[Product Settings](docId\:Cm9B1I6Cz0vOlc67g-fJI)

Advanced product settings
Customer-group settings
:::

:::LinkArrayItem
[Timeline & Communications](docId\:Kf-Gd3nHSXlrn2zZvla1Y)

Track communication and activity across all order types
:::
::::


[title] Configurations
[path] Features/

## Introduction

SparkLayer has support for a wide range of additional configurations and customisations that you can apply to tailor the B2B experience for your customers.

:::hint{type="success"}
**🚀 Upgrading to the latest SparkLayer version**
To benefit from our latest updates, please upgrade your [SparkLayer Core Script](https://app.sparklayer.io/integrations/widgets/core). You can learn about how the Core Script works in [our guide here](docId\:QWXsYM9X5_pvIOGUteKcP).
:::

## Explore features

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[Quantity Rules](docId\:CmxfrPgjQxfz9vJzTVv0D)

Product pack sizing
Minimum quantities
Maximum quantities
:::

:::LinkArrayItem
[Pricing Display](docId\:S_VTlJBorGmnwjjfSMom9)

RRP (MSRP) pricing
Quantity pricing
Unit cost pricing
:::

:::LinkArrayItem
[Stock Display](docId\:Gj_Ao_gQ6oA-jx0D27Hys)

Live stock levels
Pre-order & backorders
Reserving stock
:::

:::LinkArrayItem
[Product Display](docId\:m3DF4f0Eyc2rM-vUaRG9H)

Layout customisations
Product customisations
Quick-buy mode
1-click ordering
:::

:::LinkArrayItem
[Payment Methods](docId\:ibIKczvHM085BkeJIfFYv)

Enable B2B payments
Setting the defaults
Renaming payment methods
Request for quotes
:::

:::LinkArrayItem
[Cart & Checkout](docId\:o3nDhZBCxisWH6M6satDt)

Custom checkout fields
Custom file uploads
Terms & conditions
Customising text
:::

:::LinkArrayItem
[Tax & Shipping](docId\:ZSsXG6FjRLCod_GxoluTN)

B2B-only shipping
Free shipping rules
Tax handling
Product tax rules
:::

:::LinkArrayItem
[Account & Addresses](docId\:xXiWZ30EfVbKXnuF3j1G8)

Custom account fields
Address editing
Address display
Sales statistics
:::

:::LinkArrayItem
[Credit, Net Terms, & Invoicing](docId\:yWm70oQUosyKOoIqb4Z4G)

Credit limits
Account balances
Net terms
Attaching PDF invoices
:::

:::LinkArrayItem
[Customer Pricing](docId\:v8dVUcJ7Ju0fH7BvINrEw)

Customer discounts
Customer price lists
:::

:::LinkArrayItem
[Languages & International](docId\:kLrS7wtxn3WnCDy8z5Zvu)

Supported languages
Locale support
Text overwrites
:::

:::LinkArrayItem
[Automation & Workflows](docId:7kxW1S6TBM57MlpLJn_Uk)

Update order statuses
Sending notifications
:::

:::LinkArrayItem
[Product Settings](docId\:Cm9B1I6Cz0vOlc67g-fJI)

Advanced product settings
Customer-group settings
:::

:::LinkArrayItem
[Timeline & Communications](docId\:Kf-Gd3nHSXlrn2zZvla1Y)

Track communication and activity across all order types
:::
::::

## Platform configurations

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-xrelmh2HotG2vOK1xg-YL-20250228-125249.png"}
[Shopify B2B Registration & Login](docId\:Gfc0UW7mJnMNpnNO6EdRl)&#x20;
Setup up a B2B registration form and customise your login page for B2B.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-EymfhHCxjNkVanKt2ndju-20250228-125256.png"}
[Shopify B2B-only Content](docId:30hMTg4Cqqv69EhqNvpnf)&#x20;
Hide products, hide prices, display B2B-only content (e.g. a navigation), and more.
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-cDU6DcNV7ecwgFqOfLuzD-20250228-125429.png"}
[Shopify Flow for B2B](docId\:uvXV1kUg_VsZEPr5Dlb2z)&#x20;
Automate B2B-specific actions within your Shopify store such as email notifications.
:::
::::

:::hint{type="info"}
**Explore more**
See our full list of Shopify configurations in [Shopify Customisations](docId\:ddIv5TDAnCayWTOJ0Vyb7).
:::


[title] Logic & Validation
[path] Features/Forms/


[title] Field types
[path] Features/Forms/Form setup/

## Introduction

Field types define how your form collects information from customers. Each type is designed for a specific input — from simple text fields to structured address or file uploads.

SparkLayer Forms includes a wide range of fields, organised below by category.&#x20;



***

## ✏️ Standard input fields

Use these to collect basic customer information.

| Field       | Best for                              |
| ----------- | ------------------------------------- |
| `Text`      | Names, company details, references    |
| `Email`     | Contact email addresses               |
| `Long text` | Longer notes or requests              |
| `Number`    | Quantities, values, or numeric input  |
| `Phone`     | Phone numbers with country codes      |
| `Password`  | Secure login or gated forms           |
| `URL`       | Link input for websites or other URLs |

These fields support validation such as required values, length limits, or numeric ranges.&#x20;



***

## 📅 Date & time fields

Collect scheduling or timeline information.

| Field         | Use case                  |
| ------------- | ------------------------- |
| `Date`        | Delivery dates, deadlines |
| `Time`        | Appointment times         |
| `Date & Time` | Combined scheduling input |

You can control allowed ranges and availability when configuring the field.&#x20;



***

## 🔘 Selection fields

Use these when customers need to choose from predefined options.

| Field             | Description                         |
| ----------------- | ----------------------------------- |
| `Select`          | Dropdown with one choice            |
| `Multiple choice` | Choose multiple options from a list |
| `Radio`           | Single choice shown inline          |
| `Toggle`          | On/off confirmation                 |
| `Checkbox`        | On/off choice shown as a checkbox   |
| `Slider`          | Numeric range input                 |
| `Country`         | Single country choice               |

Options can be created manually or pulled from structured Data Sources using [Data References](docId\:Bj9Tb3GN_VYbi1-Ehm4Rd).&#x20;



***

## ⭐ Advanced input fields

Designed for richer data capture.

| Field                     | Best for                                                                                                                                                                                                 |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Rating`                  | Feedback or scoring                                                                                                                                                                                      |
| `Signature`               | Agreements or approvals                                                                                                                                                                                  |
| `File Upload`             | Documents, images, attachments. Please note that the value of file uploads is a SparkLayer File ID. Use the [Files API ](https://docs.sparklayer.io/tech-docs/get-bulk-files)to get file download links. |
| `Hidden`                  | Tracking values or internal data                                                                                                                                                                         |
| `Tax Information`         | Fields for collecting tax-related information such as a VAT number, tax ID, etc                                                                                                                          |
| `Workflow Trigger Button` | Button to trigger an automation workflow. Mostly used for internal entry administration fields rather than the main fields form.                                                                         |

Hidden fields are not visible to customers but can store automation or integration data.&#x20;



***

## 🧱 Structured fields

These fields automatically generate multiple sub-fields to keep data organised.

| Field     | What it includes                |
| --------- | ------------------------------- |
| `Name`    | Title, first name, last name    |
| `Address` | Street, city, postcode, country |

Structured fields help keep submissions consistent — especially for B2B account requests or onboarding workflows.&#x20;



***

## 📦 Layout & grouping fields

Use these to organise your form visually.

| Field                               | Purpose                                                                                                                                                             |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Group`                             | Arrange related fields together. Makes it easier to display related fields together, as well as apply conditional display logic at once to a whole group of fields. |
| `Group (with Repeatable option on)` | Allow customers to add multiple entries of a set of fields.                                                                                                         |

Groups help keep long forms structured and easier to complete.&#x20;



***

## 🧾 Content fields (display only)

These fields don’t collect data — they help you guide customers through the form.

| Field       | Use case                 |
| ----------- | ------------------------ |
| `Heading`   | Section titles           |
| `Paragraph` | Instructions or context  |
| `Image`     | Visual guidance          |
| `Video`     | Embedded content         |
| `Button`    | Link or workflow trigger |
| `HTML`      | Custom content blocks    |

Use content fields to improve clarity and reduce form friction.&#x20;



***

## 💡 Best practices

When choosing field types:

- Use structured fields (Name, Address) for consistency&#x20;
- Prefer Select or Radio for predefined choices&#x20;
- Break long forms into grouped sections using Pages
- Avoid collecting unnecessary information

[title] Product Detail Interface
[path] Features/Frontend Interfaces/

## Introduction

The Product Detail Interface lets your B2B customers quickly and easily add products to their order and automatically loads when a logged in B2B customer visits a product detail page on your website.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/xOpit3AbQHYG16nn6zmxv_image.png)

:::hint{type="success"}
**SparkLayer Interactive Demo**
You can explore how the SparkLayer Product Page Interfaces work in [our interactive demo](https://www.figma.com/proto/5FPCY5hSGl7mlwjsjMZI2t/SparkLayer-Interfaces?page-id=0%3A1\&type=design\&node-id=86-36708\&viewport=554%2C-398%2C0.33\&t=34VlPwbCqpvQOTsh-8\&scaling=min-zoom\&starting-point-node-id=35%3A7920\&hide-ui=1).
:::



***

## How it works

The Product Detail Interface replaces your existing website's pricing and "add to cart" area with a specially-optimised layout. It supports a variety of product types, from single variant products, to multi-dimensional products (e.g. colour and size). When a B2B customer visits a product detail page, they'll see this specially-optimised layout and can begin ordering.

:::::Tabs
::::Tab{title="Single Variant Product"}
This is the most simple product type with just a single option to purchase.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/kXqAlbUtTUFs33CtGWgdF_image.png)

:::hint{type="info"}
**What SparkLayer displays**

- Product price specific to the customer (including quantity pricing)
- RRP Price (if set)
- Product SKU (or code)
- Stock availability (including pre-ordering)
- Quantity, including quantity rules (e.g. pack-sizes)
- Add to Order button
:::
::::

::::Tab{title="Multiple Variant Dimensions"}
This interface will render for products that have variants (e.g. colour, size, etc). To make purchasing easy, the variants are displayed in a table format.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DTlW8begYo52EZhRqoUf6_image.png)

:::hint{type="info"}
**What SparkLayer displays**

- Product price specific to the customer (including quantity pricing)
- RRP Price (if set)
- Variant list: primary variant (e.g. colour) and secondary variants that relate to them (e.g. size)
- Pack sizes (if available
- Variant specific price and RRP price
- Stock availability: if a variant isn't available, it will display accordingly. Note: unless the set up allows purchase of out of stock products, the product will display as unavailable if there is no stock
- Quantity, including quantity rules (e.g. pack-sizes)
- Add to Order button

:::
::::
:::::



***

## Integrating the code

To add the Product Detail Interface to your website, you just need to add a single line of code to your product detail page template.

```javascript
<spark-pdp parent-id="{{ product.id }}"></spark-pdp>
```

One this is added, the interface will display for all logged in B2B customers and they can begin placing orders.

:::hint{type="info"}
**Please note**
Based on the platform you're using, the variable `product.id` will need to be adjusted to the appropriate setting.&#x20;
:::

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
SparkLayer's Product Detail Interface can be installed in three ways on Shopify:

1. **Automatic install** - on [supported themes](https://docs.sparklayer.io/installing-shopify-sparklayer#installing-the-frontend-widgets), the interface is added automatically as a Shopify app block, no code changes required.
2. **Manual install via app block** - on any Online Store 2.0 theme, you can add the SparkLayer Product Page app block directly through your Shopify theme customiser. Go to **Online Store → Themes → Customize**, navigate to a product page, and add the **SparkLayer - Product Page** app block where you'd like it to appear.
3. **Manual install via code** - if your theme doesn't support app blocks, or you'd prefer a code-based install, add the code snippet above to your product detail page template.

Our team is also happy to install this for you - see the [Theme setup](https://app.sparklayer.io/configuration/onboarding) page in the SparkLayer dashboard to request a free install.
:::

:::Tab{title="🌐 Other platforms"}
Please refer to guide above
:::
::::



***

## Configurations

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/pdp-all-variants.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

SparkLayer supports a wide range of configurations you can apply to the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa). Please see our [full guide here](docId\:m3DF4f0Eyc2rM-vUaRG9H) on what's possible!


[title] My Account Interface
[path] Features/Frontend Interfaces/

## Introduction

When SparkLayer is installed on your website, it automatically replaces your website's existing my account area and allows your B2B customers to keep track of key information about their account, track orders and view their order history, manage their address book, quickly re-order, and more!

You can try our interactive demo by clicking the video below!

:::Iframe{iframeHeight="0" code="<a href=&#x22;https://www.figma.com/proto/5FPCY5hSGl7mlwjsjMZI2t/SparkLayer-Interfaces?page-id=0%3A1&type=design&node-id=86-36708&viewport=554%2C-398%2C0.33&t=34VlPwbCqpvQOTsh-8&scaling=min-zoom&starting-point-node-id=35%3A7920&hide-ui=1&#x22; target=&#x22;_blank&#x22;>&#xA;<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/interactive-account-demo.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>&#xA;</a>"}

:::



***

## How it works

The My Account Interface replaces your existing website's my account area with a specially-optimised layout. It works as an "overlay" and can be accessed on any page by any of the following ways:

- By clicking the account link, typically in the website's header providing this points to the URL `/account`
- By adding  `#spark-account` to the end of a URL, e.g. `https://www.yourstore.com/#spark-account`



***

## Order History

Each time a customer places an order on your website via SparkLayer, this is then saved within their order history. By default, orders are listed by the most recent first and each gives a full record of their order activity. It's also possible to 'filter' by different order types such as completed orders, or orders that require approval ([learn more](docId:_WwfeWVJY9xrSuNCQlFoZ)).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7guZNsihPpKj86jFz6Ds9_image.png)

All orders will display in the order history, with SparkLayer giving the customer visibility on their specific status (see below). Whether the customer has paid by net payment terms or via online payment, the customer can easily then click the order to see the full details.

:::hint{type="info"}
**Updating the names of order statuses**
If you'd like to update the names of the order statuses shown, [see our guide here](docId\:xXiWZ30EfVbKXnuF3j1G8)
:::

### Order search and filtering

From within the My Account, customers can click "View all" within Recent Activity to see all orders they've placed.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jCnAe4NcrCk4H9VypWBLR_image.png)

It's possible to filter orders by search times as well as time periods, giving an easy way to track orders.

| Filter   | Details                                                                                                         |
| -------- | --------------------------------------------------------------------------------------------------------------- |
| `Search` | Customers can search by:<br />* Order ID
* Purchase Order Number
* Address (first line, second line, city, zip) |
| `Date`   | Customers can filter orders by:<br />* Year
* Time period (within a 365 day period)                             |

### Order details

:::hint{type="info"}
**Please note**
By default, SparkLayer will only show *completed* orders within the My Account. Orders that are in draft (or pending) status will not show in the list.
:::

When a customer views the details of an order, they'll be able to see the following details:

| Item                | Details                                                                                                                            |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `Order Number`      | An order (or quote) reference ID.<br />On Shopify, this number can be [customised](docId\:BxWnGB6b1n7QFfhTnu7pk)                   |
| `Order Date`        | The date the order was placed                                                                                                      |
| `Order Status`      | The order status, e.g. Processing, Shipped, Cancelled based on order status details sent from your website admin or backend system |
| `Payment Status`    | The payment status, e.g. Unpaid, Paid. [Learn more](docId\:ibIKczvHM085BkeJIfFYv)                                                  |
| `Payment method`    | The payment method used to pay for the order, e.g. Pay on Account. [Learn more](docId\:ibIKczvHM085BkeJIfFYv)                      |
| `Address`           | The address the order is being shipped to                                                                                          |
| `Products`          | A summary of all products ordered, organised by order status                                                                       |
| `Totals`            | The order totals including tax and shipping                                                                                        |
| `Shipping tracking` | If supplied, the shipping tracking number for the order. [Learn more](docId\:xXiWZ30EfVbKXnuF3j1G8).                               |

### Offline and archived orders

It's possible to display offline orders within SparkLayer. For example, customers may place orders via your website or over the phone and you want them to be able to view a centralised overview of their entire order history. Please refer to the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT) for more details.

### Invoices

::embed[]{url="https://www.youtube.com/embed/-LeGyR2E3F0"}

Depending on your setup, you can also allow customers to view and download invoices from the order history. Learn more in [our guide here](docId\:yWm70oQUosyKOoIqb4Z4G).

### Order exporting

Customers can export their order activity to a CSV file directly from the Activity view - making it easy to reconcile orders against internal systems, analyse purchasing over time, or share a record with their team.

To export your orders, click "View all" within Recent Activity to open the Activity view, then use the **Download** dropdown in the top right. This dropdown will provide two options, depending on how much detail you need:

| Option                     | What you get                                                                                                                                                    |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Activity`                 | One row per order, with order-level information such as the order number, date, status, and total. Best for a quick overview of orders.                         |
| `Activity with line items` | One row per product line, including product details, quantities, prices, shipping, and tracking. Best for analysing individual products across multiple orders. |

If you use custom fields or line item attributes, these are also included as additional columns in the "Activity with line items" export. Custom field columns are prefixed with `custom_` in the resulting CSV file.

:::hint{type="info"}
**Please note**
When exporting orders, any filters or searches applied in the Activity view will be reflected in the orders shown at the time you download. For example, filtering by "Quote" will export only quotes.
:::

### Order Status

Each order has a "status" that represents the overall status of all the packages included in that order. For example, you may have an order where half the items are shipped and half are still processing. This will show as `Part-shipped`.

You can click on an order to see a list of the packages that are a part of that order and you'll be able to see that status of each individual package. You can find a list of the order statuses below and the circumstances when they show.

| Order Status    | Package statuses                           |
| --------------- | ------------------------------------------ |
| `Processing`    | `Processing` or `Processing` + `Cancelled` |
| `Shipped`       | `Shipped`                                  |
| `Cancelled`     | `Cancelled`                                |
| `Returned`      | `Returned`                                 |
| `Part-returned` | `Returned` + `Processing`                  |
| `Part-shipped`  | `Shipped` + `Processing`                   |
| `Varied`        | All other configurations of packages       |

### Special order statuses

SparkLayer also supports a range of special order statuses that are "SparkLayer-specific". These will not correspond to the order statuses within your eCommerce platform.

| Order Status        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Awaiting Approval` | A limited customer has submitted an order for approval. The main company user has to approve this order.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `Awaiting Merchant` | The order has been placed and is in a "draft" status, waiting for the merchant to accept the order by turning it into a completed order. It's also possible to do this automatically via the [SparkLayer Dashboard](docId\:gznStzTqCRffLFZSTAw0N)<br />When a purchase is internal to SparkLayer, it will use an internal ID. This is the case for purchases that are not in Shopify, e.g. orders for approval, and quotes. You can customise this ID to have a prefix and/or postfix. By default, the prefix is `#P`. This can [be modified here](https://app.sparklayer.io/configuration/settings) |
| `Archived`          | The order has been archived. For example, if a user cancels an order-for-approval before it is approved, it will become archived.                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |



***

## Re-ordering

The re-ordering feature on SparkLayer is a powerful feature that lets customers quickly "duplicate" their previous orders or products ordered. On any order detail page, the re-ordering button can be accessed on the top right giving the customer two options:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/H6Ix1jCPEi30KDOx2TcGw_image.png)

| Option                        | Details                                                                                           |
| ----------------------------- | ------------------------------------------------------------------------------------------------- |
| `Add items as new order`      | This will **replace and remove** the existing Quick Order contents with the products in the order |
| `Add items to existing order` | This will **update** the existing Quick Order contents with the products in the order             |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/wn8MM_6lzo5WQ_HlUMYQz_image.png)

Customers can also individually re-order specific products by clicking the "Order again" button. It's also possible to add products from an entire time period in our [reports feature](docId\:lQXaNI7IVDqna09D9soAP).

:::hint{type="info"}
**Please note**
If products aren't available (e.g. out of stock), these products will not be automatically added unless rules have been configured to allow the ordering of unavailable items.
:::



***

## Shopping lists

The saved shopping lists feature in SparkLayer is a great way for customers to be able to quickly re-order items they've previously saved.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Y4v4SvgOelkLfEl1_KkPH_image.png)

For example, they may have a specific range of products they always order from you or they want to create a 'favourites' list to come back to. Each time a shopping list is saved from the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), these will appear in the main My Account area. The interface includes the following items:&#x20;

| Item           | Details                                                                                                                                                                                                                                                              |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Name`         | This is the name the customer gives the shopping list from the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-)                                                                                                                                                     |
| `Updated date` | The last time the saved shopping list was updated (typically when it was created)                                                                                                                                                                                    |
| `Actions`      | There are two options to choose from:<br />* *Add items to exiting cart:* this will add the shopping list items on top of any items already in the cart
* *Create new cart:* this will remove any existing items in teh cart and add the shopping list items on top. |



***

## Reports

The My Account Interface includes a variety of built in report tools that give your B2B customers visibility on key activities within their account. From within the reports, customers can filter by time period and perform actions such as quickly re-ordering to rapidly place new orders.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/purchase-report.mp4?v=345&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

Available reports currently include the following:

| Report                            | Details                                                                                                                                                                                                                                                                                                                                                                                                    |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Purchase history by time period` | This report gives customers a breakdown of all products they've purchased over a period of time (e.g. by quarter, by month, by week). In a matter of clicks, they can re-order an entire range of products and then proceed through the checkout to complete their order. It's a great way to allow your customers to more rapidly repeat-order and easily see products they've purchased from your store. |

Please note the following limitations for the available reports:

| Limitation    | Details                                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------------------- |
| `Time period` | It is currently only possible to show the **most recent 4 periods&#x20;**&#x66;or a selected time range |
| `Products`    | It is currently only possible to show a maximum of 100 products for a time period                       |



***

## Address book

SparkLayer is able to display available customer addresses both within the My Account Interface and the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-). These addresses are either fed through directly from your website admin or from your backend system (via the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT)).



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/si8Rdvn76jDGyWqSz9rGK_image.png)

The address book interface includes:

| Item               | Details                                                                     |
| ------------------ | --------------------------------------------------------------------------- |
| `Default Billing`  | The default billing address used for orders                                 |
| `Default Shipping` | The default shipping address used for orders                                |
| `Other Addresses`  | A list of all other available addresses which haven't been set as 'Default' |

Any available address can then be selected during the checkout process in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).

SparkLayer also supports full address editing and adding, allowing customers to manage their online address book. Within the My Account interface, customers can simply click the icons next to each address to edit, delete an address, or add a new one.

### Address autocomplete

When a customer adds or edits an address, they can start typing and choose from a list of suggested addresses that automatically fill in the rest of the form. This speeds up address entry and cuts out the errors that come from typing each field by hand - helping orders ship to the right place first time.

Suggestions are weighted towards your store's country, since that's where most of your customers will be based. If a relevant match sits further afield, it will still appear in the results, so international customers can find their address too.

### Region-based address labels

The address form adapts to match the local conventions of the customer's selected country, so it always feels familiar wherever your customers are based. Two things adjust automatically:

- **Field order and labels** - fields reorder and relabel to suit the region. For example, the first name and last name fields switch order in regions where that's the local convention.
- **Region-specific terminology** - labels use the correct local term for each region. For example, customers in Japan see "Prefecture" in place of "Region".

These labels are also translated across all available SparkLayer languages, so each customer sees the right term in their own language.

:::hint{type="info"}
**Customising addresses**
Address management is enabled by default. To see available configurations for addresses, please refer to [our guide here](docId\:xXiWZ30EfVbKXnuF3j1G8).
:::



***

## Account information

The My Account Interface can also display a summary of the customer's information such as their email address, name, company name, and financial details (such as [credit terms](docId\:yWm70oQUosyKOoIqb4Z4G)).&#x20;

This information is taken directly from the customer's details within your website admin or directly from your backend system (via the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT)).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Qmanay4tohJGEtEWxlh5k_image.png)

If you have [credit terms](docId\:yWm70oQUosyKOoIqb4Z4G) set up but you'd prefer to hide the "Financials" section, you can do this by adding the following setting within your [SparkLayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).&#x20;

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
  display: {
    hideFinancials: true,
    /* Other settings should show below */
  },
/* End of code */
```

:::hint{type="info"}
**Adding custom fields**
You can also add custom fields to the My Details screen (such as website address, sales agent contact, etc). Learn more about this [our guide here](docId\:xXiWZ30EfVbKXnuF3j1G8).
:::



***

## Company Users

Company Users is a powerful feature of SparkLayer that allows companies to create "teams" of users that can share specific actions within their account. Sometimes referred to as "company roles" or "sub accounts", this feature is designed to optimise company B2B purchasing and account management. Learn more in [our guide here](docId:_WwfeWVJY9xrSuNCQlFoZ).



***

## Timeline & Communications

The Timeline & Communications feature provides a streamlined way to track communication and activity across all order types within SparkLayer, including [Quotes](docId:8A4OpNIndUyfs3Pup-tuo) (if enabled).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/RV3zbKJMDzSxHtF8KsEn0-20251207-180558.png)

It displays messages, internal notes, and order events, and related email notifications in one centralised area. Learn more in [Timeline & Communications](docId\:Kf-Gd3nHSXlrn2zZvla1Y) .



***

## Quick links to view orders

SparkLayer has built-in functionality that can optionally 'auto-redirect' a customer or sales agent directly to their order or quote details, simply by clicking a link. This is useful in the following scenarios:

| Item              | Details                                                                                                                                                        |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|  `Company Users`  | You're using the [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ) "Limited User" functionality that allows the main user to view and approve an order via an email |
| `Quoting Engine ` | You're using the SparkLayer [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo) and your customers and/or sales agents are accessing a quote via an email            |
| `Sales Activity`  | You're accessing SparkLayer Dashboard [Activity](docId\:Z3BXNIoOm5g6yetty8pZj) area and want to view the details of the order or quote.                        |

To enable this feature, you'll need to add a special script to your website.

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
Within your Shopify store, go to **Online Store**, click **Themes** and edit the code of your live store. Within the closing `</head>` tag, add the following JavaScript.&#x20;

:::CodeblockTabs
theme.liquid

```html
<script async src="https://cdn.sparklayer.io/spark-redirect.js"></script>
```
:::
::::

::::Tab{title="🌐 Other platforms"}
Within your website code, before the closing `</head>`  tag, add the following JavaScript.

:::CodeblockTabs
theme.liquid

```html
<script async src="https://cdn.sparklayer.io/spark-redirect.js"></script>
```
:::
::::
:::::

:::hint{type="info"}
**Please note the following&#x20;**

- This should code should be added and available to all users of your store (whether they are signed in or not)
- If a customer or sales agent is already logged into your store, they will automatically be directed to their order (regardless of whether this script is added).
:::



***

## Re-ordering and hiding sections

If you'd prefer to change the order or hide sections within the My Account area, you can customise this using special code that's added to your [SparkLayer Core Script.](docId\:QWXsYM9X5_pvIOGUteKcP) For example, you may want the customer's "Addresses" to be higher up on the page, or want to move the "My Details" section further down.

To get started, you'll need to add the following code to the `display` section of the SparkLayer Core Script.

```javascript
 display: {
    sectionConfiguration: {
      'my-account': {
        order: [
          'recent-activity',
          'shopping-lists',
          'financials',
          'my-details',
          'reports',
          'address-book',
          'company-users',
        ],
        hide: [
          
        ],
      },
    },
  },
```

::embed[]{url="https://www.youtube.com/embed/7fG35_y1qIc"}

| Name                    | Details                                                                                                |
| ----------------------- | ------------------------------------------------------------------------------------------------------ |
| `spark-slot-my-account` | If you're using [custom slots](docId\:l_2ooHJiY-rAx2chBMgP2), you can reference this in your ordering. |
| `recent-activity`       | The customer's order history                                                                           |
| `shopping-lists`        | The customer's shopping lists                                                                          |
| `my-details`            | The customer's detail summary                                                                          |
| `reports`               | The customer's purchasing history reports                                                              |
| `address-book`          | The customer's address book                                                                            |
| `company-user`          | [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ) within the account (if enabled)                           |

In addition to this, you can also hide sections you don't want to show by updating the below code. In this example, the reports, address book, and company users sections are hidden.

```javascript
 display: {
    sectionConfiguration: {
      'my-account': {
        order: [
          'recent-activity',
          'shopping-lists',
          'my-details',
          'reports',
          'address-book',
          'company-users',
        ],
        hide: [
          'reports',
          'address-book',
          'company-users',
        ],
      },
    },
  },
```

**Hiding sections conditionally**

It's also possible to conditionally apply re-ordering or hiding sections based on basic coding that can be added to your website.

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
If you're using Shopify, you may want to hide certain My Account elements based on a [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ) role (e.g. a limited customer) and you can adjust the code with specific liquid code (as in our example below).&#x20;

:::CodeblockTabs
theme.liquid

```javascript
display: {
    sectionConfiguration: {
        'my-account': {
            hide: [
                {% if customer.metafields.sparklayer.role == 'limited-customer' %}
                    'recent-activity',
                {% endif %}
            ],
        },
    },
},
```
:::

The same principle could be used to hide or show content based on a tag.

:::CodeblockTabs
theme.liquid

```javascript
display: {
    sectionConfiguration: {
        'my-account': {
            hide: [
                {% if customer.tags contains 'b2b-vip' %}
                    'recent-activity', // Hide recent activity if the customer is b2b-vip
                {% endif %}
            ],
        },
    },
},
```
:::
::::

::::Tab{title="🌐 Other platforms"}
Within your website code, before the closing `</head>`  tag, add the following JavaScript.

:::CodeblockTabs
theme.liquid

```html
<script async src="https://cdn.sparklayer.io/spark-redirect.js"></script>
```
:::
::::
:::::



***

## Showing custom content (using "slots")

Custom Slots (or "Targets") allow you to enhance the SparkLayer My Account interface by adding your own custom code in predefined areas.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/3tBkNcGyFECajydjtS6Mu_image.png)

You can learn more in our [custom slots guide here](docId\:l_2ooHJiY-rAx2chBMgP2).



***

## The My Account  URL redirect

When a logged in customer accesses your website's existing my account area (e.g. `/account`), it will redirect them to the SparkLayer My Account interface instead. If you'd prefer, you can change the default handling an&#x64;**&#x20;set a custom URL** to redirect B2B customers to once they log in. You can do this by updating the SparkLayer Core Script on your website. [Learn more](docId\:xXiWZ30EfVbKXnuF3j1G8)



***

## Configurations

SparkLayer supports a wide range of configurations you can apply to the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa). Please see our [full guide here](docId\:SBEaOaCq_A7FfbTatX8bD) on what's possible!

[title] Validation Rules
[path] Features/Forms/Logic & Validation/

## Introduction

Validation rules help ensure the data submitted through your forms is accurate, complete, and usable. Alongside built-in field validation, you can create custom rules to enforce specific business logic — such as matching values or formatting requirements.

Validation runs automatically during form completion and whenever entries are updated, helping prevent incorrect data from reaching your workflows or storefront processes.



***

## 🧱 Built-in validation

Every field type includes basic automatic validation based on its format.

| Field type    | Built-in checks            |
| ------------- | -------------------------- |
| `Email`       | Valid email structure      |
| `URL`         | Valid web address          |
| `Number`      | Numeric value within range |
| `Date`        | Valid date format          |
| `Phone`       | Contains valid digits      |
| `File upload` | File type and size limits  |

These checks run without additional setup, helping catch common errors early.&#x20;



***

## ⚙️ Custom validation rules

Custom rules allow you to define additional conditions beyond standard field validation.

### Adding a validation rule

1. Select a field in the form builder&#x20;
2. Open the **Validation** tab&#x20;
3. Click **Add rule**&#x20;
4. Define the condition and error message&#x20;
5. Save your changes&#x20;

Each rule includes:

| Component       | Purpose                                |
| --------------- | -------------------------------------- |
| `Condition`     | Defines when the field becomes invalid |
| `Error message` | Text shown to the customer             |

:::hint{type="info"}
**Please note**
A rule's error message displays when the condition evaluates to **false** - not when it matches. This means conditions should describe the values you want to **allow**, not the ones you want to block.
:::

For example, if you want to prevent customers from selecting the United Kingdom (because you don't ship there), don't set the condition to "country equals United Kingdom" - this will show the error for every country instead of just the UK. Instead, set the condition to match the countries you **do** ship to (e.g. "country is one of: France, Germany, Spain"), so the error only appears when the customer selects a country outside that allowed list.



***

## 🧠 Types of validation you can build

### 🔎 Simple value validation

Check a field’s own value.

Example:

:::BlockQuote
Must be at least 10 characters
:::

Used for:

- Password strength&#x20;
- Reference numbers&#x20;
- Minimum input requirements&#x20;

### 🔗 Cross-field and Data Reference validation

Compare one field against another, or against other data in the system using [Data References](docId\:Bj9Tb3GN_VYbi1-Ehm4Rd).

Examples:

- Confirm email matches original email&#x20;
- End date occurs after start date
- Purchase ID matches one of the customer's SparkLayer Purchases

This is useful when multiple fields need to stay aligned.



***

## 🔎 Supported validation operators

Validation uses the same logic operators as conditional logic.

### Text validation

| Operator          | Example use          |
| ----------------- | -------------------- |
| `Matches pattern` | Regex format checks  |
| `Contains`        | Must include a value |
| `Starts with`     | Required prefix      |
| `Ends with`       | Required suffix      |

### Numeric validation

| Operator               | Example use      |
| ---------------------- | ---------------- |
| `Greater than / equal` | Minimum quantity |
| `Less than / equal`    | Maximum value    |
| `Equals / not equals`  | Exact match      |

### Length validation

| Operator         | Example use      |
| ---------------- | ---------------- |
| `Minimum length` | Password rules   |
| `Maximum length` | Reference codes  |
| `Exact length`   | Postcodes or IDs |

### Format validation

| Operator                  | Example use            |
| ------------------------- | ---------------------- |
| `Is email`                | Email format check     |
| `Is number`               | Numeric value          |
| `Is integer`              | Whole numbers          |
| `Is alpha / alphanumeric` | Character restrictions |

These allow you to enforce consistent formatting across submissions.

Please note that the availability of operators depends on the type of field you are configuring.



***

## 💬 Writing effective error messages

Clear messages help customers fix issues quickly.

### Recommended approach

- Explain what’s wrong&#x20;
- Show how to fix it&#x20;
- Avoid technical wording&#x20;
- Keep messages short&#x20;

Example:

✅ “Phone number must include area code”
&#x20;❌ “Invalid input”

Dynamic messages can also reference values using templates — for example showing a required minimum value.&#x20;



***

## 📊 Validation states

### Entry validation status

| State     | Meaning                                               |
| --------- | ----------------------------------------------------- |
| `Valid`   | All rules pass - ready to submit                      |
| `Invalid` | One or more rules fail - submitting not allowed       |
| `Pending` | Async validation in progress - submitting not allowed |

### Field-level feedback

Fields may show:

- Error message when invalid&#x20;
- Success indicator (optional)&#x20;
- No indicator before interaction&#x20;

These visual cues help guide customers through completion.&#x20;



***

## 🧾 Common validation patterns

### 📅 Date relationships

Ensure end dates occur after start dates.

### 🔁 Unique selections

Prevent duplicate items in repeatable groups or multi-select fields.

These patterns help maintain clean data across complex forms.&#x20;



***

## 🔗 Validation in workflows

Workflows can extend validation beyond the form itself.

### On submission, form page change, or field update

Workflows can:

- Perform advanced checks&#x20;
- Validate against external systems&#x20;
- Apply cross-form logic&#x20;

### Validation steps

Add conditions inside workflows to:

- Update answers
- Notify teams about invalid data&#x20;
- Trigger follow-up actions&#x20;

This creates a layered validation approach across your entire process.&#x20;



***

## 💡 Best practices

**Layer your validation**

1. Built-in field validation for format&#x20;
2. Custom rules for business logic&#x20;
3. Workflows for advanced checks&#x20;

**Improve the user experience**

- Validate early rather than only on submit&#x20;
- Show clear instructions&#x20;
- Avoid overly strict rules unless necessary&#x20;

**Test thoroughly**

Check:

- Empty values&#x20;
- Edge cases (min/max)&#x20;
- Special characters&#x20;
- Very long inputs&#x20;

**Keep performance in mind**

- Avoid heavy regex where possible&#x20;
- Limit complex cross-field rules&#x20;
- Use workflows for advanced processing&#x20;

These practices help keep forms fast and reliable as they grow.

[title] Conditional Logic
[path] Features/Forms/Logic & Validation/

## Introduction

Conditional logic lets your forms adapt based on customer input. You can show or hide fields, sections, or pages dynamically — helping keep forms shorter, clearer, and more relevant for B2B customers.

Instead of showing every possible field upfront, you can guide users through a progressive experience based on their answers.&#x20;



***

## 🧠 How conditional logic works

Each field can include rules that control when it appears.

When a customer changes a value:

1. SparkLayer checks your conditions&#x20;
2. Visibility updates instantly&#x20;
3. The form adapts in real time&#x20;



***

## ⚙️ Adding conditional logic

To apply logic to a field:

1. Select a field in the form builder&#x20;
2. Open the **Display Logic** tab&#x20;
3. Click **Add condition**&#x20;
4. Choose the field, operator, and value&#x20;
5. Save your changes&#x20;

Each condition follows a simple structure:

| Part       | Description                     |
| ---------- | ------------------------------- |
| `Field`    | The field you want to reference |
| `Operator` | How the value is compared       |
| `Value`    | The condition that must be met  |

Example:

:::BlockQuote
Show "State" when Country equals "US"
:::



***

## 👁 Visibility actions

When creating logic, you decide how the field behaves.

### Show when

The field only appears if the condition is met.

Best used for:

- Region-specific address fields&#x20;
- Optional business details&#x20;
- Advanced settings&#x20;

### Hide when

The field disappears if the condition is met.

Best used for:

- Skipping irrelevant questions&#x20;
- Simplifying long forms&#x20;
- Removing unnecessary options&#x20;

Both approaches help reduce form friction and improve completion rates.&#x20;



***

## 🧩 Building conditions

### Simple conditions

Use a single rule to control visibility:

:::BlockQuote
Show Phone when Contact preference equals "Call"
:::

Multiple conditions

Combine rules using AND or OR logic:

:::BlockQuote
Show Shipping Address when:
Delivery method = Ship
AND Country = United Kingdom
:::

### Condition groups (advanced)

Group multiple rules acknowledges more complex workflows:

:::BlockQuote
Show Discount field when:
(Customer type = Premium OR Order total > 1000)
AND Promotions enabled = true
:::

Condition groups allow more precise control without duplicating fields.&#x20;



***

## 🔎 Supported condition types

SparkLayer supports a range of comparisons so you can build flexible logic.

### Comparison rules

| Use case               | Example               |
| ---------------------- | --------------------- |
| `Equals / Not equals`  | Customer type = Trade |
| `Greater or less than` | Order value > 500     |
| `Numeric thresholds`   | Quantity ≥ 10         |

### Text-based rules

| Use case      | Example                   |
| ------------- | ------------------------- |
| `Contains`    | Email contains “@company” |
| `Starts with` | Phone starts with +44     |
| `Ends with`   | Email ends with .edu      |

### Value checks

| Use case         | Example            |
| ---------------- | ------------------ |
| `Has value`      | Email is not empty |
| `Boolean checks` | Approved is true   |

### Length checks

Useful for validating structured inputs:

- Postcode length&#x20;
- Reference codes&#x20;
- Order numbers&#x20;

These operator types allow forms to respond intelligently to different input patterns.&#x20;



***

## 🔗 Referencing other fields and data

You can build conditions using static values, or [Data References](docId\:Bj9Tb3GN_VYbi1-Ehm4Rd):

- Fields on the same page&#x20;
- Fields on earlier pages&#x20;
- Global (non-repeating) fields&#x20;
- Fields within the same repeatable group instance
- Fields from other forms
- Data table values
- Current logged in SparkLayer customer data

Inside repeatable groups, logic can applies to the current item — helping keep behaviour predictable when customers add multiple entries.&#x20;



***

## 🙈 Hidden field behaviour

When a field becomes hidden:

- It is removed from the UI&#x20;
- Validation rules no longer apply&#x20;
- Required settings are ignored&#x20;
- The value is preserved unless configured otherwise&#x20;



***

## 🧾 Common SparkLayer use cases

### 🌍 Region-based forms

Show different fields depending on country selection.

### ⚙️ Advanced settings

Hide complex configuration options until a toggle is enabled.

### 📦 Progressive disclosure

Gradually reveal extra options instead of overwhelming customers with long forms.

### 👤 Customer dependent forms

Use currently logged in customer data such as IDs, SparkLayer group and role, and other data, to conditionally hide or show sections and fields.





***

## 💡 Best practices

**Keep logic simple**

- Avoid deeply nested conditions&#x20;
- Use clear field labels&#x20;
- Document complex rules for your team
- Utilise the Group field to apply display logic once to a list of sub-fields to reduce duplicated logic

**Test thoroughly**

- Try every condition path&#x20;
- Test with empty fields&#x20;

**Think about UX**

- Don’t hide too much at the start&#x20;
- Give context when new fields appear&#x20;
- Group related logic together&#x20;

**Consider performance**

Very complex logic can slow large forms. If your form grows significantly:

- Break into multiple pages&#x20;
- Simplify nested conditions&#x20;
- Reduce unnecessary dependencies between field

[title] Sales Agent Ordering
[path] Features/

:::hint{type="info" attributes="[object Object]"}
**Please note**
Sales Agent Ordering is available on the SparkLayer *Starter*, *Growth, Pro,* and *Enterprise* plan or as an addon for $39 per agent (per month) *on any plan*.You can [change your plan here](https://app.sparklayer.io/settings/plan) or [learn more](https://www.sparklayer.io/pricing/) about our how pricing works.
:::

## Introduction

Sales Agent Ordering is a powerful feature of SparkLayer that lets certain users (*Sales Agents*) place orders and manage accounts on behalf of your B2B customers. Watch our video below to see how it works!

::embed[]{url="https://www.youtube.com/embed/pAaHBiT-yzY"}

Sometimes referred to as *Order Masquerading,* it's a great way to integrate your sales team and centralise your B2B orders. Once enabled, Sales Agents are able to perform any of the following actions against an existing B2B customer account:

| Action                | Notes                                                                                                                                                                                      |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `View products`       | The Sales Agent can view products on the website at the B2B prices assigned to the selected customer                                                                                       |
| `Add products`        | The Sales Agent can add products to an order                                                                                                                                               |
| `Edit prices`         | The Sales Agent can edit product prices (if they have "Administrator" priveleges)                                                                                                          |
| `Edit shipping costs` | The Sales Agent can set a custom shipping price (if they have "Administrator" priveleges)                                                                                                  |
| `Place an order`      | The Sales Agent can place an order using their available payment methods and request payment from the customer                                                                             |
| `Shopping Lists`      | The Sales Agent can save and edit Shopping Lists                                                                                                                                           |
| `Address Book`        | The Sales Agent Add/edit addresses (if enabled for the customer)                                                                                                                           |
| `Re-order`            | Re-order from an existing order by viewing the order details within the account                                                                                                            |
| `Persistent cart`     | Products that are added to an order will remain in the customers **My Order** until they checkout or make edits. The order will also be saved for the Sales Agent if they come back later. |

In addition to performing actions against an existing B2B customer account, Sales Agents can also:

| Action              | Notes                                                                                                                                                                                                                                                                                                     |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Add new customers` | The Sales Agent can add new customers directly from the frontend, allowing them to then place an order on their behalf right away.<br />*Note: this requires assigning the Sales Agent a special "Sales Administrator" role,&#x20;*[learn more](https://docs.sparklayer.io/sales-agent-ordering#_nmxQ)*.* |



:::hint{type="success" attributes="[object Object]"}
**Want to test out Sales Agents?**&#x20;
Head over to our [B2B Demo store](https://demo.sparklayer.io/pages/b2b-login-register) and give it a go!
:::



***

## Getting set up

Setting up sales agents is straightforward. The process works as follows:

1. Go to Customers → [Agents](https://app.sparklayer.io/v2/customers/agents) in the SparkLayer dashboard.
2. Find the customer you want to make a sales agent and click **View**.
3. Scroll to the **Role** section and select **Sales agent** or **Sales administrator**.
4. Click **Save role**.

Once activated, the sales agent can log into your website and will be presented with the sales agent interface - where they can search for and select a customer, then place orders or manage accounts on their behalf.

:::hint{type="info"}
**Please note**
The customer must already have an active account in Shopify with a b2b tag before they can be assigned as a sales agent.
For details on the difference between the Sales Agent and Sales Administrator roles, see the Roles section below.
:::



***

## Configuring Sales Agents

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
To assign a customer as a sales agent, go to Customers → [Agents](https://app.sparklayer.io/v2/customers/agents) in the SparkLayer dashboard. You can also navigate to Customers, find the customer in the list, and click **View** to open their detail page.

Scroll to the **Role** section and select from the following options:

| Option                | Details                                                                                                                                                                                                                                           |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Customer`            | This is the default role for a customer, allowing them to login and place B2B orders.<br /><font color="#ff6900">**This option means the customer is not a sales agent**</font>                                                                   |
| `Sales Agent`         | This enables Sales Agent access with the ability to action the following on behalf of a customer: place orders, manage addresses, manage shopping lists, and manage company user access.<br />**This option means the customer is a sales agent** |
| `Sales Administrator` | This enables additional Sales Agent controls: the ability to update B2B prices on an order for a customer, the ability to add new customer records to subsequently place orders for.<br />**This option means the customer is a sales agent**     |
| `Custom`              | See "**Sales Agent Roles**" below for guidance on setting up custom roles.                                                                                                                                                                        |

Once you've made your selection, click **Save role** to activate the sales agent.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ujV-Hz0NmUdFUBIP51vRv_image.png)

**Editing sales agents**

To change a sales agent's role or remove their sales agent access, go to Customers → [Agents](https://app.sparklayer.io/v2/customers/agents) in the SparkLayer dashboard, find the agent in the list, and click **View**.

From the **Role** section, you can:

- Change their role between Sales agent and Sales administrator
- Remove sales agent access entirely by selecting **Customer**

Click **Save role** to apply your changes.
:::

:::Tab{title="🌐 Other platforms"}
No configurations applicable
:::
::::



***

## Sales Agent Roles

Sales agent roles let you control what each sales agent can see and do in SparkLayer - so the right people have the right level of access. Instead of managing permissions individually, you can create reusable roles and assign them across your team.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/d1VWkt2IhlVzrFq5Omnbs_image.png)

With roles, you can:

- **Create custom roles** with flexible permissions tailored to specific job functions
- **Use built-in system roles** for quick setup without any configuration
- **Assign one role to multiple sales agents** - keeping your team organised as you grow
- **Update permissions from a single screen** - changes apply automatically to all assigned users

Go to [Customers → Roles](https://app.sparklayer.io/companies/roles) in the SparkLayer dashboard. This is your central place to create, edit, and manage all roles.

SparkLayer includes two system roles out of the box, and you can create as many custom roles as you need.

| Role type                   | Description                                     |
| --------------------------- | ----------------------------------------------- |
| `Sales Agent (system role)` | Standard access for day-to-day selling          |
| `Sales Admin (system role)` | Full access across the SparkLayer app           |
| `Custom roles`              | Create your own roles with specific permissions |

:::hint{type="info"}
**Please note**
System roles cannot be edited or deleted.
:::

**Creating a custom role**

1. Go to Companies → Roles and click **Create Role**
2. Enter a role name
3. Check or edit the handle (this is auto-generated from the name)
4. Select the permissions you want to allow - each permission is shown as a checkbox, so select it to grant access or leave it unchecked to restrict access
5. Click **Save**

**Editing a role**

1. Find the role in the list and click **Edit**
2. Update the permissions as needed
3. Click **Save**

:::hint{type="info"}
**Please note**
Changes apply immediately to all sales agents assigned to that role - there's no need to update each agent individually.
:::

**Assigning a role to a sales agent**

1. Go to [Customers → Agents](https://app.sparklayer.io/companies/agents) in the SparkLayer dashboard
2. Find the sales agent in the list and click **View**
3. Scroll to the **Roles** section
4. Select a role using the radio buttons
5. Click **Save Role**

****
**Permissions you can set**

It's possible to set any of the following permissions against a role.

- Change the price of items that have been quoted to a customer
- Add or modify custom line items on an order
- Override the shipping method or cost on an order
- Bypass product-level rules like minimum order quantities or increments
- Place orders via the normal checkout process
- Create quotes via the checkout
- Edit quotes once created
- Finalise quotes once approved
- Archive quotes when no longer required
- Manage the sales agent assigned to quotes
- Add new customer records to the platform
- Update shipping and billing addresses on a customer's account
- Change which address is set as the default for shipping or billing

:::ExpandableHeading
**Best practises (click to expand)**

- **Create roles based on job function** - for example, a "Sales Rep" role for day-to-day ordering and a "Manager" role with broader access
- **Avoid giving full access unless necessary** - use the Sales Admin system role or a custom equivalent only for users who genuinely need it
- **Review roles regularly** - as your team grows, check that permissions still match how each role is being used


:::

:::ExpandableHeading
**FAQs (click to expand)**

**Can I edit system roles?**&#x20;
No - system roles (Sales Agent and Sales Admin) are fixed and cannot be changed. If you need different permissions, create a custom role.

**Can I assign one role to multiple users?**&#x20;
Yes - roles are designed to be reused. Assign the same role to as many sales agents as you need.

**What happens when I update a role?**&#x20;
All sales agents assigned to that role will automatically receive the updated permissions.

**Can I delete a custom role?**&#x20;
Yes, but only if no sales agents are currently assigned to it. Reassign them to a different role first.
:::



***

## The ordering experience

The key difference in the ordering experience for a Sales Agent versus a standard B2B customer is simply this: the Sales Agent isn't placing an order against their own personal account but instead against **their selected B2B customer.**&#x20;

Once they login, they'll be prompted by a special Sales Agent Ordering search box within the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) that lets them easily search and select a customer. At this point, the Sales Agent will be able to search for **any B2B customer** within your store and place orders on their behalf.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/4puAZ_Efh820ZKypZjJPr_sales-agents2.jpg)

You can also see how the order experience works in our video below.

::embed[]{url="https://www.youtube.com/watch?v=7gVix6BsN64"}

:::hint{type="warning" attributes="[object Object]"}
**Please note**
Only customers that have been tagged as **B2B customers** will show within the search results. Within Shopify, simply add a tag of `b2b` against any customer record. Customers must also always have an email assigned to their account in Shopify. If you don't have an email address, you could always use a test email such as `salesagent123@yourstore.com`
:::

The Sales Agent can search customers by:

- Company Name
- First and Last Name of the customer
- Postcode of their default address
- Accounting ID (if available)

Once they've selected a customer, the Sales Agent is then in 'Sales Agent Mode' with a notification that will follow them around the ordering experience, notifying who they are logged in as.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/QRwJfnuUfPHxeTLO9qtlZ_image.png)



***

## Placing an order

Once logged in as a customer, the Sales Agent can then browse the website and begin adding items to an order. All prices shown will be the prices you've set up for the specific customer using the [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) functionality of SparkLayer.

Once they've added products to an order, they can access the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) at any point and begin the checkout process. Just as with the standard customer experience, they can select an address, shipping method, and see all available payment methods.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/SCZrM596_DUuBkvOSP76P_image.png)

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
To understand the payment flow, the payment methods work as follows:

| Payment Method       | Flow                                                                                                                                    | Status                                                               |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `Pay by Invoice`     | The order is submitted as a **Draft order** within Shopify and then has to be manually acted upon                                       | Order is left in Draft status until the payment is successfully made |
| `Pay on Account`     | The order is submitted as a **Draft order** within Shopify and then has to be manually acted upon                                       | Order is left in Draft status until the payment is successfully made |
| `Pay Online by Card` | The order is submitted as a **Draft order** within Shopify and the customer will **receive a notification** to make payment (see below) | Order is left in Draft status until the payment is successfully made |
| `Request for Quote`  | The order is submitted as a **Draft order** within Shopify and then has to be manually acted upon                                       | Order is left in Draft status until the payment is successfully made |

**Creating Draft Orders**

As noted above, the payment flow works slightly differently to the standard customer experience when placing an order. When a Sales Agent is logged in and places an order, the order will by default enter Shopify in the **Draft order** status with the customer's details pre-selected. Just as with any order in Shopify, you'll see the customer's details on the top right.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/s-UKqYf18JAFSi2vFfouh_image.png)

**Making a payment against an order**

Depending on the payment method used by the Sales Agent, if the customer is required to make payment, they'll receive an **automatic email notification** detailing their order and a button to checkout. This uses the 'Send invoice' feature of Shopify Draft orders and you can learn more about [how this works here](https://help.shopify.com/en/manual/orders/create-orders#share-checkout-link-with-customers).

Once the customer completes their purchase by making payment, the order is then marked as paid and will then display within your **Shopify Orders** area.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VzjkMj9NzFirTHi5t1wJA_image.png)

:::hint{type="info" attributes="[object Object]"}
You can edit this email template by going to **Settings > Notifications** within Shopify and search for the **Draft order invoice** template
:::

If the customer hasn't made payment for any reason or you are processing it manually, within Shopify you can open the order and easily resend or manually mark as paid. Please note, the order will stay as a Draft order until action has been taken.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5S8zfxv_o3DNG93Yl4gLF_image.png)
::::

:::Tab{title="🌐 Other platforms"}
Please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::



***

## Creating new customers

Sales Agents are also able to add new customers directly from the SparkLayer interface, making it easy for them to quickly place an order (versus having to manually set up a customer record within your website's admin area).

To get started, for your selected Sales Agent, you'll need to [follow these steps](docId\:Uw8mDbMEfwWKqZrVB5CqX). When selecting **Customer Role**, choose **Sales Administrator** from the list.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DaDg9mXcRqoEDRuUWzg-p_image.png)

This will activate additional privileges for the Sales Agent, allowing them to create customers on-the-fly the next time they sign into your website. From the main Sales Agent overview page, they'll see the option to **Add a new customer** as shown below.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/nJEAmOaKAITOlZWN-xsWK_image.png)

When **Add a new customer** is clicked, the Sales Agent will then need to complete the basic information for the customer including their First and Last Name, their Email, and their Company.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/O9GZK6AK5MyMaHWjtLzji_image.png)

When the **"Add new customer"** button is clicked, this will then trigger the following actions:

| Account status                                                   | Actions                                                                                                             |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `If the invitee does not already have an account on the website` | This will send the invitee an email asking them to create a password to activate their account and join the company |
| `If the invitee already has an account on the website`           | The customer will be able to login with their existing login details to join the company.                           |

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Preventing notifications being triggered**
If you'd prefer for notifications to **not** be sent when a new customer is created, you can manage this within the SparkLayer Dashboard under [Integrations](https://app.sparklayer.io/configuration/integrations/platform). Simply tick the **"Disable new customer invite email"** to prevent notifications being sent.
:::

For new customers that do not already have an account, they'll receive an email that looks similar to the below. This is an email that is generated via Shopify and can be easily modified. Within Shopify, this uses the "Activate Account" email notification and can be modified within the **Settings > Notifications** area of your Shopify admin.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/rryqxURyzMy8zBPnSKr3k_image.png "An example of an account activation email sent from Shopify")

:::hint{type="warning" attributes="[object Object]"}
**Please note the following**
As part of introducing new customers to your B2B customer base, we recommend informing them of the process detailed above to ensure they are familiar with the steps involved.
:::

:::hint{type="info"}
**Please note the following**
When a new customer is added this way by a Sales Agent, the customer will automatically b&#x65;**&#x20;assigned the same rules** assigned to the Sales Agent. This includes the following:&#x20;

- Price lists
- Discount percentage
- Customer Group
- Sales agent groups (if applicable)

For example, if the Sales Agent has been set up to use price list `ABC`, the new customer will automatically be assigned this **same price list**. This can be modified by subsequently going into the new customer's record and updating as required (e.g. by assigning them an updated customer group tag)
:::
::::

:::Tab{title="🌐 Other platforms"}
No configurations applicable
:::
:::::



***

## Editing prices on-the-fly

Sales Agents have the ability to edit prices "inline" for customers; it's a great way to make ad-hoc price changes or apply discounts without requiring adjustments to price lists.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/sales-agent-edit-prices.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

To get started, for your selected Sales Agent, you'll need to [follow these steps](docId\:Uw8mDbMEfwWKqZrVB5CqX). When selecting **Customer Role**, choose **Sales Administrator** from the list.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DaDg9mXcRqoEDRuUWzg-p_image.png)

This will activate additional privileges for the Sales Agent, allowing them to edit prices on-the-fly the next time they sign into your website. When they add items to a customer's order, they'll see an **Edit** button next to the Unit price to then make changes.

:::hint{type="info"}
**Please note**
It is only possible to **lower** the unit price when editing prices.
:::



***

## Adding custom items

Our new "Add custom item" feature lets your Sales Admins add additional items to a customer's order that sit outside of your general product catalogue.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/YC_y9E_j9HB7LhDkzALdF_image.png)

Use-cases could include adding custom instructions or details specific to an order, additional products (that don't have a specific SKU), or any custom item that needs to be associated with an order. Items can be added at a specific cost or at a zero cost value.&#x20;

To get started, for your selected Sales Agent, you'll need to [follow these steps](docId\:Uw8mDbMEfwWKqZrVB5CqX). When selecting **Customer Role**, choose **Sales Administrator** from the list.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DaDg9mXcRqoEDRuUWzg-p_image.png)

This will activate additional privileges for the Sales Admin, allowing them to add custom items the next time they sign into your website.

To add a custom item to an order, from the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), go to "**Actions**" and select "**Add custom item**". This will then allow the sales agent to enter the following details:

| Item       | Details                              |
| ---------- | ------------------------------------ |
| `Name`     | The name of the custom item          |
| `Cost`     | The per unit cost of the custom item |
| `Quantity` | The number of units                  |

When a custom item is added to the order, it is then possible to edit the unit cost, quantity, and fully remove the item if required.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/voi7JUYAwTIa2dB1GQOl6_image.png)



***

## Setting custom shipping costs

Sales Agents have the ability to set a custom shipping cost for customers; it's a great way to create a specific shipping costs without needing to edit shipping rules or costs behind the scenes.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://cdn.shopify.com/videos/c/o/v/43e6aae0e2424c1483de7369271389e5.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

To get started, for your selected Sales Agent, you'll need to [follow these steps](docId\:Uw8mDbMEfwWKqZrVB5CqX). When selecting **Customer Role**, choose **Sales Administrator** from the list.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DaDg9mXcRqoEDRuUWzg-p_image.png)

This will activate additional privileges for the Sales Agent, allowing them to create a custom shipping cost on-the-fly the next time they sign into your website. When they add items to a customer's order and go through the checkout, they'll see an **Edit** button next to the shipping methods to then make changes.

It's also possible to set a custom message that shows when setting a custom shipping cost. If you'd like to make edits, please refer to the instructions below.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
translations: {
  en: {
    "cart.checkout.shipping-method.custom-method.message": "Set a custom shipping rate for this order to replace default shipping methods.",
  }
},
/* End of code *
```

:::hint{type="info"}
**Please note**
When setting up a custom shipping price, it will be labeled as "Custom Shipping" in your store's admin (e.g. Shopify). If you have backend integrations in place, this label might impact how order data is processed. To ensure smooth operation, we recommend testing this feature beforehand to identify and address any potential issues.&#x20;
:::



***

## Overwriting product settings

For Sales Agents with the "Sales Administrator" customer role (see above), it's possible to edit the product settings of items within an order.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/sales-agent-settings.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

For any products that have pack size or min/max product rules, the Sales Agent can enter "freeform" quantities and increment/decrement the line item quantities as required.

If changes are made to the default settings, the Sales Agent will be prompted to confirm their changes before proceeding to complete the order.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/AA8gzwMXf_Jz08sqLGSkT_image.png)



***

## Placing "personal" orders as a Sales Agent

:::hint{type="info"}
**Please note**
To use this feature, your store must be using version `1.4.0` or above in the [SparkLayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP)
:::

Sales Agents can access their own personal account by clicking the my account icon within the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/sales-agent-tabs.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

Alongside placing orders on behalf of customers, Sales Agents can also add products to their **personal** orders and complete the checkout process independently. Whether it's for buying a product for an upcoming customer demonstration or making a personal purchase at a preferential rate.

When a Sales Agent places a personal order, pricing will be applied based on the price list assigned to their [customer group](docId:5_lWMNohhjBJJppg9E6Vh) within the SparkLayer Dashboard.

:::hint{type="success"}
**Shopping lists**
One great use for the the Sales Agent "personal" account is the [shopping lists feature](docId\:efevur-A3yCJXUHvrR7t-). Sales Agents can create their own shopping lists to save in their account. Once they log in as a customer, they can then access the shopping lists to populate an order. It's a great way to quickly start an order for a B2B customer!

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/kRBIt-g9f2xsDsiE-kWMf_image.png)
:::





***

## Using Sales Agents across multiple devices&#x20;

An additional feature of Sales Agents is the ability to access customer accounts **across multiple devices** using the same Sales Agent login. This means that you can:

- Pick up orders from where you left off
- Manage the same order in parallel across different devices
- Log in as a different customer on a different device whilst using your sales agent account

::embed[]{url="https://www.youtube.com/watch?v=u5AMtONH11k"}



***

## Restricting Sales Agent Access

If you want to restrict which customers a sales agent can see, you can configure this using sales agent groups. This powerful feature gives you full control over how you manage sales agent access - for example, limiting agents to specific territories, regions, or customer types.

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                         |
| ------------------ | ------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields) |
| `Metafield type`   | This must be set as `Single line text` and set to `List of values`              |
| `Namespace`        | This must be set as `sparklayer`                                                |
| `Key`              | This must be set as `sales_agent_groups`                                        |
| `Validation`       | Tick Limit to preset choices and then enter your values                         |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5h0hdyYPNnIYYSLi06REY_image.png)

The values you enter represent how you want to categorise your Sales Agents. Common use-cases may include:

| Example use-case                                    | Example Values           |
| --------------------------------------------------- | ------------------------ |
| Limiting by a territory (e.g. Germany, France, UK). | `germany, france, uk`    |
| Limiting by a geographical region                   | `north-east, south-west` |
| Limiting by a customer type                         | `vip, new-customer`      |

:::hint{type="warning" attributes="[object Object]"}
**Important**: when entering values, make sure to not include spaces. Instead, you can separate using dashes (e.g. `south-east`)
:::

**Assigning Sales Agent Groups to a customer**

Once you've created your Sales Agent Groups, you can then easily assign these to a customer. Within Shopify, search for a customer and then scroll down to the Metafields section. From the Sales Agent Groups option, select the appropriate values and then click Save. Note, it's possible to assign more than one value to a customer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/X5cff9QxpKWhvOGPjzAM__image.png)

**Configuring rules for the Sales Agent**

The final step is to then assign the Sales Agent Group rules to a specific sales agent. This is done through the SparkLayer dashboard. Simply head to "Customer Sync", find your sales agent, and scroll down to "Restrict sales agent access". Then, just enter the groups you would like the sales agent to be able to access. As with customers in Shopify, a Sales Agent can have access to multiple groups.&#x20;

:::hint{type="info" attributes="[object Object]"}
**Please note**
If you leave the field as blank, the Sales Agent will have **access to all customers**.

Any modifications to sales agents/admins must be done through the dashboard. You cannot change the metafields for a sales agent/admin on Shopify. This includes changing their role or sales agent groups they are assigned to.
:::

When the Sales Agent next signs into your Shopify store, they'll then be able to search for customers that match the Sales Agent Group rules you've set up.
::::

:::Tab{title="🌐 Other platforms"}
Please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::



***

## Notifying sales agents of new orders

When a B2B customer places an order, it's possible to also notify the sales agent of any order activity using automations within your eCommerce platform.

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
Using [Shopify Flow](https://apps.shopify.com/flow), you can set up specific triggers to send emails to specific sales agents when an order is placed.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/j_GF5qzktpyUk_A-LxVhA_image.png)

The flow works by detecting an order (or draft order) being placed, checking which sales agent has been assigned to the customer (see "Restricting Sales Agent Access" above), and then sending an internal email.&#x20;

To get started, you can download a [sample Shopify Flow template here](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Sales_Agents_-_Email_sales_agent_when_order_placed_by_customer.flow?v=1726494991).
:::

:::Tab{title="🌐 Other platforms"}
No configurations applicable
:::
::::



***

## Managing Quotes

Do you have Sales Agents who manage quotes on behalf of your B2B customers?

The SparkLayer [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo) introduces a unified solution that streamlines the entire "quote-to-order" process directly from your existing online store. It allows you to handle quotes more effectively, converting them into completed orders faster than ever!

::embed[]{url="https://www.youtube.com/embed/Lmjwg4RK0r8"}

The SparkLayer Quoting Engine works by allowing your B2B customers to easily submit quotes for review, and for your sales team to then communicate with the customer until they're ready to complete their order. Learn more about how it works in [our full guide](docId:8A4OpNIndUyfs3Pup-tuo).&#x20;



***

## Tracking activity&#x20;

When Sales Agents place orders through your store, a range of **additional data** is tracked against the order, from specific tags through to additional notes. This is useful if you want to be able to filter or analyse Sales Agent activity or integrate this into your backend systems. &#x20;

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
To view the available data, you can click into an open Draft order and you'll see the following information. This information will also display on any completed orders once payment has been taken.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/6zb2ME-xLfOVJq4gkoDOD_image.png)

| Data field                   | Details                                                                                                                                                                                                                                |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Shopify tags`               | The following tags will be added against the order:<br />* `agent` (denoting an agent order)
* `agent-[start of email]` (denoting the agent's email)
* `agent-[email domain]` (denoting the agent's email)- b2b (denoting a B2B order) |
| `B2B Sales Agent Account ID` | If the sales agent has an accounting ID assigned, this will display within the order                                                                                                                                                   |
| `B2B Sales Agent email`      | The email address of the Sales Agent                                                                                                                                                                                                   |
| `sparkPaymentType`           | This is captured against all B2B orders, and will also include the payment type the Sales Agent has selected                                                                                                                           |
:::

:::Tab{title="🌐 Other platforms"}
No configurations applicable
:::
::::



***

## Order exporting

Sales agents can export order activity to a CSV file directly from the Activity view, making it easy to analyse customer purchasing patterns and report on sales performance across their customers. Use the **Download** dropdown in the top right of the Activity view to export, with the same "Activity" and "Activity with line items" options available to customers.

For full details on the export options and the fields included, see our [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) guide.



***

## Barcode scanning

Built into SparkLayer is the ability for Sales Agents to easily build orders simply by scanning barcodes via their mobile device. It's a great way to allow sales teams to easily order when they're in-store, at trade shows, or any other location where they have access to product barcodes. You can learn more about this and other time-saving tools in our [Intelligent Cart (AI)](docId\:rIAcYwzOMfwSomd5KB5p8) guide.




[title] Form settings & notifications
[path] Features/Forms/Form setup/

## Public form settings

The "Settings" tab in the form builder allows configuring the following properties:

- **Form title:** The title displayed to users filling out the form
- **Form description:** A brief description or instructions for users filling out the form
- **Submit button text:** Customise what appears on the submit button
- **Success message:&#x20;**&#x6D;essage shown to the user after they submit the form. Supports templates, references, conditions, loops, and HTML.

## Admin settings

These are internal form settings:

- **Internal title:&#x20;**&#x4F;nly visible to admins in the SparkLayer dashboard. Useful to give clear internal name to the form that might differ from a public title.
- **Read/unread tracking:&#x20;**&#x45;nable marking entries as read or unread for this form.



***

## Notifications

When you create a new form, the modal has an option to send new submission email notifications:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/FiPjKivUCsf1hQh3wQNv2_screenshot-2026-04-21-at-123456.png)

When this option is on, a "New submission notifications" workflow is added to the form, which sends an email to the store email address on new submissions.

The workflow can be customised to modify the email address, or add any further logic.

[title] Backend
[path] /

## Introduction

The *SparkLayer Backend* is essentially the mechanism whereby SparkLayer connects your B2B data behind the scenes. If you're using the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT), you can connect your backend systems and automatically send your B2B data to SparkLayer. Alternatively, you can use the manual import tools within the [Dashboard](docId\:nzsx6U_DAWtzVzSehf4oR) to configure your B2B data.



***

## Understanding how SparkLayer connects

If we look at your *current* system architecture, it's likely that your eCommerce platform will be doing the following:&#x20;

- Talking directly to your backend systems (e.g. ERP, CRM, or iPaaS) to synchronise key data such as product information, customer data, order details
- Providing the interface (i.e. a storefront) for retail customers to browse and place orders from

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qTeig-xb8jhzC2vVkYeAy_api.jpg)

SparkLayer sits outside of this, with the SparkLayer [Backend](docId:-jSDFT3oqvpyda2H0Lw16) connecting to B2B-specific data, and the SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) rendering wholesale-specific frontend features.&#x20;



***

## Explore more

::::LinkArray
:::LinkArrayItem
[SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT)
Learn how the SparkLayer API works and what's possible
:::

:::LinkArrayItem
[Building Integrations](docId\:CmZj_EmE3vX8bU3J-xt3L)
Learn how to build your own custom integrations with SparkLayer
:::

:::LinkArrayItem
[Product Settings](docId\:Cm9B1I6Cz0vOlc67g-fJI)
Learn how to configure advanced settings for product data
:::

:::LinkArrayItem
[Data Limitations](docId\:RN0x85hIjIuCz2406Cun9)
Review our recommendations on data limits
:::

:::LinkArrayItem
[SparkLayer Ignite](docId:6b0jvnDWYHE1jmlIqkXtI)
Learn about our B2B Commerce Framework for custom integrations
:::
::::




[title] Building Integrations
[path] Backend/

## Introduction

Are you looking to build your own custom integration to SparkLayer? If you're using the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT), you can connect your backend systems and automatically send your B2B data to SparkLayer.



***

## Understanding how to integrate

For merchants using a backend system (e.g. an ERP or CRM), SparkLayer offers two options to connect to your data source of truth.

| **Direct Connection**                                                                                                                                                                                           | **Middleware connection**                                                                                                                                                      |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Using the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT), you can build an integration to connect SparkLayer directly to your backend system. Implementation requires custom development (in-house or external) | Your existing middleware partner (e.g. an iPaaS) connects directly to SparkLayer to synchronise & map specific B2B data. Implementation is carried out by their technical team |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fOvnvYNOEYTGC-xeW8SQR_image.png)



***

## Available integrations

SparkLayer integrates with a number of leading backend systems which make it rapid to connect your data to send to SparkLayer. [See our full list here](https://www.sparklayer.io/integrations/index.html).

:::hint{type="info"}
**Learn more**
If you'd like to learn more about how SparkLayer interacts with different systems, please speak to our [Support](docId\:NNUw1G9z7eaJ4M78vk7t9) team and we'll be happy to talk further.
:::


[title] Integrations
[path] Dashboard/

## Introduction

:::hint{type="info"}
**Need help setting things up?**
Our team is here to help! Head over to our [Support](docId\:NNUw1G9z7eaJ4M78vk7t9) page to get in touch.
:::

The Integrations section lets you specify which systems you'll be connecting SparkLayer to.&#x20;



***

## Platform Integrations

For listed third-party platforms, this has the added benefit of automatically connecting your website to SparkLayer.

| Platform      | Details                                                                                                                                                                                                                                                                                                                         |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Shopify`     | If choosing [Shopify](docId:7TmhkOEHbgEGGFdd6EMr1), you'll be prompted to enter your Shopify store name (or ID). When you click "Save", you'll be taken off to Shopify to install the SparkLayer app. This will connect your Shopify store to SparkLayer and products and customer data will automatically be synchronised.     |
| `BigCommerce` | If choosing [BigCommerce](docId:6zLPH9x8-qEUITCHs2obE) , you'll be prompted to enter your BigCommerce Store ID. When you click "Save", you'll be taken off to BigCommerce to install the SparkLayer app. This will connect your Shopify store to BigCommerce and products and customer data will automatically be synchronised. |
| `Wix`         | If choosing [Wix](docId\:vEqgPapEA8X0X60U6ZWZe)  , you'll be prompted to enter your Wix Site ID. When you click "Save", you'll be taken off to Wix to install the SparkLayer app. This will connect your Shopify store to Wix and products and customer data will automatically be synchronised.                                |
| `Custom`      | If choosing Custom, you'll need to manually send SparkLayer all necessary data. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) to learn more.                                                                                                                                                                                |

:::hint{type="success"}
**Setting up a test environment**
With SparkLayer [Test Mode](docId\:y74DZm4NK61rsUZwJ3Vcn)**,** you can configure a live and test environment.
:::

### Order Actions

You can additionally configure specific order actions for your store.&#x20;

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
| Setting                                           | Details                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Automatically complete Shopify draft orders`     | If you're using manual payments (such as Payment by Invoice) these will be default enter the Shopify admin as **Draft orders**. This setting allows you to automatically mark these as completed and the orders will instead show in the **Shopify Orders admin** as soon as they are placed                                                                                                                           |
| `Automatically mark Shopify draft orders as paid` | For new draft orders, the payment method will be set as payment pending. It's possible to automatically mark these orders as paid allowing you to process the orders faster. To enable this, first tick the 'Automatically complete Shopify draft orders' toggle, then choose from the following settings;Payment on Account orders - automatically mark as paidPayment by Invoice orders - automatically mark as paid |
:::

:::Tab{title="New Tab"}
Not applicable
:::
::::



***

### Configure metafields

Within the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/integrations/platform), you can speed up the creation of metafields using our built-in tool to automatically configure them.

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
To get started, go to **Integrations, Platform Connection** and click **Configure** within the **Configure metafields** section. You'll then see all available metafields that can be configured for **Product** and **Customer** data.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/77PPtnle394bKNefuREm4_screenshot-2025-03-07-at-060054.png)

When a metafield is enabled, this will automatically be added to the [Custom Data](https://admin.shopify.com/settings/custom_data) section of your Shopify admin and will be 'pinned' for easy access when configuring metafields for products or customers.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/U8TldaNsA4KK5Zvo_vfGB_image.png)

Any metafields automatically created by SparkLayer in this way will be prefixed with `B2B - [name]` for example `B2B - Pack Size`

Should you need to modify or remove metafields, you can manage this via the [Custom Data](https://admin.shopify.com/settings/custom_data) section within your Shopify store.
:::
::::



***

## Partner Ingrations

SparkLayer supports a number of partner integrations that you can manage within the SparkLayer Dashboard. To see all available integrations, please see [Integrations](docId\:Eewk4JDEtPwyhjhrTwlvp). &#x20;



***

## Data Sync

To learn more about how the Customers Sync and Products Sync work, see [Data Sync](docId:8XClbafeyxHtt5begKM58) &#x20;



***

## Widgets

The Widgets section guides you through installing the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) on your website. There are the following key steps:

- Installing the Core script
- Installing the product page scripts
- Customising the Design by using CSS

You can read our full guide on how this works in our [Frontend Integration Guide](docId\:QWXsYM9X5_pvIOGUteKcP).



***


[title] Account Settings
[path] Dashboard/

## Introduction

The **Account** section in the Dashboard lets you manage your basic account details used on SparkLayer, update your password, and manage team members who have access to your SparkLayer Account.



***

## My Account

From the My Account tab, you can edit the following information:

| Field           | Details                                                                                                                                                |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Name`          | Your full name                                                                                                                                         |
| `Email address` | Your email address used for logging into the SparkLayer Dashboard                                                                                      |
| `Company Name`  | The company name registered with SparkLayer                                                                                                            |
| `Website`       | The website address registered with SparkLayer                                                                                                         |
| `Site ID`       | This is used in setting up the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) and the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT) (if enabled) |

:::hint{type="warning" attributes="[object Object]"}
At this time, it is **not** possible to edit the fields pertaining to your company information. These are intrinsic to SparkLayer operating and any edits may cause errors within the SparkLayer integration. If you do need to make changes, please [contact us here.](https://forms.clickup.com/f/4b3cj-134/QGWV5GH8KV7KHQEBUS)
:::



***

## Plan

From the Plan tab, you can check the current plan you're on as well as available options to upgrade or downgrade.&#x20;

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
If you're using Shopify, **all billing** is processed via Shopify directly. If you change plan, you'll be taken off to the Shopify admin to confirm the change and then processed monthly via Shopify.
:::

:::Tab{title="🌐 Other platforms"}
No configurations applicable or necessary
:::
::::



***

## Enterprise plan

If you're using the Enterprise plan, you'll see your monthly cost within the **Plan Summary**. As with the Starter and Professional Plan, all payments are managed via Shopify directly.&#x20;

:::hint{type="info"}
**Learn more**
Looking to learn more about the Enterprise plan? [Get in touch](https://www.sparklayer.io/?demo#contact) with our team and we'll be happy to discuss further.
:::





***

## Password

The Password tab lets you modify your existing password used for logging into the SparkLayer Dashboard. It's also possible to perform a password reset via the [SparkLayer login page](https://app.sparklayer.io/forgotten-password).



***

## Team

### Inviting team members

If you're looking to invite additional people to your SparkLayer account, you can do so within the Team section.&#x20;

:::hint{type="warning" attributes="[object Object]"}
Please note, only Team Owners can invite team members to collaborate on an account.
:::

To get started, click the 'Add team member' button and you'll then see the following form:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jJJwKdvoQY8mB2aJRsAGO_image.png)

From here, you can set the email address of the person you'd like to invite to your dashboard. They'll be granted full access to your dashboard to make edits as required.

When you invite a team member, they'll then receive an email to activate their account. They'll be asked to "Accept Invitation" and create an account to get started.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ZBl1kj2jvq0KkNHo747AA_image.png)

### Creating a new team

:::hint{type="info"}
**Please note**
Any teams you create will be associated with your main SparkLayer account details. You can use these details to access any teams you set up.
:::

If you're looking to use SparkLayer on more than one store, it's possible to create a brand new instance of SparkLayer using our built-in **"Create New Team"** feature.&#x20;

Use-cases could include:

- You want to trial SparkLayer in "development mode" to allow you to test the features of SparkLayer
- You have multiple stores within your brand and you require SparkLayer account for each of them

In each scenario, once you've created a team you can then proceed to invite other team

To access this, go to the [SparkLayer Dashboard](https://app.sparklayer.io/) and click your current team shown on the top left. You'll then see a button "Create New Team".&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-fkfGlPmIf3TMcjYuM0yc--20240813-074839.png)

You'll then see the option to setup your team with the ability to specify a **Company Name&#x20;**&#x61;nd **Company Website**.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/YjAA2mHMQj5rkLE4qjknw_image.png)

Once you've created your team, you can access this via the top left of the SparkLayer Dashboard whenever you sign in. When a new team is created, you'll then need to proceed through the SparkLayer onboarding steps to get things setup (you can learn more in our [Launching SparkLayer](docId\:YUfghEGoxe_h7uJfcshna)).&#x20;

You can also proceed to invite any other team members to your new team by following the "Inviting team members" guide above.

### Changing Team Owner

If you're the current team owner, it's possible to assign ownership to another individual via the [Team section](https://app.sparklayer.io/settings/team) of SparkLayer.

Once you've invited a team member to the account, simply click the **Change owner** button where you'll then be asked to confirm this action.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/u8Jc_pyOFSRJRuCH-cmhX_image.png)



***

## Deleting your account

Currently it's not possible to delete your SparkLayer account via the Dashboard. By default, if an account becomes inactive (e.g. you disconnect SparkLayer from your online store), our system will **automatically** delete the account associated with that team after 30 days.

If an account is scheduled for automatic deletion, you'll see a warning message at the top of the dashboard notifying you.

:::hint{type="warning"}
**Please note**
If you have **multiple** SparkLayer accounts, you may encounter this warning message on any accounts that do not have an active store connected with them. To make sure you're signed into the correct SparkLayer account, please click the menu beneath the SparkLayer logo on the top left and choose the appropriate store.
:::

For further information, please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.





***

## Accessing the Dashboard

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
**Accessing the SparkLayer Dashboard via your Shopify admin**

To make accessing your dashboard more convenient, we've introduced a feature that **automatically** logs you into the team owner's SparkLayer Dashboard account linked to your Shopify app installation.

For security reasons, if the email you use to log in to Shopify **differs** from the email associated with the SparkLayer team owners email, you will be logged in with **restricted access**. This limited access means you won't be able to:

- Changing to other teams
- Managing teams
- Managing account details

If you need full access to the dashboard, please log out and log back in using the team owner's credentials.
:::

:::Tab{title="🌐 Other platforms"}
No configurations applicable or necessary
:::
::::


[title] Shipping
[path] Dashboard/

## Introduction

SparkLayer allows you to set shipping rules for your B2B customers that show when they place an order via the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zKpYf2PZLwbtiEBIwNhci_image.png)

There are two ways to manage your B2B shipping via SparkLayer:

::::WorkflowBlock
:::WorkflowBlockItem
**Using the shipping methods already set up on your store**
You can use your pre-existing shipping methods as set up on your eCommerce store, even if you're using a third-party app to manage this. This is useful if you want to keep your shipping configuration within your eCommerce store and/or you have complex shipping requirements
:::

:::WorkflowBlockItem
**Using SparkLayer's shipping system**
You can use SparkLayer to **set your own B2B shipping rules** that you can vary based on the B2B customer group. This is useful if you're running DTC and B2B on the same store and you want a simple way to differentiate your DTC versus B2B shipping rules.
:::
::::



***

## Understanding the differences

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
**Using your eCommerce store**

✅ **ADVANTAGES**

- Uses the shipping admin of your existing eCommerce platformand will use rules and configurations you've set up (e.g. specific country/state-level shipping rules)
- Handling for more complex shipping rules

⛔️ **DISADVANTAGES**

- May not have support B2B-only shipping methods, unless using an app
:::

:::VerticalSplitItem
**Using SparkLayer**

✅ **ADVANTAGES**

- Define B2B shipping rules that vary based on customer group type
- Handling for order value and weight





⛔️ **DISADVANTAGES**

- Support for only basic shipping types
- Managed outside of your eCommerce platform's shipping admin
:::
::::



***

## Using your eCommerce Store

*Please click a tab below to learn more*

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
Out of the box, SparkLayer uses the Shopify shipping setup. If you need help with setup, we recommend reading their guide [here](https://help.shopify.com/en/manual/shipping/setting-up-and-managing-your-shipping) or contacting Shopify support. Shopify live shipping rates or apps which provide shipping rules can also be used and the information will be pulled through.

**Varying shipping for B2B / DTC customers in Shopify**

Shopify has limitations in how shipping can be customised meaning that it's **not possible** **natively** to vary Shopify shipping methods and rules based on different customer types. For example, you may want a special 'B2B shipping method' to show when a B2B customer starts the checkout process.&#x20;

The solution to this is to use a **recommended Shopify** **app** to achieve the desired effect.

Within the Shopify app store, there are a number of tools that include powerful functionality to enable more customer shipping on your Shopify store. One such is called [Intuitive Shipping](docId\:ZkesmMUAWX2SQQ7j6as07).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/buRU1l8DPxN--A2bbaOJM_image.png)

The app works by allowing you to set up special shipping rates and rules **based on customer tags**. For example, when a B2B customer signs in (i.e. one assigned with a customer tag of `b2b`), their specific B2B shipping methods can then be applied successfully.

:::hint{type="info" attributes="[object Object]"}
**Please note**
If you're using Intuitive Shipping, we will need to enable a special setting to ensure the full shipping rates load within the SparkLayer widget. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) to enable this for you.
:::

**Changing shipping rates after an order is placed**

You may want to change the shipping charges **after** the order is placed. If orders are left as drafts within Shopify or the customer uses the 'Request a Quote' payment option, it's possible to **adjust the shipping rate** to a custom amount. You can learn how this works [here](https://help.shopify.com/en/manual/orders/create-orders#add-shipping).

This means that you could technically allow customers to select your *standard* Shopify shipping methods and then simply edit the shipping amount **once they've placed an order.**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zHP6BPdTjEgD_cRu9u_xs_image.png)

**How shipping works in the SparkLayer Frontend**

When a customer adds items to an order, the SparkLayer Frontend will automatically display their shipping rates as defined in your [Shopify Shipping admin](https://help.shopify.com/en/manual/shipping/shopify-shipping), giving them an accurate overview of their order cost. The user-journey works as follows:

1. The customer adds products to their order
2. When they're ready to checkout, they select their preferred shipping address
3. On the summary screen, they'll then be given their available shipping method to select (as you've set up within your Shopify shipping admin)
4. Once they select a shipping method, they'll be given their final total, including tax

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/XUbP3V54Z4ZZWNQ2G7k-l_image.png)

If you'd like more details on how shipping works on Shopify, please refer to [Support](docId\:PGHGYVUTEu4gwwXNLAQl0).

**Enabling an alternative to local pickup**

Shopify allows merchants to enable a special shipping method called **'local pickup**' that allows customers to choose a store (or location) to pick their order up from. If you're using this feature on your Shopify store, unfortunately SparkLayer doesn't yet have direct support.

An alternative that can work for merchants is to simply create a new shipping method within Shopify called 'Local pickup' that allows B2B customers to select during the checkout process on SparkLayer. Setting this up works just the same way as you would do when creating/editing other shipping methods with Shopify. Simply go to the shipping admin (`yourstore.myshopify.com/admin/settings/shipping`) and follow the steps to create a new shipping method and associated rates.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DK76g4CbqNSGbjDRCumUr_image.png)

Once added, this will then display within the SparkLayer interface.&#x20;

:::hint{type="info" attributes="[object Object]"}
**Please note**
Unless you're using an app to hide/show shipping methods for B2B customers, this shipping method will show for regular (DTC) customers placing orders via the standard Shopify checkout process. To make this show **only for B2B customers**, you can configure your shipping rates directly in SparkLayer (see below).
:::
::::

:::Tab{title="🌐 Other platforms"}
No configurations applicable
:::
:::::



***

## Using SparkLayer

SparkLayer has support for a variety of different shipping rules, allowing you to offer your B2B customers customised shipping rates that will show when they place an order on your website. To get started, within the SparkLayer Dashboard go to **Configuration** and click **Shipping** and you'll see the **Shipping** section.

### How Shipping Rates work

Within your eCommerce platform, it's likely that you already have a variety of Shipping Rates set up. The Shipping section within SparkLayer is designed to **replicate this set up** ensuring that shipping rates synchronise correctly between systems.&#x20;

For example, your backend system may have a shipping rate set up whereby customers from the United Kingdom get **free shipping when spending over £100**. Within SparkLayer, this exact rule can be replicated allowing the customer to have a seamless experience when using the SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) and using the checkout.

### Shipping Method & Shipping Bands

Broadly speaking, when configuring your shipping it's important to understand the following terminologies:

| Type              | Details                                                                                                                                                                            |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Shipping Method` | This is the shipping method the customer will see in their order summary and during the checkout process, e.g. Standard Shipping. Shipping Methods are assigned at a Country level |
| `Shipping Band`   | These are the specific rules you have within each Shipping Method. e.g. for orders under £100, shipping costs £20. For orders over £100, shipping is free.                         |

### Shipping Methods

To create your first Shipping Method, click the **Create new method** button and you'll then see the following screen:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/OBUAAlHZXjkAqdbeJ8dZj_image.png)

| Item                  | Details                                                                                                                                                                                                                                                                                        |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Method Name`         | This is the name the customer will see during checkout process so should be clear and easy to understand (e.g. Standard Shipping, Next Day Shipping, etc)                                                                                                                                      |
| `Shipping SKU`        | This can be anything as long as it's unique across your shipping methods. For example, if the shipping method is called "Express Shipping", you could use express-shipping. Note: if you're using our API, this ID must match the corresponding shipping SKU in your backend system (e.g. ERP) |
| `Priority Order`      | If you are using multiple shipping methods, you can set which order they show in.  e.g. enter "1" to make it show as the first, "2" as the second, etc. You will need to apply this to all Shipping Methods                                                                                    |
| `Available countries` | Which countries will trigger this shipping method during the checkout process                                                                                                                                                                                                                  |
| `State (or Region)`   | For certain countries, you can optionally specify a specify state (or region/territory). Currently this includes: United States, Canada, Australia                                                                                                                                             |
| `Customer groups`     | Which B2B customer group(s) the shipping method applies to                                                                                                                                                                                                                                     |

Once you've completed this information, you can then then begin adding Shipping Bands

### Shipping Bands

Shipping bands let you define rules for the shipping method you've just created, allowing you to create different charges based on criteria being met. Currently, SparkLayer has support for:

- Shipping bands based on **order total (NET)**
- Shipping bands based on **order weight (in grams)**

:::hint{type="info" attributes="[object Object]"}
**Please note**
Configuring Shipping Bands based on order weight will always be in grams, regardless of the unit of weight that you've set on products in Shopify admin. If you are using any other unit of weight (e.g oz or lb), then you will need to convert this into grams to use in our shipping tool.&#x20;
:::

Click **Add new band** to get started and you'll then see the following screen:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/cEbcS9vIf1X2cmfWOV75o_image.png)

| Item                    | Details                                                                                                    |
| ----------------------- | ---------------------------------------------------------------------------------------------------------- |
| `Shipping Band Name`    | This is an internal name you can give the shipping band, e.g. Orders under £99                             |
| `Shipping SKU`          | If your backend system has support for shipping band SKUs, you can enter it here                           |
| `Shipping Cost Type`    | You can choose from: <br />* Free
* Fixed price
* Percentage of the Net Total
* Custom Message (see below) |
| `Applicable Conditions` | Here you can set how the shipping band gets applied, e.g. based on a net total or a total order weight     |

For example, if you're looking to set up a shipping band that charges £20 for orders under £99, this would look like the following:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-a9HHxNGkka6RqpiTWdi5_image.png)

### Custom Shipping Message

Using the "Custom Message" shipping cost type (see above), it's possible to show custom text for a specific B2B shipping method. For example, you may want your B2B customers to select a shipping method but you can't confirm the cost at this point.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/6bH5mgb6FUIbEFt18X4eK_image.png)

The messaging works by taking the **Shipping Band Name** (e.g. "Standard Shipping) and then displaying a special language string as the cost. When the order is placed, the shipping cost is simply set to 0.00, allowing you to then make edits accordingly.

To customise the shipping cost message, you can add a special language string to your website to amend as you require. Once you set up a shipping band with a custom message, you'll see a **Language String** field at the bottom (e.g. "standard-shipping"). This can then be added as shown below to your website.&#x20;

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* [shipping-band-name] should be replaced with the name of your Shipping Band set in lowercase and uses dashes between words */
translations: {
  en: {
    "shipping.custom-message.standard-shipping": "To be confirmed",
  }
},
/* End of code *
```

### Setting custom shipping rates with Sales Agents

If you're using the [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) tool, sales agents with "Administrator" priveleges can set custom shipping rates during the checkout that overright any default shipping rules you may have set up.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://cdn.shopify.com/videos/c/o/v/43e6aae0e2424c1483de7369271389e5.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

To learn more about how this works, see [our guide here](docId\:Uw8mDbMEfwWKqZrVB5CqX).&#x20;

### Testing your Shipping Rates

Whether you're using the Shopify shipping methods or custom methods via SparkLayer, once you've created your Shipping Methods and assigned Shipping Bands, you will then see these reflected in the [Quick Order Interface](docId\:lX4_OMChJ6reQ4hIW-Fqn) and checkout process.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/hmlyHPPSwY7_-dDbxjiP0_image.png)

We recommend trialling a few scenarios during your testing to make sure the shipping methods display as required.



***

## Troubleshooting

:::ExpandableHeading
**Shipping options not appearing for B2B customers**

If shipping methods are not showing during checkout, check the following:

- Ensure shipping methods are correctly configured in your e-commerce platform and assigned to the relevant regions.&#x20;
- If you are using SparkLayer Shipping Rules, confirm the method is enabled for the correct Customer Groups.&#x20;
:::

:::ExpandableHeading
**Shipping bands (based on weight or order value) not calculating correctly**

If shipping costs appear incorrect:

- Confirm your shipping bands are set to the correct calculation type (Order Total or Order Weight).&#x20;
- Weight-based rules must always be set in grams.&#x20;
- Review each band to make sure there are no missing or overlapping ranges.
:::

:::ExpandableHeading
**Local Pickup not displaying**

- We do **not** support the Shopify Local Pickup option. If you want to display this to your wholesale customers then you will need to create this as a free shipping method within Shopify or SparkLayer depending on what one you are using.&#x20;
- Confirm the method is available for the regions you are testing.
:::

:::ExpandableHeading
**Shipping not matching the shipping bands&#x20;**

- Verify that the shipping rules are configured for the criteria you expect (e.g., weight-based vs. order-value-based).
- Check that all products have valid weight and price data so calculations can be applied correctly.
:::

:::hint{type="warning"}
**⚠️ Having technical issues?**
If you're having issues with setting this up or are experiencing error messages, please refer to our [Troubleshooting](docId\:BlCEkkx3I30nkUcglsfw7) guide or contact our [Support](docId\:NNUw1G9z7eaJ4M78vk7t9)
:::


[title] Automation & Workflows
[path] Features/Configurations/

## Automatically mark orders as paid

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
By default, when you set up SparkLayer on your Shopify store, unless you're using 'Upfront Payment', all orders created by customers will be generated as Draft orders within Shopify (learn about [Shopify Draft Orders](https://help.shopify.com/en/manual/online-sales-channels/wholesale/channel/orders/process-orders)). You can access these in the Shopify admin by clicking Orders and then Draft Orders.

One of the big benefits of using Draft orders is the ability to make changes before you then take payment and fulfil. For example, you may need to adjust quantities of products ordered or apply a special shipping method.

It's possible to automatically mark these orders as paid and then process them like any other order via the SparkLayer Dashboard under [Settings](https://app.sparklayer.io/configuration/integrations/platform).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/y4aAbl9DYpEYOenngokvo_image.png)
:::

:::Tab{title="🌐 Other platforms"}
No configurations applicable
:::
::::



***

## Sending email notifications for draft orders&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
If your customers are placing orders and paying by manual payment methods (such as *Pay by Invoice* or *Request for Quote*), these orders will automatically come through to Shopify as Draft orders. By default, Shopify **doesn't notify you of Draft orders** but there are some great ways to solve this. One such way is to use [Shopify Flow](docId\:uvXV1kUg_VsZEPr5Dlb2z), a free app made by [Shopify](http://apps.shopify.com/flow). This allows you to create workflows to automate many tasks in your store and across apps.

In our [Shopify Flow for B2B](docId\:uvXV1kUg_VsZEPr5Dlb2z) guide, you can find some ready-made "Flow templates" that can help automate your email notifications.

Another option would be to use the highly popular Shopify app called [Mechanic](https://apps.shopify.com/mechanic), which is a **development and automation platform** available to all Shopify merchants. Similarly to [Shopify Flow](https://apps.shopify.com/flow), it gives the flexibility to automate actions to suit your own business workflows. We've provided a sample below that you can simply set up within Mechanic.

If customers have opted to pay via manual payment methods, you can automatically **send an email to a specified email address** to notify them to review the order.

:::ExpandableHeading
**View sample code&#x20;**

```json
{"docs":"For newly-created draft orders which are quotes from Sparklayer, it sends an email.","halt_action_run_sequence_on_error":false,"name":"SparkLayer - Send email for new quote","online_store_javascript":null,"order_status_javascript":null,"perform_action_runs_in_sequence":false,"script":"{% if options.email_recipient__email %}\n  {% assign email = options.email_recipient__email %}\n{% else %}\n  {% assign email = shop.email %}\n{% endif %}\n\n{% assign sparkPaymentType = draft_order.note_attributes[\"sparkPaymentType\"] %}\n{% if sparkPaymentType == 'quote' %}\n  {% action \"email\" %}\n    {\n      \"to\": {{ email | json }},\n      \"subject\": \"New quote {{ draft_order.name }}\",\n      \"body\": \"View the quote here: https://{{ shop.domain }}/admin/draft_orders/{{ draft_order.id }}\",\n      \"reply_to\": {{ shop.customer_email | json }},\n      \"from_display_name\": {{ shop.name | json }}\n    }\n  {% endaction %}\n{% endif %}","shopify_api_version":"2022-10","subscriptions_template":"shopify/draft_orders/create","subscriptions":["shopify/draft_orders/create"],"preview_event_definitions":[],"options":{"email_recipient__email":null}}
```


:::
::::

:::Tab{title="🌐 Other platforms"}
No configurations
:::
:::::

:::hint{type="success"}
**Learn more about Shopify Flow**
You can see our full Shopify Flow guide in our [Shopify Flow for B2B](docId\:uvXV1kUg_VsZEPr5Dlb2z) guide.
:::


[title] Customers
[path] Dashboard/

# Introduction

The Customers area is where you manage everything related to your B2B customer base and sales team. From here, you can:

- **Groups** - configure customer groups with specific ordering rules - such as price lists, payment methods, order limits, and additional settings. [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;
- **Customers** - view and manage your B2B customer records, including their assigned groups, price lists, and account details. [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;
- **Agents** - set up and manage your sales agents, including assigning roles and controlling which customers they can access. [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;
- **Roles** - create and manage roles that control what each sales agent can see and do in SparkLayer. [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;



***

# Groups

The **Customers Groups** section is the heartbeat of your SparkLayer integration and allows you to manage the ordering rules for your customers.

It's common for B2B customers to have terms agreed when they place orders with you. For example, brand new customers may only be allowed to pay via credit/debit card, whereas long-term customers may have more favourable payment terms.&#x20;

The Customer Groups section lets you define specific rules for specific customer groups, giving you flexibility in how your B2B customers order online. This includes:

- Setting which price lists they use
- Setting which payment methods they can use
- Setting order limit rules (e.g. minimum and maximum order totals)
- Setting additional settings (such as blocking the ability to edit an address)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VCpaeUVexzGyLicOpq8_U_image.png)



***

## The default customer group

By default, SparkLayer has a **Base customer group** that is a catch-all for all your B2B customers. If you're looking to have just a single B2B customer group then the **Base customer group** will be sufficient. Any changes you make will automatically apply to all your B2B customers unless you create new customer groups.

:::hint{type="info" attributes="[object Object]"}
**Understanding 'Inheriting'&#x20;**&#xA;When you see **Inheriting** in a customer group, it means it will **inherit** settings from another customer group, by default the "Base". For example, if your Base customer group is set to a specific price list or has specific payment methods, any new customer groups you create will start off by **using these same settings**. You can easily modify this by simply clicking the *Edit icon* and changing them as you need.
:::



***

## What can be configured

It's possible to configure the following rules&#x20;

| Rule type                | Description                                                                                                                                                                                                                               |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Order Limits`           | You can set order limit rules for your customers, such as the minimum **order total&#x20;**&#x6F;r minimum **quantity of items&#x20;**&#x74;hey must reach before being able to place an order (and conversely, the **maximum** of these) |
| `Payment Methods`        | The payment methods that the customer will see when they checkout. For example, "Payment on Account" and "Payment by Invoice".  See also [Payment Methods](docId\:ibIKczvHM085BkeJIfFYv)                                                  |
| `Price Lists`            | The [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) that are assigned to that customer group. For example, you may have different price lists per customer group                                                                                  |
| `Address Management`     | If activated, your customers will be able to edit and add addresses via the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) and the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).                                               |
| `Credit Settings`        | If you have [credit limits](docId\:yWm70oQUosyKOoIqb4Z4G) set up, you can optionally choose to prevent customers from being able to checkout if they exceed their credit limit.                                                           |
| `Stock Display Settings` | Configure if stock levels and units are displayes ans your max, low and last stock values.                                                                                                                                                |
| `Stock locations`        | If you're store is set up with multiple stock locations ("inventory locations"), you can specific which location the B2B customer orders from.                                                                                            |
| `Quoting engine`         | If you have the SparkLayer [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo) activated, you can specify which customers can submit quotes.                                                                                                    |

### Order Limits

There are two types of order limits you can set for your B2B customers:

| Order Limit Type                 | Details                                                                                                       |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `Order limits by order total`    | Set rules based on the customers order total, e.g. the customer must spend more than $100                     |
| `Order limits by order quantity` | Set rules based on the number of items in the customers order, e.g. the customer must have at least 50 items. |
| `Combination`                    | Set rules based on both an order total AND the order quantity                                                 |

**Order limits by order total**

To configure order limits by order total, click the **Edit** icon next to a customer group and under the **Inherited rules** section, click **Order total limits**.

If the customer group doesn't already have an order limit set, click the **plus** icon and then the order limit values you want.

| Limit type | Details                                                                              | Example                                                       |
| ---------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
| `Minimum`  | This is the minimum order total the customer must have before being able to checkout | The customer must have an order total of at least $200.00     |
| `Maximum`  | This is the maximum order total the customer must have before being able to checkout | The customer must have an order total of no more than $400.00 |

:::hint{type="info"}
**Please note**
All order values are in **net** pricing (i.e. excluding tax calculations)
:::

Once you've set this, when you access the Quick Order on the frontend, you'll then see corresponding messaging show on the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/yNLXfYebH53R2-pDAAR82_image.png)

If you'd prefer to change the default language that is shown, you can use the below language strings.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "cart.validation-message.minimum-order-totals": "Your order must be more than {amount} to meet the order requirements.",
    "cart.validation-message.maximum-order-totals": "Your order must be less than {amount} to meet the order requirements.",
  }
},  
/* End of code */
```

**Order limits by order quantity**

To configure order limits by order quantity, click the **Edit** icon next to a customer group and under the **Inherited rules** section, click **Order quantity limits**. If the customer group doesn't already have an order limit set, click the **plus** icon and then the order limit values you want.

| Limit type | Details                                                                                 | Example                                                           |
| ---------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| `Minimum`  | This is the minimum order quantity the customer must have before being able to checkout | The customer must have an order quantity of at least 12 items     |
| `Maximum`  | This is the maximum order quantity the customer must have before being able to checkout | The customer must have an order quantity of no more than 40 items |

Once you've set this, when you access the Quick Order on the frontend, you'll then see corresponding messaging show on the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/4OHMMQIJ3WFz2FwYjeOXG_image.png)

If you'd prefer to change the default language that is shown, you can use the below language strings.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "cart.validation-message.minimum-order-item-quantity": "Your order must have at least {minimum} items to meet the order requirements.",
    "cart.validation-message.maximum-order-item-quantity": "Your order must not exceed {maximum} items to meet the order requirements.",
  }
},  
/* End of code */
```

### Payment Methods

You can specify what payment methods are shown for each customer group by clicking the **Edit** icon next to a customer group and under the **Inherited rules** section, click **Payment methods**. You'll then see the following options:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/A52eRTAlNzTc1jOmW4jy__image.png)

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info" attributes="[object Object]"}
**Payment methods in Shopify**

By default, when you set up SparkLayer on your Shopify store, unless you're using 'Upfront Payment', **all orders** created by customers will be generated as **Draft orders** within Shopify (learn about [Shopify Draft Orders](https://help.shopify.com/en/manual/online-sales-channels/wholesale/channel/orders/process-orders)). One of the big benefits of using Draft orders is the ability to make changes before you then take payment and fulfil.&#x20;
:::

| Payment method       | Description                                                                                                                                                                                                                                                                         |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment by invoice` | The order will be submitted as a "Draft" order which can subsequently be edited. Orders can automatically be converted into "Completed" orders if required. See [Settings](docId\:gznStzTqCRffLFZSTAw0N)                                                                            |
| `Payment on Account` | The order will be submitted as a "Draft" order which can subsequently be edited. Orders can automatically be converted into "Completed" orders if required. See [Settings](docId\:gznStzTqCRffLFZSTAw0N)                                                                            |
| `Upfront Payment`    | Customers will be taken through the Shopify checkout.                                                                                                                                                                                                                               |
| `Request for quote`  | The order will be submitted as a "Draft" order which can subsequently be edited.<br />*Please note: as of June 2025, this has been replaced with the &#x20;*[SparkLayer Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo)*&#x20; and can no longer be selected within a Customer Group.* |
::::

:::Tab{title="🔵 Using Wix "}
When customers reach the payment step, they'll see a variety of available payment methods and can select their preference.

| Payment method       | Description                                                                                                                                                                                                                                                            |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment on Account` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** needing to enter any payment details (e.g. via net terms). [Learn more](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                           |
| `Payment by invoice` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** having to enter in payment details.                                                                                                                                             |
| `Pay Online by Card` | **👪 For the B2B customer:**<br />The customer will be directed to your **standard checkout process&#x20;**&#x61;nd will be required to make payment right away (e.g. by card or via another payment processor). This is sometimes referred to as "Pro-forma payment". |

**How orders arrive into Wix**

Depending on which [payment method](docId\:ibIKczvHM085BkeJIfFYv) you've selected, orders will arrive into Wix in the following ways:

| Payment Method       | Flow                                                                                                                                                                                                                                                       |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Pay by Invoice`     | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                |
| `Pay on Account`     | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                |
| `Pay Online by Card` | The order will be created within **Sales > Orders** with a payment status of "PAID". You can then proceed to fulfil the order. Note: this is termed "Upfront Payment" within the [Customers](docId:5_lWMNohhjBJJppg9E6Vh) area of the SparkLayer Dashboard |
| `Request for Quote`  | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                |

**"Unpaid" orders and "Paid" orders**

By default **all payment methods** other than Upfront Payment will be generated as "Unpaid" orders.&#x20;

**Wix checkout payment methods**

If a customer selects "Pay Online by Card" (i.e. "Upfront payment"), they'll be directed to the Wix checkout. By default, they will see all Wix payment methods you have set up (e.g. card payment, Paypal, etc).&#x20;
:::

:::Tab{title="🌐 Other Platforms"}
| Payment method       | Description                                                                                                                                                                                                                  |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment by invoice` | This will allow the customer to place an order without having to enter payment details                                                                                                                                       |
| `Payment on Account` | Similar to above, the customer can place an order without needing to enter any payment details                                                                                                                               |
| `Upfront Payment`    | The customer will be required to enter credit/debit card details and will see the payment methods you have set up during the checkout process. This is sometimes referred to as Proforma payment within wholesale operations |
| `Request for quote`  | The customer can submit their order without choosing a payment method. The order will be marked as a 'Draft' order and can subsequently be edited.                                                                           |
:::
:::::

When the customer activates the [Quick Order Interface](docId\:lX4_OMChJ6reQ4hIW-Fqn), they'll see whichever payment methods are allowed and can then select as appropriate. You can also edit how these are named in [Quick Order Interface](docId\:lX4_OMChJ6reQ4hIW-Fqn).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/94S_C_UJdbaDcb-__G74O_image.png)

### Price Lists

Depending on which price lists you have set up in the [Price Lists](docId\:lDePanHogqwEGNf-jHZ6L) section, you can assign specific price lists to customer groups. Click the **Edit** icon next to a customer group and under **Inherited rules**, click **Price lists**. If the customer group doesn't already have a price list set, click the plus icon and then choose the available Price List from those shown.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bnRVZdK1bWkL_HlE_ym3o_image.png)

You can also assign **multiple price lists&#x20;**&#x74;o a customer group if you want to set up more sophisticated pricing. Simply click **Add price list** to select a price list.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/wYv3m9ZZfekqsnWkUw8qE_image.png)

:::hint{type="info"}
**Please note**
In terms of pricing, if a product SKU exists in multiple price lists, SparkLayer will search through all available price lists and use the first one it finds. For example:

- Product `ABC-123`exists in 3 price lists
- In `Price List 1`, it is **$10**
- In `Price List 2`, it is **$8**
- In `Price List 3`, it is **$12**

SparkLayer will select the first price it finds. In this case, product `ABC-123` will be shown to the customer at a **price of $10**, using `Price List 1`
:::

### Address Management

If activated, your customers will be able to edit and add addresses via the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) and the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/kq3L90Akn5jnOla_fJFlo_image.png)

You can also optionally choose to prevent billing address editing by unticking "Allow customers to add and edit billing addresses".

:::hint{type="warning"}
**Please note**
If you've set up SparkLayer to automatically synchronise addresses from another system (e.g. an ERP), these may override updates your customers make. Please contact us if you're unsure.
:::

### Credit Settings

If you have [credit limits](docId\:yWm70oQUosyKOoIqb4Z4G) set up, you can optionally choose to prevent customers from being able to checkout if they exceed their credit limit.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VknOptmxcgX7crO_5sXpV_image.png)

### Stock Display Settings

:::hint{type="warning"}
**Please note**
This feature requires upgrading your store to the latest version of the [the Sparklayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
:::

If you'd like to display stock levels to your B2B customers, you can activate the **Stock display** and customise how this works. When a customer visits a product page on your store, they'll then see their specific stock display settings as detailed in [our guide here](docId\:Gj_Ao_gQ6oA-jx0D27Hys).

To get started, edit a customer group and under Inherit rules, click **Stock display.**

:::hint{type="success"}
**Applying this to all customers**
If you want to apply this to all customer groups, simply apply the setting to the **Base** customer group and all others will 'inherit' the settings.&#x20;
:::

Once activated, you can then configure how the stock display works:

| Configuration                          | Details                                                                                                                                                                                                                              |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Show stock availability to customers` | When enabled, customers can see the stock status of the product (and individual SKU)                                                                                                                                                 |
| `Hide pre-order`                       | When enabled, this will hide any pre-order messaging shown to customers in the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa). You can learn more about how pre-order works in [our guide here](docId\:Gj_Ao_gQ6oA-jx0D27Hys).  |
| `Show number of units of stock`        | When enabled, customers can see the availability of the product (e.g. 50 in stock)                                                                                                                                                   |
| `Max`                                  | When `Show number of units of stock` is enabled, this will show to the customer in green. Anything above will show as 50+                                                                                                            |
| `Low`                                  | When `Show number of units of stock` is enabled, this will show to the customer in amber and denotes low levels of stock                                                                                                             |
| `Last`                                 | When `Show number of units of stock` is enabled, this will show to the customer in red and denotes the last remaining stock                                                                                                          |

:::hint{type="success"}
**Looking to enable pre-ordering?**
You can enable pre-orders and back orders in [our guide here](docId\:Gj_Ao_gQ6oA-jx0D27Hys)&#x20;
:::

### Stock locations ("inventory locations")

:::hint{type="warning"}
**Please note&#x20;**&#xA;The stock locations feature is **only** available on the SparkLayer *Growth, Pro,* and *Enterprise* plan. You can [change your plan here](https://app.sparklayer.io/settings/plan) or [learn more](https://www.sparklayer.io/pricing/) about our how pricing works.
:::

Stock locations allow you to specify which stock (or "inventory") locations you want specific customer groups to see stock display settings from. If your B2B store is set up with **multiple stock locations** (e.g. by geography), it's a great way to ensure your B2B customers are viewing stock dispaly settings from the relevant location.

For example, your store may be set up with 4 stock locations across the world. Using this feature, you can easily assign B2B customers to a specific geographic location, so that they can only see stock display from their specific region.

To begin using stock locations, click the **Edit** button next to a customer group and you'll see the option under the **Inherit rules** section.&#x20;

:::hint{type="info"}
**Default stock location**
Please note, if stock locations are **not** specifically set, SparkLayer will assume that stock will be taken across **all locations&#x20;**&#x73;etup within your store.
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/J55OoOzaP93oXlQHLTC5-_image.png)

:::hint{type="info"}
**Please note**
Currently, it's only possible to select **one stock location** per customer group.
:::

:::hint{type="warning"}
**Please note&#x20;**&#xA;SparkLayer's Stock Location feature is for stock display purposes only and will not affect which stock location is used to fulfill orders in your eCommerce platform.
:::

Using stock locations requires configuration within your specific eCommerce platform and we've detailed how it works below.

::::::Tabs
:::::Tab{title="🛍️ Using Shopify"}
To get started, you'll nee to ensure that [Locations](https://admin.shopify.com/settings/locations) are enabled within your Shopify store. You can learn more about how locations work in this [Shopify guide](https://help.shopify.com/en/manual/locations). Any active locations will then be automatically synchronised to SparkLayer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/M8sDSm1gxYBL__B0tKpPt_image.png)

There are a number of configurations that need to be reviewed when setting up your locations in the context of your B2B customers.

::::WorkflowBlock
:::WorkflowBlockItem
**Fulfilment details**
You'll need to ensure any locations that you want to use for your B2B customers have the "Fulfill online orders from this location" checkbox ticked.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/uDBk9Px987pLesNTfsKBJ_image.png)
:::

:::WorkflowBlockItem
**Order routing**
You may also want to review how Shopify prioritises your stock locations using [order routing,](https://admin.shopify.com/settings/shipping/order_routing) allowing you to customise the workflow rules for your stock control.


![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/AHYuz6NM7-7yN4Vr_Fxn2_image.png)
:::

:::WorkflowBlockItem
**Store setup (hybrid B2B and DTC)**
If you're store is set up to "share" B2B and DTC on the same store, it's important to note the following if you're using Stock locations:

1. Logged in B2B customers will be able to purchase products from the stock locations you've assigned to them. For example, if a customer has the **"London Warehouse"&#x20;**&#x61;ssigned to their customer group and **Product A** has 100 available from this warehouse, they can order a maximum of 100.
2. Setting up stock locations for your B2B customers will **not** prevent your regular (DTC) customers from purchasing the same stock. Depending on how your Shopify store is configured, regular customers can still access the same stock and place orders. SparkLayer does support the ability to reserve stock and set minimum stock levels and you can [learn more here.](docId\:Gj_Ao_gQ6oA-jx0D27Hys)
:::
::::
:::::

:::Tab{title="🌐 Other Platforms"}
Please refer to our technical documentation, [Stock Locations](docId\:who9uQj6ZLDP88g2XWdau)
:::
::::::

### Disable checkout

By default, all customer groups are configured to allow customers to proceed through the checkout (providing they meet the order requirements). There may be some scenarios where you want to prevent a customer from being able to checkout and you can deactivate this within the "Disable checkout" setting. If you're using the [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo), one use-case would be to deactivate this setting and only allowing the customer to "Submit a quote".



***

## Creating new customer groups

New customer groups allow you to create different rules for different customers. When you create a new customer group, you'll see the following screen where you can enter a **Display Name** and a **Handle**. The Handle is a unique identifier that you can then use in your eCommerce platform (e.g. Shopify) to match with (see below for more details).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/eJnGi1NW1AAyjbT4geq3u_image.png)

## Synchronising customer data

:::::::Tabs
:::::Tab{title="🛍️ Using Shopify"}
:::hint{type="warning" attributes="[object Object]"}
Please note:

- You need to **always** tag a customer with `b2b` even if you are assigning them to an additional customer group
- Customers cannot have **more than two** `b2b` related tags assigned to their customer record in Shopify. For example:
  ✅ This is correct `b2b` `b2b-vip`
  ❌ This is incorrect `b2b` `b2b-vip` `b2b-user`
:::

For your Shopify store to recognise the customer rules you set up in SparkLayer, it uses the **customer tag** feature within Shopify. Once a customer in Shopify is tagged, when they sign into your Shopify store they will see their unique B2B ordering rules such as pricing and payment methods.

For the most simple set up, if you're using just the **Base** **customer group**, you can synchronise your customer rules with Shopify by simply tagging customers with `b2b` as shown below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/rxYDGfrmD7ogzNt0GerrH_image.png "How customer tags show in Shopify for a customer record")

If you've set up **additional** customer groups, the process works as follows:

::::WorkflowBlock
:::WorkflowBlockItem
First, within SparkLayer create your customer group and give it a unique Handle, e.g. `vip`
:::

:::WorkflowBlockItem
Under the Shopify Tag column, make a note of tags that are shown. You'll note there is an additional tag to b2b, so in our example, the tags we want to note are `b2b` and `b2b-vip`
:::

:::WorkflowBlockItem
Find the customer record in Shopify and assign it the tags shown. So for our example below, if you wanted to assign them to the VIP group, you would tag them in Shopify with `b2b` and `b2b-vip`. If the tag doesn't already exist in Shopify, you can simply create is as a **new** tag which can then be assigned to other customers.
:::
::::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ZTMZtJ4415Fpc4HNI-Q7j_image.png "How customer tags are then assigned in Shopify")

:::hint{type="warning"}
**Assigning customer groups**
Please note, a customer can only be assigned to one B2B customer group. If you're looking to assign multiple price lists to a customer, you can do so by [configuring price lists](docId:5_lWMNohhjBJJppg9E6Vh).
:::
:::::

::::::Tab{title="🔵 Using Wix"}
To get started, please following the below steps:

:::::WorkflowBlock
::::WorkflowBlockItem
Within Wix, go to **Customers & Leads** and click **Contacts.&#x20;**&#x59;ou can either create a new customer or edit an existing one.

:::hint{type="warning"}
**Please note**
Please ensure that a valid address is added and all address fields are populated. Make a note of the email address you’ve added as you will need to access this to login.
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/yasbN2UmzPABqPUAYyD4R_image.png)
::::

::::WorkflowBlockItem
To synchronise to SparkLayer, the customer must have a label of `b2b` assigned to them and be a **Site Member**.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/wix-admin-labels.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

You can set this up by clicking the **Add Label** button when editing a customer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pclEA1XohgIVsFe-J6qgG_image.png)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/t2Z4CihI4u6oyA1eMDawa_image.png)

:::hint{type="warning"}
**Please note the following on customer groups**

- SparkLayer will only synchronise customers that have a label of `b2b` assigned
- If you have created additional [customer groups](https://app.sparklayer.io/customers/groups) within SparkLayer, please ensure that the labels are added to the contact record in Wix exactly as shown. e.g. `b2b` `b2b-additional-group`
- Customers must be set up as **Site Members** to be able to sign in to your online store.
- When adding a new label in Wix, please ensure that it is not subsequently edited.
:::
::::

:::WorkflowBlockItem
Once your customers have been set up in Wix (i.e. those with a label of `b2b`), and you've assigned the customer group to **at least** one customer, you can then manage specific rules within the [Customer groups area.](https://app.sparklayer.io/customers/groups)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Xct7huw_ma9kdd8c8DUV5_image.png)
:::

:::WorkflowBlockItem
You'll see a default **Base** customer group that you can use for your B2B customers. If you want to set up additional rules, you can simply click **Create Customer Group** and configure accordingly. For any additional customer groups you create, you'll need to update the labels on the customer record in Wix to match (e.g. `b2b` and `b2b-account`)
:::

:::WorkflowBlockItem
To simulate logging in as a B2B customer, please see **✅ Testing & launching** below.
:::

:::WorkflowBlockItem
You can also check if your customer record is syncing by using the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. Within Wix, navigate to a Contact record that has a label of b2b. Within the URL, you'll see a unique ID at the end of the URL. In the example below, the unique ID is `66b4c99a-3431-47d6-995d-309e4e8c5908`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GVKla6zDdNg2IEVmcqV7m_image.png)

With this unique ID, you can then paste this into the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. If the search results show the customer details, this confirms the customer is synchronosing correctly.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/c5I3ypE5OwwZzNDGPMsaV_image.png)
:::
:::::
::::::

:::Tab{title="🌐 Other Platforms"}
No configurations applicable or necessary&#x20;
:::
:::::::



***

## Testing a customer

:::hint{type="success"}
**🚀 See our full launch check list**
You can see our full [launch checklist guide here](docId\:YUfghEGoxe_h7uJfcshna) which covers the key steps to testing and then launching SparkLayer to your B2B customers.
:::

To simulate a B2B customer on your store, you can configure a sample customer within your eCommerce store.

:::::::Tabs
::::::Tab{title="🛍️ Using Shopify"}
:::::WorkflowBlock
:::WorkflowBlockItem
**Ensure customer accounts are enabled**
You’ll need to make sure that customer accounts are **enabled** on your storefront so that customers can sign in. Within your Shopify admin, go to [Customer Accounts](https://admin.shopify.com/settings/customer_accounts) and select either "**Customer Accounts**" or "**Legacy Accounts**" (both are compatible with SparkLayer).
:::

:::WorkflowBlockItem
**Edit or create a customer record**
Within your [Shopify Customers admin](https://admin.shopify.com/customers), find an **existing** customer record or add a **new one**.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2Fu3AcpGjnxiWnE6Ea66Md%2Fimage.png?alt=media&token=167b7a73-ecf7-4ae1-8d43-9def1aba00a8)

Fill in all the form fields, **including the address**. It's important that an address is specified otherwise SparkLayer won't find the customer record.
:::

::::WorkflowBlockItem
**Tag the customer**
Next, tag the customer with `b2b`

From within the customer record in Shopify, go to the **Tags** section and type `b2b` into the field. You can either choose from an existing tag, or add it as a new tag

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/shopify-tag-add.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::
::::

:::WorkflowBlockItem
**Invite the customer**
If you're using Shopify "**Customer Accounts**", you can simply direct your customers to the login page and they can then enter their email to receive a 6-digit access code. You can access this by going to `www.yourstore.com/account`.

If you're using "**Legacy accounts**" and you're creating a brand new customer record, you'll need to click "**Send account invite"** and then confirm the account once you've received the activation email ([learn more here](https://help.shopify.com/en/manual/customers/customer-accounts#invite-customers-to-create-accounts)).

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FN1nMCUqE9AKpxfLBGTIz%2Fimage.png?alt=media&token=268d58c4-aa72-4676-9afd-588e144d07e7)

The customer will then receive an email asking them to confirm your account by setting a password. Should you require, you can also edit the contents [of this email here](https://admin.shopify.com/email_templates/customer_account_activate/preview).

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FdWavKJr5PzkJ76rIof4j%2Fimage.png?alt=media&token=773b9e3c-94a9-4a3b-863a-c3bebc64b709)
:::

::::WorkflowBlockItem
**Login as a customer**
Finally, return to your website and visit the login page (e.g. `www.yourstore.com/account`) and enter your details. If you're using Shopify "Customer Accounts", you'll be prompted to enter a 6-digit code that will be sent to your email.

You'll then see SparkLayer load and you can browse your store as a B2B customer!

:::hint{type="info"}
**Please note**
If you can't access this page, make sure you have [customer accounts enabled](https://admin.shopify.com/settings/customer_accounts).
:::
::::

:::WorkflowBlockItem
**Inviting customers**
To learn more, please see [our full guide here.](docId\:YUfghEGoxe_h7uJfcshna)&#x20;
:::
:::::
::::::

:::Tab{title="🌐 Other platforms"}
Please refer to your platform for details.
:::
:::::::

:::hint{type="info"}
**Checking a B2B customer**
You can also check that a B2B customer has successfully synchronised to SparkLayer in the [Customer Sync](https://app.sparklayer.io/data-sync/customers) tool within the SparkLayer Dashboard.
:::



***

# Customers

The [Customers](https://app.sparklayer.io/customers/list) page shows a list of all B2B customers that can place orders on your store. Each row displays the customer's name, email, assigned role, and customer group - giving you a quick overview of your entire B2B customer base.

Use the search bar at the top to find a specific customer by name or email.

:::hint{type="info"}
**Please note**
Customer data is synced from your connected platform (e.g. Shopify). If the sync encounters any issues, you'll see a notification at the top of the page with the option to view errors and resolve them.
:::

**Viewing a customer**

Click **View** on any customer to open their detail page. From here, you can see:

- **Basic information** - email, company name, customer group, price list overwrites, and sales agent group
- **Financial details** - discount percentage and accounting ID
- **Payment on account** - balance, credit limit, net terms, and currency
- **Role** - assign the customer as a standard customer, sales agent, or sales administrator
- **Company users** - view all users associated with this customer and their roles
- **Addresses** - default shipping and billing addresses

:::hint{type="info"}
**Please note**
Customer information is pulled from your connected platform. To update fields like email or company name, make changes in your Shopify admin and they'll sync across to SparkLayer.
:::



***

# Agents

The [Agents](https://app.sparklayer.io/customers/agents) page shows all sales agents that have been set up to place orders and manage accounts on behalf of your B2B customers. Each row displays the agent's name, email, role (Sales Agent or Sales Administrator), and their assigned group.

Use the search bar to find a specific agent by name or email. You'll also see a summary at the top showing how many sales agents you've assigned out of your total allowance.

**Viewing an agent**

Click **View** on any agent to open their detail page. From here, you can see their basic information, financial details, and payment on account settings - just as with a standard customer record.

**Assigning a role**

The Role section lets you control the level of access for each agent. Select one of the following options and click **Save role**:

- **Customer** - can log in and place orders (removes sales agent access)
- **Sales agent** - can place orders and manage addresses, shopping lists, and company access on behalf of customers
- **Sales administrator** - all sales agent permissions, plus the ability to edit order prices and create new customers

If you want agents to only see specific customers, you can restrict their access using groups. Select one or more groups from the dropdown beneath the role options - or leave it empty to allow access to all customers.

You can learn more about how sales agents work, including the ordering experience, payment flows, and advanced features, in our [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) guide.



***

# Roles

The [Roles](https://app.sparklayer.io/customers/roles) page lets you manage permissions and access levels for your sales team. Instead of managing permissions individually per agent, you can create reusable roles and assign them across your team - keeping things organised as you grow.

The list view shows each role's name, type (system role or custom), and how many agents are currently assigned to it.

**System roles**

SparkLayer includes two built-in system roles that cover the most common setups:

| Role          | Description                            |
| ------------- | -------------------------------------- |
| `Sales Agent` | Standard access for day-to-day selling |
| `Sales Admin` | Full access across the SparkLayer app  |

:::hint{type="info"}
**Please note**
System roles cannot be edited or deleted.
:::

**Creating a custom role**

Click **Create role** to build a role with specific permissions tailored to your team. Enter a role name, check or edit the handle (auto-generated), and then select the permissions you want to allow.

Permissions are organised into two categories:

**Orders**

- Edit quoted prices - change the price of items that have been quoted to a customer
- Edit custom items - add or modify custom line items on an order
- Edit custom shipping - override the shipping method or cost on an order
- Override product settings - bypass product-level rules like minimum order quantities or increments
- Complete Checkout - place orders via the normal checkout process
- Create Quotes - create quotes via the checkout
- Edit Quotes - edit quotes once created
- Complete Quotes - finalise quotes once approved
- Archive Quotes - archive quotes when no longer required
- Edit Quote Assignee - manage the sales agent assigned to quotes

**Customers**

- Create new customers - add new customer records to the platform
- Edit addresses - update shipping and billing addresses on a customer's account
- Edit address defaults - change which address is set as the default for shipping or billing

Click **Save** when you're done. To edit an existing custom role, find it in the list and click **Edit** - any changes will apply immediately to all agents assigned to that role.

You can learn more about how sales agents work, including the ordering experience, payment flows, and advanced features, in our [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) guide.

[title] Installing SparkLayer on Shopify
[path] Integrations/Shopify/

:::hint{type="success"}
**👋 We're here to help!**
Our team can help get everything set up on your Shopify store. You can [book a call here](https://meetings-eu1.hubspot.com/sparklayer/onboarding) and we'll walk you through the process! If you'd prefer, you can also use our guide below to try setting things up yourself.
:::

## Introduction

SparkLayer enables B2B functionality on your existing Shopify store, allowing your B2B customers to login, place orders, manage their account, and much more. &#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vWNSkcGu-6SYP5BrvL_hF_image.png)

To familiarise yourself with SparkLayer, we also recommend reviewing the following guides:

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[How SparkLayer Works](docId:_2g8HwCXnN7OFy4o199y1)

The fundamentals of what SparkLayer does
:::

:::LinkArrayItem
[Frontend](docId\:OgKfvQX13dHW2582D57kJ)

The special "interfaces" SparkLayer enables
:::

:::LinkArrayItem
[Features](docId\:SSzdKXuNMlEIDOOITHQcU)

The available features and functions.
:::
::::



***

## What to expect

Our customers typically get up and running in a matter of days and the process works as follows:&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-bPmhuN9lNDGm09Z_gWouc-20240814-131910.jpg)

Our team is available to help support you during the process, from helping set up the special [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa), walking you through how to set up [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) and [Customers](docId:5_lWMNohhjBJJppg9E6Vh), as well as recommending the best ways to go live with our [Launching SparkLayer](docId\:YUfghEGoxe_h7uJfcshna).&#x20;



***

## ⚠️  Requirements

Before installing SparkLayer on your Shopify store, please ensure the following:&#x20;

| Item                | Details                                                                                                                                                                                                                                                                                                                                                        |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Customer Accounts` | Customer accounts must be enabled on your storefront so customers can sign in. Within your Shopify admin, go to [Customer accounts](https://admin.shopify.com/settings/customer-accounts) and choose the version you'd like to use. SparkLayer is compatible with both **Legacy (Classic) and New customer accounts** - see *Shopify customer accounts* below. |
| `Product SKUs`      | All products must have SKUs assigned so SparkLayer can save B2B prices against them. See [Shopify's SKU](https://help.shopify.com/en/manual/products/details/sku) guide if you need to add them.                                                                                                                                                               |
| `Customers`         | B2B customers must have a **b2b** tag on their customer record and at least one address assigned.                                                                                                                                                                                                                                                              |
| `Payment Processor` | If you’re installing SparkLayer on a test store, please ensure you have an example [payment method](https://admin.shopify.com/settings/payments) enabled.                                                                                                                                                                                                      |



***

## 👤 Shopify customer accounts

When setting up your Shopify store, it's possible to choose from two types of 'Customer Accounts' within Shopify:

- **Legacy customer accounts (formerly "Classic"):** this is how most Shopify stores are set up and allows compatibility with third-party apps and the ability to customise the look and feel
- **New customer accounts**: this uses a 'password-less login' and has a locked down account area that uses Shopify's 'out of the box' functionality (very similar to the checkout)

**Setting up customer accounts**

To check which version you're using, within your Shopify admin, click **Settings** and go to [Customer Accounts](https://admin.shopify.com/settings/customer_accounts). Under 'Customer accounts', simply click the Edit button to change the version.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/XZtsI_eISLVI1AT0LlW2x_image.png)

If you're using Legacy customer accounts, there's no further action to take and SparkLayer is fully compatible.

If you're using New customer accounts, there are some minor configurations to apply to your Shopify store to ensure compatability with SparkLayer (see our guide below).

**Which version should I use?**

SparkLayer is compatible with both options and there are some advantages and disadvantages with both.

| Version                   | Advantages                                                     | Disadvantages                                                                                                        |
| ------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `Legacy (Classic)`        | - Smoother customer experience
- No configurations required    | * Funcionality is specific to your Shopify store
* Not fully supported by Shopify                                    |
| `Customer accounts (New)` | - Works on all Shopify stores
- Actively maintained by Shopify | * Limited customisations (e.g. you cannot customise the look and feel)
* Relies on 6-digit code rather than password |

::::ExpandableHeading
**Configuring new customer accounts with SparkLayer (click to expand)&#x20;**

:::hint{type="info"}
**Need assistance?**
Please speak to our [suppor team](docId\:NNUw1G9z7eaJ4M78vk7t9) if you require any help setting this up.
:::

To ensure new customer accounts are compatible with SparkLayer, there are 2 actions to take:

1. First, enable the SparkLayer "customer account extension" within your Shopify settings (see below)
2. Secondly, you can then optionally update your theme with a special code snippet that makes the login process a little smoother

You can see how it works in our video below

::embed[]{url="https://www.youtube.com/embed/xyQ08k19NxM"}

**Adding an automatic redirect to the customer account area**

The first step is to enable the special SparkLayer customer account extension within your Shopify store. Once setup, if a B2B customer accesses the Shopify customer account area, they will automatically be redirected and taken back to your online store.

In your Shopify admin, go to Settings, Checkout, and within [Configurations](https://admin.shopify.com/settings/checkout#checkoutprofiles), click "Customize".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Kw5A14fjJZG3Jlv8YaObH_image.png)

From the top, navigate to the "Orders" page, click "Apps" on the left, and then enable the **"B2B Account Redirect"&#x20;**&#x65;xtension. You can also include:

- Some optional placeholder text that shows before the customer is redirected should you wish to inform them that they are being redirected.
- A specific destination URL to take the customer to once they are redirected. For example, you may want to take them to a specific collection page or a landing page.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/NaHUAczJD21PdejJgCvWT_image.png)

Finally, click "Save" and that will complete the process. You only need to apply this once and it'll take effect on all pages within the Shopify Customer Account area

**Updating your theme**

:::hint{type="info"}
**Learn more**
You can read the official [Shopify technical guide here](https://shopify.dev/docs/storefronts/themes/login).
:::

In additional to the automatic redirect detailed above, you can also add some minor customisations to your Shopify theme to make the process a little smoother.

With the addition of some minor code, you can redirect a customer back to the page they were viewing prior to logging in.

Once set up, when a customer signs in, they'll be taken back to your store and can proceeed to use SparkLayer. To get started, you'll need to locate the Shopify liquid code that controls the My Account link.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/y8ilXr5Itj_jFj2mhJgJU_image.png)

In our sample code below, we've modified the link destination with the correct syntax.

```html
{%- if shop.customer_accounts_enabled -%}
  <a href="{%- if customer -%}{{ routes.account_url }}{%- else -%}{{ routes.storefront_login_url }}{%- endif -%}"
    class="icon"
    rel="nofollow">
  </a>
{%- endif -%}
```

Similarly, you can add the route to any URL on your storefront:

```html
<a href="{%- if customer -%}{{ routes.account_url }}{%- else -%}/customer_authentication/login?return_to={{ request.path | append: "#spark-account" | url_encode }}{%- endif -%}">
Login
</a>
```
::::



***

## 🚢  The Onboarding process

When you create an account on SparkLayer, you'll get access to the SparkLayer dashboard, which guides you through the steps needed to get up and running.

The onboarding process has the following phases:

**1. Test how SparkLayer works**

Before installing anything on your theme, you'll first experience SparkLayer as a B2B buyer would. The dashboard walks you through three quick steps:

| Step                    | What happens                                                                                                                                                                             |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Create a price list** | Set up your first B2B price list - either as an automatic discount on your Shopify prices, or by uploading a CSV. Learn more about pricing.                                              |
| **Set up a customer**   | The dashboard creates a test customer for you, automatically tagged b2b and assigned to the price list you just created.                                                                 |
| **Place an order**      | Sign in as your test customer, browse your store, and place a test order to see SparkLayer's full B2B experience. The order appears as a Shopify draft order and won't affect inventory. |

This phase is fully guided in the dashboard and takes only a few minutes.

**2. Finish theme setup**

Once you've placed a test order, you'll move on to installing SparkLayer's frontend widgets on your theme. You can either let our team do this for you (recommended) or install yourself - see Installing the frontend widgets below.

While theme setup is in progress, you can continue configuring your B2B pricing and customer groups in the dashboard.

**3. Launch**

The final step is to run through some launch checks (such as logging in as a real B2B customer and placing an order) and then go live. See our [Launching SparkLayer](docId\:YUfghEGoxe_h7uJfcshna) guide for the full launch checklist.



***

## 🛠️ Installing the frontend widgets

SparkLayer comes with ready-made B2B-optimised "widgets" that we collectively call the SparkLayer Frontend. These overlay sections of your existing Shopify store and enable our powerful B2B features for logged-in B2B customers - leaving your regular DTC experience untouched.

You can install the widgets in one of two ways:

| Option                                      | Best for                                                            | Time                                           |
| ------------------------------------------- | ------------------------------------------------------------------- | ---------------------------------------------- |
| **Install SparkLayer for me** (recommended) | Most merchants - no coding required                                 | Typically within 1 working day, free of charge |
| **I'll install SparkLayer myself**          | Merchants comfortable making theme changes and basic Shopify coding | Variable, depending on your theme              |

Both options are managed from the Theme setup page in the SparkLayer dashboard.

### Option 1: Install SparkLayer for me (recommended)

Our team will install SparkLayer on your theme for you, free of charge. Once you click **Install SparkLayer for me**, the dashboard will guide you through a four-stage process:

1. **Requesting access** - we'll request collaborator access to your Shopify store
2. **Approve access** - you approve our access request in your Shopify admin
3. **In progress** - our team installs the SparkLayer widgets on your theme
4. **Complete** - you're notified once everything is ready

As part of the install, we will:

- Add the required storefront elements (product page and product card widgets)
- Match your store's branding (colours and fonts)
- Add a B2B login and application page
- Run checks to make sure everything is set up correctly
- Walk you through everything on a free onboarding call

This is the fastest and most reliable way to get SparkLayer installed - most merchants choose this option.

### Option 2: Install SparkLayer myself

:::hint{type="info"}
**Please note**
We recommend duplicating your live Shopify theme and making changes on the duplicate first. You can publish it once you're happy.
:::

If you'd prefer to install SparkLayer yourself, there are three steps to follow.

:::ExpandableHeading
**Step 1: Enable the SparkLayer app embed**

The app embed loads SparkLayer's JavaScript on your storefront. From the dashboard, select your theme and click **Enable app embed** - this opens your theme editor in a new tab where you'll click **Save** to activate it.
:::

::::ExpandableHeading
**Step 2: Install the product detail interface**

The product detail interface replaces your standard product purchasing area with SparkLayer's B2B-specific pricing and quantity controls when a B2B customer is logged in.

Add the following snippet to the file that controls your product detail page (typically main-product.liquid or product-template.liquid in your theme's /sections/ directory):

:::BlockQuote
\<spark-pdp parent-id="\{\{ product.id }}">\</spark-pdp>
:::

If your theme includes the following block, we recommend adding the snippet directly beneath it:

:::BlockQuote
\{% when 'price' %}\<spark-pdp parent-id="\{\{ product.id }}">\</spark-pdp>
:::

**Important:** if you're running SparkLayer on your existing DTC theme, you'll need to hide elements that B2B customers shouldn't see (prices, quantity selectors, product options, buy buttons, etc.). To hide an element, add data-spark="b2c-only" to it:

:::BlockQuote
\<div data-spark="b2c-only" class="product-meta-reference">
:::

See our Frontend integration checklist for the full list of elements to hide.
::::

::::ExpandableHeading
**Step 3: Install the product card interface**

The product card interface shows SparkLayer pricing and quantity controls on your collection pages, so customers can add items to their order from anywhere on your store.

Add the following snippet to the file that renders product cards on collection pages (typically card-product.liquid, product-grid-item.liquid, or similar in your theme's /snippets/ directory):

:::BlockQuote
\<spark-product-card parent-id="\{\{ product.id }}">\</spark-product-card>
:::

Look for the line that renders the product title:

:::BlockQuote
\{\{ product.title }}
:::

Add the SparkLayer snippet directly below it.

**Please note:** depending on your theme, the variable product.id may need to be card\_product.id or similar. Check your theme's existing variable naming.

As with the product detail interface, hide any DTC elements with data-spark="b2c-only".
::::

### Adding CSS customisations

Once the widgets are installed, you can match SparkLayer's styling to your store's look and feel by adding the [CSS snippet from here](docId\:qCt2Zk8wjhYIV2ZbVBJYy) to `theme.liquid` or a standalone CSS file. This lets you control button colours, font sizes, spacing, and typefaces.

:::hint{type="info"}
**Seeing styling conflicts on a supported theme?**

On supported themes, SparkLayer's auto-install applies a small amount of CSS to help the B2B widgets sit cleanly alongside your existing theme. If this is causing styling conflicts with your store, you can disable the auto-install and apply the SparkLayer interfaces manually instead - see **Disabling the auto-install** below.
:::

### App Blocks status

The dashboard shows the live status of each SparkLayer component on your theme:

| Status            | Meaning                                                     |
| ----------------- | ----------------------------------------------------------- |
| **Enabled**       | The app block is installed and active on your theme         |
| **Awaiting team** | Our team will install this for you                          |
| **Pending**       | The app block needs to be enabled - typically the app embed |

### Automatic install on supported themes

SparkLayer can be installed on any Shopify theme, but for a range of supported themes, the product detail and product card interfaces are installed automatically. Supported themes include:

- **Dawn family:** Dawn, Refresh, Sense, Studio, Craft, Taste, Origin, Ride, Colorblock, Crave, Spotlight, Publisher, Trade
- **Horizon family:** Horizon
- **Other:** Savor, Ritual, Vessel, Atelier, Dwell, Pitch, Heritage, Tinker
- **Archetype family:** Impulse, Expanse, Streamline

If you're on one of these themes, the manual snippet steps above are handled automatically.

### Disabling the auto-install

If you'd like to install the SparkLayer interfaces manually on a supported theme - for example, to control exactly where they appear, or to avoid the styling adjustments that auto-install applies - you can disable the auto-install behaviour.

Add the following to your theme's theme.liquid file, just before the closing \</head> tag:

```html
<script>
  window.sparkShopify = {
    options: {
      disableAutoInstall: true
    }
  };
</script>
```

Once added, you can follow the manual install steps above to add the product detail and product card interfaces exactly where you'd like them.

### B2B Dawn theme

If you'd prefer not to modify your existing theme, our B2B Dawn theme comes preloaded with all the SparkLayer widgets and can be installed in one click from your Shopify theme library.

:::hint{type="success"}
**Finished installing?**
Once the widgets are in place, run through our Frontend integration checklist to make sure everything is configured correctly. You can also explore the full set of configurations and customisations available on your store.
:::



***

## 📓 Setting up your B2B price lists

Within the [Price Lists ](https://app.sparklayer.io/pricing/lists)area of the SparkLayer Dashboard, you can create and manage your B2B pricing rules.&#x20;

You can manage your price lists directly inside the **SparkLayer B2B & Wholesale** sales channel in your Shopify admin - go to **Sales channels → SparkLayer B2B & Wholesale → Price lists** for the same controls available in the dashboard.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/JwirUqRnUV2xRWzkt_gjI_image.png)

SparkLayer allows you to set the following pricing types:

| Type        | Details                                                                                                                          |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `Automatic` | You can use your Shopify prices and apply a discount, e.g. 50% off Shopify retail prices or 40% off your Comare-at Shopify price |
| `Manual`    | You can manually upload a CSV file with specific prices and even enable quantity pricing                                         |

:::hint{type="success"}
**Ready to set your pricing?**
To learn more about pricing, please see our [full guide here](docId\:s8XcbZGxQpgdeIGWtXseT).
:::



***

## 👪 Setting up your B2B customer groups

[Customer Groups](https://app.sparklayer.io/customers/groups) let you configure specific rules for your customers, from defining their minimum order values and which price lists they see, through to what payment methods they're allowed to use when checking out. &#x20;

You can manage customer groups via the SparkLayer dashboard or directly inside the **SparkLayer B2B & Wholesale** sales channel in your Shopify admin (under **Sales channels → SparkLayer B2B & Wholesale → Customer groups**).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VCpaeUVexzGyLicOpq8_U_image.png)

Much like with Price Lists, you can fully manage this via the [SparkLayer Dashboard](https://app.sparklayer.io/customers/groups).

:::hint{type="warning"}
**Please note**

- For any customers that you want to place B2B orders, they must have a tag of `b2b` assigned to them in Shopify within their customer record
- If you intend to set up Customer Groups that apply different rules per customer, you'll also need to tag customers with additional tags (e.g. `b2b`  `b2b-group-2`)&#x20;
- Customers cannot have more than two `b2b` related tags assigned to their customer record in Shopify. For example:
  ✅ This is correct `b2b` `b2b-vip`
  ❌ This is incorrect `b2b` `b2b-vip b2b-user`
  If the tag doesn't already exist in your Shopify store, you can simply create it as a new one within Shopify by adding it to an existing customer record.
- At least one valid and fully completed address must be assigned to their record in Shopify. This is to ensure the customer can go through the checkout process

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FQIfDxuilIEXOND3Aj8zm%2Fimage.png?alt=media&token=dd372248-b122-407a-af11-c3e70b8d58ff)
:::

:::hint{type="success"}
**Ready to set up your customer groups?**
To learn more about customer groups, please see our [full guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::

:::hint{type="info"}
**Using Shopify Companies?**
Please refer to [our full guide](docId\:wrzSu8adFvbXOkF50hX5I) on how Shopify Companies is compatible with SparkLayer.
:::



***

## ✅ Testing & launching

The final step is to run some tests and checks to ensure SparkLayer is fully configured. Within the SparkLayer Dashboard, you'll see a number of [Launch checks](https://app.sparklayer.io/?expand=launch) to perform, from logging in as a B2B customer, through to placing an order.

:::hint{type="success"}
**🚀 See our full launch check list**
You can see our full [launch checklist guide here](docId\:YUfghEGoxe_h7uJfcshna) which covers the key steps to testing and then launching SparkLayer to your B2B customers.
:::



***

## 📁 Troubleshooting

To troubleshoot the most common issues (such as issues with pricing), please see [our guide here](docId\:BlCEkkx3I30nkUcglsfw7). You can also [contact our support team](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to assist.



***

## 🚀 Best-practice configurations

Once you've completed the SparkLayer integration on your store, you may want to consider enhancing your B2B experience with the following.&#x20;

:::hint{type="success"}
**Customer experience**
✅  [Set up a B2B login page](docId\:Gfc0UW7mJnMNpnNO6EdRl)&#x20;
✅  [Set up a B2B registration page](docId\:Gfc0UW7mJnMNpnNO6EdRl)
✅  [Hiding B2B products from regular DTC customers](docId:30hMTg4Cqqv69EhqNvpnf)&#x20;
✅  [Show B2B-only content](docId:30hMTg4Cqqv69EhqNvpnf)&#x20;
✅  [Create a B2B-only navigation menu](docId:30hMTg4Cqqv69EhqNvpnf)&#x20;
✅  [Modify your B2B email notifications](docId\:FAW11UwvEk1KN06woxik0)&#x20;

****
**Checkout process**
✅  [Configure B2B-only shipping](docId\:ZSsXG6FjRLCod_GxoluTN)
✅  [Customise your B2B payment methods](docId\:ibIKczvHM085BkeJIfFYv)
✅  [Configure custom checkout data fields](docId\:o3nDhZBCxisWH6M6satDt)


**Product configurations**
✅  [Setup product pack sizing](docId\:CmxfrPgjQxfz9vJzTVv0D)
✅  [Setup minimum and maximum quantities](docId\:CmxfrPgjQxfz9vJzTVv0D)
✅  [Show live inventory levels](docId\:Gj_Ao_gQ6oA-jx0D27Hys)
✅  [Setup pre-orders and backorders](docId\:Gj_Ao_gQ6oA-jx0D27Hys)
✅  [Set "reserve inventory" for your DTC customers](docId\:Gj_Ao_gQ6oA-jx0D27Hys)

Automations****
✅  [Shopify Flow (Ready-made automations)](docId\:uvXV1kUg_VsZEPr5Dlb2z)&#x20;

You can explore our full list of [configurations here](docId\:SBEaOaCq_A7FfbTatX8bD).
:::



***

## ℹ️  Frequently Asked Questions

### Shopify setup

:::ExpandableHeading
**What Shopify plan do I need to be on to use SparkLayer?**

SparkLayer works on all versions of Shopify, from Shopify Basic right through to Shopify Plus. All you need is an active Shopify store and you're good to go.
:::

:::ExpandableHeading
**How does SparkLayer compare to Shopify B2B?**

Shopify expanded native B2B features to all plan tiers, including company accounts, up to 3 pricing catalogs, net terms, PO numbers, and easy reorders. For merchants with a handful of wholesale accounts on simple terms, this covers the basics.

SparkLayer is designed for merchants who need more. Here are the key differences:

**Pricing flexibility** - Shopify's free B2B tier limits you to 3 pricing catalogs assigned to Markets (customer groupings). If you need more than 3 pricing tiers or per-customer pricing, you'd need Shopify Plus at $2,300/month. SparkLayer gives you unlimited price lists on all plans, assigned directly to customer groups.

**Sales team ordering** - Shopify offers staff accounts that can create draft orders in the admin. SparkLayer has a dedicated Sales Agent Portal where reps log in, switch between customer accounts, see customer-specific pricing, and place orders on behalf of buyers. It's a fundamentally different workflow.

**B2B ordering features** - Several capabilities are only available through SparkLayer and don't exist on any Shopify plan, including Plus: CSV and bulk order upload, AI Intelligent Cart (auto-builds carts from emailed POs), saved shopping lists, advanced discounts, a Quoting Engine for quote-to-order workflows, and self-service invoicing.

**Works on any theme** - SparkLayer overlays a B2B experience on top of your existing Shopify theme. Shopify's native B2B works best with their Trade theme.

**Transaction fees** - SparkLayer charges no transaction fees on any plan. Shopify charges variable platform fees on B2B orders across all plan tiers.

**Shopify Companies compatibility** - SparkLayer works alongside Shopify's Companies feature. Draft orders created through SparkLayer are automatically associated with the correct Shopify Company, Contact, and Location for accurate order attribution and reporting.

SparkLayer and Shopify's native B2B can't currently run side by side for the same customer session - it's one or the other for the ordering experience.

For a full feature-by-feature breakdown, read our detailed comparison: [SparkLayer vs Shopify B2B - What You Need to Know](https://sparklayer.io/blog/2026/04/03/shopify-b2b-all-plans/)
:::

:::ExpandableHeading
**Can I use SparkLayer with my development website?**

Yes! If you're setting up SparkLayer on a development store (e.g. a test account), we can enable a special developer-mode that lets you use SparkLayer until you're ready to activate a billing plan. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) for more details.
:::

:::ExpandableHeading
**Can I have DTC and B2B on the same Shopify website?**

Yes, It's possible to install SparkLayer onto your existing Shopify DTC store (i.e. retail), meaning you can run both DTC and B2B on the same store. We call this a 'hybrid setup' and [we've a guide here](https://www.sparklayer.io/blog/2022/04/04/shopify-hybrid-b2c-b2b/) that explains how works. When your B2B customers sign in, they simply see the special SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) interface that allow them to see their prices and place orders.

If you want to see this in action, you can try our [B2B/B2C demo store here](https://b2b-demo-store-usd.myshopify.com/)
﻿
﻿Sometimes it can be better to separate out your B2B store onto a secondary Shopify store and we've detailed some of the [common reasons](https://www.sparklayer.io/blog/2021/12/15/shopify-b2b-store-setup/).
:::

:::ExpandableHeading
**Which version of Shopify "Customer Accounts" is SparkLayer compatible with?**

When setting up your Shopify store, it's possible to choose from two types of 'Customer Accounts' within Shopify:

- **Legacy (Classic) customer accounts:** this is how most Shopify stores are set up and allows compatibility with third-party apps and the ability to customise the look and feel
- **New customer accounts**: this uses a 'password-less login' and has a locked down account area that uses Shopify's 'out of the box' functionality (very similar to the checkout)

**Compatibility with SparkLayer**

SparkLayer works with both versions of accounts. You can learn more in [Shopify Customisations](docId\:ddIv5TDAnCayWTOJ0Vyb7) under "Shopify customer accounts"
:::

:::ExpandableHeading
**Is there support for Shopify "Companies"?**

Yes, please refer to our full guide, [Shopify Companies](docId\:wrzSu8adFvbXOkF50hX5I).&#x20;
:::

:::ExpandableHeading
**What is the "SparkLayer B2B & Wholesae" (B2B Ordering) pixel that's added to my Customer Events within Shopify?**

When a customer places an order via the Shopify Checkout, SparkLayer needs to know when the order is completed. By adding a special Shopify pixel, this then resets contents of the customer's order and allows them to place additional orders if they wish. **Please note, this step is fully automated when you install SparkLayer and no action is typically required.**

To check the SparkLayer pixel has been added to your Shopify store, go to **Settings** and click **Customer events**. You should see a pixel added by SparkLayer and this should be set to the Connected state. When you view the pixel, you will see it called **"B2B Ordering"&#x20;**&#x77;hich corresponds to the Sales Channel used by SparkLayer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Dr2VhbtHuZaNwQFrxj1tj_pixel.png)

If you don't see the SparkLayer "B2B Ordering" pixel, you will need to reconnect your Shopify store via the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/integrations/platform). Simply click the "Save" button at the bottom, and this will activate the pixel for you.
:::

### Theme setup

:::ExpandableHeading
**Can you help me install SparkLayer on my Shopify website?**

Yes! Within the [SparkLayer Dashboard](https://app.sparklayer.io/help), you'll see an option to request our team to install SparkLayer for you. Typically we can do this within 1-2 working days and you're then good to go. We then offer an onboarding session to walk you through how everything works.
:::

:::ExpandableHeading
**Does SparkLayer work on any Shopify theme, include Online Store 2.0?**

Yes! SparkLayer is compatible with all Shopify themes, even fully customised. If you need help in the setup, our team can add all the code snippets for you. You can even try our [Shopify B2B Dawn Theme](docId\:LHkU0_G_4GVef1jAmgXmo)
:::

:::ExpandableHeading
**Can SparkLayer work with my variant "image switcher"**

SparkLayer works by updating the product page templates with our special frontend widgets - these automatically pull in your variants, SKUs, and any associated product data that is required for your B2B customers. When they are loaded into your Shopify store, they essentially 'replace' the existing Shopify purchase area that your regular DTC (retail) customers see. Very often, we see Shopify themes that have functionality whereby changing variants will auto-update the main product imagery.

This itself is almost always very specific "custom coding" to the theme that is being used - on a technical level, it will be using Shopify theme specific JavaScript coding to do this and will be engineered in a particularly way for the theme. When our SparkLayer widgets are loaded in, they won't have any handling for this specific JavaScript that controls the imagery, so this functionality isn't compatible for logged in B2B customers. As a solution to this, we have released a guide (aimed at Shopify developers) to point them in the right direction to make SparkLayer compatible based on the specific theme they are using. [Learn more](https://docs.sparklayer.io/tech-docs/javascript-sdk#qReb9)
:::

:::ExpandableHeading
**If I update my Shopify theme, will I need to re-install SparkLayer?**

SparkLayer requires adding specific code to your Shopify store and normally involves updating 3 or 4 files within your theme. When you perform a theme update, it's likely that these changes will be removed and the SparkLayer code will need adding back in. We are always happy to perform this re-install for you, please [get in touch](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.
:::

:::ExpandableHeading
**How does SparkLayer affect my current Shopify theme?**

The SparkLayer B2B widgets, including B2B pricing, cart and my account area, are only loaded once a customer who has been tagged with b2b successfully signs in to your store.

For all other users, your store will remain completely unaffected.

This allows you to have full control over which customers are able to see your B2B pricing and place B2B orders.
:::

:::ExpandableHeading
**What if I'm already using a wholesale B2B app on my website?**

If you already have a B2B / Wholesale app installed on your store, SparkLayer can work alongside this. It's a great way to test out SparkLayer and, once you're happy, you can simply uninstall any previous B2B apps you were using. If your previous B2B app has made code changes to your Shopify store, you may want to ask the app developer to remove these although this is optional.
:::

:::ExpandableHeading
**Will SparkLayer slow down my Shopify website?**

No. For performance, the SparkLayer Frontend only loads when a valid B2B customer successfully logs into a website; for your standard (B2C) customers, no code is loaded at all. When a B2B customer logs in, all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.
:::

:::ExpandableHeading
**How do I set up a B2B registration form?**

If you're looking to enable a wholesale/B2B registration form, we recommend the following options:

- **SparkLayer Forms (recommended)** - Our built-in, no-code form builder lets you create and manage B2B registration forms directly within SparkLayer. Get started with the ready-made Customer Registration Form template which includes approval workflows, automatic customer tagging, and email notifications. No third-party apps needed. Learn more about [SparkLayer Forms](docId\:nn5qnfmfGkXlyUmAMpSnq) or get started in the [SparkLayer Dashboard](http://app.sparklayer.io/forms).
- **B2B Login and Registration Page** - We offer a free, ready-made template that adds a dedicated B2B login and registration page to your Shopify store (e.g. yourstore.com/pages/b2b-login). It includes a login form for existing wholesale customers, a registration form for new applicants, and is fully customisable via the Shopify Customizer. Our team is happy to install this for you at no charge. Learn more in  [Shopify B2B Registration & Login](docId\:Gfc0UW7mJnMNpnNO6EdRl)&#x20;

It's also worth noting that you can manually add customers via the Shopify Customers admin and from there you could moderate your wholesale applications.
:::

:::ExpandableHeading
**How do I stop my Shopify pricing showing on Google Search?**

By default, Google will almost certainly index your Shopify store to show on their search listings. A result of this is your Shopify prices (retail prices) may also show within Google.&#x20;

It's very important to note that this is not related to SparkLayer and is in fact a built-in feature of Shopify. If you do not want your prices to show on Google this is a customisation that would need to be applied via your Shopify store (not via SparkLayer directly). The Shopify support team may be able to best advice here but there are a range of [Shopify community articles](https://community.shopify.com/c/forums/searchpage/tab/message?advanced=false\&allow_punctuation=false\&filter=location\&location=category\:en\&q=hide%20prices%20from%20google) that you can review.

Please note, making any changes to your Shopify store in this manner may effect your Google search results and we strongly advise speaking with a Shopify expert before making any changes.
:::

### Discounts

:::ExpandableHeading
**How do I set up discount promotional codes at checkout?**

It's possible to set up discount codes that customers can use during the checkout process. For example, you could set up a discount coupon that gives them 10% off their order.

To learn how discounts work, please see [our guide here.](docId\:WrejPw9URyjQwiQeKs_Cg)
:::

:::ExpandableHeading
**How do I set up discounts to apply across a product range?&#x20;**

Within the SparkLayer [Discounts](docId\:WrejPw9URyjQwiQeKs_Cg) , using the "Advanced requirements and rewards", you can setup discounts to apply to products with specific tags setup within your store (e.g. in Shopify). For example, you could set the discount to only apply if products within the cart have a tag of `dog-toy` applied, or match a broad term of `dog`. This allows you to setup discounts to apply to collections and product ranges easily.

There are also other workarounds without using discounts:

- You could create a brand new product in Shopify and set up a range of variants within it (e.g. all the products you want to offer within the discount)
- We have a special setting called *minimum product quantity* ([See our guide here](docId\:CmxfrPgjQxfz9vJzTVv0D)) which forces the customer to order at least X of the product (e.g. 3)
- Using the [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe), you can then set up your discounted rates (e.g. buy 3 and the price is 10% cheaper)
- Within Shopify, you could make these products 'hidden' from standard B2C customers simply by not associating them to a collection
:::

:::ExpandableHeading
**How do I set up discounts based on an order total?**

It's possible to set up discounts that apply based on a certain threshold, e.g. the order total or the number of items in a cart. To learn more about discounts, see [our guide here](docId\:WrejPw9URyjQwiQeKs_Cg)
:::

### Payments

:::ExpandableHeading
**How do B2B payments work with SparkLayer and Shopify?**

SparkLayer supports a range of B2B-specific payment methods that can be tailored on a per-customer basis. Our diagram below illustrates how they work in the context of SparkLayer and Shopify. To learn more, please see our [full guide here](docId\:efevur-A3yCJXUHvrR7t-).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TENR2PPGjIE6eHAwrpbEG_image.png)
:::

:::ExpandableHeading
**Do vaulted credit cards work with SparkLayer?**

Yes! Shopify's vaulted credit card feature is fully compatible with SparkLayer. For it to work, the customer placing the order must be assigned to a Shopify company (under Customers > Companies in the Shopify admin). Once a customer within that company location has saved a card - either during checkout or via their customer account - any other customer linked to the same company location can use it.

Vaulted cards appear as an option when a customer selects "Pay Online by Card" during the SparkLayer checkout process. They can also be charged against draft orders created by SparkLayer - for example, if a customer places an order using "Pay by Invoice", you can collect payment on the resulting draft order using a vaulted card directly from the Shopify admin.

To get started, you need Shopify Payments enabled and your B2B customers linked to company records in Shopify. No additional SparkLayer configuration is required. You can learn more in our [Shopify Companies](docId\:wrzSu8adFvbXOkF50hX5I) guide.
:::

:::ExpandableHeading
**Can I use my existing payment methods on the checkout?**

In terms of payment methods supported by SparkLayer and Shopify. If your customers choose "Pay Online by Card" during the SparkLayer checkout process, they will simply be taken to the Shopify checkout. From there, any payment methods you have set up in Shopify (e.g. Paypal, Shop Pay, Affirm Pay) will show up, allowing the customers to pay by this method. We've attached a screenshot to illustrate this.

In short, if Shopify support this payment method, your B2B customers could select it during the checkout providing they choose "Pay Online by Card".
:::

:::ExpandableHeading
**Can I additional charges on a B2B order based on the payment type used?**

There may be scenarios where you want to add an additional charge on an order based on the payment type used (e.g. if the customer is paying by credit card, you may want to charge an additional 2%).

Currently, there is no way to do this directly via SparkLayer. One potential option is to allow the customer to place an order via a manual payment method (e.g. Pay by Invoice), and when the order arrives into Shopify as a draft order, adjust the order totals accordingly. From the draft order within Shopify, you can then use their "Collect payment" functionality to take the card payment.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/iifsJg0OaMSygfOYPPaPW_image.png)
:::

### Products

::::ExpandableHeading
**How do I hide products or set up B2B-only products?**

[B2B Catalogs ](https://apps.shopify.com/sparklayer-b2b-catalogs)is a free SparkLayer app that lets you control which products are visible to different types of customers on your Shopify store. Hide products from B2C customers, restrict items to B2B-only, or show different product ranges to different customer groups - all using simple tags, no code required.

[Install B2B Catalogs](https://apps.shopify.com/sparklayer-b2b-catalogs) from the Shopify App Store, then head to our [B2B Catalogs documentation](https://docs.sparklayer.io/b2b-catalogs/) for the full setup guide.

:::hint{type="info"}
**Hiding variants**
Looking to hide variants for specific B2B customer groups?&#x20;
:::
::::

:::ExpandableHeading
**Can I use my Shopify prices for my B2B pricing?**

Yes! SparkLayer allows you to automatically synchronise your Shopify prices (e.g. your main Shopify price, Compare-at price), making it really easy to set up B2B pricing for your customers. For example, you could set your B2B prices to be 20% off your Shopify prices and we can even make provisions for your tax set up in Shopify (e.g. exclusive or inclusive of tax).
:::

:::ExpandableHeading
**How do I set up pre-order and backorder products?**

In terms of pre-ordering, SparkLayer has full support for different stock status messages and it's possible to set up products as pre-order/back-order easily - it does rely on some configuration within Shopify, but it's relatively easy to do!

We've [full information here](docId\:Gj_Ao_gQ6oA-jx0D27Hys) on how it works and you can even set up "due in" dates to give your customers visibility.
:::

:::ExpandableHeading
**Do I need to use product SKUs?**

In terms of product SKUs, SparkLayer relies on these being added to your products within Shopify so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.

If you don't already have SKUs in Shopify, it's relatively quick to do. You can either edit individual products and add them manually, or you can use Shopify's 'Import' or 'Edit products' feature to do this in bulk.
:::

::::ExpandableHeading
**How do I restrict B2B customers from DTC inventory (and vice versa)**

If you're installing SparkLayer on a single website and you are looking to run both DTC and B2B at the same time, it will be necessary to **use the same stock pool&#x20;**&#x62;ehind the scenes. From an inventory point of view, this essentially means that both DTC and B2B customers will be ordering from the same stock source which can pose challenges.&#x20;

SparkLayer has a way to "reserve" stock for your DTC customers, essentially blocking B2B customers from ordering too much inventory for a specific product. [Learn more](docId\:Gj_Ao_gQ6oA-jx0D27Hys)

:::hint{type="info"}
**Important**
It is not possible to block DTC customers from ordering from your inventory and there is no mechanism in Shopify to do this. If you are wanting to implement this, you will need to consider:

- Creating B2B-specific products on your store (e.g. you could use an app such as [Locksmith](https://apps.shopify.com/locksmith) to do this)
- Creating a separate store just for your B2B customers, effectively separating out your inventory completely. Learn more in [our guide here](docId\:ddIv5TDAnCayWTOJ0Vyb7)
:::

###
::::

### Customers

:::ExpandableHeading
**How do I set up a customer in Shopify as B2B**

To enable a customer as B2B, this works by adding a special tag in Shopify against their customer record. This tag by default is always `b2b` and you can add additional tags based on the rules you've set for the customer in the SparkLayer [Customers](docId:5_lWMNohhjBJJppg9E6Vh) admin.&#x20;

To learn more about setting up customers as B2B, see [our guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::

:::ExpandableHeading
**How do I invite a B2B customer to my website?**

Please refer to [our guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::

### Orders

:::ExpandableHeading
**Where do I find my B2B orders in Shopify?**

For non-card payment orders (e.g. Payment by Invoice), the order is saved as a "Draft order".

- You can view these in Shopify within **Orders** and then click [Draft Orders](https://admin.shopify.com/draft_orders?selectedView=all)
- You can then convert these into approved orders by marking them as paid or marking them with payment terms (please [see this guide](https://help.shopify.com/en/manual/orders/create-orders#accept-payment) for more details).&#x20;
- It's also possible to automatically convert Draft Orders into Completed Orders with [our feature here ](https://app.sparklayer.io/configuration/settings/general)"Auto-complete Shopify Draft orders"
- By default Shopify will not send an email for Draft orders but we have a [guide here](docId:7kxW1S6TBM57MlpLJn_Uk) that explains how to do this.&#x20;

When a customer places an order via non-card payment methods, it will show with a status of "**Awaiting Merchant"&#x20;**&#x75;ntil the order ("Draft" order) is converted into a Completed order.
:::

:::ExpandableHeading
**How do I edit orders?**

Firstly, it is possible to edit orders within Shopify when an order is placed via SparkLayer. If you have it configured to create orders as 'Draft orders' you can go into the order and make changes. If you subsequently then manually complete the order (i.e. Mark as paid), you can still edit the order up until the point of fulfilment.

The issue arises in one scenario we know about which is a limitation of Shopify. If you have 'Auto-complete Shopify Draft orders' turned on within the [SparkLayer Dashboard > Settings](https://app.sparklayer.io/configuration/settings/general) this will skip the ability to make subsequent orders. This is why, when you try and edit a 'Completed order', you are seeing the "Unable to edit order" message. At this point in time, we don't have a solution to this, other than switching 'off' the SparkLayer setting that automatically completes a draft order.
:::

:::ExpandableHeading
**Can I stop pricing showing as a discount within a Shopify order?**

Yes! By default, prices from SparkLayer into Shopify will show exactly as you've set them up in the SparkLayer [Price Lists](docId\:Zv2wCfqf7CUC5j_pYJ8Pt).

If you'd prefer to show the original Shopify price, please contact our team.&#x20;
:::

:::ExpandableHeading
**How do I change the wording for "custom discount" on an order**

You can change the wording of "Custom discount" by editing the languages within your Shopify store.&#x20;

- Go to Themes and click the 3 dots next to the theme name. Select "Edit default theme content"
- Search for "Custom discount" and then edit as required.
:::

:::ExpandableHeading
**How do I send an invoice?**

Please see our guide: [Invoices](docId\:NKh8H14Ffna5DD71SwwNd)&#x20;
:::

:::ExpandableHeading
**How do I set a minimum order quantity?**

Within SparkLayer, we do have support for minimum (and maximum) quantities, but you're only able to set these at a product or product-variant level. It's not possible to currently set minimum order-level quantities but it's something we are considering as part of a future update!

There is a potential workaround for product-variant requirements and we've included our recommend approach

- You could create a brand new product in Shopify and set up a range of variants within it (e.g. all the products you want to offer within the discount)
- We have a special setting called [Minimum product quantity](docId\:CmxfrPgjQxfz9vJzTVv0D) which forces the customer to order at least X of the product (e.g. 3)
- Using the [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe), you can then set up your discounted rates (e.g. buy 3 and the price is 10% cheaper)
:::

:::ExpandableHeading
**How do I set up multi-currency using Shopify Markets?**

Please refer to [Shopify Markets & Currencies](docId\:vex5XjFlT6Pvb0AzhlKQD)
:::

:::ExpandableHeading
**How do I send order notifications to customers and my team?**

At the moment, Shopify doesn't have a built-in 'notification' for when a draft order is placed so it does require workarounds for now. There are a few options:

**Receive notifications as store owner:**&#x20;

- if you are a merchant on the Shopify, Advanced or Shopify Plus plans, you can use Shopify Flow to do this. We've an example you can [download here](docId\:ddIv5TDAnCayWTOJ0Vyb7)
- It's also possible to automatically convert Draft Orders into Completed Orders with [our feature here](https://app.sparklayer.io/configuration/settings/general)

**Receive notifications as a customer:**

- If you want your customers to receive a notification, there are a few ways to do this. As above, you could activate the auto-complete [orders feature above](https://app.sparklayer.io/configuration/settings/general).
- We also recommend a really good one called Mechanic that lets you set rules/flows based on criteria. We have some ready-made templates [you can use here](docId:7kxW1S6TBM57MlpLJn_Uk)
:::

:::ExpandableHeading
**Can I import historic B2B orders into Shopify**

Yes, there are methods to do this. Please refer to [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

:::ExpandableHeading
**Can I change the order number "prefix" in Shopify, e.g. B2B-123**

Due to current limitations in Shopify, there is currently no way to differentiate the Shopify Order Number (e.g. #123456) between regular (DTC) and B2B orders. In terms of filtering and segmenting orders between retail and B2B, SparkLayer will by default add a tag to an order `b2b`. Within Shopify, or systems you may have integrated (e.g. shipping, 3PLs), this can then be used as a way to separate out workflows to allow you to differentiate between the customers who are placing orders.
:::

:::hint{type="info"}
**Need assistance?**
We'd be happy to help guide you through this process. Please refer to [our guide here](docId\:NNUw1G9z7eaJ4M78vk7t9).
:::




[title] Cart & Checkout
[path] Features/Configurations/

## Custom checkout fields

Custom checkout fields allow you to capture additional information from customers during the checkout process. It's a great way to allow customers to add data such as preferred shipping date, Purchase Order numbers, and more!  &#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FamTuD1AKYPuAoGSAU2zL%2Fimage.png?alt=media\&token=bb9205a1-dabf-4c63-947c-15f8c1cbb504)

Once enabled, the *custom checkout fields* will display on the 'Shipping' step of the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) before the customer selects their shipping address.&#x20;

### How custom checkout field data is stored

When a customer completes a custom checkout field, these will be attached to their order data as special 'Notes'.

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
In the context of Shopify, these will display as "Additional details" within "Order Notes". From a data perspective, these are referred to as **"custom attributes"** which can then be retrieved and used to display on packing slips, [email notifications](docId\:ddIv5TDAnCayWTOJ0Vyb7), and even sent through to a backend system (via the API) and more. &#x20;

![How custom checkout data appears in Shopify](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zk-R710nUomjiher_MIrv_image.png)

If you're using automation apps such as [Shopify Flow](https://apps.shopify.com/flow), you can also set up triggers based on specific custom fields that the B2B customer has filled in. To see some examples, you can review our [ready-made Shopify Flow templates](docId\:ddIv5TDAnCayWTOJ0Vyb7).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/mWsoB9vnh5hj_aA2mmX44_image.png)

:::hint{type="info"}
Some third-party Shopify apps may also support displaying "Additional details" on the invoices they generate and we recommend speaking directly with the specific app to learn more.
:::

From a B2B customer's perspective, any checkout custom fields you set up will also show against their orders when viewing order history within [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP)

![How custom checkout data appears to a customer](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/MWijAZYqNBmYy7IPc7Esl_image.png)
::::

:::Tab{title="🌐 Other platforms"}
No configurations applicable
:::
:::::

### How to add custom checkout fields

Custom checkout fields work by adding special code to your website within the SparkLayer Core Script.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/Checkout-custom-fields.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

In our example, we've included how this would work with an example 'shipping date'. This can also be adapted with a wide range of other field types such as radios, date pickers, text fields (see below for the full list).

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

::::Tabs
:::Tab{title="Example with a shipping date"}
```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */ 

checkoutCustomElements: [
  {
    name: "delivery-date",
    translations: {
      en: {
        title: "Delivery Date",
        detail:  "Delivery unavailable on weekends."
      }
    },
    attributes: {
      required: true,
      type: "date"
    }
  },
],
/* End of code */
```
:::

:::Tab{title="Example with multiple custom fields"}
```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
checkoutCustomElements: [
{
  translations: {
      en: {
          title: "Text field",
          detail: "Explains what the field is for. Must be 2 letters followed by 2-4 digits"
      }
  },
  name: "text-field",
  attributes: {
      required: true,
      type: "text",
      placeholder: "Placeholder shows inside the empty input",
      minlength: 4,
      maxlength: 6,
      pattern: "[a-zA-Z]{2}[0-9]{2,4}"
  }
},
{
  translations: {
      en: {
          title: "Number field",
      }
  },
  name: "number-field",
  attributes: {
      type: "number",
      step: 5,
      min: 15,
      max: 25,
  }
},
{
  translations: {
      en: {
          title: "Date field",
      }
  },
  name: "date-field",
  attributes: {
      type: "date"
  }
},
{
  translations: {
      en: {
          title: "Time field",
      }
  },
  name: "time-field",
  attributes: {
      type: "time"
  }
},
{
  translations: {
      en: {
          title: "Week field",
      }
  },
  name: "week-field",
  attributes: {
      type: "week"
  }
},
{
  translations: {
      en: {
          title: "Datetime field",
      }
  },
  name: "datetime-field",
  attributes: {
      type: "datetime-local"
  }
},
{
  translations: {
      en: {
          title: "Checkbox field",
      }
  },
  name: "checkbox-field",
  attributes: {
      type: "checkbox"
  }
},
{
  translations: {
      en: {
          title: "Month field",
      }
  },
  name: "month-field",
  attributes: {
      type: "month"
  }
},
{
  translations: {
      en: {
          title: "Telephone field",
      }
  },
  name: "telephone-field",
  attributes: {
      type: "tel"
  }
},
{
  translations: {
      en: {
          title: "Email field",
      }
  },
  name: "email-field",
  attributes: {
      type: "email"
  }
},
{
  translations: {
      en: {
          title: "URL field",
      }
  },
  name: "url-field",
  attributes: {
      type: "url"
  }
},
],
/* End of code */
```
:::
::::

**Custom element configuration options**

| Key            | Details                                                                                                                                                                                                                                                                                       |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`         | The name of the custom field. This is shown in your eCommerce platform but is not visible to customers. **(required)**                                                                                                                                                                        |
| `translations` | An object containing customer-facing strings. Keys must be 2 letter language codes ([ISO 639-1](https://www.wikiwand.com/en/ISO_639-1)). **(required)**                                                                                                                                       |
| `attributes`   | HTML attributes applied to the element. Use these to specify the type of input and validation rules. These include:<br />* max
* maxlength
* min
* minlength
* name
* pattern
* placeholder
* required (default is "false")
* disabled (default is "false")
* step
* type (default is "text") |
| `title`        | It's also possible to customise the text that is shown to the customer using translations. Text shown in bold above the input **(required)**                                                                                                                                                  |
| `detail`       | Small 'helper' text shown beneath the input. Useful for explaining what the field is for and acceptable values.                                                                                                                                                                               |

:::hint{type="info" attributes="[object Object]"}
**Supported element attributes**
Some attributes only apply to certain input types and you can find more detailed documentation [can be found here](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes).
:::

### Example custom checkout fields

To get started, we've included some of our most popular customer checkout field types.&#x20;

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

:::ExpandableHeading
**Date picker, e.g. 'Shipping date'**

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
checkoutCustomElements: [
  {
    name: "shipping-date",
    translations: {
      en: {
        title: "Shipping Date",
        detail:  "Please select your preferred shipping date"
      }
    },
    attributes: {
      required: true,
      type: "date"
    }
  },
],
/* End of code */
```


:::

:::ExpandableHeading
**Custom text, e.g. 'Tax ID Reference'**

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
checkoutCustomElements: [
  {
      translations: {
          en: {
              title: "Tax ID Reference",
              detail: "Please enter your Tax ID reference"
          }
      },
      name: "tax-id",
      attributes: {
          required: false,
          type: "text",
          placeholder: "Enter Tax ID reference",
          minlength: 4,
          maxlength: 600
      }
  },
],
/* End of code */
```
:::

::::ExpandableHeading
**Drop-down menu ("select" menu), e.g. 'Seasonal information'**

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/checkout-select.mp4?v=345&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
checkoutCustomElements: [
 {
    translations: {
      en: {
        title: "Option Title",
        detail: "Select Option Detail"
      }
    },
    name: "select-option-test",
    attributes: {
      required: true,
      type: "select",
    },
    options: [
      {
        translations: {
          en: {groupName: "Group A"},
        },
        items: [
          {value: "Option 1", 
            translations: {
              en: {
                label: "Option 1"
              }
          }
          },
          {value: "Option 2", 
            translations: {
              en: { label: "Option 2" }
            }
          }
        ],
      },
      {
          translations: {
          en: { groupName: "Group B" }
        },
        items: [
          {value: "Option 3", 
            translations: {
              en: { label: "Option 3" }
            }
          },
          {value: "Option 4", 
            translations: {
              en: { label: "Option 4" }
            }
          }
        ],
      }
    ]
  }
],
/* End of code */
```
::::

:::ExpandableHeading
**Custom text, e.g. 'Shipping instructions'**

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
checkoutCustomElements: [
  {
      translations: {
          en: {
              title: "Shipping instructions field",
              detail: "Please confirm any shipping instructions for us"
          }
      },
      name: "shipping-instructions",
      attributes: {
          required: true,
          type: "text",
          placeholder: "Shipping instructions field",
          minlength: 4,
          maxlength: 600
      }
  },
],
/* End of code */
```


:::

:::ExpandableHeading
**Number, e.g. 'Contact phone number'**

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
checkoutCustomElements: [
  {
      translations: {
          en: {
              title: "Contact phone number",
              detail:  "Please supply a phone number to allow us to contact you"
          }
      },
      name: "number-field",
      attributes: {
          type: "number",
          min: 10,
          max: 25,
      }
  },
],
/* End of code */
```


:::

:::ExpandableHeading
**File attachments (e.g. Purchase Order file upload)&#x20;**

If you're looking to add file uploads to the checkout process, you can manage this via custom checkout fields. Please refer to our full guide below
:::

:::ExpandableHeading
**Date picker that requires date at least 1 day in future&#x20;**

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
checkoutCustomElements: [
  {
    name: "delivery-date",
    translations: {
      en: {
        title: "Delivery Date",
        detail:  "Delivery date must be at least one day in future."
      }
    },
    attributes: {
      required: true,
      type: "date",
      min: ((d) => { 
        d.setDate(d.getDate() + 1); 
        return d.toISOString().slice(0,10); 
      })(new Date())
    }
  },
],
```


:::

:::ExpandableHeading
**Date picker that restricts by weekends and specific dates&#x20;**

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
checkoutCustomElements: [
  {
  translations: {
    en: {
      title: "Delivery Date",
      detail: "Delivery unavailable on weekends.",
      'select-mon-fri': "Date must be Monday-Friday",
      'select-date-in-future': "Select a date in the future",
      'select-non-bank-holiday': "Select another date which is not a UK bank holiday",
    },
  },
  name: "delivery-date-requested",
  attributes: {
    required: true,
    type: "date"
  },
  onChange(val, el) {
    const [year, month, date] = val.split('-');
    const selectedDate = new Date(
      Number(year),
      Number(month)-1,
      Number(date), 
      0,
      0,
      0,
      0
    );
    const now = new Date()
    const ukTime = now.toLocaleString(
      'en-GB',
      {
        hour: '2-digit',
        hour12: false,
        timeZone: 'Europe/London'
      }
    );

    const earliestDeliveryDate = new Date(
      now.getFullYear(),
      now.getMonth(),
      now.getDate() + (Number(ukTime) >= 12 ? 1 : 0)
    )

    const ukBankHolidays = [
      '07/04/2023',
      '10/04/2023',
      '01/05/2023',
      '08/05/2023',
      '29/05/2023',
      '28/08/2023',
      '25/12/2023',
      '26/12/2023',
    ];

    const selectedDateStr = new Intl.DateTimeFormat('en-GB', { dateStyle: 'short' })
      .format(selectedDate);

    let messageTranslationKey
    switch (true) {
      // Date is in the past
      case selectedDate < earliestDeliveryDate:
        messageTranslationKey = 'select-date-in-future'
        break;
      // Day is weekend
      case [0, 6].includes(selectedDate.getDay()):
        messageTranslationKey = 'select-mon-fri'
        break;
      // Is bank holiday
      case ukBankHolidays.includes(selectedDateStr):
        messageTranslationKey = 'select-non-bank-holiday'
        break;
    }

    return {
      valid: messageTranslationKey === undefined,
      messageTranslationKey
    }
  }
}
],
/* End of code */
```


:::

:::ExpandableHeading
**Checkbox to require customer confirmation**

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
checkoutCustomElements: [
  {
    translations: {
      en: {
        title: "I agree to the terms and conditions",
        detail: "Please confirm you've read and agree to the terms and conditions",
      },
    },
    name: "confirmation",
    attributes: {
      required: true,
      type: "checkbox"
    },
  },
],
/* End of code */
```


:::

### Supported form field types

Custom checkout fields currently support the following field types:

| Field Type       | Notes                      |
| ---------------- | -------------------------- |
| `text`           | Freeform text entry        |
| `select`         | Drop down menu             |
| `number`         | Number entry               |
| `date`           | Date, DD/MM/YYYY           |
| `time`           | Specific time, 00:00       |
| `week`           | Week (4)                   |
| `month`          | Month of year (12)         |
| `datetime-local` | DD/MM/YYY 00:00            |
| `checkbox`       | Allows multiple selections |
| `tel`            | Number entry for phone     |
| `email`          | Email entry                |
| `url`            | Website URL entry          |
| `file`           | File attachment            |



***

## Standard checkout fields

Alongside the freeform custom checkout fields above (which use a name), SparkLayer supports a set of standard checkout fields. These use a known `id` instead of a `name`, so SparkLayer recognises them and integrates them more deeply with your store.

Because they're recognised fields, each one is mapped to a structured location in your orders (rather than a generic order note), is available in your theme and template editor, and can be searched and filtered. This makes them a better choice than a freeform field when you're capturing a customer reference, purchase order number, or requested shipping date.

The following standard fields are available:

| Field                   | Field ID                  |
| ----------------------- | ------------------------- |
| Customer Reference      | `customer-reference`      |
| PO Number               | `po-number`               |
| Requested Shipping Date | `shipping-requested-date` |

:::hint{type="info"}
**Please note**
The **id** must match exactly for SparkLayer to recognise the field and apply the integration described below.
:::

### Adding standard checkout fields

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Xy-ixWiLkycCtYFvzVdUJ_image.png)

To get started, you can enable the standard checkout fields via [Storefront Options](docId\:TlYOdygHE8taYqbi81JJa) within the SparkLayer Dashboard. For a more advanced setup, you can also add the standard fields to your core script using their id.

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */ 

checkoutCustomElements: [
  { id: "customer-reference" },
  { id: "shipping-requested-date" },
  { id: "po-number" },
],

/* End of code */

```

Standard fields support the same attributes and onChange keys as custom checkout fields, so you can apply validation such as `required: true`, along with more advanced configurations (see **Customer checkout fields** above for the full list of supported attributes).&#x20;

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */ 

checkoutCustomElements: [
  {
    id: "customer-reference",
    attributes: {
      required: true,
    },
  },
],

/* End of code */

```

### Where standard fields appear in your orders

Unlike freeform custom fields, which are stored as generic order notes, each standard field is mapped to a structured location on the order:

| Field                     | Where it appears                                                             |
| ------------------------- | ---------------------------------------------------------------------------- |
| `PO Number`               | The native Shopify PO Number field on the order.                             |
| `Requested Shipping Date` | A dedicated custom field on the order (shown as sparkShippingRequestedDate). |
| `Customer Reference`      | The Shopify order notes field.                                               |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/wAvs86BucQQ-nllDhzRcf_image.png)

Because these fields map to structured data, they're also available in your theme and template editor, so you can display them on documents such as invoices.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7aKDioQyhphf-C7KOHZ-y_image.png)

### Searching and filtering by standard fields

Mapping each field to structured data also means you can find orders by the information customers enter. From the order and activity views you can:

- Search by Customer Reference
- Search by PO Number
- Filter by Requested Shipping Date (using a date range)

****

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/AW9XwTK8gNo19XoQWzUbP_image.png)

### Migrating to standard fields

If you're already capturing any of these fields using the older approach, you can move over to the standard fields to gain the deeper integration.&#x20;

:::ExpandableHeading
**Customer Reference**

If you previously used the additional information field (via the customerReferenceHidden and customerReferenceRequired display settings), switch to the standard field:

```javascript
/* Add the below code into the display object within the SparkLayer core script */

display: {
  customerReferenceHidden: false,
  customerReferenceRequired: true,
},

/* End of code */
```

New code to add:

```javascript
/* Add the below code into the SparkLayer core script */

checkoutCustomElements: [
  {
    id: "customer-reference",
    attributes: {
      required: true,
    },
  },
],

/* End of code */
```
:::

:::ExpandableHeading
**Requested Shipping Date**

If you previously added a shipping date as a freeform field using a `name`, switch it to the standard `id`:

Old code:

```javascript
/* Add the below code into the SparkLayer core script */

checkoutCustomElements: [
  { name: "my-shipping-requested-date" },
],

/* End of code */
```

New code to add:

```javascript
/* Add the below code into the SparkLayer core script */

checkoutCustomElements: [
  { id: "shipping-requested-date" },
],

/* End of code */
```

The `id` must be `shipping-requested-date`. Previously the name could be anything you chose - switching to the standard id is what enables the structured storage, searching, and filtering.
:::



***

## File Upload (file attachments)

:::hint{type="warning"}
**Please note&#x20;**&#xA;The file upload feature is **only** available on the SparkLayer *Growth, Pro,* and *Enterprise* plan. You can [change your plan here](https://app.sparklayer.io/settings/plan) or [learn more](https://www.sparklayer.io/pricing/) about our how pricing works.
:::

SparkLayer supports the ability for B2B customers to upload files during the checkout process. This is a great way to capture additional details from the customer such as a "Purchase Order", details specific to the order, or any other file that is relevant to their account.&#x20;

::embed[]{url="https://www.youtube.com/embed/UgmP800AdKw"}

SparkLayer also supports customers to upload details per line item (such as logos or name customisations) and you can learn more below.

### File upload at checkout

**The file upload at checkout flow works as follows:**

The B2B customer will see a special field during the checkout process where they can upload relevant files.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/SfUiUs0L7KHnZsQP_CzNE_image.png)

When the order is completed, any files uploaded to an order will then display in their [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) area against the order they have just placed. The customer can then easily download any files associated against the order.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/BVI25wZtua5xwePuLhn1T_image.png)

**Enabling file uploads**

The file upload feature works by adding special code to the [SparkLayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP) that lets you customise how you accept files from your customers. To get started, you can use our sample code below.

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
checkoutCustomElements: [
	{
		translations: {
			en: {
				title: "File Upload",
				detail: "Files must not be larger than 10MB. You can upload between 1 and 4 files"
			},
		},
		name: "file-upload",
		attributes: {
			type: "file",
			required: false,   // Optional. Default: false
			minlength: 1,     // Optional. Default: 1
			maxlength: 4,     // Optional. Default: 20
			maxsize: '10MB',  // Optional. Default: 20MB, Must be a number followed by `B`, `KB` or `MB`
			fileextensions: [ // Optional. Default: ['txt', 'csv', 'pdf', 'json', 'png', 'jpeg', 'gif', 'webp', 'svg', 'psd', 'xls', 'xlsx', 'ods', 'fods', 'ppt', 'pptx', 'odp', 'fodp', 'doc', 'docx', 'odt', 'fodt']
			  'png',
			  'txt',
			  'pdf',
			  'xls'
			]
		}
	}
],

/* End of code */
```

To customise how you accept files from your B2B customers, you can adjust the special settings:

| Setting          | Description                                                                                                                                                                                                                                                                                                                                           |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `required`       | Setting as `true` will force the customer to have to upload a file                                                                                                                                                                                                                                                                                    |
| `minlength`      | This sets the **minimum** number of files the customer must upload (e.g. entering `1` would force them to upload 1 file)                                                                                                                                                                                                                              |
| `maxlength`      | This sets the **maximum** number of files the customer must upload (e.g. entering `4` would prevent them from uploading more than 4 files)                                                                                                                                                                                                            |
| `maxsize`        | By default, SparkLayer sets a maximum file size of 20MB and this **limit cannot be increased**. If you'd prefer to limit file size, you can adjust this. For example entering `10MB` would set a maximum file size limit of 10MB                                                                                                                      |
| `fileextensions` | If you'd prefer to limit the file types your customers can upload, you can specify file extensions. By default, SparkLayer will support all the following file extensions.<br />`['txt', 'csv', 'pdf', 'json', 'png', 'jpeg', 'gif', 'webp', 'svg', 'psd', 'xls', 'xlsx', 'ods', 'fods', 'ppt', 'pptx', 'odp', 'fodp', 'doc', 'docx', 'odt', 'fodt']` |
| `translations`   | You can edit the default text that shows for customers by editing the default language string (see example above).                                                                                                                                                                                                                                    |

**Retrieving file uploads**

Due to how files are stored within SparkLayer, there are some very specific methods in which to download any files that have been uploaded. When a B2B customer uploads a file against an order, there are **3 ways** to retrieve the files that have been uploaded.

| Method        | Details                                                                                                                                                                                                                                             |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Customer`    | The customer themselves can login to their account and download the attachments from their order                                                                                                                                                    |
| `Sales Agent` | As a user with access to the [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) tool, they can login on behalf of the customer, navigate to their account and download any attachments.                                                           |
| `API`         | Via the *SparkLayer Files API*, file uploads will be associated with order data and this can then be routed into a back-office (e.g. an ERP). For more details on how this works, please speak to our [support team](docId\:NNUw1G9z7eaJ4M78vk7t9). |

**How file upload are referenced&#x20;**

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
When a customer uploads a file and the order arrives into Shopify, files will be referenced within the `file-upload` section on the top right of an order detail. If you'd prefer to use a different naming convention to `file-upload`, you can modify this within the checkout code sample above `name: "file-upload"`

:::hint{type="warning"}
**Please note**
This will include a 'raw link' to the file and it's important to note that this **cannot** be accessed via Shopify. Please refer to our steps above on the methods to retrieve files that have been uploaded.
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Vq2Jhy1JUMgQUtLSG-zNR_image.png)
::::

:::Tab{title="🌐 Other platforms"}
Please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::

### File upload per line item

:::hint{type="warning"}
**Please note**
This is an advanced configuration of SparkLayer and will require a developer to implement on a store that requires this feature. Please refer to our [JavaScript SDK](docId\:KqOyqBdWzsiRlt7j-S6CU) for full details.
:::

The file upload per "line item" feature allows for item-level customisation control, enabling B2B customers to clearly outline their order requirements and streamline the order process.&#x20;

Once enabled, the B2B customer will see a special field on the product page where they can upload relevant files. The design and layout of this field can be configured as detailed in [JavaScript SDK](docId\:KqOyqBdWzsiRlt7j-S6CU)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zaMLTr9COae4Qymci7TBT_line-item-file-upload-with-22design-22.jpg)

In some instances, there may be a need for more than one file upload section. When the files are uploaded to the product page, they will appear above the **"Choose file"** button.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/HmVXysO50yInA45tWY2cs_line-item-file-upload-front-back.jpg)

The files uploaded by the customer will then show in the cart as separate line items.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DQnTfbmccM2e1p1XqGCTr_line-item-file-upload-showing-at-checkout.jpg)

After "line item" file uploads have been added there is still the option to enable the "checkout-level" file upload feature too (see "*File upload at checkout"* above). Whilst the line item file upload option may be ample customisation for some customers, enabling checkout-level file uploads will allow for any order-level attachments to be added such as a "Purchase Order".&#x20;

When the order is completed, all files uploaded to an order (at line item *and* checkout level) will then display in their [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) area against the order they have just placed. The customer can then easily download any files associated against the order.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-G25xuXpYlOeZ958rnPVs_file-download-for-line-item-and-checkout-uploads-in-my-account.jpg)

:::hint{type="info"}
**Enabling file uploads for line items**
To implement this line item file upload feature, please refer to [our technical guide here.](docId:315uNbM85_FWnh6FU9KkK)
:::



***

## Discounts & promotions

SparkLayer supports the ability to have discounts and promotions applied during the checkout and these can either be redeemed via discount codes, or applied "automatically" to the customer's order.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/discount-codes.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

The SparkLayer Discount Engine unlocks a range of discount rules including:

- **Order-level discounts:** eg, spend $1,000 and get 10% off, spend $2,000 and get 15% off
- **Percentage and fixed discounts:&#x20;**&#x65;g, 20% off an order total, $100 off an order total 
- **Coupon codes:** eg, enter code NEWCUSTOMER and get 5% off
- **Scheduled discounts:** eg, start discount today and end it on a specific date and time
- **Customer-specific discounts:** eg, only allow customer group ‘b2b-vip’ to qualify for the discount 
- And more

:::hint{type="info"}
**Learn more about discounts**
You can see a full overview of what’s possible with discounts in [our guide here](docId\:WrejPw9URyjQwiQeKs_Cg).
:::



***

## The "Additional Information" field (PO Number)

The Additional Information field is useful if you want to capture additional details from a customer whilst their placing an order.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/IMELdEIyEBYg6DnelOtcI_image.png)

Typical use-cases include capturing a Purchase Order number (sometimes referred to as PO number), delivery instructions, or instructions.

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
When completed by a customer, the data will then show within the Shopify order under the **Notes** section (this can also be sent to a backend system using the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT)).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/03PIybxwZywb4-VrH5xtd_image.png)
:::

:::Tab{title="🌐 Other platforms"}
Please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
::::

:::hint{type="info"}
**Please note**
The additional information is a separate field to the 'custom checkout fields' detailed above. The Additional Information field is also limited to 512 characters in total
:::

**Make "Additional information" mandatory**

You can force customers to complete the 'Additional information' field before proceeding to place their order.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/SUeHVJrbcDSo3NrfSvLlQ_image.png)

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the display object within the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
display: {
  customerReferenceRequired: true,
},
/* End of code */
```

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "cart.checkout.notes.label": "Additional Information",
    "cart.checkout.notes.placeholder": "Order notes e.g. PO Number",
    "cart.checkout.notes.helper-text": "Please note, this is required before placing your order", /* Only shown if the field is set to required */
    "cart.checkout.notes.default-helper-text": "", /* Add a helper message below the form field */

  }
},  
/* End of code */
```

**Limiting characters of the "Additional information" field**

It's possible to set a character limit for the additional information field should you have requirements to restrict what can be added.

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the display object within the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
display: {
  customerReferenceMaxLength: 512, /* update 512 as required */
},
/* End of code */
```

**Hiding the "Additional information" field**

Alternatively, if you'd prefer to hide the additional information field from showing, you can update this via the SparkLayer Core Script.

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the display object within the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
display: {
  customerReferenceHidden: true,
},
/* End of code */
```



***

## Custom payment messages

On the final step of the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), Review & Pay, it's possible to display a "custom payment messages" that let you add additional details about a payment method. For example, if a customer is paying by "Pay by Invoice", you could add some additional text to inform them on how this process works.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/JDHHIkn-7h-9qi-cqa0Qr_image.png)

The "custom payment message" works by adding a special code snippet to the [SparkLayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP) that lets you define the text you want to show.&#x20;

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "cart.checkout.payment-providers.paymentByInvoice.message": "This is a message for Payment by Invoice",
    "cart.checkout.payment-providers.upfrontPayment.message": "This is a message for Pay Online by Card",
    "cart.checkout.payment-providers.paymentOnAccount.message": "This is a message for Pay on Account",
    "cart.checkout.payment-providers.quote.message": "This is a message for Request for Quote",
  }
},  
/* End of code */
```

:::hint{type="warning"}
**Please note**
It's important to note that this text will show to **all customers&#x20;**&#x64;uring the checkout process and it's not possible to vary it based on who the customer is.
:::



***

## Custom checkout message

On the final step of the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), Review & Pay, it's possible to display a "custom checkout message" that lets you inform customers of any special notes or information they need to be aware of. It's a great way to highlight information about shipping, payment, or anything else!

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bazPYJbuvnW_mUJCUzoD8_image.png)

The "custom checkout message" works by adding a special code snippet to the [SparkLayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP) that lets you define the text you want to show.&#x20;

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "cart.checkout.review-step.custom-message": "Add your custom checkout message here",
  }
},  
/* End of code */
```

:::hint{type="warning"}
**Please note**
It's important to note that this text will show to **all customers&#x20;**&#x64;uring the checkout process and it's not possible to vary it based on who the customer is.
:::

### Styling the message

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/sJ2LTxnbShtGCIJwe8p3__image.png)

If you'd like to customise how the message looks, you can do this by adding special [CSS](docId\:qCt2Zk8wjhYIV2ZbVBJYy) to your website. Simply add the below CSS to your website's CSS file and you can then set styling such as colours and spacing.

```css
<style>
:root {
  --spark-message-checkout-review-message-color: #555;
  --spark-message-checkout-review-message-background: #fff;
  --spark-message-checkout-review-message-padding: 0.5em 0.75em;
  --spark-message-checkout-review-message-alignment: left;
  --spark-message-checkout-review-message-border: 1px solid #CCCCCC;
}
</style>
```



***

## Search

SparkLayer has a built-in tool allowing customers to quickly add items to an order, directly from the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-). You can learn more in [our guide here](docId\:efevur-A3yCJXUHvrR7t-).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/W16ynJRiwqxV2TNfFk6Nd_image.png)



***

## Terms and conditions &#x20;

When customers checkout via the SparkLayer [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), they'll be asked to confirm the store's terms and conditions before completing their order.&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FPx1pjSIROLE14bCpwjWc%2Fimage.png?alt=media\&token=2a2b9e02-8af1-45f2-b320-487d370ac61f)

By default, the terms and conditions link will point to a URL of `policies/terms-of-service` but it's possible to change this via the SparkLayer Core Script.

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
termsAndConditionsLink: "/policies/terms-of-service",
/* End of code */
```

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
You can customise the link based on a customer's tag by using code within your Shopify store.

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
{% if customer.tags contains 'b2b' %}
  termsAndConditionsLink: '/policies/b2b-terms',
{% elsif customer.tags contains 'b2b-2' %}
  termsAndConditionsLink: '/policies/b2b-2-terms',
{% elsif shop.locale == "fr" %}
  termsAndConditionsLink: '/policies/fr-terms-and-conditions',
{% else %}
  termsAndConditionsLink: '/policies/terms-and-conditions',
{% endif %}
/* End of code */
```

If your store is set up with multiple languages, you can also configure the code to show a different link based on the customer's location

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
{%- if shop.locale == "fr" -%}
  termsAndConditionsLink: '/policies/fr-terms-and-conditions',
{%- else -%}
  termsAndConditionsLink: '/policies/terms-and-conditions',
{%- endif -%}
/* End of code */
```
:::

:::Tab{title="🌐 Other platforms"}
No configurations applicable
:::
::::

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "cart.checkout.terms.start": "I agree to the ",
    "cart.checkout.terms.link": "terms and conditions",
    "cart.checkout.terms.end": " ",
  }
}, 
/* End of code */
```



***

## Payment methods

Please refer to the [Payment Methods](docId\:ibIKczvHM085BkeJIfFYv) guide for more information.



***

## Tax & shipping messaging

:::hint{type="info"}
**Tax & shipping**
To learn more about how SparkLayer handles tax and shipping, see [our guide here](docId\:ZSsXG6FjRLCod_GxoluTN).
:::

When a customer proceeds through the checkout, they'll be notified about tax and shipping with messaging beneath the main call to action.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/056AS5dHuzq-0t2juDrlW_image.png "This message is shown on the first step of the checkout")

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qHwkx_nmV0y0C0-2Tz0Z5_image.png "This message is show on the 'Shipping' step of the checkout")

If you'd like to modify what is shown here, you can do so by updating the default language within your store.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "cart.tax-shipping-note": "Tax and shipping costs calculated during checkout",
    "cart.tax-shipping-message": "Tax and shipping costs shown on next step",
  }
}, 
/* End of code */
```



***

## Tax ID Requirements

Some countries require you to collect your customer’s Tax ID or equivalent during checkout. This helps ensure orders comply with local tax laws and avoids delays or fines at customs. [Learn mroe](docId\:ZSsXG6FjRLCod_GxoluTN)&#x20;



***

## The order complete screen

You can modify the confirmation screen that shows to the customer by adding the below to the language overwrites within the SparkLayer Core Script.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/SL0vz6fG2uCb5F_dXTvx5_image.png)

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "cart.thanks.payment.main": "Thank you for your order!",
    "cart.thanks.payment.blurb": "Your order has now been placed and you will shortly receive email confirmation to {email}. You can check the status of your order at any time by going to 'My Account'.",
    "cart.thanks.quote.main": "Thank you for requesting a quote!",
    "cart.thanks.quote.blurb": "We can confirm that your request for a quote has been received and we'll be in touch once our team has reviewed it.",
  }
},
/* End of code */
```



***

## Order limits (minimum and maximum order values)

It's possible to set minimum and maximum order values that a customer has to meet before being able to place an order. Please refer to [our full guide here](docId:5_lWMNohhjBJJppg9E6Vh).



***

## Showing custom content (using "slots")

Custom Slots (or "Targets") allow you to enhance the SparkLayer [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) by adding your own custom code in predefined areas.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/3Hzeu-VvOuGlXBhog-9NS_image.png)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Lc9-HabMyT0uc0zKbsGrI_image.png)

You can learn more in our [custom slots guide here](docId\:l_2ooHJiY-rAx2chBMgP2).



***

## Pricing Display

If you have [RRP pricing (MSRP)](docId\:S_VTlJBorGmnwjjfSMom9) set up, by default the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) will display this below the main selling price.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7tSh0UIEPmXde5y6TdkSS_image.png)

If you'd prefer to hide this, you can add the below CSS to your [CSS overwrites](docId\:qCt2Zk8wjhYIV2ZbVBJYy).

```css
--spark-cart-rrp-display: none;
```



***

## Cart Image

It's possible to change how the product image is rendered in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) by using special CSS overwrites. This is especially useful if your product images aren't square in ratio and you want to prevent the image being cropped.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ixu6Vqqgfpw-0DLW3VEr1_image.png)

Simply add one of the below options to your [CSS overwrites](docId\:qCt2Zk8wjhYIV2ZbVBJYy).

```css
--spark-cart-background-size: cover /* Set image to fill the space*/
--spark-cart-background-size: contain /* Set image to be fully visible*/
```


[title] Account & Addresses
[path] Features/Configurations/

## Custom My Account fields&#x20;

Within the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP), the customer can see a summary of their details such as email address, company name, and financial details from the "My Details" section. It's possible to set up additional "custom fields" within the My Details area, allowing you to include other information that may be relevant to your B2B customers.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-OKmXgtJaTXpm0zeQTuOl_my-accountarea.gif)

Setting custom fields for the My Details area works in a very similar way to the [custom checkout fields feature](docId\:o3nDhZBCxisWH6M6satDt), by adding special code to your website within the SparkLayer Core Script. You can use our sample below to get started.

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
 customAccountDetails: [
  {
    title: "Website",
    value: "{{ customer.metafields.global.company_website }}",
    type: "website",
    displayText: "Visit Website",
  },
  {
    title: "Phone",
    value: "01234567890",
    type: "phone",
  },
  {
    title: "Email",
    value: "contact@sparklayer.io",
    type: "email",
    displayText: "Click to email",
  },
  {
    title: "Some normal text",
    value: "This is a normal value with no formatting",
  },
],
/* End of code */
```

**Custom element configuration options**

| Key           | Details                                                                                                                                                                                                                                                                                                                                                |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `title`       | The label name to show to the customer, e.g. "Website"                                                                                                                                                                                                                                                                                                 |
| `value`       | The value, this can either be set manually or dynamically generated, e.g. via a metafield or setting                                                                                                                                                                                                                                                   |
| `type`        | The field type, with the following options<br />* `email` This will set a link in the following format:&#xA;`<a href="mailto:value">displayText</a>`
* `phone` This will set a link in the following format:&#xA;`<a href="tel:value">displayText</a>`
* `website` This will set a link in the following format:&#xA;`<a href="value">displayText</a>` |
| `displayText` | By default, the value will be shown to your customers. If you'd prefer to show custom text, you can use the `displayText` field. For example, for a link, you could use<br />`displayText: "Click here"`                                                                                                                                               |

:::hint{type="warning"}
**Please note**
If you are using our [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) functionality, there is an important limitation to be aware of that applies to custom fields that are based on a customer metafield.

When a sales agent signs in as a B2B customer, they will not see the value inputted in the metafield on the customer's account - rather they will see the value inputted in the agent's account itself.
:::



***

## Order statuses

SparkLayer supports a range of orders statuses (e.g Processing, Shipped) and you can learn more about how this works in [our guide here](docId\:lQXaNI7IVDqna09D9soAP).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7guZNsihPpKj86jFz6Ds9_image.png)

If you'd like to change the naming conventions for the order statuses shown, you can update these using special language string settings.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "account.order-status.incoming": "Incoming",
    "account.order-status.returned": "Returned",
    "account.order-status.cancelled": "Cancelled",
    "account.order-status.shipped": "Shipped",
    "account.order-status.part_shipped": "Part-shipped",
    "account.order-status.part_returned": "Part-returned",
    "account.order-status.varied": "Varied",
    "account.order-status.processing": "Processing",
    "account.order-status.awaiting_approval": "Requires approval",
    "account.order-status.awaiting_merchant": "Awaiting merchant",
    "account.order-status.archived": "Archived",
  }
},  
/* End of code */
```



***

## Payment status

Alongside shipping status, you can give your customers a real-time view of their Payment status (e.g. Paid, Unpaid). Learn more in [Payments Visibility](docId\:ibIKczvHM085BkeJIfFYv).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TMhny3IGGxy7t3hQUoxBR_image.png)



***

## Show shipping address summary

If you want to give customers an easy way to show their shipping address for an order, you can optionally display this from their My Account overview.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/v1fCTQ8jIHqYYorOghNaK_image.png)

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the display object within the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
orderListShowShippingAddress: true,
/* End of code */
```



***

## Allow address editing

SparkLayer supports full address editing and adding, allowing customers to manage their online address book. With the My Account interface, customers can simply click the icons next to each address to edit or delete an entry or add a new one. Learn how to configure this in [our guide here](docId:5_lWMNohhjBJJppg9E6Vh).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/EjTZOhD6m8exnnPKh8wZE_address1.gif)

:::hint{type="info"}
**Please note**
Address management is enabled by default. If you'd prefer customers to not be able to edit or add addresses, you can turn that off via the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/settings/general). There is also an option to prevent addition and modification of the default billing address. This still allows for addition and modification of other addresses.
:::



***

## Order tracking (shipping) details

SparkLayer has support to show order tracking information against an order, allowing customers to view shipping tracking details. This also works for part-shipments for an order, giving the customer great visibility of their order details.

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
Within Shopify, go to an order and go through the fulfilment process. Under "Tracking information (optional)" enter the tracking number and shipping carrier (this can be automated via a third-party app)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/wIs3rXmKyR1IktxAfnFxh_image.png)

Once added, this will then show in the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) for the customer when viewing an order detail page.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/1OiWFl6V8TTYZG7fHIDpc_image.png)
:::

:::Tab{title="🌐 Other platforms"}
For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
::::



***

## Account credit and credit balances

Please refer to [Credit, Net Terms, & Invoicing](docId\:yWm70oQUosyKOoIqb4Z4G)



***

## Timeline & Communications

The Timeline & Communications feature provides a streamlined way to track communication and activity across all order types within SparkLayer, including [Quotes](docId:8A4OpNIndUyfs3Pup-tuo) (if enabled).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/RV3zbKJMDzSxHtF8KsEn0-20251207-180558.png)

It displays messages, internal notes, and order events, and related email notifications in one centralised area. Learn more in [Timeline & Communications](docId\:Kf-Gd3nHSXlrn2zZvla1Y) .



***

## Account redirect

When a logged in customer accesses your website's existing my account area (e.g. `/account`), it will redirect them to the SparkLayer My Account interface instead. If you'd prefer, you can change the default handling and set a custom URL to redirect B2B customers to once they log in. You can do this by updating the SparkLayer Core Script on your website.

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
accountRedirect: {
  urlRegex: /\/account/g,
  goTo: "/index", // page to redirect logged in users to
},
/* End of code */
```

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
**Using Shopify Customer Accounts (New Accounts)**

If you're using Shopify Customer Accounts, you can configure which URL to send a customer to directly via your Shopify admin. In your Shopify admin, go to Settings, Checkout, and within [Configurations](https://admin.shopify.com/settings/checkout#checkoutprofiles), click "Customize".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Kw5A14fjJZG3Jlv8YaObH_image.png)

From the top, navigate to the "Orders" page, click "Apps" on the left, and then enable the "B2B Account Redirect" extension.&#x20;

You can include:

- Some optional placeholder text that shows before the customer is redirected should you wish to inform them that they are being redirected.
- A specific destination URL to take the customer to once they are redirected. For example, you may want to take them to a specific collection page or a landing page.&#x20;

**Setting up redirect URLs based on a customer tag**

If you're using *Legacy* Shopify accounts (Classic Accounts), you can also add handling to vary the destination redirect URL based on a customer group. E.g. customer group ABC goes to` /collections/wholesale-page` whereas customer group XYZ goes to `/collections/wholesale-vip`

Within your SparkLayer Core Script, you can replace the above code sample with the following Liquid code logic (and adapt accordingly):

```javascript
accountRedirect: {
urlRegex: /\/account/g,

{% assign goTo = "/index" %}

{% for tag in customer.tags %}
 {% if tag == "b2b-group-1" %}
   {% assign goTo = "/collections/wholesale-page" %}
 {% elsif tag == "b2b-group-2" %}
   {% assign goTo = "/collections/another-wholesale-page" %}
 {% endif %}  
{% endfor %}
 
goTo: {{ goTo | json}},

},
```
:::

:::Tab{title="🌐 Other platforms"}
No configurations available.
:::
::::



***

## Quick links to view orders

SparkLayer has built-in functionality that can optionally 'auto-redirect' a customer directly to their order or quote details, simply by clicking a link. To learn how this works, please see [our guide here](docId\:lQXaNI7IVDqna09D9soAP).&#x20;



***

## Order invoices

It's possible to attach invoices (e.g. a PDF) to a B2B customer's order. Please refer to [our guide here](docId\:yWm70oQUosyKOoIqb4Z4G) to learn more.



***

## Showing a custom Order ID ("Visible ID")

It's possible to overwrite the standard order ID that is shown when a customer views their orders, allowing you to have consistent order IDs across systems

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pC1DVTBIDyXZPiIBJpIbL_image.png)

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
To learn how this works, see [our full guide here](docId\:BxWnGB6b1n7QFfhTnu7pk).&#x20;
:::

:::Tab{title="🌐 Other platforms"}
Not applicable
:::
::::



***

## Showing custom content (using "slots")

Custom Slots (or "Targets") allow you to enhance the SparkLayer My Account interface by adding your own custom code in predefined areas.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/3tBkNcGyFECajydjtS6Mu_image.png)

You can learn more in our [custom slots guide here](docId\:l_2ooHJiY-rAx2chBMgP2).



***

## Advanced account settings

It's possible to extend how you manage the account information for your B2B customers by using special metafields. For example, if you're using a backend system (e.g. an ERP) that requires very specific address and customer data, these advanced address settings offer more granular flexibility in how data is stored. You can explore our available metafields below.&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
To learn more about how to configure metafields on Shopify for SparkLayer, please refer to [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

:::ExpandableHeading
**Accounting ID&#x20;**

| Item               | Details                                                                                                                                                                                                                                                                                       |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields)                                                                                                                                                                                                               |
| `Metafield type`   | This must be set as a `single line text` string                                                                                                                                                                                                                                               |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                                              |
| `Key`              | This must be set as `accounting_id`                                                                                                                                                                                                                                                           |
| `Use-case`         | This can be used to specify a unique accounting ID for a customer. For example, if you're using an ERP or accounts package, you can associate a unique account ID against a customer record.<br />When an Accounting ID is set, this will be added to the eCommerce platform orders metadata. |
:::

:::ExpandableHeading
**Title**

| Item               | Details                                                                         |
| ------------------ | ------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields) |
| `Metafield type`   | This must be set as a `single line text` string                                 |
| `Namespace`        | This must be set as `sparklayer`                                                |
| `Key`              | This must be set as `title`                                                     |
| `Use-case`         | This can be used to specify a "title" for the customer.                         |
:::

:::ExpandableHeading
**Company Name**

| Item               | Details                                                                         |
| ------------------ | ------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields) |
| `Metafield type`   | This must be set as a `single line text` string                                 |
| `Namespace`        | This must be set as `sparklayer`                                                |
| `Key`              | This must be set as `company_name`                                              |
| `Use-case`         | This can be used to specify a "Company Name" for the customer.                  |
:::

:::ExpandableHeading
**Shipping Address ID**

| Item               | Details                                                                                                                                                    |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields)                                                                            |
| `Metafield type`   | This must be set as a `single line text` string                                                                                                            |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                           |
| `Key`              | This must be set as `shipping_address_id`                                                                                                                  |
| `Use-case`         | This can be used to specify a unique shipping address ID  for the customer.<br />When specified, this will be set as the default address for the customer. |
:::

:::ExpandableHeading
**Billing Address ID&#x20;**

| Item               | Details                                                                                                                                                   |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields)                                                                           |
| `Metafield type`   | This must be set as a `single line text` string                                                                                                           |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                          |
| `Key`              | This must be set as `billing_address_id`                                                                                                                  |
| `Use-case`         | This can be used to specify a unique billing address ID  for the customer.<br />When specified, this will be set as the default address for the customer. |
:::

:::ExpandableHeading
**Available Shipping Addresses by ID&#x20;**

| Item               | Details                                                                                                                                                                 |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields)                                                                                         |
| `Metafield type`   | This must be set as `JSON`                                                                                                                                              |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                        |
| `Key`              | This must be set as `available_shipping_address_ids`                                                                                                                    |
| `Example Value`    | `[9840404758756,9840404758756]`                                                                                                                                         |
| `Use-case`         | This can be used to specify the available shipping addresses for the for the customer (by Shopify ID). You can provide multiple address IDs in a comma separated list.  |
:::
::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | Variant-level (products)                                                                                                                                                                                                                                                                                                                                                      |
| `Metafield type`   | This must be set as an `JSON` string                                                                                                                                                                                                                                                                                                                                          |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                                                                                                                              |
| `Key`              | This must be set as `rrp`                                                                                                                                                                                                                                                                                                                                                     |
| `Value`            | This must be set up in the following format<br />`[{"value":15.99,"currency_code":"usd"}]`<br />Where `value` is the retail price and `currency_code` is the currency code (e.g. usd, gbp, eur).<br /><br />You can define prices for additional currencies by using this example format<br />`[{"value":15.99,"currency_code":"usd"},{"value":10.99,"currency_code":"gbp"}]` |

For more information, please refer to the [SparkLayer Technical Do](https://docs.sparklayer.io/tech-docs)
:::
:::::


[title] Company Users
[path] Features/

## Introduction

Company Users is a powerful feature of SparkLayer that allows companies to create "teams" of users that can share specific actions within their account. Sometimes referred to as "company roles" or "sub accounts", this feature is designed to optimise company B2B purchasing and account management.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/10SnVPd-AJRqfBs8QTfpF_company-users.jpg)

Once enabled on your store, Company Users allows the following activities to be shared across team members once they log into their account:

| Area             | Actions                                                                                                      |
| ---------------- | ------------------------------------------------------------------------------------------------------------ |
| `Order history`  | Users of the same company can see all orders placed for the entire company, check order status, and re-order |
| `Shopping lists` | Users of the same company can view and delete shopping lists that have been created                          |
| `Address book`   | Users of the same company can view, edit, and delete all addresses within the company                        |

It's also possible to set "roles" of Company Users that grant users specific permissions during the B2B ordering process (see below).

Please note, the following activities **are not shared** across team members.

| Area            | Actions                                                                    |
| --------------- | -------------------------------------------------------------------------- |
| `Shopping Cart` | If a user has items in their order, these will not be shared across users. |



***

## Getting started

To get started with Company Users, you'll need to enable a special setting within SparkLayer. Within the SparkLayer Dashboard, go to the [Settings area](https://app.sparklayer.io/configuration/settings/general) and switch on "Enable company users".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/drrbrCIpqK2yRH6MAz-0x_image.png)

When this setting is enabled, this will then activate a special "widget" within the My Account area called "Company Users".



***

## How it works

The Company Users functionality works as follows:

::::WorkflowBlock
:::WorkflowBlockItem
An active B2B customer logs into their account on your website
:::

:::WorkflowBlockItem
From their My Account area, they then navigate to the **"**&#x43;ompany Users"  widget (at the bottom). From here, they can see all other active company users and invite other users
:::

:::WorkflowBlockItem
Once another user has been invited to the Company, that **specific user** can subsequently login and begin placing B2B orders
:::
::::

Once a company user logs in, they'll also have access to a variety of shared actions and activities that all other company users can see. This currently includes:

- **Orders** - users will see all orders placed by the company
- **Shopping lists** - users will see all shopping lists created by the company
- **Address book** - users will see all addresses added by the company &#x20;



***

## Inviting users

::embed[]{url="https://www.youtube.com/watch?v=fjunRXufeTs"}

Essentially, the customer who begins the *inviting* process becomes the **"main user"** (or "admin") and can control which other users have (or do not have) access to the company.

To invite users, from the My Account area, the customer clicks the 'Invite new user" link in the "Company Users" widget.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/nu5z9tExFXujXdhZmamkw_image.png)

Once the "Invite new user" link is clicked, they are then asked to complete an invite form. This form includes the ability to:

- Specify a first and last name and an email address
- Specify the "role" of the Company User (see below)

:::hint{type="info" attributes="[object Object]"}
**Please note**
The email address specified here will be the email address used to login
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/flrkQ7rzHy7fj-3xBZM4w_image.png)

When the **"Send invite"** button is clicked, this will then trigger the following actions:

| Account status                                                   | Actions                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `If the invitee does not already have an account on the website` | This will send the invitee an email asking them to create a password to activate their account and join the company                                                                                                                                                                                                                                                                                                                    |
| `If the invitee already has an account on the website`           | The customer will be able to login with their existing login details to join the company.<br /><br />If the invitee is already registered as a B2B customer in your store, they will not be able to become a sub-account. In this instance, the invitee will need to be "manually" associated. This can be actioned by using metafields to associate records and you can learn more in [our guide here.](docId\:OTLHhi8sQ6oS4PAt23-8H) |

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
For invitees that do not already have an account, they'll receive an email that looks similar to the below. This is an email that is generated via Shopify and can be easily modified. Within Shopify, this uses the "Activate Account" email notification and can be modified within the Settings > Notifications area of your Shopify admin.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/rryqxURyzMy8zBPnSKr3k_image.png "An example of an account activation email sent from Shopify")

:::hint{type="warning" attributes="[object Object]"}
**Please note**
As part of introducing Company Users to your B2B customer base, we recommend informing them of the process detailed above to ensure they are familiar with the steps involved.
:::
::::

:::Tab{title="🌐 Other platforms"}
No configurations applicable
:::
:::::



***

## Logging in as an invited Company User

When an invited Company User logs in, they'll see the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) as normal along with additional messaging confirming they are part of a company.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/eth2VSgv4nBEk1VCUsRlX_image.png "Logged in Company Users see a special message at the top")

In addition, they'll also see the company they are connected to within their **My Details** area.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/8WK3rVGVJ4A8zPDH0aDGn_image.png)



***

## Placing an order

The invited Company User can browse the website and begin adding items to an order. All prices shown will be the prices set up for the "main user" using the [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) of SparkLayer.

Once they've added products to an order, they can access the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) at any point and begin the checkout process. Just as with the standard customer experience, they can select an address, shipping method, and see all available payment methods.

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
To understand the payment flow, the payment methods work as follows:

| Payment Method       | Flow                                                                                                                                    | Status                                                               |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `Pay by Invoice`     | The order is submitted as a **Draft order** within Shopify and then has to be manually acted upon                                       | Order is left in Draft status until the payment is successfully made |
| `Pay on Account`     | The order is submitted as a **Draft order** within Shopify and then has to be manually acted upon                                       | Order is left in Draft status until the payment is successfully made |
| `Pay Online by Card` | The order is submitted as a **Draft order** within Shopify and the customer will **receive a notification** to make payment (see below) | Order is left in Draft status until the payment is successfully made |
| `Request for Quote`  | The order is submitted as a **Draft order** within Shopify and then has to be manually acted upon                                       | Order is left in Draft status until the payment is successfully made |
:::

:::Tab{title="🌐 Other platforms"}
No configurations applicable
:::
::::

### Creating Draft Orders

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
The payment flow works broadly the same for a Company User as for a standard customer. When the Company User places an order, the orders will by default enter Shopify in the **Draft order** status with the order saved in the account of the "main user". Within the "Notes" section, under "Additional details", you'll find the email address of the company user who placed the order (within the "Company User Email" field). Just as with any order in Shopify, you'll see the customer's details on the top right.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pW7YhdhRb9i5wHgdh8tcf_image.png "A draft order in Shopfy")
:::

:::Tab{title="🌐 Other platforms"}
No configurations applicabMaking a payment against an order
:::
::::

### Making a payment against an order

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
Depending on the payment method used by the Company User, if the customer is required to make payment, they'll receive an **automatic email notification** detailing their order and a button to checkout. This uses the 'Send invoice' feature of Shopify Draft orders and you can learn more about [how this works here](https://help.shopify.com/en/manual/orders/create-orders#share-checkout-link-with-customers).

Once the customer completes their purchase by making payment, the order is then marked as paid and will then display within your **Shopify Orders** area.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zEQhqqZ6M5lz0YIBAiNKT_image.png)

:::hint{type="info" attributes="[object Object]"}
You can edit this email template by going to **Settings > Notifications** within Shopify and search for the **Draft order invoice** template
:::

If the customer hasn't made payment for any reason or you are processing it manually, within Shopify you can open the order and easily resend or manually mark as paid. Please note, the order will stay as a Draft order until action has been taken.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/rKRXVjO8tWtL1e66M30HR_image.png)
::::

:::Tab{title="🌐 Other platforms"}
No configurations applicabMaking a payment against an order
:::
:::::



***

## Roles

"Roles" let you set up specific privileges for Company Users that are invited. To set a role for a Company User, from the main My Account overview click the "**Invite new user**" link to get started. Within the invitation screen, you'll see a section "**User role**".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vUvTku2febvP_C9fxbIyC_image.png)

There are currently two types of roles available:

| Role       | Details                                                                                                                                |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `Standard` | This will allow users to place orders and view all account activity within your shared company account                                 |
| `Limited`  | Users will be able to add items to an order but not complete orders. All orders will be sent to the company account owner for approval |

### Limited access

If the invited Company User is set to "Limited", they will be prompted during the checkout process that their order will need reviewing by a team member before it can be completed.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/V_pbPzMgW3jZt6kXP6Zlm_image.png)

Orders placed this way are essentially "pending" orders that will be invisible to the merchant. Once the order has been approved, this will then create a full order which can then be reviewed, completed, and fulfilled as normal.

### Reviewing orders

When an order is submitted for review, this will show within the main Company User's account under "Recent Activity" with a status of "Requires Approval". The Order ID will be prefaced with a special identifier (e.g. #P-1234), differentiating it from other orders. You can [learn more](docId\:gznStzTqCRffLFZSTAw0N) about how this works.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/sCLAejO6VhfOwJ6q25pPQ_image.png)

When clicking through to an order, within the Actions menu, the Company User can then perform the following actions:

| Action           | Details                                                                                                                                   |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `Complete Order` | This will load the contents of the order into a new "Cart", allowing the Company User to proceed through the checkout and place the order |
| `Cancel Order`   | This will cancel the order and remove it from the "Requires approval" list.                                                               |

:::hint{type="info"}
**Please note**
Previously, submitting an order for review did not trigger email notifications to the main Company User. With the new update, **notifications are now sent automatically**.
:::

**Email notifications** are sent to both the "main" and "limited" Company Users at key stages of the order review process, without requiring them to be logged in:

- **Main User Notification**: When a limited user submits an order for review, the main Company User will receive an email alert, notifying them of the pending order that requires their attention.&#x20;
- **Limited User Confirmation**: Once the main Company User approves or amends the order, the limited user will receive a confirmation email, updating them on the status of their order.&#x20;

:::ExpandableHeading
**Email notifcation examples (click to expand)&#x20;**

![](https://archbee-image-uploads.s3.amazonaws.com/RVgCGw6NuWxwjkLvPcIcT-iq_7ExqAVImMuNn1EXw-N-20241111-182413.jpg)
:::

:::hint{type="info"}
**Please note**
The name displayed at the top of Company User emails, as shown in the dropdown example above, is synchronised directly from your eCommerce platform by default. If you’d like to customise this information, you can learn how to modify and overwrite your [default store details](docId\:gznStzTqCRffLFZSTAw0N).&#x20;
:::



***

## Removing users

As with inviting new users, the "main user" can also easily remove users. From the "Company Users" widget, simply click the icon to remove the user's access to the company.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/aEVD9uIyiVP3gaF-F2O26_image.png)



***

## Manually associating users

As well as the "main user" being able to invite users, it's also possible to associate users to a company manually by using special settings against a customer.

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                         |
| ------------------ | ------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields) |
| `Metafield type`   | This must be set as a `single line text`                                        |
| `Namespace`        | This must be set as `sparklayer`                                                |
| `Key`              | This must be set as `parent_customer_id`                                        |
| `Value`            | This must be the customer ID of the main user (see below)                       |

The manual association works by simply adding the **main account customer ID** into the `parent_customer_id` metafield.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/A3a5SZj-7aFbt-FwAjx7Y_image.png)

You can find the **main account customer ID** in the URL when navigating a customer within the admin. For example, the URL in your browser may look something like this:

`https://your-shopify-store-url.com/admin/customers/6494756339930`&#x20;

In this example, the main account customer ID would be `6494756339930`

In addition, you can manually set the user's role to Standard or Limited using the following metafield:
::::

:::Tab{title="🌐 Other platforms"}
Please refer to the [SparkLayer Technical Docs](https://hub.sparklayer.io/tech-docs)
:::
:::::

| Item               | Details                                                                                                       |
| ------------------ | ------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields)                               |
| `Metafield type`   | This must be set as a `single line text`                                                                      |
| `Namespace`        | This must be set as `sparklayer`                                                                              |
| `Key`              | This must be set as `role`                                                                                    |
| `Value`            | To set the customer's role as Standard: `main`<br />To set the customer's role as Limited: `limited-customer` |

:::hint{type="info"}
**Please note**
In addition to adding the metafields above, any customers added manually will also require the appropriate b2b tags to be associated to their customer record in Shopify. For example, if the main user has tags `b2b` and `b2b-company-1`, these must also be added to the customers being associated.
:::



***

## Compatibility with Sales Agents

Company Users is fully compatible with the [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) allowing sales agents to add users to a company, just as a "main user" would. The inviting users works in the same fashion as detailed above.



***

## Customising text

It's possible to adjust the text specific to the Company Users functionality by adding special code to the SparkLayer Core Script.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "account.main.company-users.actions": "Actions",
    "account.main.company-users.title": "You're signed into a Company User account",
    "account.main.company-users.child-account-notice": "Any activity will be shared across all users from your company. This applies to orders, shopping lists, and addresses. Please speak to your company account owner if you have any queries.",
    "account.main.company-users.email": "Email",
    "account.main.company-users.delete-confirm-message": "Are you sure you want to remove this user from your company?",
    "account.main.company-users.delete-failed-message": "Failed to delete user.",
    "account.main.company-users.header": "Company Users",
    "account.main.company-users.invite-button-text": "Invite new user",
    "account.main.company-users.invite-user.header": "Invite new user",
    "account.main.company-users.invite-user.invite-sent": "User invite sent",
    "account.main.company-users.invite-user.invite-failed": "Sorry, something has gone wrong and we have not been able to invited this user",
    "account.main.company-users.invite-user.form.first-name": "First Name",
    "account.main.company-users.invite-user.form.last-name": "Last Name",
    "account.main.company-users.invite-user.form.email": "Email",
    "account.main.company-users.invite-user.form.send-invite": "Create Company User",
    "account.main.company-users.invite-user.form.cancel": "Cancel",
    "account.main.company-users.invite-user.form.description": "When you invite company users, any activity will be shared across your team including orders, shopping lists, and addresses. If the user you're inviting doesn't already have an account to login to our store, they'll receive an Account Activation email and they'll be asked to set a password to gain access. If they already have an account, they can login with their existing details by visiting the login page. If you're unsure about inviting users, please speak to your contact within our company."      
    }
  },
/* End of code */
```



***

## Limitations

Please note the following limitations of Company Users:

- **Inviting users**: when a new user is invited, they will receive the "Activate Account" email from Shopify. It is not currently possible to create a custom email notification for this
- **Restricting access**: when Company Users is activated in the SparkLayer Dashboard, it will apply to all customers that login. It is not possible to manually specify which customers have access to Company Users. &#x20;


[title] How SparkLayer Works
[path] Introduction/

## Introduction

SparkLayer is an eCommerce platform that enables brands to rapidly scale and grow their B2B operation. It works alongside your existing online store, enabling a powerful self-service portal for your B2B customers to place orders, manage their account, and much more.&#x20;

::embed[]{url="https://www.youtube.com/watch?v=23uqVqW59d0"}

Once SparkLayer is set up, your B2B customers can simply login via your website and they'll then see all the B2B pricing and other B2B rules you've set up (e.g. payment methods, minimum spend shipping rules, and more).

Under the hood is a technical feature-set that allows you to connect your mission-critical systems (such as an ERP or CRM) allowing automation of your processes. SparkLayer enables this in one complete solution, helping you achieve your ambitious B2B goals!&#x20;

SparkLayer works out-of-the-box with major eCommerce platforms, including:

::::LinkArray
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/PIEXshl0tG1QL9mwDUrSZ_shopify.png"}
[Shopify](docId:7TmhkOEHbgEGGFdd6EMr1)
Works with all versions
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/MfTGR03MBhkc_usK1Rlo3_bigcommerce.png"}
[BigCommerce](docId:6zLPH9x8-qEUITCHs2obE)
Works with all versions
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-AHbuSveltgWw9xRDwxWOk-20250210-144900.png"}
[Wix](docId\:vEqgPapEA8X0X60U6ZWZe)&#x20;
Works with all versions
:::
::::



***

## The key elements to SparkLayer&#x20;

To better understand how SparkLayer works, there are a number of key elements:

::::WorkflowBlock
:::WorkflowBlockItem
**🔗  Connecting to your website**
Firstly, SparkLayer connects to your existing eCommerce website (e.g. [Shopify](docId:7TmhkOEHbgEGGFdd6EMr1)). Once connected, it then synchronises specific data such as product and customer information.&#x20;
:::

:::WorkflowBlockItem
**📋  B2B data configuration**
Secondly, it allows B2B data and rules to be configured, such as [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) and settings for your [Customers](docId:5_lWMNohhjBJJppg9E6Vh) (e.g. what payment methods they can use). You can manage this manually via the SparkLayer [Dashboard](docId\:nzsx6U_DAWtzVzSehf4oR) or you can even automate this by connecting SparkLayer to your backend system (e.g. ERP or CRM) via the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT)
:::

:::WorkflowBlockItem
**😊  B2B frontend experience**
Thirdly, it enables a beautiful [Frontend](docId\:OgKfvQX13dHW2582D57kJ) "self-service" experience for your B2B customers, allowing them to place orders, manage their account, re-order, and much more. This all happens on your existing website by enabling special "widgets" within your code.
:::

:::WorkflowBlockItem
**👪  Sales teams support**
&#x20;If you have a sales team within your business, our [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) tool empowers them to manage B2B customer accounts. They can also manage the full "quote to order" process using our powerful [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo).&#x20;
:::

:::WorkflowBlockItem
**🔄  B2B order processing**
Once everything is set up, any orders placed by B2B customers will arrive into your website's admin (e.g. [Shopify](docId:7TmhkOEHbgEGGFdd6EMr1)) where you can then review them, make edits, or simply process them for shipment. This all uses your existing process and workflows that you've already got set up!
:::
::::



***

## Next steps

Visit our [Getting Started](docId:-5djX1YCIgzAI6MRkq0u6) guide on how to get up and running with SparkLayer or [try our demo](docId:87ILO_vHmG3XUXKecOLXv) to see it in action!








[title] Technical Information
[path] Frontend/

## Introduction

SparkLayer is designed to be as lightweight as possible and uses modern JavaScript technology to power the frontend.&#x20;



***

## How SparkLayer is loaded

All elements of SparkLayer are fully-hosted using a best-of-breed server infrastructure, meaning there's no code for you to self-manage, host, or maintain going forward.

For performance, SparkLayer Frontend **only** loads when a customer successfully logs into a website; all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.



***

## Browser Support

We currently support the latest two versions of the following major browsers:

- Google Chrome
- Mozilla Firefox
- Apple Safari
- Microsoft Edge
- Apple Safari for iOS
- Google Chrome for Android and iOS

Please note, SparkLayer may not work fully with beta or pre-release versions of these browsers



***

## Mobile support

The [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) work across all devices (e.g.desktop, tablet, mobile), ensuring customers can easily browse your website no matter which device they are using.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/khnmG7YCoVYuMrfoU5XEW_archbee-1.jpg)



***

## Building custom interfaces

It's possible to extend the frontend of SparkLayer to create more custom layouts. Please refer to [JavaScript SDK & Headless](docId\:B-blQYlOC3QNKrit7XLgw)



***

## Event tracking for analytics (Google Analytics, GA4)

:::hint{type="warning"}
**Please note**
This integration requires some technical setup, so please ensure a developer is available to assist. For full instructions, consult our [our technical docs here.](docId\:nRnplHclcT3sLJt_C_9pF)&#x20;
:::

**Integrating Google Analytics with SparkLayer**

If you're looking to track key events in Google Analytics (GA4) or Google Tag Manager (GTM) through SparkLayer, you can set this up directly in your integration. This will help you capture valuable B2B events like "add to cart" "checkout," and "purchase" actions.&#x20;

**Key details to note:**

- Supports GA4, GTM, and custom analytics.
- Configuration is done using `sparkOptions`.

Detailed code examples and setup steps are available in [our technical docs here.](docId\:nRnplHclcT3sLJt_C_9pF)&#x20;

:::ExpandableHeading
**Available Events (expand to see)**

| Event Name           | Description                                              |
| -------------------- | -------------------------------------------------------- |
| `addToCart`          | Triggered when a product is added to the cart.           |
| `cartUpdate`         | Fired when the cart is updated (e.g., quantity changes). |
| `shoppingListSave`   | Occurs when a shopping list is saved.                    |
| `shoppingListLoad`   | Occurs when a shopping list is loaded.                   |
| `shoppingListDelete` | Occurs when a shopping list is deleted.                  |
| `csvUpload`          | Triggered when a CSV file is uploaded.                   |
| `quickAdd`           | Fired during quick add actions.                          |
| `finalStageCheckout` | Occurs at the final stage of the checkout process.       |
| `shippingUpdate`     | Fired when shipping details are updated during checkout. |
| `beginCheckout`      | Triggered when the checkout process begins.              |
| `purchase`           | Occurs upon successful purchase completion.              |
| `viewCart`           | Fired when the cart is viewed.                           |


&#x9;


:::

::::ExpandableHeading
**Sample code to add (expand to see)**

:::hint{type="info"}
**Updating sparkOptions and text**
You can enable this feature by adding some special code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
:::

```javascript
window.sparkOptions = {
  // ... other SparkLayer options ...

  analytics: {
    providers: [
      {
        handler: 'ga', // Use 'ga' for Google Analytics
        events: {
          addToCart: true,
          cartUpdate: true,
          shoppingListSave: true,
          shoppingListLoad: true,
          shoppingListDelete: true,
          csvUpload: true,
          quickAdd: true,
          finalStageCheckout: true,
          shippingUpdate: true,
          beginCheckout: true,
          purchase: true,
          viewCart: true
        }
      },
      {
        handler: 'gtm', // Use 'gtm' for Google Tag Manager
        events: {
          addToCart: true,
          cartUpdate: true,
          shoppingListSave: true,
          shoppingListLoad: true,
          shoppingListDelete: true,
          csvUpload: true,
          quickAdd: true,
          finalStageCheckout: true,
          shippingUpdate: true,
          beginCheckout: true,
          purchase: true,
          viewCart: true
        }
      },
      {
        handler: function(eventName, eventParam) {
          console.log('Event fired to custom provider:', eventName, eventParam);
          // Implement your custom analytics logic here
        },
        events: {
          addToCart: true,
          cartUpdate: true,
          shoppingListSave: true,
          shoppingListLoad: true,
          shoppingListDelete: true,
          csvUpload: true,
          quickAdd: true,
          finalStageCheckout: true,
          shippingUpdate: true,
          beginCheckout: true,
          purchase: true,
          viewCart: true
        }
      }
    ]
  }
};
```


::::


[title] Frontend
[path] /

## Introduction

SparkLayer comes with ready-made B2B-optimised "widgets" that we collectively call the *SparkLayer Frontend*. The widgets simply overlay sections of your existing eCommerce store and enable our [powerful B2B features](docId\:SSzdKXuNMlEIDOOITHQcU).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/0RBWC4nAqwhUdESffWrg__ecommerce-tech-sparklayer.jpg)

The best part? You can do away with having to build and maintain these yourself, it's super lightweight, and works with leading eCommerce platforms.



***

## Explore more

::::LinkArray
:::LinkArrayItem
[Integration Guide](docId\:QWXsYM9X5_pvIOGUteKcP)

Learn how to add SparkLayer to your website with our special frontend widgets
:::

:::LinkArrayItem
[Features](docId\:SSzdKXuNMlEIDOOITHQcU)

Explore the available features and configurations available out of the box
:::

:::LinkArrayItem
[Customising the Design](docId\:qCt2Zk8wjhYIV2ZbVBJYy)

SparkLayer can be tailored to match your website branding via CSS configurations
:::

:::LinkArrayItem
[JavaScript SDK](docId\:B-blQYlOC3QNKrit7XLgw)

Looking to build a more custom interface? Extend SparkLayer with our frontend SDK.
:::

:::LinkArrayItem
[Technical Information](docId\:qD08Q-eiJ2-8k1MweLqca)

Learn about how SparkLayer is loaded, browser support, and more!
:::
::::






[title] Product Price Interface
[path] Features/Frontend Interfaces/

## Introduction

The Product Price Interface lets you display B2B pricing for a product anywhere on your website. It can be used alongside (or instead of) the other product interfaces and gives you flexibility to customise how you want your pricing to be shown to your customers.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/lXL7YQyjuFT6FMA3tdFxw_image.png)

:::hint{type="success"}
**SparkLayer Interactive Demo**
You can explore how the SparkLayer Product Page Interfaces work in [our interactive demo](https://www.figma.com/proto/5FPCY5hSGl7mlwjsjMZI2t/SparkLayer-Interfaces?page-id=0%3A1\&type=design\&node-id=86-36708\&viewport=554%2C-398%2C0.33\&t=34VlPwbCqpvQOTsh-8\&scaling=min-zoom\&starting-point-node-id=35%3A7920\&hide-ui=1).
:::



***

## How it works

The Product Price Interface lets you show B2B pricing anywhere on the product pages on your website. This could include product collection (or "category") pages or product detail pages. There are two configurations available:

| Item          | Details                                                                                                               |
| ------------- | --------------------------------------------------------------------------------------------------------------------- |
| `B2B pricing` | This shows logged in customers their specific B2B pricing                                                             |
| `RRP pricing` | This shows logged in customers the RRP pricing you've set for the product. [Learn more](docId\:S_VTlJBorGmnwjjfSMom9) |



***

## Integrating the code

To add the Product Price Interface to your website, you just need to add a single line of code to your product detail page template based on which pricing type you'd like to show. You can also combine the pricing types anywhere on your website.

```javascript
<!-- Use this to show the B2B pricing -->
<spark-product-price parent-id="{{ product.id }}"></spark-product-price>
```

```javascript
<!-- Use this to show the RRP pricing -->
<spark-product-rrp parent-id="{{ product.id }}"></spark-product-rrp>
```

Once this is added, the interface will display for all logged in B2B customers.

:::hint{type="info"}
**Please note**
Based on the platform you're using, the variable `product.id` will need to be adjusted to the appropriate setting. If you're installing on your Shopify website, please see [our guide here](docId\:x6xahBJ_9KYJTHD80_1QH).
:::

:::hint{type="warning"}
**Important!**
If you're using SparkLayer on your existing website, you will need to hide elements that you don't want your B2B customers to see. Please see our [full guide here](docId\:QWXsYM9X5_pvIOGUteKcP).
:::



***

## Configurations

SparkLayer supports a wide range of configurations you can apply to the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa). Please see our [full guide here](docId\:SBEaOaCq_A7FfbTatX8bD) on what's possible!

[title] Customer Pricing
[path] Features/Configurations/

:::hint{type="info"}
**Price Lists**
To learn more about how pricing works, view [our full guide here.](docId\:s8XcbZGxQpgdeIGWtXseT)
:::

## Customer percentage discounts

As well as assigning [price lists](docId\:s8XcbZGxQpgdeIGWtXseT) to customer groups, you can go a step further and add additional percentage discount on top of this at a customer-specific level.&#x20;

For example, let's say you've set up your B2B customers and assigned them to a price list but you want to give a range of these customers an additional 25% discount on top of these prices. SparkLayer lets you do this simply by adding special settings against a customer record.

To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                         |
| ------------------ | ------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields) |
| `Metafield type`   | This must be set as an `number_decimal`                                         |
| `Namespace`        | This must be set as `sparklayer`                                                |
| `Key`              | This must be set as `discount_percentage`                                       |
| `Value`            | This must be set as an decimal, e.g. `10, 22.5, 50.25 etc`                      |

:::hint{type="info"}
**Discounts and promotions**
SparkLayer also allows you to set up powerful discounts. [Learn more](docId\:WrejPw9URyjQwiQeKs_Cg)
:::
::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                               |
| ------------------ | ----------------------------------------------------- |
| `Custom data type` | Customers                                             |
| `Metafield type`   | This must be set as an `decimal`                      |
| `Namespace`        | This must be set as `sparklayer`                      |
| `Key`              | This must be set as `discount_percentage`             |
| `Value`            | This must be set as an decimal, e.g. `10, 20, 50 etc` |

For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::



***

## Customer-specific price lists&#x20;

As well as assigning price lists to customer groups, you can go a step further and set specific price lists per customer (this overrides the customer group price lists).&#x20;

For example, let's say you've set up your standard B2B price list but you want specific customers to get additional pricing discounts on some (or all) products. To achieve this, you can create an additional price list, upload your prices via SparkLayer, and then simply set this to apply to a customer.

To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                                                                                       |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields)                                                               |
| `Metafield type`   | This must be set as a `json` string                                                                                                           |
| `Namespace`        | This must be set as `sparklayer`                                                                                                              |
| `Key`              | This must be set as `price_lists`                                                                                                             |
| `Value`            | An example of just one price list:``<br />`["price-list-handle-one"]`<br />For two, use commas:<br />`["price-list-handle-one", "base-list"]` |
::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                                                                                                                       |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | Customers                                                                                                                                     |
| `Metafield type`   | This must be set as a `json` string                                                                                                           |
| `Namespace`        | This must be set as `sparklayer`                                                                                                              |
| `Key`              | This must be set as `price_lists`                                                                                                             |
| `Value`            | An example of just one price list:``<br />`["price-list-handle-one"]`<br />For two, use commas:<br />`["price-list-handle-one", "base-list"]` |

For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::

:::hint{type="success"}
Learn more about how price lists work [our guide here](docId\:s8XcbZGxQpgdeIGWtXseT).
:::


[title] Data Tables
[path] Features/Forms/

# Introduction

Data tables let you store reusable structured data for your forms. Think of them as a simple spreadsheet inside the Forms system.

They’re useful when you want to:

- power select, radio, or multi-select fields from a central list
- reuse the same data across multiple forms
- look up table rows and values in calculations, conditions, and workflow logic
- keep your form logic cleaner by managing data in one place

### How data tables work

Each data table contains:

- columns, which define the data you want to store
- rows, which hold the actual records
- views, which let you filter rows and control which columns are shown

Data tables currently support these column types:

- Text
- Number
- Date

### Common use cases

You can use data tables for things like:

- product lists
- branch or store locations
- pricing bands
- sales reps or account managers
- internal reference codes
- approved option lists for advanced forms

### How to set one up

1. Create a new data table.
2. Add the columns you need.
3. Add rows manually, or import them from CSV.
4. Connect the table to a choice-based field in your form, or reference it inside calculations and workflows.

You can also export table data to CSV when needed.

### Example

You might create a Products table with columns for:

- product name
- SKU
- category
- price

You can then use that table to populate a choice field in a form, and use the same table data later in workflow logic or calculations.

### Best practice

Use data tables when the same list or lookup data needs to be managed in one place and reused across multiple forms. This makes updates easier and helps keep forms consistent.


[title] B2B Catalogs
[path] Features/

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/K1gxDnbxj_kaYrN15-QbN-20260430-121629.jpg)

B2B Catalogs is a free SparkLayer app that lets you control which products are visible to different types of customers on your Shopify store. Hide products from B2C customers, restrict items to B2B-only, or show different product ranges to different customer groups - all using simple tags, no code required.

[Install B2B Catalogs](https://apps.shopify.com/sparklayer-b2b-catalogs) from the Shopify App Store, then head to our [B2B Catalogs documentation](https://docs.sparklayer.io/b2b-catalogs/) for the full setup guide.

[title] Workflows & Automations
[path] Features/Forms/

## Introduction

Workflows let you automate actions when something happens in a SparkLayer Form — for example sending notifications, updating data, or triggering internal processes.

Instead of building manual processes around form submissions, workflows allow you to create automated flows using a visual editor.&#x20;

Typical SparkLayer use cases include:

- Trade account approvals&#x20;
- Internal notifications
- Order request processing&#x20;
- Conditional routing based on customer data&#x20;



:::hint{type="info"}
Please note that creating and editing of workflows is only available on the Growth plan and above.
:::





***

## 🧠 What is a workflow?

A workflow is an automated sequence that runs when an event occurs.

Every workflow follows a simple structure:

:::BlockQuote
Trigger → Step → Step → Step → End
:::

Each workflow contains:

| Component     | Description                         |
| ------------- | ----------------------------------- |
| `Trigger`     | The event that starts the workflow  |
| `Steps`       | Actions performed after the trigger |
| `Connections` | Paths that link steps together      |

Workflows are created visually by connecting nodes together on a canvas.&#x20;

:::hint{type="info"}
If you chose to receive notifications on new submissions when creating a form, then your form already has a workflow! Click on the Workflows tab to see it.
:::





***

## Available Triggers

Triggers define when a workflow starts.

| **Trigger**             | Use this to                                                                        |
| ----------------------- | ---------------------------------------------------------------------------------- |
| Form submitted          | Run the workflow when a form is completed and submitted.                           |
| Entry created           | Run the workflow when a new entry is created (user starts filling out the form).   |
| Answer updated          | Run the workflow when one or more selected form answers change.                    |
| Internal field updated  | Run the workflow when one or more selected internal fields change.                 |
| Page loaded             | Run the workflow when a selected form page is loaded.                              |
| Button clicked          | Run the workflow when a button field on the form is clicked.                       |
| Internal button clicked | Run the workflow when an internal fields button field is clicked by an admin user. |
| API request             | Run the workflow when it is triggered by an API request.                           |

Common examples:

- Send an internal notification when a form is submitted
- Recalculate a value when an answer changes
- Start an approval process when an internal button is clicked
- Update internal fields when an admin changes review data
- Trigger a workflow from another system using an API request

## Available Steps

Steps define what the workflow does after the trigger runs.

| **Step**            | **What it does**                                                                                                               |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Send email          | Sends an email to one or more recipients.                                                                                      |
| Condition           | Branches the workflow based on rules.                                                                                          |
| Calculation         | Performs calculations using numbers, formulas, and Data References.                                                            |
| For each loop       | Repeats a set of steps for each item in a list, such as line items, repeatable fields, or Data Table rows.                     |
| Update entry or row | Updates a field value on a form entry or Data Table row.                                                                       |
| Clear answer        | Clears one or more values from a form entry or Data Table row. Useful when a value should be reset after related data changes. |
| Read/Unread entry   | Marks an entry as read or unread.                                                                                              |
| Create entry or row | Creates a new form entry or Data Table row.                                                                                    |
| Delete entry or row | Deletes a form entry or Data Table row.                                                                                        |
| API request         | Sends an HTTP request to an external system.                                                                                   |
| Get customer        | Looks up an existing SparkLayer customer by ID, platform ID, or email.                                                         |
| Create customer     | Creates a customer in the eCommerce platform and SparkLayer.                                                                   |
| Update customer     | Updates an existing SparkLayer customer.                                                                                       |

## Step Paths

Some steps have multiple paths. Paths control what happens next.

| **Step**         | **Paths**                                |
| ---------------- | ---------------------------------------- |
| Condition        | True, False                              |
| For each loop    | Loop body for each iteration, After loop |
| API request      | Success, Error                           |
| Get customer     | Found, Not found, Error                  |
| Create customer  | Success, Error                           |
| Update customer  | Success, Error                           |
| Most other steps | Next                                     |

Example: an API request can continue on the success path if the request works, or follow the error path if the request fails.

## Choosing the Right Step

- Use **Condition** when the workflow needs to make a decision.
- Use **Calculation** when you need to calculate totals, scores, discounts, or other numeric values.
- Use **Update entry or row** when you want to write a value back into the current entry, an internal field, another form entry, or a Data Table row.
- Use **Clear answer** when a previous value is no longer valid and should be removed. This is useful for dependent fields, such as clearing a selected option after the field that controls its available options changes.
- Use **For each loop** when you need to process every item in a list, such as repeatable fields, line items, or filtered Data Table rows.
- Use **API request** when another system needs to receive form or workflow data.
- Use the **SparkLayer** **customer** steps when the workflow needs to find, create, or update customer account data.



***

## 🚀 Creating a workflow

To create a workflow:

1. Open your form in SparkLayer&#x20;
2. Go to the **Workflows** tab&#x20;
3. Click **Add workflow**&#x20;
4. The visual editor will open&#x20;

### Add a trigger

Triggers define when the workflow runs.

Examples:

- Form submitted&#x20;
- Entry answer updated&#x20;
- Internal field updated
- Workflow trigger button clicked

To add a trigger:

1. Click **Add Trigger** on the canvas&#x20;
2. Select the trigger type&#x20;
3. Configure any options

Steps can use [Data References](docId\:Bj9Tb3GN_VYbi1-Ehm4Rd) to read and write values to current entry, workflow run data, and other data sources.

### Add steps

Steps define what happens after the trigger.

To add a step:

1. Click the **Add step** button, or drag the path handle out from an existing step
2. Choose a step type&#x20;
3. Configure the action&#x20;
4. Connect to additional steps if needed&#x20;

You can build simple linear workflows or create branches using conditions.&#x20;



***

## 🧾 Publishing workflows

Workflows are part of your form version.

This means:

- Changes remain in **Draft** until published&#x20;
- The live workflow only updates when the form version is published&#x20;
- Older entries continue using the workflow version they were created with&#x20;

To activate a workflow:

1. Save your changes&#x20;
2. Publish the form version&#x20;

This keeps automation stable even while you make updates.&#x20;



***

## 🎛 Understanding the workflow canvas

The workflow editor uses a visual canvas where you arrange nodes and connections.

### Navigation

| Action         | How it works           |
| -------------- | ---------------------- |
| `Pan`          | Click and drag         |
| `Zoom`         | Scroll or use controls |
| `Select node`  | Click the node         |
| `Multi-select` | Shift + click or drag  |

### Nodes

Nodes represent triggers and steps:

| Node type       | Purpose                            |
| --------------- | ---------------------------------- |
| `Trigger nodes` | Starting point for workflows       |
| `Step nodes`    | Actions performed during execution |
| `Connections`   | Paths between nodes                |

Click a node to:

- Edit settings&#x20;
- View input/output data&#x20;
- Delete or reconnect it&#x20;



***

## 🔗 Connecting steps

You connect steps by dragging from one node to another.

### Connection types

| Path           | Meaning                   |
| -------------- | ------------------------- |
| `Next`         | Continue to the next step |
| `True / False` | Conditional branching     |
| `Error`        | Run when a step fails     |
| `Loop`         | Used in repeat processes  |

A single step can branch into multiple paths, allowing complex automation flows.&#x20;



***

## ⚙️ How workflows run

Workflows execute **synchronously**, meaning steps run one after another in order.

Execution flow:

1. Trigger fires&#x20;
2. Steps execute sequentially&#x20;
3. Entry data updates&#x20;
4. Workflow completes&#x20;

During execution, workflows can access:

- Entry data&#x20;
- Form structure&#x20;
- Outputs from previous steps&#x20;
- Data tables or stored values&#x20;



***

## 📊 Workflow runs & history

Every time a workflow runs, SparkLayer records a run log.

### Viewing workflow runs

1. Open an entry&#x20;
2. Go to **Workflow Runs**&#x20;
3. Select a run to view details&#x20;

Each run includes:

| Data               | Description                  |
| ------------------ | ---------------------------- |
| `Start & end time` | When execution occurred      |
| `Duration`         | Total runtime                |
| `Status`           | Completed or failed          |
| `Step logs`        | Inputs, outputs, and results |

This helps diagnose issues without needing developer access.&#x20;



***

## 🧪 Debugging workflows

When something doesn’t work as expected:

1. Open the workflow run&#x20;
2. Review each step&#x20;
3. Check error messages or failed conditions&#x20;
4. Adjust the workflow or entry data&#x20;

You can see exactly which path was taken through the workflow — including conditional branches.&#x20;

## 🧩 Example workflow patterns

### 📩 Simple notification

:::BlockQuote
Trigger: Form submitted
↓
Send internal email
:::

### 🔀 Conditional routing

:::BlockQuote
Trigger: Form submitted
↓
If category = Sales
&#x20;→ Notify sales team
Else
&#x20;→ Notify support team
:::

### 🧾 Multi-step approval process

:::BlockQuote
Trigger: Form submitted
↓
Calculate totals
↓
Update entry fields
↓
Send confirmation email
↓
If total > threshold → Request approval
:::

### 🧾 Dependent Field Reset

Use this pattern when one field controls the valid options for another field.

Example:

A customer selects a country. A second field shows regions for that country. If the customer changes the country, the previously selected region may no longer be valid, so the workflow clears it.

Pattern:

:::BlockQuote
Trigger: Answer updated
↓
Answer changed: Country
↓
Clear answer: Region
↓
The user can now select a valid region for the new country
:::

Common uses:

- Country → Region
- Customer group → Available products
- Product category → Product
- Department → Approval reason
- Order type → Required supporting details



***

## 💡 Best practices

**Keep workflows focused**

- One workflow per process&#x20;
- Avoid combining unrelated automation&#x20;
- Use clear naming&#x20;

**Test before publishing**

- Use preview mode&#x20;
- Submit test entries&#x20;
- Check workflow runs for errors&#x20;

**Plan for errors**

- Add error paths where needed&#x20;
- Log important outputs&#x20;
- Avoid breaking critical workflows&#x20;

**Optimise performance**

- Limit unnecessary API calls&#x20;
- Avoid overly long step chains&#x20;
- Keep automation logic clear and maintainable

[title] Forms
[path] Features/

## Introduction

SparkLayer Forms provides a **native, no-code form builder** that lets you capture, manage and act on customer data directly within SparkLayer. 

::embed[]{url="https://www.youtube.com/embed/_M4QphRF9_k"}

Forms can be used across your B2B journey - from **registration**, to **editing sales agent details** - all without relying on third-party apps or custom development.&#x20;

Forms are built and managed in the [SparkLayer Dashboard](https://app.sparklayer.io/forms) and can be embedded into your storefront or used internally by your team.

Common use-cases include:

- Wholesale / B2B registration forms
- Internal contact or enquiry forms
- Capturing structured customer data (e.g. VAT IDs, trade references, licences)
- Streamlining approval and onboarding workflows
- Reducing reliance on third-party form builders



***

## Features

At a top-level, [SparkLayer Forms](https://app.sparklayer.io/forms) supports the following range of features and configurations.

| Item                   | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Form Builder`         | - Build forms visually using a drag-and-drop builder
- Add flexible field types including text, email, phone, dropdowns, checkboxes, dates, addresses and file uploads
- Set fields as required or optional
- Apply validation rules (e.g. email, phone or tax ID formats)
- Show or hide fields using conditional logic
- Structure forms into multiple pages with headers, dividers and progress indicators
- Save progress and return later                                                                                                                                                                        |
| `Internal Fields`      | * Setup a internal fields for entry administration
* Internal Fields act as it's own form that will be shown to administrative users when reviewing the form submissions
* Internal Fields are not exposed to the end customer at any time
* Use these to setup internal workflows:
  - Changes to internal fields can trigger workflows
  - Use the Workflow Trigger field to add a button that can trigger a workflow
* You can use any features available in the main form for the internal fields setup including field display logic, custom validation, integration with workflows, adding multiple pages, etc. |
| `Publishing`           | - Preview forms before publishing
- Embed forms on your storefront&#x20;
- Create internal-only forms for team use
- Customise success or confirmation pages after submission                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `Branding`             | * Style forms to match your site using CSS variables
* Customise labels, help text and messaging                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `Entries & Management` | - View all submissions in one place
- Review individual responses and uploaded files
- See and update Internal Fields against a submission entry
- Track timestamps and submission status
- Export submissions to CSV for reporting or external systems                                                                                                                                                                                                                                                                                                                                                               |
| `Workflows & Actions`  | * Build custom automations that can be triggered by field updates, entry submissions, internal admin field updates, API calls and other triggers
* Workflows can perform a series of actions (called Steps) including:
  - Assign approved users to customer groups
  - Automatically apply tags based on responses
  - Map form data into your connected platform (e.g. metafields or customer data)
  - Perform an API request to your ERP or external system
  - Send an email
* Build custom review and approval workflows that fit your business, or start with a template                                       |



***

## Getting started

To begin using SparkLayer Forms, go to **Forms** within the [SparkLayer Dashboard](http://app.sparklayer.io/forms). You'll then be prompted to create a new form or edit an existing form.

:::ExpandableHeading
**1️⃣ Create your first form**

1. Go to **SparkLayer → Forms**&#x20;
2. Click **New Form**&#x20;
3. Enter a form name (e.g. *Trade Account Request*)&#x20;
4. Click **Create**&#x20;

You’ll be taken to the form builder.
:::

:::ExpandableHeading
**2️⃣ Add fields to your form**

Use fields to collect the information you need from customers.

Common field setup

| Field Type | Example Use                |
| ---------- | -------------------------- |
| Text       | Company name, contact name |
| Email      | Customer email address     |
| Textarea   | Notes or messages          |

**To add a field:**

- Click **Add field**&#x20;
- Choose the field type&#x20;
- Configure:&#x20;
  - Label&#x20;
  - Required toggle&#x20;
  - Placeholder text&#x20;
- Click **Save**&#x20;
:::

:::ExpandableHeading
**3️⃣ Configure form settings**

Open the **Settings** tab to control how the form behaves.

| Setting            | What it does                        |
| ------------------ | ----------------------------------- |
| Form title         | Public name shown to customers      |
| Submit button text | Customise CTA wording               |
| Success message    | Confirmation shown after submission |
:::

:::ExpandableHeading
**4️⃣ Preview your form**

When you have added all the fields:

1. Click **Preview**&#x20;
2. Fill out the form to test it
3. Make any required tweaks
:::

:::ExpandableHeading
**5️⃣ Publish your form**

When your form is ready:

1. Click **Publish**&#x20;
2. Confirm changes&#x20;

Your form is now live inside SparkLayer.
:::

:::ExpandableHeading
**6️⃣ Add your form to your storefront**

Once published, you can embed the form where needed using one of the options:

1. On Shopify stores, you can use the **SparkLayer Form** block in your themes.
   - If you can't select your required form from the dropdown, you may need to re-visit the Sparklayer B2B & Wholesale sales channel app, and confirm any new permissions.
2. On all platforms, you can use the embed code directly:
   - Copy the embed snippet from the **Share** tab&#x20;
   - Add it to your theme or page content&#x20;
   - Save your changes
:::

:::ExpandableHeading
**7️⃣ View submissions**

When customers complete your form:

1. Open your form in SparkLayer&#x20;
2. Go to **Entries**&#x20;
3. Click any submission to view full details
:::



***

## Start with a Template

A few common form templates are available to get you started quickly. Forms created from templates can be further customised and extended with custom automations and extra fields.

### Customer Registration Form

Use this template to get a fully working customer registration form with the following features:

- Common registration form fields already setup
- New registration submission email notifications
- Internal approval workflow fields setup allowing easy approval or rejection of new applications
- On approval, automatic creation of the customer in the eCommerce platform
- Extendible with custom automations or extra fields

### Contact Form

Use this template for a customisable contact form:

- Add any required or optional fields
- Receive an email notification for new submissions
- Setup automations and administrative workflows

###



***

## Explore more

After creating your first form, explore:

[Form setup](docId\:ZMxs_yKAM14ynYNEoEMNw)
Configure how your form behaves, including settings, publishing, and version control.

[Field types](docId\:zJqYfItNqFnZq-kGLD2TS)&#x20;
Choose the right inputs to capture structured data from your customers.

[Form Entries](docId\:uSPvWmmpbtmrtHSpcNyOk)&#x20;
View, manage, and update submissions sent through your forms.&#x20;

[Conditional Logic](docId\:JZ1KsJxZIS72g2JNq8lee)
Show or hide fields dynamically based on customer responses.&#x20;

[Validation Rules](docId\:IjhTAqJO7CzJCRi98gSxf)&#x20;
Ensure form data meets your requirements before it’s submitted or processed.

[Workflows & Automations](docId\:KFk4KgojUGQV3Bolye--b)&#x20;
Automate actions and processes triggered by form activity.


[title] Form setup
[path] Features/Forms/


[title] Shopify
[path] Integrations/

## Introduction

SparkLayer is the powerful platform that transforms your existing Shopify website into a fully featured B2B solution. Say goodbye to complicated and costly installation processes and hello to a hassle-free setup that gets you up and running in no time!

::embed[]{url="https://www.youtube.com/watch?v=23uqVqW59d0"}

Once you've installed the [official SparkLayer for Shopify app](https://apps.shopify.com/sparklayer), SparkLayer enables a B2B-ready frontend interface that simply "overlays" sections of your Shopify store. The best part is you can retain your *existing* Shopify store design and layout and enable B2B alongside your retail operation (DTC).

## Supported Shopify Plans

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TN429Y5udMPGPctAvWKny_image.png)

SparkLayer works on all versions of Shopify, from Shopify Basic through to Shopify Plus. No matter which version of Shopify you use, you can easily enable SparkLayer on your Shopify store.&#x20;

:::hint{type="success"}
**Try our demo**
Want to test SparkLayer on an example Shopify Store? [Try our Demo](docId:87ILO_vHmG3XUXKecOLXv)
:::



***

## Get started

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[Installing SparkLayer on Shopify](docId:687ZiSnQ7rsITCGjjKFyb)

Learn about the steps to install SparkLayer on your Shopify store
:::

:::LinkArrayItem
[Shopify Customisations](docId\:ddIv5TDAnCayWTOJ0Vyb7)

Explore our tips and tricks on Shopify B2B customisations
:::

:::LinkArrayItem
[Shopify B2B Dawn Theme](docId\:LHkU0_G_4GVef1jAmgXmo)

Get a head start with our ready-made Shopify B2B theme
:::

:::LinkArrayItem
[Shopify Markets & Currencies](docId\:vex5XjFlT6Pvb0AzhlKQD)

Take your B2B international with Shopify Markets
:::

:::LinkArrayItem
[Shopify Metafields & Data Mapping](docId\:BxWnGB6b1n7QFfhTnu7pk)

Learn how to use the powerful Shopify metafields feature
:::

:::LinkArrayItem
[Shopify FAQs](docId\:P-7titr2d20hXBeixvKBZ)

See some of our most commonly asked questions!
:::

:::LinkArrayItem
[Shopify Companies](docId\:wrzSu8adFvbXOkF50hX5I)&#x20;

How SparkLayer works alongside Shopify Companies.
:::
::::


[title] Product Matrix Interface
[path] Features/Frontend Interfaces/

## Introduction

The Product Matrix Interface lets your B2B customers rapidly add products to an order in bulk via a special "matrix table" display. If your products come in multiple variant types (e.g. colour and size), it's a great way to allow customers to quickly see all variants available and quickly purchase them.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-Ec50OLf4l3c24ME0NA7b_image.png)

:::hint{type="success"}
**SparkLayer Interactive Demo**
You can explore how the Product Matrix Interface works on our [example product here](https://demo.sparklayer.io/collections/b2b-grid-mode/products/example-running-shoes).
:::



***

## How it works

:::hint{type="info"}
**Please note**
We only recommend using the Product Matrix Interface if you have products that have multiple variant option types (e.g. colour and size) with a large number of options.&#x20;
:::

The Product Matrix Interface replaces elements on your website's product detail page with a specially optimised layout that shows all the product options (variants) in **one single view**.&#x20;

::embed[]{url="https://www.youtube.com/embed/cloM8_DJ7eg"}

Once set up, the interface will be presented in a table and show the following information to the customer:

| Item               | Details                                                                                              |
| ------------------ | ---------------------------------------------------------------------------------------------------- |
| `Product pricing`  | Their specific B2B pricing and, optionally, RRP pricing                                              |
| `Variants`         | A matrix table of all available variants                                                             |
| `Quantity`         | The ability to select the quantity of a product using [Quantity Rules](docId\:CmxfrPgjQxfz9vJzTVv0D) |
| `Add to order`     | The ability to add items to an order                                                                 |
| `Quantity pricing` | Visibility of quantity pricing available (this is shown in an information popup)                     |
| `Stock level`      | The stock status of a product (e.g. pre-order)                                                       |
| `SKU`              | The product code (this is shown in an information popup)                                             |

The Product Matrix Interface also has handling for more than two variant groups. For each additional variant group, these will be presented within the table matrix for the customer to view. In the example below, the product is set up with Colour, Size, and an option to add a logo.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/kwRxGwEzt4WnkdBqqQhgt_image.png)



***

## Integrating the code

To add the Product Matrix Interface to your website, you just need to add a single line of code to your product detail page.

```javascript
<spark-product-matrix parent-id="{{ product.id }}"></spark-product-matrix>
```

Once this is added, the interface will display for all logged in B2B customers and they can begin placing orders.

:::hint{type="info"}
**Please note**
Based on the platform you're using, the variable `product.id` will need to be adjusted to the appropriate setting. If you're installing on your Shopify website, please see [our guide here](docId\:x6xahBJ_9KYJTHD80_1QH).
:::

:::hint{type="warning"}
**Important!**
When using the Product Matrix Interface, we recommend implementing it on your website in a location that gives plenty of space for the B2B customer to see. For example, you may want to position it **below** the product image and description on your product detail page and configure it to span the full-width of the page.
:::

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
If you're looking to apply the Product Matrix Interface to a **select range of products** on your store, one way to achieve this is to use product tags.

For products that you want to apply this to, you could set up a tag `b2b-product-matrix` and apply this to relevant products. Within your Shopify theme code, locate your product detail page (e.g. `sections/main-product.liquid`) and then apply some conditional Shopify Liquid code login.

```html
<!-- Show Product Matrix Interface for tagged products -->

{% if product.tags contains 'b2b-product-matrix' %}
     <spark-product-matrix parent-id="{{ product.id }}"></spark-product-matrix>
{% else %}
    <!-- Don't show anything -->
{% endif %}
        
 <!-- Show regular Product Detail Interface for other products-->

{% if product.tags contains 'b2b-product-matrix' %}
    <!-- Don't show anything -->
{% else %}
    <spark-pdp parent-id="{{ product.id }}"></spark-pdp>
{% endif %}
```
:::

:::Tab{title="🌐 Other platforms"}
Please refer to your platform on how to apply custom coding
:::
::::



***

## Configurations

SparkLayer supports a wide range of configurations you can apply to the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa). Please see our [full guide](docId\:m3DF4f0Eyc2rM-vUaRG9H) on what's possible!




[title] My Cart Interface
[path] Features/Frontend Interfaces/

## Introduction

The SparkLayer My Cart Interface provides your B2B customers with a rapid way to build and place orders on your website. Like the other [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa), the My Cart Interface replaces certain elements of your existing website, providing customers a seamless way to order from you.&#x20;

You can try our interactive demo by clicking the video below!

:::Iframe{iframeHeight="0" code="<a href=&#x22;https://www.figma.com/proto/5FPCY5hSGl7mlwjsjMZI2t/SparkLayer-Interfaces?page-id=0%3A1&type=design&node-id=86-36708&viewport=554%2C-398%2C0.33&t=34VlPwbCqpvQOTsh-8&scaling=min-zoom&starting-point-node-id=35%3A7920&hide-ui=1&#x22; target=&#x22;_blank&#x22;>&#xA;<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/interactive-cart-demo.mp4?v=45&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>&#xA;</a>"}

:::



***

## How it works

The My Cart Interface replaces your existing website's shopping cart with a specially-optimised layout. It works as an "overlay" and can be accessed on any page by any of the following ways:

- By clicking the shopping bag link, typically in the website's header providing this points to the URL `/cart`
- By adding products to an order and clicking the link within the notification (see below)
- By adding  `#spark-cart` to the end of a URL, e.g. `https://www.yourstore.com/#spark-cart`



***

## Notifications

When a customer adds an item to their order, this will trigger a notification to show on the top right of the screen. We refer to this as a "toast notification" and gives the customer instant feedback on their action.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qqYCUV-dK3LBTmyM1TyeR_image.png "The notification that shows when adding a product to an order")

:::hint{type="info"}
**Customising the notifications**
To see how to customise the styling and animations, please see [our guide here](docId\:qCt2Zk8wjhYIV2ZbVBJYy)
:::



***

## &#x20;Search & Lookup

:::hint{type="info"}
**Please note**
To benefit from the search tool below, you'll need to ensure your SparkLayer version is set to `3.8` or above. [Learn more about upgrading](docId\:QWXsYM9X5_pvIOGUteKcP)&#x20;
:::

The My Cart Interface has a built-in tool that lets customers rapidly add products to their order. There are a variety of types that you can select from:

| Type                   | Details                                                                                                                                                                                                                                                                                                                                                          |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Search`               | This allows you to search by **product name, variants, and other related criteria** and quickly add products to your order. It will also handle mis-spellings of keywords.<br />It also enables you to add products to your cart in the same way as the SKU/Barcode Lookup option. <br />*This type gives your customers the more feature-rich user experience.* |
| `SKU / Barcode Lookup` | This allows you to search by **SKU / Barcode** and will add items to an order only if an exact match is found. <br />*This type is useful if your customers use the tool purely for adding exact SKUs or Barcodes.*                                                                                                                                              |

### How to enable

Depending on your preference, you can enable these via the configuration area of the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/settings/general).

:::hint{type="info"}
**Hiding the search / lookup**
It's also possible to fully hide the search / lookup feature, you can manage this in the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/settings/general) by selecting **Hide search** from the **Cart search type**.
:::

### Understanding the types

::::Tabs
:::Tab{title="🔍 Search"}
The Search tool offers an easy way for your customers to quickly add items, allowing them to search by a range of criteria including product name, product description, product SKU, product variant name, product variant option name and barcode.

::embed[]{url="https://www.youtube.com/embed/61IRiGBcR6Q"}

The tool also handles mis-spellings and "partial matching", ensuring results are delivered where possible and allowing for a more user-friendly search. For example, when searching coffee, results will be returned for entries such as `coffe`, `cofee`, `cofe`

In the example below, searching `example coffee` returns results of any products that match this term, prioritising those most relevant.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/W16ynJRiwqxV2TNfFk6Nd_image.png)

Similar to the main cart, the customer will see the ability to add items to an order using the quantity entry box as well as full visibilty of any quantity discounts, pack size rules, and inventory status.
:::

:::Tab{title="➕ SKU / Barcode Lookup"}
The SKU / Barcode Lookup adds products to your order simply by typing in the SKU or Barcode (if you're store is set up to use barcodes, you can [read our guide here](docId\:m3DF4f0Eyc2rM-vUaRG9H)). If it finds a match, it will immediately add the item and you can subsequently make edits.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jVx-5vVN9L1cSMEx-Glmw_search.gif)
:::
::::

:::hint{type="info"}
**Please note**
Each type noted above automatically add products to the order **using the rules** you've set. For example, if the product has been configured to use [pack sizing](docId\:CmxfrPgjQxfz9vJzTVv0D) or minimum or maximum quantities, this will automatically be applied at the point of adding to the order.
:::

### Customising the text

It's also possible to adjust the text that shows by default in the search box by adding a special text overwrite as shown below. For example, if you're using barcodes, you may want to inform customers that they can use both a SKU and a barcode to search.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "cart.quick-order.search-placeholder": "Add products by SKU or barcode",
  }
},  
/* End of code */
```



***

## Intelligent Cart (AI)

SparkLayer Intelligent Cart introduces a revolutionary new way for your B2B customers and sales teams to build orders quickly and effortlessly using the power of AI.

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-DAUwPJh55AjR-rnQNbWSF-20250426-112809.jpg)

The magic lies in its simplicity: files and emails containing order details (such as SKUs, barcodes, and quantities) can be uploaded or emailed directly to SparkLayer, instantly populating a cart. Learn more about how this works in [our full guide here](docId\:rIAcYwzOMfwSomd5KB5p8).



***

## CSV file importing

It's possible to quickly bulk upload products by using the "Import CSV file" feature within the 'Options' menu.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fIfs9qr9HX70DsWEH5z4L_image.png)

SparkLayer supports two ways to upload the contents of a CSV file:

| Type          | Details                                                                                                                                                                                                                 |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `File upload` | Customers can manually upload a CSV file by specifying two columns:<br />* **If using SKUs:**  `sku` and `qty` (you can also customise these names, please see below)
* **If using barcodes:&#x20;**`barcode` and `sku` |
| `Pasting`     | Customers can paste the contents of a CSV file into the text entry box                                                                                                                                                  |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/hpSdFqycxEBzWE7aR0BYS_image.png)

By default, SparkLayer will accept a CSV file that has two columns, `sku` (or `barcode`) and `qty`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/uukXyLNCeo_M6H9DZH-UA_image.png)

It's possible to configure customised titles for these columns, if you have a requirement for them to be more personalised for your customers. In the example below, the columns have been changed to `Item No.` and `Quantity`.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/OXhaD9OHxXE4l8uU_FMs8_image.png)

To get started, within your [language string overwrites](docId\:kLrS7wtxn3WnCDy8z5Zvu), simply add the below code and update accordingly.

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "cart.import.csv-headers.sku": "Item No.",
    "cart.import.csv-headers.barcode": "Barcode No.",
    "cart.import.csv-headers.qty": "Quantity",
  }
}, 
/* End of code */
```

:::hint{type="info"}
**Please note**
Providing the contents of the CSV file includes valid SKUs (or barcodes), all products will be added to the customer's order and **replace** the existing contents. If a product requires specific pack sizes to be specified, the CSV Import will round up to the nearest valid pack size.
:::



***

## Shopping lists

Shopping Lists let your customers save the contents of an order for future use, making it quick and easy to reorder the products they buy regularly.&#x20;

::embed[****]{url="https://www.youtube.com/embed/rhuLyeKaMQY"}

Products can be saved to a list straight from any product page, and lists can be fully managed from within the My Account area - including previewing, adding, and editing their contents. Your B2B customers and sales agents can also export any list as a CSV, making it easier to share and reorder across teams. [Learn more](docId\:AQJJjc8wJrskIYivjIZrG)&#x20;



***

## Checkout process

When a customer is ready to place their order, they can then begin the checkout process. This is split into 4 steps:

::::WorkflowBlock
:::WorkflowBlockItem
**My Cart**
This contains the summary of the products they want to order
:::

:::WorkflowBlockItem
**Shipping**
This allows the customer to set their shipping address and complete additional fields (such as PO number)
:::

:::WorkflowBlockItem
**Review & Pay**
The customer can confirm their preferred shipping cost, select payment method and confirm their order
:::

:::WorkflowBlockItem
**Complete**
This is the final step of the checkout and completes the customer's order
:::
::::

### My Cart

The My Cart step is essentially a summary of the customer's order and lets them:

- View item level costs for products
- Change quantities and remove products
- Clear and empty the contents of an order
- Perform actions such as saving shopping lists or importing CSV files (see above)
- See their order sub-total (typically excluding tax and shipping costs)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vWNSkcGu-6SYP5BrvL_hF_image.png)

:::hint{type="info"}
**Order limit rules**
It's possible to set minimum and maximum order rules (by order total and order quantity) that a customer has to meet before being able to place an order.&#x20;
Please refer to [our full guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::

### Shipping

The Shipping step allows the customer to select their shipping address and complete any data entry fields you may have enabled.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fqcFBUVey_Qvh56wUD1NA_image.png)

**Data entry fields**

The data entry fields include the following configurations:

- **Additional Information:&#x20;**&#x74;his is useful if you want to capture additional details from a customer whilst they are placing an order. Typical use-cases include capturing a Purchase Order number (sometimes referred to as PO number), delivery instructions, or instructions. [Learn more](docId\:o3nDhZBCxisWH6M6satDt)
- **Custom checkout fields:&#x20;**&#x43;ustom checkout fields allow you to capture additional information from customers during the checkout process. It's a great way to allow customers to add data such as preferred shipping date, shipping instructions, and more! [Learn more](docId\:o3nDhZBCxisWH6M6satDt)
- **File uploads:&#x20;**&#x53;parkLayer supports the ability for B2B customers to upload files during the checkout process. This is a great way to capture additional details from the customer such as a "Purchase Order", details specific to their order (e.g. customisations they require), or any other file that is relevant to their account. [Learn more](docId\:o3nDhZBCxisWH6M6satDt)

**Addresses**

By default, any addresses for the customer are automatically taken from their address book information within your website admin.&#x20;

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/checkout-address.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

Customers can also manually add addresses by clicking the '"Add new address" button or via the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/uqJDTo9VkZOikzPjqvAbD_image.png)

If they're adding an address via the My Cart interface, they can also select from the following:

| Item                              | Details                                                                                                                               |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `Set as default shipping address` | This will become the default shipping address for future orders                                                                       |
| `Set as default billing address`  | This will become the default billing address for future orders                                                                        |
| `Save address to address book`    | This will save the address to their address book and this can be edited from the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) |

If a customer has more than 4 addresses saved, the interface will also adapt to show all saved addresses within a drop down menu.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/WVXgAGCt5YoUpQTK18v8r_image.png)

:::hint{type="info"}
**Please note**
It's possible to disable the ability to edit addresses, learn more in our [guide here](docId:-O7CpOLTlCJA2ChYChdoa)
:::

### Review & Pay

The Review & Pay step is the final step of the checkout process and lets customers:

- Select and confirm their preferred shipping method
- Select and confirm their preferred payment method
- See a full breakdown of the cost of their order, including tax and shipping
- Confirm to your terms and conditions

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/sKGXwS-iWqVbcY5Piyz2o_image.png)

**Shipping method**

The shipping methods work in one of two ways:

1. Shipping is automatically calculated from the rules set up within your website admin
2. Shipping is calculated by the rules set up in the SparkLayer Dashboard

You can learn more about how shipping works in [our guide here](docId\:CfZ_ZpGw2umOVAo73Lc5m).

**Payment methods**

:::hint{type="info"}
Please see [payment methods](docId\:efevur-A3yCJXUHvrR7t-) below
:::

### Complete

Once the customer has completed their order, this is then sent through to your eCommerce platform just like any regular order. Depending on the payment method selected, this will either arrive into your website admin as a *Draft* order or a *Completed* order.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/wK1HDv-scjPvhREifI6T__image.png)

If you've additionally configured orders to connect to the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT) this will then be sent directly to your backend system or via a middleware solution.&#x20;

:::hint{type="info"}
**Customising the order complete screen**
You can modify the text that shows to a customer, learn more in [our guide here](docId\:o3nDhZBCxisWH6M6satDt).
In addition, you can also add custom content using "Slots". [Learn more](docId\:l_2ooHJiY-rAx2chBMgP2)
:::



***

## Payment methods

SparkLayer supports a range of B2B-specific payment methods that can be tailored on a per-customer basis.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/H3U8OoG7nva_jdZyW4Vco_image.png)

When customers reach the payment step, they'll see available methods and can select their preference.

| Payment method       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment on Account` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** needing to enter any payment details.<br /><br />**🏦 For merchants:**<br />It's essentially an 'offline' payment method and you can even set credit limit rules and net payment terms such as `Net 30, Net 60, etc`[Learn more](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                                                                                                                                   |
| `Payment by invoice` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** having to enter in payment details.<br />**🏦 For merchants:**<br />Like "Payment on Account", this is essentially an 'offline' payment method. You can then process the order and take payment via offline channels (e.g. by bank transfer)                                                                                                                                                                                                                     |
| `Pay Online by Card` | **👪 For the B2B customer:**<br />The customer will be directed to your **standard checkout process&#x20;**&#x61;nd will be required to make payment right away (e.g. by card or via another payment processor). This is sometimes referred to as "Pro-forma payment".<br />**🏦 For merchants:**<br />This will come through as a paid (or "completed") order and no further action should be required to collect payment. Note: this is termed "Upfront Payment" within the [Customers](docId:5_lWMNohhjBJJppg9E6Vh) area of the SparkLayer Dashboard |
| `Request for quote`  | **👪 For the B2B customer:**<br />The customer can submit their order **without** choosing a payment method.<br />**🏦 For merchants:**<br />The order will be marked as a 'Draft' order and can subsequently be edited (e.g. changing the shipping cost, adding additional discounts, adding or removing products from an order).<br />*Please note: as of June 2025, this has been replaced with the &#x20;*[SparkLayer Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo)*&#x20;and can no longer be selected within a Customer Group.*                    |

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
The diagram below helps to illustrate how payments working with SparkLayer and Shopify, based on the payment method the B2B customer selects.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/litRRFUavvJE6pA6-1ciK_image.png)

**Draft orders**

If you're using Shopify, by default **all payment methods** other than Upfront Payment will be generated as [Draft orders](https://help.shopify.com/en/manual/orders/create-orders). If you'd prefer to automatically convert Draft orders into *Completed* orders, you can enable this via the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/settings/general).

**Shopify checkout payment methods**

If a customer selects "Pay Online by Card" (i.e. "Upfront payment"), they'll be directed to the Shopify checkout. By default, they will see all Shopify payment methods you have set up (e.g. card payment, Paypal, etc). It's possible to set rules on which payment methods show for your B2B customers and we recommend [exploring available apps here](https://apps.shopify.com/payfy-conditional-payments).

Please note that if a customer uses "Pay Online by Card" and doesn't complete their order, this will still show in your Shopify Draft Orders admin for review.
:::

:::Tab{title="🌐 Other platforms"}
Please refer to the [SparkLayer Technical Docs](https://hub.sparklayer.io/tech-docs)
:::
::::

:::hint{type="info"}
**Customising the B2B payment methods**
You can edit the names and priority of payment methods easily. Learn more in [our guide here](docId\:ibIKczvHM085BkeJIfFYv)
:::



***

## Managing Quotes

The SparkLayer [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo)  introduces a unified solution that streamlines the entire "quote-to-order" process directly from your existing online store. It allows you to handle quotes more effectively, converting them into completed orders faster than ever!

::embed[]{url="https://www.youtube.com/embed/Lmjwg4RK0r8"}

The SparkLayer Quoting Engine works by allowing your B2B customers to easily submit quotes for review, and for your sales team to then communicate with the customer until they're ready to complete their order. Learn more in [our full guide](docId:8A4OpNIndUyfs3Pup-tuo).&#x20;



***

## Discounts & promotions

SparkLayer supports the ability to have discounts and promotions applied during the checkout and these can either be redeemed via discount codes, or applied "automatically" to the customer's order.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/discount-codes.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

The SparkLayer Discount Engine unlocks a range of discount rules including:

- **Order-level discounts:** eg, spend $1,000 and get 10% off, spend $2,000 and get 15% off
- **Percentage and fixed discounts:&#x20;**&#x65;g, 20% off an order total, $100 off an order total 
- **Coupon codes:** eg, enter code NEWCUSTOMER and get 5% off
- **Scheduled discounts:** eg, start discount today and end it on a specific date and time
- **Customer-specific discounts:** eg, only allow customer group ‘b2b-vip’ to qualify for the discount 
- And more

:::hint{type="info"}
**Learn more about discounts**
You can see a full overview of what’s possible with discounts in [our guide here](docId\:WrejPw9URyjQwiQeKs_Cg).
:::



***

## File uploads (file attachments)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qOGpTHf89EmrRCM1Eanmz_image.png)

SparkLayer supports the ability for B2B customers to upload files during the checkout process. This is a great way to capture additional details from the customer such as a "Purchase Order", details specific to their order (e.g. customisations they require), or any other file that is relevant to their account. [Learn more](docId\:o3nDhZBCxisWH6M6satDt).



***

## Showing custom content (using "slots")

Custom Slots (or "Targets") allow you to enhance the SparkLayer My Cart interface by adding your own custom code in predefined areas.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/3Hzeu-VvOuGlXBhog-9NS_image.png)

You can learn more in our [custom slots guide here](docId\:l_2ooHJiY-rAx2chBMgP2).



***

## Persistent saved order

A great feature of the SparkLayer My Cart Interface is the "persistent saved order". When a customer adds items to their order, the contents are automatically saved to their browsing session for up to 90 days. If the customer then signs out and logs back in, all previous items in their order will be saved.

This feature also works across different devices, e.g. a customer could build an order on a desktop computer and then complete it the next day on a mobile device.



***

## Cart "Locking"

SparkLayer has built-in handling for concurrent users making changes to an order, termed cart "locking". This is specifically relevant to our [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) tool where sales agents may be building an order on behalf of a customer.

If there is an active cart and a customer subsequently accesses it, they'll see a message shown at the to of the page.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/U7nq88vs8MRt_VYPGL0ex_image.png)

By clicking "Take control", this will then allow the customer (or sales agent) to make further edits before completing the order.



***

## Tax

:::hint{type="info"}
**Understanding tax**
Please refer to our [guide here](docId\:ZSsXG6FjRLCod_GxoluTN) for details on how tax works with SparkLayer.
:::



***

## Configurations

SparkLayer supports a wide range of configurations you can apply to the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa). Please see our [full guide here](docId\:SBEaOaCq_A7FfbTatX8bD) on what's possible!



***

## Using Hardware (e.g. barcode scanners)

::embed[]{url="https://www.youtube.com/embed/BGnL56nZ8Jk"}

Did you know SparkLayer can also support hardware such as barcode scanners? SparkLayer automatically synchronises [barcode data](docId\:m3DF4f0Eyc2rM-vUaRG9H) from your store, meaning you could technically use the My Cart Interface to accept barcode-scanned orders!

If you have products with barcodes assigned in your admin then the below option will automatically be displayed in the cart for you to simply scan a product and add it to the cart.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jNVbjAeoca0AMv8BdjKDP_image.png)

The Quick Search tool (see below) allows you to insert both SKUs and Barcodes, meaning you can quickly add items to an order simply by entering codes into this input field. You'll need to configure your hardware to "target" this input field, but it's a great way to bring powerful B2B ordering to your warehouse or in-store experience.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/YEdho7w3dOxZLajnYVeAC_image.png)


[title] Pricing Display
[path] Features/Configurations/

## Displaying a RRP price (MSRP price)

Within the SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ), it's possible to show RRP prices (or "MSRP prices") alongside your specific B2B pricing. For example, you may want logged in users to see what non-B2B customers pay for a specific item, allowing them to easily see their pricing savings.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/M0FpvdByADG7mGI4b3XGp_image.png)



To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
To learn more about how to configure metafields on Shopify for SparkLayer, please refer to [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields)                                                                                                                                                                                                                                                                                          |
| `Metafield type`   | This must be set as an `JSON` string                                                                                                                                                                                                                                                                                                                                          |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                                                                                                                              |
| `Key`              | This must be set as `rrp`                                                                                                                                                                                                                                                                                                                                                     |
| `Value`            | This must be set up in the following format<br />`[{"value":15.99,"currency_code":"usd"}]`<br />Where `value` is the retail price and `currency_code` is the currency code (e.g. usd, gbp, eur).<br /><br />You can define prices for additional currencies by using this example format<br />`[{"value":15.99,"currency_code":"usd"},{"value":10.99,"currency_code":"gbp"}]` |

:::hint{type="success"}
**Automate the RRP pricing**
You can automatically populate the SparkLayer RRP metafield from your live Shopify prices using Shopify Flow. See [our guide](docId\:uvXV1kUg_VsZEPr5Dlb2z) for ready-made templates.
:::

You can also watch our video tutorial on how to set this up.

::embed[]{url="https://www.youtube.com/embed/Duue-ZGKp3A"}
::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | Variant-level (products)                                                                                                                                                                                                                                                                                                                                                      |
| `Metafield type`   | This must be set as an `JSON` string                                                                                                                                                                                                                                                                                                                                          |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                                                                                                                              |
| `Key`              | This must be set as `rrp`                                                                                                                                                                                                                                                                                                                                                     |
| `Value`            | This must be set up in the following format<br />`[{"value":15.99,"currency_code":"usd"}]`<br />Where `value` is the retail price and `currency_code` is the currency code (e.g. usd, gbp, eur).<br /><br />You can define prices for additional currencies by using this example format<br />`[{"value":15.99,"currency_code":"usd"},{"value":10.99,"currency_code":"gbp"}]` |

For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "pdp.price.rrp": "MSRP: ",
    "product-card.price.rrp": "MSRP: ",
    "cart.price.rrp": "MSRP: ",
  }
},  
/* End of code */
```

If you'd like to adjust the appearance of the RRP pricing, you can do so via adding special CSS overwrites to apply formatting.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/6L2jEgPEEV6HBJowG5JzE_image.png)

Simply add the below CSS to your [CSS overwrites](docId\:qCt2Zk8wjhYIV2ZbVBJYy) and adjust accordingly.

```css
<style>
:root {
   --spark-pricing-rrp-decoration: line-through;
   --spark-pricing-rrp-color: red;
}
</style>
```



***

## Quantity pricing

:::hint{type="info"}
**Learn more**
For our full guide on quantity pricing and available configurations, please see our [Quantity Rules](docId\:CmxfrPgjQxfz9vJzTVv0D) guide.
:::

### Quantity pricing table

If you've set up [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe) for your products, SparkLayer will by default show this to your customers within the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT).&#x20;

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/quantity-pricing.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

This will also show to customers when they add items to the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Le4suLBeqckj4_BwIvfue_image.png)

It's also possible to display the tiered pricing breaks table anywhere on your product detail page by adding a special code snippet to your website.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/s9upMQ4GSzsJOcndhmp9C_image.png)

Simply add the below in the source code of your product pages to display an additional quantity breaks table.

```html
<spark-variant-price-breaks
  variant-sku="{{ product.selected_or_first_available_variant.sku }}"
  parent-id="{{ product.id }}"
>
</spark-variant-price-breaks>
```

### Quantity pricing savings

You can also customise how the "savings" column displays to customers.&#x20;

| Area             | Details                                                                                                                                                                                                                                                                                 |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Decimal places` | If you'd prefer to show **two decimal places** in the savings percentage (e.g. 9.45% off instead of 9% off), you can add the following setting to your [SparkLayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP) (within the `display` settings).<br />`roundPriceBreakPercentages: true,` |
| `Hiding savings` | You can optionally hide the savings percentage from showing by adding the following setting to your [SparkLayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP) (within the `display` settings).<br />`showPriceBreakSavings: false,`                                                        |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/goIrNuN9LV2xlLtJ8sgyl_image.png)

### Quantity pricing discount percentage based off RRP&#x20;

If you're using [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe) in your price lists, this will display additional information to make it clear to the customer how much they are saving based on how many units they purchase.

By default, the 'Savings' will be calculated based on th&#x65;**&#x20;single unit price&#x20;**&#x6F;f the particular product (or variant). For example, if the single unit price is $2.00 and if you purchase 5 or more the price reduces to $1.00, the savings will display as `-50%`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vNWdEmh8xsUwqVRiGa45E_image.png)

If you'd prefer for the savings to instead b&#x65;**&#x20;calculated off the RRP** (i.e. retail price) of a product, you can enable this by adding a special setting.&#x20;

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
  display: {
    savingsUseRrp: true,
    /* Other settings should show below */
  }
/* End of code */
```



***

## Unit of measure pricing

Are you looking to set up pricing based on "units of measure" such as boxes, cartons, or pallets? Please refer to our [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe) guide to learn more.



***

## Customising the pricing text

It's possible to *prefix* the pricing display on a product detail page with custom language such as `'Your price'`.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/yM-LVbJSBImw3DJWobnqY_image.png)

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "pdp.price.from-prefix": "Your Price:"
  }
},
/* End of code */
```

In addition to this, you can also adjust any of the default language used for pricing using the below language strings.

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "pdp.price.from": "From:",
    "pdp.price.rrp": "RRP:",
    "pdp.price.pack-size": "Pack ({packSize}): {price}",
    "product-card.price.from": "From:",
    "product-card.price.rrp": "RRP:"
  }
},
/* End of code */
```



***

## Display a 'unit cost' price

If you sell products that comprise 'multiple units', it's possible to display an automatically calculated "Unit Price" on your product pages. For example, you may sell a product that comes in packs of 10, but you want to make it clear to your customers how much a "single unit" costs. Or you may sell products that come in specific weights (e.g. kg) and you want to show a "price per kg".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jq2v_7TpD0Axkji68brE4_image.png)

To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
To learn more about how to configure metafields on Shopify for SparkLayer, please refer to [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                              |
| ------------------ | ------------------------------------------------------------------------------------ |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields) |
| `Metafield type`   | This must be set as an `integer` string                                              |
| `Namespace`        | This must be set as `sparklayer`                                                     |
| `Key`              | This must be set as `case_size`                                                      |
| `Value`            | This must be set up in the following format<br />`1, 2, 3, etc`                      |

Once the setting has been set up, you can then use and modify the below code sample to display on your product pages.

:::ExpandableHeading
**Click here to view code sample**

```javascript
{%- if customer.metafields.sparklayer.authentication -%}
  
  {% if product.metafields.sparklayer.case_size %}
  <span data-custom-spark-case-size="{{ product.metafields.sparklayer.case_size }}" data-product-id="{{ product.id }}"></span>
  
  <script>
      document.addEventListener('DOMContentLoaded', function(event) {
        setTimeout(() => {
        document.querySelectorAll('[data-custom-spark-case-size]').forEach(async (el) => {
          var caseSize = Number(el.dataset.customSparkCaseSize);
          if (!caseSize) {
             return;
          }
          var productId = el.dataset.productId;
          try {
            priceData = await window.spark.getPriceForProduct (productId);
          } catch (e) {
            console.error(e);
            return;
          }
          const formatter =	new Intl.NumberFormat([], {
            style: 'currency',
            currency: priceData.currencyCode ?? 'usd',
          });
          el.textContent = `This product comes in packs of ${caseSize}. Unit price ${formatter.format(priceData.fromPrice / Number(caseSize))}`;
        });
        }, 500);
      });
  </script>
  
  {% endif %}

{% endif %}
```
:::

**Combining with Shopify's unit price feature**

If you're using Shopify's built-in unit price feature, you can also dynamically display the 'reference unit' e.g. kg, lb, ml.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/WVLXknI1Pl9JNo08q7q6s_image.png)

Within the code sample above, simple change `el.textContent` to the below:

```javascript

el.textContent = `Unit price per {{ item.unit_price_measurement.reference_unit }}:  ${formatter.format(priceData.fromPrice / Number(caseSize))}`;
```

:::hint{type="warning"}
**Important to note**
If you are looking to customise the behaviour of how this works, we recommend engaging a Shopify expert to assist.
:::
::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                                         |
| ------------------ | --------------------------------------------------------------- |
| `Custom data type` | Variant-level (products)                                        |
| `Metafield type`   | This must be set as an `integer` string                         |
| `Namespace`        | This must be set as `sparklayer`                                |
| `Key`              | This must be set as `case_size`                                 |
| `Value`            | This must be set up in the following format<br />`1, 2, 3, etc` |

For more information, please refer to the [SparkLayer Technical Doc](https://docs.sparklayer.io/tech-docs)
:::
:::::



***

## Adjusting the "Unavailable" message

When a product has no B2B pricing set against it, the  [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) and [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) will display a message that shows "Unavailable". This indicates to the B2B customer that the product cannot be purchased.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/x1OiHLW5YQ0h4flfosR2V_image.png)

If you'd prefer, you can adjust this to display a different message by updating the language settings on your store.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "pdp.messaging.un-sellable": "Unavailable",
    "product-card.messaging.un-sellable": "Unavailable",
    "product-card.messaging.select-option": "Unavailable, please select another option"
  }
},
/* End of code */
```



***

## Discounts & promotions

SparkLayer supports the ability to have discounts and promotions applied during the checkout and these can either be redeemed via discount codes, or applied "automatically" to the customer's order.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/discount-codes.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

The SparkLayer Discount Engine unlocks a range of discount rules including:

- **Order-level discounts:** eg, spend $1,000 and get 10% off, spend $2,000 and get 15% off
- **Percentage and fixed discounts:&#x20;**&#x65;g, 20% off an order total, $100 off an order total 
- **Coupon codes:** eg, enter code NEWCUSTOMER and get 5% off
- **Scheduled discounts:** eg, start discount today and end it on a specific date and time
- **Customer-specific discounts:** eg, only allow customer group ‘b2b-vip’ to qualify for the discount 
- And more

:::hint{type="info"}
**Learn more about discounts**
You can see a full overview of what’s possible with discounts in [our guide here](docId\:WrejPw9URyjQwiQeKs_Cg).
:::



***

## Show RRP prices only (for in-store shopping)

If you manage orders in physical locations with customers (e.g. in store), it's possible to enable a setting that sets the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) to **only** show the RRP (or "MSRP) prices when browsing and adding items to an order.&#x20;

This is especially useful if you need to "obscure" your B2B prices from view and you only want to show the full retail prices.&#x20;

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://cdn.shopify.com/videos/c/o/v/0d4ca2d2d8e54cf68d23604223ff4f8d.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

Use-cases could include:

- In-store customer visits where an order needs to be placed and the customer must only be able to see the retail (RRP) prices
- Sales teams who are placing orders on behalf of customers (e.g. on the road) and only the retail (RRP) prices must be seen

:::hint{type="info"}
**Please note**
Behind the scenes, the B2B prices associated with the logged in B2B customer will still be used to create the order. This feature is solely for display purposes.
:::

To enable this feature, you'll just need to update the SparkLayer Core Script. This will then apply to all B2B customers that log in.&#x20;

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
  display: {
    showRrpToggle: true,
    /* Other settings should show below */
  }
/* End of code */
```

If you'd prefer to make this display for specific customers, you can configure the code as shown below:

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
  display: {
  {% for tag in customer.tags %}
   {% if tag == "b2b-group-1" %}
    showRrpToggle: true,
   {% elsif tag == "b2b-group-2" %}
    showRrpToggle: true,
   {% endif %}  
  {% endfor %}
   
    /* Other settings should show below */
  }
/* End of code */
```



***

## Tax-Inclusive Price Display

Tax-inclusive price display lets you show your B2B prices with tax included, labelled clearly as "inc. tax" so buyers know exactly what they're looking at. It's designed for markets where buyers expect to see gross prices - common in Australia as well as in trade sectors selling to smaller businesses.

:::hint{type="info"}
**Please note - this changes presentation only.**&#x20;
Your prices are still stored, uploaded, and transacted net, and the tax your buyer actually pays is still calculated by your store's checkout at the point of purchase using any rules or 3rd party integration as set up in the eCommerce platform.

Tax-inclusive price display is enabled for your store by the SparkLayer team. If you'd like it turned on, please get in touch with our support team.
:::

### Key features

- **Show the price your buyers expect** - display gross prices to buyers who think in tax-inclusive terms, without changing how you upload or transact your pricing.
- **Control it per price list** - turn it on for the price lists that need it and leave the rest showing net, so you can serve different markets from one store.
- **Set your own rate per product** - supply a display tax rate per SKU, so reduced-rate and zero-rated products show correctly alongside standard-rate ones.
- **Clearly labelled** - key pricing areas will add an extra "inc. tax" label, so there's no ambiguity about which basis a buyer is seeing.

### How to enable

There are three parts to the setup, and all three need to be in place before buyers see gross prices.

1. **Ask us to enable the feature**
   Tax-inclusive display is controlled by a store-level switch that **only the SparkLayer team can change**. [Contact support](docId\:NNUw1G9z7eaJ4M78vk7t9) to have it enabled on your account. You'll be able to see it as enabled in your settings once it's on.
2. **Turn it on for a price list**
   Each price list has its own Tax Inclusive Display setting. Turn it on for the price lists whose customers should see gross prices, and leave it off elsewhere. Price lists with the setting off continue to show net prices exactly as before.
3. **Add a display tax rate to your products**
   Add a display\_tax\_rate column to your price CSV. This is the percentage used to work out the gross price from your net price, given as a number between 0 and 100.

| Column             | Value                            | Required                                                          |
| ------------------ | -------------------------------- | ----------------------------------------------------------------- |
| sku                | Your product SKU                 | Yes                                                               |
| price              | Your net price                   | Yes                                                               |
| quantity           | Quantity break                   | No - leave the column out and every price applies from quantity 1 |
| display\_tax\_rate | Display tax percentage, 0 to 100 | No                                                                |

An example with quantity breaks:

:::BlockQuote
sku,quantity,price,unit\_of\_measure,display\_tax\_rate
ABC-123,1,10.00,each,20
ABC-123,10,9.00,each,20
:::

And the same product without them:

:::BlockQuote
sku,price,display\_tax\_rate
ABC-123,10.00,20
:::

:::hint{type="info"}
**Please note**
**I**f you include the quantity column, every row needs a value in it. An empty cell in a quantity column will fail the import - to price from quantity 1, leave the column out altogether.

The rate applies to the whole SKU on that price list, so it must be the same on every row for a given SKU. Rows may leave the column blank, but conflicting rates for the same SKU will cause the import to fail.

A product on a tax-inclusive price list with no rate supplied, or a rate of 0, still shows the "inc. tax" label - at 0%. This is deliberate, so a genuinely zero-rated product isn't indistinguishable from one where the rate simply hasn't been uploaded yet.
:::

### How it works

Once enabled, gross prices and the "inc. tax" label appear throughout the buying journey.

- **Product pages and product cards**
  The price shown on product detail pages and product cards is the gross price, with the label alongside key pricing info (the label is not repeated for every price in pricing tables for UX purposes). Where a product has several prices, the "from" price follows whichever price wins.
- **Cart**
  Each cart line shows its gross line total, and the cart subtotal and total show gross with the label. The cart's shipping message also changes to make the basis clear, reading "Prices include tax. Shipping costs calculated during checkout" instead of the standard net wording.
- **Checkout**
  The order total on the checkout review step shows gross with the label. Minimum and maximum order value rules are also assessed on the gross figure, so a buyer seeing gross prices is measured against the total they can actually see.
- **Order history**
  In the customer's account area, order line items and the order total display on the same basis, so a buyer looking back at a past order sees it presented the way they bought it.

### Notes and limitations

This is the part worth reading closely before you enable it - this feature is only suitable for stores with simple tax configurations where you can consistently provide a tax percentage rate for each SKU in price lists that you want to show tax-inclusive pricing.

- **Your store's checkout is the authority on tax charged.** The display tax rate is the figure you upload, used for presentation. The actual tax your buyer pays is calculated by your store's checkout. If the two disagree, your buyer will see one figure in the cart and pay another. It's critical to keep your uploaded rates aligned with your store's tax configuration.
- **Tax-exempt customers always see net prices.** If a customer is marked as tax exempt, SparkLayer shows them net prices with no label, regardless of the price list setting. This is intentional, since a gross price would be wrong for them.
- **Mixed carts fall back to net totals.** If a cart contains a mixture of tax-inclusive and tax-exclusive products, the cart totals show net and drop the label. Individual lines still show on their own basis. A single gross total spanning both would understate the tax on the exclusive lines, so we show net instead.
- **Custom items and unpriced products affect cart totals.** Custom line items added to a cart carry no display tax rate. A cart containing a product with no price but a manually quoted price will show net totals.
- **Quoted prices are always net.** When a sales agent edits a quoted unit price, that price is entered and stored net. The editor is labelled "(excluding tax)" when surrounding prices are shown gross, so there's no confusion.
- **RRP prices are never tax-adjusted.** RRP values display exactly as you upload them. On a tax-inclusive price list this means a gross B2B price sits next to a net RRP, and any savings percentage calculated from RRP compares the two different bases. We recommend uploading RRP values on the same basis as your display prices if you show both.
- **Display mode can vary within a product.** Variants of the same product can resolve to different price lists, so one variant may be tax inclusive while another is not. This is a configuration issue - please ensure customers are only offered either tax inclusive or exclusive prices though careful price list and customer group configuration.

### FAQ

:::ExpandableHeading
**Does this change the prices I upload or the amount my customer is charged?**

No. Prices are stored and transacted net exactly as before, and your checkout calculates tax as it always has. Only the figure displayed on your storefront changes.
:::

:::ExpandableHeading
**Can I use it for some customers and not others?**

Yes. The setting is per price list, so you can show gross prices to the customer groups on one price list and net prices to everyone else.
:::

:::ExpandableHeading
**What happens if I don't upload a display tax rate?**

Products on a tax-inclusive price list with no rate show their net price, still labelled "inc. tax", at an effective 0%. We recommend uploading rates for every product on a tax-inclusive price list so buyers see accurate gross figures.
:::

:::ExpandableHeading
**Why does my cart total show net when my product prices show gross?**

Your cart most likely contains a mixture of tax-inclusive and tax-exclusive products, a custom item, or a product with a quoted price and no uploaded price. In these cases the cart totals fall back to net rather than show a gross figure that would understate the tax due. Please ensure the price list and customer group setup is consistent so a customer would either see only tax inclusive price lists or tax exclusive ones, but not a mixture.
:::

:::ExpandableHeading
**Will my buyers see gross prices at card checkout?**

The SparkLayer cart and checkout review show gross prices with the label. Once a buyer moves into your store platform's own checkout, that platform's tax display rules apply.
:::


[title] Product Display
[path] Features/Configurations/

## Product detail interface&#x20;

### Table-view mode&#x20;

By default, the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) shows single variant products with the option to change quantity and an "Add to Order" button.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/KGtzvP0OaeQ3Dib4NEl5Z_image.png)

If you'd prefer, you can force all products to render in the special "table-view" mode, even if they only have a single variant.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/RsGbUCn-LP_AQaZ4KR-oA_image.png)

To enable this, simply add the below code:

```html
<spark-pdp parent-id="{{ product.id }}" mode-table-only></spark-pdp>
```

:::hint{type="info"}
**Please note**
Based on the platform you're using, the variable `product.id` will need to be adjusted to the appropriate setting.
:::

### "All Variants" mode

If your products are available in **multiple** variant options (e.g. colour, size, shape), it's possible to enable a special "All Variants" mode that gives customers an easy way to see all available variants.&#x20;

:::hint{type="info"}
**Please note**
This differs from the 'standard' [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) that shows variant options in a drop-down menu.
:::

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/pdp-all-variants.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

To enable this, simply add the below code to your product pages:

```html
<spark-pdp parent-id="{{ product.id }}" mode-all-variants></spark-pdp>
```

The "All Variants" mode will add additional columns to the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) which may interfere with the display on mobile devices by being too wide. You can optionally choose to hide columns from showing on mobile devices by using the below code:

```html
<spark-pdp parent-id="{{ product.id }}" hide-on-mobile="colour,size" mode-all-variants></spark-pdp>
```

The special "All Variants" mode takes the variants you've set up within your product catalogue, and will additionally order the list based on the ordering set within your product catalogue.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TQOCy-05IDtFdOm_7Spd1_image.png)

### "Matrix" mode

If your products are available in **multiple** variant options (e.g. colour, size, shape) and you want to display them in a "table" view, it's possible to enable a special [Product Matrix Interface](docId:8Go0NYHFDmYnwlJSNfO-S) that gives customers an easy way to see all available variants. This can be used anywhere that products are displayed on your website and gives customers a rapid way to add products to an order.

:::hint{type="info"}
**Please note**
This differs from the 'standard' [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) that shows variant options in a drop-down menu.
:::

::embed[]{url="https://www.youtube.com/embed/cloM8_DJ7eg"}

To enable this, simply add the below code to your product pages:

```html
<spark-product-matrix parent-id="{{ product.id }}"></spark-product-matrix>
```

If you would like to show the restock date in the Matrix, simply add the below code into your product pages:&#x20;

```html
<spark-product-matrix parent-id="{{ product.id }}" show-restock-date></spark-product-matrix>
```

To learn more about how this works and how to implement it, please see [our guide here](docId:8Go0NYHFDmYnwlJSNfO-S).&#x20;

### Hiding the image in the table view

By default, the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) shows a thumbnail image of the variant within the layout. If you'd rather hide this, you can do this by adding a special CSS overwrite.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/6NBeJIvbmUfdvJV2utndG_image.png)

If you'd like this hidden, simply add the below CSS to your [CSS overwrites](docId\:qCt2Zk8wjhYIV2ZbVBJYy).

```css
<style>
:root {
    /* Default */
    --spark-pdp-image: table-cell;
    
    /* Add this to hide image */
    --spark-pdp-image: none;
}
</style>
```

### Product code display (SKU)

By default, the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) shows the product code (SKU) within the layout, both for single variant products and multi-variant products (e.g. colour, size, etc).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/178pqm8bxEahPe-HGpS-j_image.png)

If you'd like this hidden, simply add the below CSS to your [CSS overwrites](docId\:qCt2Zk8wjhYIV2ZbVBJYy).

```css
<style>
:root {
    /* Default */
    --spark-pdp-sku: block;
    
    /* Add this to hide the SKU */
    --spark-pdp-sku: none;
}
</style>
```

You can also modify the term for SKU by editing the SparkLayer default language strings.

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "pdp.product-code": "Product Code",
  }
},
/* End of code */
```

### Barcode display (ISBN, UPC, GTIN)

If your store is setup with barcodes for your products, you can optionally display these on the SparkLayer product page widgets.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/nTW-uQzk32yJrRG8e0P7h_image.png)

If you'd like the barcode to display, you'll need to make two changes within your theme code. For the product detail page widget, add `show-barcode `as shown below.

```html
<spark-pdp show-barcode parent-id="{{ product.id }}"></spark-pdp>
```

Once set up, the barcode will show clearly to customers when they visit a product page

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/LnUubUqHmN-AQj9elZFrt_image.png)

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "global.product.barcode": "Barcode",
  }
},
/* End of code */
```

### Stock display

:::hint{type="info"}
**Looking to display live stock levels?**
Please refer to our [full guide here](docId\:Gj_Ao_gQ6oA-jx0D27Hys).
:::



***

## Product card interface&#x20;

### Show stock status

It's possible to adjust the [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) to show live stock (inventory) levels to your customers, anywhere where this interface is shown.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GvKqz31iOzQ9yQ-SxqsiT_image.png)

To enable this, simply use the following code.

```html
<spark-product-card show-stock parent-id="{{ product.id }}"></spark-product-card>
```

:::hint{type="info"}
**Please note**
Based on the platform you're using, the variable `product.id` will need to be adjusted to the appropriate setting.
:::

### Product code display (SKU)

It's possible to adjust the [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) to show the product code (SKU) to your customers, anywhere where this interface is shown.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/IBFOM5gi3DJnAHH990oHh_image.png)

To enable this, simply use the following code.

```html
<spark-product-card show-sku parent-id="{{ product.id }}"></spark-product-card>
```

:::hint{type="info"}
**Please note**
Based on the platform you're using, the variable `product.id` will need to be adjusted to the appropriate setting.
:::

### Barcode display  (ISBN, UPC, GTIN)

It's possible to adjust the [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) to show the barcode to your customers, anywhere where this interface is shown.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/okMRie8PmhXUKnXgwI6gV_image.png)

To enable this, simply use the following code.

```html
<spark-product-card show-barcode parent-id="{{ product.id }}"></spark-product-card>
```

:::hint{type="info"}
**Please note**
Based on the platform you're using, the variable `product.id` will need to be adjusted to the appropriate setting.
:::

### Hide variant drop-downs

It's possible to adjust the [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) to hide variant drop-downs from showing. For example, you may have a product that has a variant group of "Size" with only one option and you'd prefer not to show the drop-down.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/eHHlo6XEPuiH8RPI_1A-W_image.png)

To enable this, simply use the following code, replacing `hide-dropdown="Size, Colour"` with the appropriate option group names from your platform.

```html
<spark-product-card hide-dropdown="Size, Colour" parent-id="{{ product.id }}"></spark-product-card>
```

:::hint{type="info"}
**Please note**
Based on the platform you're using, the variable `product.id` will need to be adjusted to the appropriate setting.
:::

### Hide price from button

If you'd prefer to now show a "total price" in the "Add" button that shows in the product card, it's possible to remove this by adding (and modifying) a special language string.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/hfRqXV0rphZJo9wB0Yhbf_image.png)

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
     "product-card.add-to-order.cta-text":"Add ({price})",
 }
},
/* End of code */
```



***

## Product variant-specific display (e.g. hiding)

Within the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) and [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv), it's possible to isolate specific variants to have variant-specific behaviour applied to them.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/i00RpqH4Q-54JPKEzrxQb_image.png "An example of a product variant being set to \"un-sellable\"")

Currently this includes the following:

| Behaviour                                | Details                                                                                                                                                     |
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Hide specific variants`                 | Within the SparkLayer interfaces, specific variants can be hidden from view, either globally (for all B2B customers) or for specific customer groups        |
| `Set specific variants to "un-sellable"` | Within the SparkLayer interfaces, specific variants can be set to "un-sellable", resulting in them displaying to the customer as "Unavailable" to purchase. |

To enable this, SparkLayer uses special settings (sometimes referred to as *metafields&#x20;*&#x6F;&#x72;*&#x20;attributes*) that allow additional data to be stored against products.&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

**Hiding specific variants**

| Item               | Details                                                                                                                                                                                                                                                                |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields)                                                                                                                                                                                   |
| `Metafield type`   | This must be set as `JSON`                                                                                                                                                                                                                                             |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                       |
| `Key`              | This must be set as `settings`                                                                                                                                                                                                                                         |
| `Value`            | This must be set in the following format<br />`[{"customer_group":"base","display":false}]`<br />To apply to multiple customer groups, you can use this format:<br />`​[{"customer_group": "base","display": true},{"customer_group": "b2b-group1","display": false}]` |

**Set specific variants to "un-sellable"**

| Item               | Details                                                                                                                                                                                                                                                       |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Variants](https://admin.shopify.com/settings/custom_data/productvariant/metafields)                                                                                                                                                                          |
| `Metafield type`   | This must be set as `JSON`                                                                                                                                                                                                                                    |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                              |
| `Key`              | This must be set as `settings`                                                                                                                                                                                                                                |
| `Value`            | This must be set in the following format<br />`[{"customer_group":"base","sell":false}]`<br />To apply to multiple customer groups, you can use this format:<br />`​[{"customer_group": "base","sell": true},{"customer_group": "b2b-group1","sell": false}]` |
::::

:::Tab{title="🌐 Other platforms"}
For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::

:::hint{type="info"}
**Product settings**
You can learn more about product settings in [our full guide here](docId\:Cm9B1I6Cz0vOlc67g-fJI).
:::



***

## Add to Favourites

Your B2B customers can save products for later using the heart icon, which appears on the product detail interface next to the Add to cart button and on product cards across your collection pages. Saved products are collected in a Favourites section within My Account, where customers can return to them and add them to the cart whenever they're ready.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/cFknc2LVltGDQ5kb6pZ80_image.png)

Favourites are turned on by default. If you'd prefer not to show the heart icon, you can turn Favourites off from **Storefront → Options** in the SparkLayer dashboard, under My Account Settings.

Learn more in [our full guide here](docId\:BXlogKI2-m4jlJtwji_gQ).&#x20;



***

## Quick Buy Mode&#x20;

:::hint{type="warning"}
**Important - please note**
The customisations detailed in this guide are recommendations only and may vary in complexity, depending on how your store is set up. Whilst the SparkLayer team can advise on how to approach implementing these recommendations, our team may not be equipped to implement them on your Shopify store. We recommend engaging a developer assist should you wish to proceed with any of the recommendations below.
:::

It's possible to adapt the SparkLayer interface to display in **"Quick buy mode"** that allows customers to more rapidly build orders from your product collection pages.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qHh2H82FaVv-5vJvtcUxE_image.png)

To enable this feature, you can adapt the [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) with a special setting that adjusts the layout to a "table-view". Simply add the code below to any product collection page.

```html
<spark-product-card mode-quick-buy parent-id="{{ product.id }}"></spark-product-card>

```

:::hint{type="info"}
**Please note**
Based on the platform you're using, the variable `product.id` will need to be adjusted to the appropriate setting.
:::

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
If you're using the [Shopify B2B Dawn Theme](docId\:LHkU0_G_4GVef1jAmgXmo), this is enabled by default, and it's also possible to manually enable this on most Shopify themes. To enable quick buy mode, you'll need to follow the below steps within your Shopify theme codebase.

- Within `/templates/` create a duplicate of your default collections layout
- Within `/sections/` create a duplicate of your default collections section layout
- Within `/snippets/` create a new file with the [following code](https://gist.github.com/cm-sl/3f417dbbd944998671ed44fce348c655)
- Adjust the theme code in the new `/sections/` collection section layout to render the new `/snippet/` file that has the special 'quick buy mode' enabled
- Add the [following CSS](https://gist.github.com/cm-sl/29f2adf01ec0e522479a55fe59fc3fad) to your code

To enable quick buy mode, within Shopify, go to **Products** and click **Collections** and then edit the collection page you wish to apply this to. From the **Theme** template section, simply choose 'quick buy' from the list of options and click save.



:::hint{type="warning"}
**Important to note**
If you apply the new 'quick buy mode' to your collection pages, this will also take effect for logged-out customers also. If you are looking to customise the behaviour of how this works, we recommend engaging a Shopify expert to assist.
:::
::::

:::Tab{title="🌐 Other platforms"}
No configurations applicable
:::
:::::



***

## Product customisations

If you sell products that require "customisations" such as custom text or any other unique requirements, it is possible to support these via SparkLayer's more advanced [JavaScript SDK](docId\:Tyb7sJdq8lhVLDP5E_ghz) option.&#x20;

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/customise-text.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

This allows your B2B customers to add customised text to products within their order and the information is sent through to your eCommerce platform when an order is placed.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/QCSsrtneVwx9KFPwtRXfS_image.png)

:::hint{type="warning"}
**Please note**
This is an advanced configuration of SparkLayer and will require a developer to implement on a store that requires this feature. Please refer to our [JavaScript SDK](docId\:Tyb7sJdq8lhVLDP5E_ghz) for full details.
:::



***

## 1-click ordering (product bundles)

It's possible to create special buttons on your store that allow customers to add collections of products to an order, rather than having to add them all individually. These are called "Spark Buttons".

Spark Buttons work by adding special snippets of JavaScript to your website that specify which SKUs and quantities will be added when a user clicks the button. These buttons can work **anywhere** on your website such as the homepage or special landing pages.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/tC223VrJfn_ml0kOa0k0C_image.png)

:::hint{type="success" attributes="[object Object]"}
**Live Demo**
Test this out for yourself on our [B2B Demo store](https://b2b-demo-store-usd.myshopify.com/pages/b2b-bundles)!Note: you'll need to be signed in first to test this feature.
:::

**Example use-cases**

Spark Buttons are useful if you're looking to direct B2B customers to purchase a **specific range** of products. Examples could include:

- Starter packs for brand new customers, e.g. your best-selling products&#x20;
- A curated range of products, e.g. a new season range
- A product bundle, e.g. the top 10 products from a certain category

Once the customer adds the items to the order, they can then make changes just as they would do normally, e.g. editing quantities, removing items, etc.

**Enabling Spark Buttons**

Spark Buttons can be added anywhere on your store using the sample code template below. In this example, we've include two buttons with each button adding different product SKUs and different quantities.

:::ExpandableHeading
**View sample code**

```html
<!-- Example Spark Button 1 -->
<a href="#" data-add-to-cart="">Add to order</a> 
 
<script>
// <![CDATA[
    document.querySelector('[data-add-to-cart]').addEventListener('click', function () {
    const products = {
    products: [
        {
            sku: 'SKU-123',
            absoluteQuantity: 5,
        },
        {
            sku: 'SKU-789',
            absoluteQuantity: 5,
        },
    ],
  };
  window.spark.updateCart(products);
});
// ]]>
</script>

<!-- Example Spark Button 2 -->
<a href="#" data-add-to-cart-2="">Add to order</a> 
 
<script>
// <![CDATA[
    document.querySelector('[data-add-to-cart-2]').addEventListener('click', function () {
    const products = {
    products: [
        {
            sku: 'SKU-ABC',
            absoluteQuantity: 10,
        },
        {
            sku: 'SKU-XYZ',
            absoluteQuantity: 10,
        },
    ],
  };
  window.spark.updateCart(products);
});
// ]]>
</script>
```


:::

When using Spark Buttons, please note the following:

| Item                         | Details                                                                                                                                                                                                         |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Inserting multiple buttons` | You can insert multiple Spark Buttons on a single page providing that unique querySelectors are used. For example, in our code sample above, we've included two buttons: data-add-to-cart and data-add-to-cart2 |
| `Product SKUs`               | For Spark Buttons to successfully add products, the product SKU must also exist within your Shopify store                                                                                                       |
| `Product quantities`         | You can specify the product quantity to add by using absoluteQuantity. If the product SKU has pack sizes configured, the quantity will automatically be rounded up.                                             |

:::hint{type="info"}
**Please note**
Using this feature requires custom JavaScript coding and you may want to engage a Shopify expert to assist. Our team may not be able to directly advise on the best approach due to the custom nature of this feature.
:::



***

## B2B-only products (Hiding products)

If you're running both B2B and DTC within the **same Shopify store**, there may be a range of products that you want to only show and be purchasable to logged in B2B customers.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/lTqvOcmfUofJ90onHMdP6_b2b-only-1.jpg)

Perhaps they can only be purchased in high-volumes or they are exclusive to your B2B customers.&#x20;

The good news is there are ways to do this and we've detailed more in our guides below.

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
Learn more in [our guide here](docId\:ddIv5TDAnCayWTOJ0Vyb7)
:::

:::Tab{title="🌐 Other platforms"}
No customisations applicable
:::
::::



***

## Updating the "Add to Cart" button text

If you'd prefer to update the text shown on the "Add to Cart" buttons on the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa), you can modify the default language strings to do so.



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/g0_MTrn1BO837GhiSAKjV_image.png)

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "product-card.add-to-order.cta-text": "Add ({price})",
    "pdp.add-to-order.cta-text": "Add to Cart ({price})"
  }
},
/* End of code */
```


[title] Timeline & Communications
[path] Features/Configurations/

## Introduction

The **Timeline & Communications** feature gives your team and customers a single place to track all order-related communication and activity in SparkLayer (including [quotes](docId:8A4OpNIndUyfs3Pup-tuo)). It brings together:

- **Messages** between customers and your sales team&#x20;
- **Internal notes** for private team-only context&#x20;
- **Order events** such as edits, status changes, and approvals&#x20;
- **Email notifications** to keep everyone up to date&#x20;

All updates are displayed in a clear, chronological timeline so you always have a complete audit trail as orders progress.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://cdn.shopify.com/videos/c/o/v/7370c91db365426d97fcfd02a997d521.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::


The timeline appears on supported order types, including:

- Standard B2B orders&#x20;
- Sales-assisted orders (via [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX))
- Quotes&#x20;
- Draft orders created by Sales Agents (via [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX))

When enabled, both customers and your internal team can send messages, track updates, and collaborate more efficiently.

:::hint{type="success" attributes="[object Object]"}
**Want to test out this feature?**&#x20;
Head over to our [B2B Demo store](https://demo.sparklayer.io/pages/b2b-login-register) and give it a go!
:::



***

## Getting started

To get started, simply enable the feature within your SparkLayer Dashboard:

**Settings → Configurations → Enable Timeline & Communications**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/L2oIOVgrd4YRXR2tkBfKh-20251205-185702.jpg)

Once enabled, the Timeline will appear within the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) > **Order Details** page for all supported order types.&#x20;

:::hint{type="info"}
**Please note**
The **Purchase Notifications** settings can only be edited if at least one of the following features is enabled:

- Quoting&#x20;
- Timeline & Communications&#x20;

If both are disabled, the Notifications row will remain unavailable.
:::



***

## Features

The Timeline & Communications feature supports the following actions:

| Item                  | Details                                                                                                    |
| --------------------- | ---------------------------------------------------------------------------------------------------------- |
| `Messages`            | Customers and sales agents can send and reply to messages directly from the order.                         |
| `Internal notes`      | Sales agents can add notes that are only visible to your internal team.                                    |
| `Order actions`       | Key order updates - such as creation, changes, approvals, and status updates - are automatically recorded. |
| `Audit log`           | A detailed history of edits made to the order                                                              |
| `Email notifications` | Team members and customers (where enabled) receive notifications when new messages are added.              |
| `Visibility`          | All communication and activity appears in a centralised Timeline view                                      |



***

## Notifications

To manage notifications, go to **Settings → Configurations** and locate the **Purchase Notifications** row beneath the Timeline & Communications toggle. Click **Edit** to add one or more email addresses that should receive alerts when new messages are posted and no Sales Agent is assigned to the order.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jrPKmLl5r1w51ziW1YT8l-20251205-185823.jpg)

Notifications for Timeline & Communications use the same configuration method as [Quote notifications](docId:8A4OpNIndUyfs3Pup-tuo).&#x20;



***

## Email notifications sent

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/_YeuEHKKr0-_khAnypJEZ_image.png)

The following notifications are triggered when Timeline & Communications is enabled:

| Notification          | Sent to                                                                                                                                                           | Details                                                  |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| `Buyer message`       | Assigned Sales Agent (if set), any additional notification email addresses, or a fallback store inbox (configured under [Settings](docId\:gznStzTqCRffLFZSTAw0N)) | Triggered when the buyer sends a message on an order     |
| `Sales Agent message` | Customer                                                                                                                                                          | Triggered when a Sales Agent sends a message on an order |

It's also possible to automatically redirect a customer or sales agent directly to the **order details view** on the website by enabling a special SparkLayer redirect. You can learn more about how this works in [our guide here](docId\:lQXaNI7IVDqna09D9soAP).&#x20;

:::hint{type="info"}
**Please note**
General **order activity** will **not** **trigger a notification**. Only a new message will trigger a notification email.&#x20;

Email template content is managed within the [Templates](docId\:gznStzTqCRffLFZSTAw0N)  section of the SparkLayer Dashboard. You can access this by going to **Settings → Templates**.&#x20;
:::

### Custom From Email Address

Improve brand recognition and deliverability with support for custom "from" email addresses (e.g. [store@mail.yourstore.com](mailto\:you@yourstore.com)), helping ensure notifications match your brand. Available on Pro and Enterprise plans

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ZJHA1PEvgt0gL2IbIRthy-20260401-105203.png)

To begin the process to enable this, go to **Settings → Configurations → Purchase Notifications → Edit** and you'll be prompted to speak to our support team who will guide you through the process.

:::hint{type="info"}
**Please note**
This only applies to email notifications from SparkLayer and does not change emails from your eCommerce platform or other systems.&#x20;
:::

### Notification Replies

Replying directly to a purchase notification email will automatically add the response to the related order timeline, showing the sender name and email address.

:::hint{type="info"}
**Please note**
Email replies are added as messages, visible to the customer and your sales team. Only the most recent reply will be added if the email is threaded, and any images/attachments will be removed.
:::



***

## Managing the Timeline

The Timeline appears on the Order Details page and displays all communication and activity in chronological order, giving your team a complete, real-time overview as orders progress.

**Timeline activities**

| Item                   | Details                                                                                            |
| ---------------------- | -------------------------------------------------------------------------------------------------- |
| `Order actions`        | Order creation, updates, and status changes                                                        |
| `Customer messages`    | Messages sent by the customer via the Order Timeline.                                              |
| `Sales agent messages` | Messages sent by the assigned Sales Agent or internal team.                                        |
| `Internal notes`       | Internal notes saved by Sales Agents that are not visible to the customer.                         |
| `Order edits`          | A detailed audit record of modifications such as quantity, pricing, or item changes.               |
| Payments               | Any payments that are made against the order. See [Payment Methods](docId\:ibIKczvHM085BkeJIfFYv)  |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/CxCrZMI7eyjAZ1bD6DeA0_image.png)



***

## Adding messages

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GJC2c9OakBAcctL1x6dUv_image.png)

When viewing an order, a message box is displayed within the Timeline.

- Customers can send messages directly to the sales team&#x20;
- Sales agents can choose to:&#x20;
  - **Send message** (visible to customer)
  - **Save internal note** (visible only to sales agents)&#x20;

:::hint{type="info"}
**Please note**
Internal notes are displayed in a separate highlighted style and are never shown to the customer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/rcX3n6CcVKrf8Z9lKedIz_image.png)
:::



***

## Frequently Asked Questions

:::ExpandableHeading
**Which plans include Timeline & Communications?**

Timeline & Communications is available on all SparkLayer plans. Timeline & Communications does not require the [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo)  to be enabled.&#x20;
:::

:::ExpandableHeading
**Do I need to enable Quoting to use the Timeline?**

No. The Timeline & Communications feature can be enabled independently.
:::

:::ExpandableHeading
**Can I disable the Timeline for specific customer groups?**

No. When the Timeline & Communications feature is enabled, it will appear on all supported order types for all customers.
:::

:::ExpandableHeading
**Will order activity trigger notifications?**

No. Only new messages will trigger notification emails. General order activity will not trigger a notification.
:::

:::ExpandableHeading
**Are internal notes visible to customers?**

No. Internal notes are only visible to Sales Agents and will not send a notification.&#x20;
:::

:::ExpandableHeading
**Does this replace Shopify order notes?**

No. Shopify order notes remain unchanged. The Timeline provides additional clarity within SparkLayer.
:::



***

## Coming soon

| New Feature          | Details                                                                                                                                                                              |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Reply-to messaging` | Customers and Sales Agents will be able to reply directly to order or quote notification emails. Email replies will automatically appear in the Timeline and notify the other party. |

To register your interest in either of these new features and to receive updates, please email **product\@sparklayer.io**



***

## Feedback

We've love to know if you have feedback on SparkLayer Timeline & Communications Let our team know by emailing **product\@sparklayer.io**

[title] Introduction
[path] /

## About SparkLayer

SparkLayer is a B2B eCommerce solution that seamlessly plugs into your eCommerce website and delivers a feature-rich B2B "self-service" ordering experience for your customers.&#x20;

::embed[]{url="https://www.youtube.com/watch?v=23uqVqW59d0"}

As well as connecting to your website, it can also integrate directly with the backend systems that manage your B2B data (such as pricing), enabling a fully connected B2B solution. SparkLayer works out-of-the-box with major eCommerce platforms, including:

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/PIEXshl0tG1QL9mwDUrSZ_shopify.png"}
[Shopify](docId:7TmhkOEHbgEGGFdd6EMr1)
Works with all versions
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/MfTGR03MBhkc_usK1Rlo3_bigcommerce.png"}
[BigCommerce](docId:6zLPH9x8-qEUITCHs2obE)
Works with all versions
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-AHbuSveltgWw9xRDwxWOk-20250210-144900.png"}
[Wix](docId\:vEqgPapEA8X0X60U6ZWZe)&#x20;
Works with all versions
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TddREsNFFwA3dPVEVVGRI-20251006-134246.png"}
[WooCommerce](docId:2afrfuiZMXgapD6ToK-5L)&#x20;
Works with all versions
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/tOSCISThJB_W31lHQ4F9p-20260224-055123.png"}
[Magento](docId\:oGbycENjv56tYL5qa6Hu5)&#x20;
Works with key versions
:::
::::



***

## What you can do with SparkLayer

SparkLayer gives you an easy way to enable B2B (or "wholesale") on your existing website. You don't need to create a new store or spend time and money trying to customise your B2B experience. SparkLayer does all this for you and, once you're set up, you'll be able to:

- Enable custom pricing for your B2B customers
- Give your B2B customers a self-service ordering experience
- Accept B2B payments, such as "net payments" and "payment on account"
- Allow your sales team (sales reps) to place orders on behalf of B2B customers
- Configure more advanced pricing rules, such as pack sizing and quantity price rules
- Enable rapid re-ordering, making it easy for your customers to repeat order
- Allow your B2B customers to save shopping lists
- Configure pre-ordering and back-ordering rules
- Allow your B2B customers to create company teams
- ...and so much more!

SparkLayer has over [100 B2B features](docId\:SSzdKXuNMlEIDOOITHQcU) right out of the box, plus our team can get everything set up for you with our free onboarding service.



***

## Who uses SparkLayer?

SparkLayer is used by over 1,500 brands, from small independent retailers through to household names, helping each of them improve and scale their B2B operation. You can explore some of our [latest case studies](https://www.sparklayer.io/customers/) and you're welcome to [book a demo](https://www.sparklayer.io/?demo#contact) if you'd like to discuss your own B2B requirements.&#x20;



***

## What to expect

Our customers typically get up and running in a matter of days and the process works as follows:&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-bPmhuN9lNDGm09Z_gWouc-20240814-131910.jpg)

Our team is available to help support you during the process, from helping set up the special [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa), walking you through how to set up [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) and [Customers](docId:5_lWMNohhjBJJppg9E6Vh), as well as recommending the best ways to go live with our [Launching SparkLayer](docId\:YUfghEGoxe_h7uJfcshna).&#x20;



***

## Exploring our Help Docs

Our Help Docs are organised to make it easy for you to learn more about the capabilities and features of SparkLayer. They are broadly categorised by these key areas:

::::WorkflowBlock
:::WorkflowBlockItem
🖥️ [Frontend](docId\:OgKfvQX13dHW2582D57kJ)
The SparkLayer Frontend comprises a variety of interfaces (or "widgets") that are installed on your website. Once set up, your logged in B2B customers then get an optimised "self-service" experience that makes ordering and managing their account a breeze!
:::

:::WorkflowBlockItem
⭐ [Features](docId\:SSzdKXuNMlEIDOOITHQcU)
SparkLayer is designed to be extremely flexible and there are a variety of ways you can customise and enhance how it works. From configuring pack size rules, enabling special display settings, changing the language customers see, and even enabling powerful tools such as Sales Agent ordering.
:::

:::WorkflowBlockItem
🛠️ [Backend](docId:-jSDFT3oqvpyda2H0Lw16)
The SparkLayer Backend focuses on our API that can connect to your backend systems (e.g. ERP, CRM, or iPaaS) to synchronise B2B data such as price lists, product settings (e.g. pack sizes), and customer rules. This is not a requirement to use SparkLayer but is a great way to add further automation if you have systems already in place.
:::

:::WorkflowBlockItem
📊 [Dashboard](docId\:nzsx6U_DAWtzVzSehf4oR)
The SparkLayer Dashboard is a web browser-based tool that lets you manage your B2B data such as price lists, customer rules, shipping settings, and more. It's also used to manage your onboarding process when you first get set up.
:::

:::WorkflowBlockItem
🌐 [Integrations](docId\:Eewk4JDEtPwyhjhrTwlvp)
SparkLayer works with a growing number of technology partners: from eCommerce platforms, ERP and operations systems, payment solutions, right through to tools that streamline the B2B customer experience. You can deliver a world-class B2B solution with our ready-made partner integrations!
:::
::::




[title] Getting Started
[path] Introduction/

## Introduction

When you sign up for a SparkLayer account, you'll get access to the SparkLayer [Dashboard](docId\:nzsx6U_DAWtzVzSehf4oR). This is a web browser-based tool that lets you keep track of all elements of your SparkLayer integration: from managing your B2B price lists, to setting rules for your B2B customers.&#x20;



***

## What to expect

Our customers typically get up and running in a matter of days and the process works as follows:&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-bPmhuN9lNDGm09Z_gWouc-20240814-131910.jpg)

Our team is available to help support you during the process, from helping set up the special [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa), walking you through how to set up [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) and [Customers](docId:5_lWMNohhjBJJppg9E6Vh), as well as recommending the best ways to go live with our [Launching SparkLayer](docId\:YUfghEGoxe_h7uJfcshna).&#x20;



***

## Onboarding Process

:::hint{type="success"}
**Book a SparkLayer Onboarding Call**
Our expert team is here to help you go live. If you need assistance along the way please [book your free call here](https://connect.sparklayer.io/onboarding-meeting).
:::

Once you sign in, you'll be welcomed by our Onboarding Process that guides you through all the necessary steps to get up and running.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-3g7TeY2-OVKA-nhqYqNj_image.png)

This process is designed to ensure that all systems are correctly set up and configured before you're ready to start inviting your B2B customers and taking orders on your website.

::::WorkflowBlock
:::WorkflowBlockItem
**🔗 Connecting your website**
You'll need to connect your eCommerce website to SparkLayer which then begins the onboarding process.&#x20;

➡️ [View in dashboard](https://app.sparklayer.io/integrations/platform) or [learn more](docId\:gznStzTqCRffLFZSTAw0N)
:::

:::WorkflowBlockItem
**🛠️ Frontend widgets**
You'll need to install special code snippets ("widgets") into your website's storefront in order to show the special SparkLayer B2B interfaces. We can also do this for you if you like!

➡️ [View in dashboard](https://app.sparklayer.io/integrations/widgets/core) or [learn more](docId\:ccZ1vnH0O6D_722w35Xpa)
:::

:::WorkflowBlockItem
**📓 Price lists**
You'll then set up the B2B price lists that you want your customers to see when they login. These can be automated or you can manually upload specific pricing (via a CSV)

➡️ [View in dashboard](https://app.sparklayer.io/pricing/lists) or [learn more](docId\:s8XcbZGxQpgdeIGWtXseT)
:::

:::WorkflowBlockItem
**👪 Customer groups**
You'll then set the ordering rules for your customers such as minimum order values, available payment methods and price lists they are assigned to.

➡️ [View in dashboard](https://app.sparklayer.io/customers/groups) or [learn more](docId:5_lWMNohhjBJJppg9E6Vh)
:::

:::WorkflowBlockItem
**✅ Test & launch**
You'll then need to run through some final checks (such as placing a test order). Once you're happy, you can then launch SparkLayer and start taking orders!&#x20;

➡️ [View in dashboard ](https://app.sparklayer.io/configuration/onboarding)or [learn more](docId\:YUfghEGoxe_h7uJfcshna)
:::

:::WorkflowBlockItem
<font color="#3b9f0f">**Optional**</font>**&#x20;- API Integration**
Your systems (e.g. ERP, CRM, or iPaaS) can integrate directly with the SparkLayer API to send through key B2B data (e.g. price lists and pack sizes). You'll need to generate an API key first, allowing you to begin the process.
*Only applicable to Professional and Enterprise plans*

➡️ [View in dashboard](https://app.sparklayer.io/configuration/api) or [learn more](docId\:LhKqO8T7-A0HaRgVYFgtT)
:::
::::



***

## Next steps

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[Shopify](docId:7TmhkOEHbgEGGFdd6EMr1)

If you're using Shopify, read our step-by-step guide
:::

:::LinkArrayItem
[Support](docId\:NNUw1G9z7eaJ4M78vk7t9)

Need help along the way? We're here to assist!
:::

:::LinkArrayItem
[Try our Demo](docId:87ILO_vHmG3XUXKecOLXv)

Want to see SparkLayer in action?  Try our demo stores
:::
::::


[title] Dashboard
[path] /

## Introduction

The [SparkLayer Dashboard](https://app.sparklayer.io/) is a web browser-based tool that lets you keep track of all elements of your SparkLayer integration. From managing your B2B price lists, to setting rules for your B2B customers. When you first sign in, you'll be welcomed by our Onboarding Process that guides you through integrating SparkLayer with your website.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/z7lnGAYcGXVBM4FyOadS9_image.png)

## Explore the Dashboard

Select an area below to get started.

::::LinkArray
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bXlksZiax9_zBI21N72_U_orders.png"}
[Activity](docId\:Z3BXNIoOm5g6yetty8pZj)

The Orders section allows you to report on all orders placed on your website
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VdVtnFPGrYsRCzGAu7U4I_frame-31a.png"}
[Pricing](docId\:s8XcbZGxQpgdeIGWtXseT)

The Price Lists section lets you manage your B2B price lists used on your store
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ipxZzcgV58tLmjhbSYz2t_frame-31b.png"}
[Customers](docId:5_lWMNohhjBJJppg9E6Vh)

The Customers Groups section lets you manage your customer groups and ordering rules&#x20;
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/annPavKL-dDPFDz8P5U3q_frame-31c.png"}
[Data Sync](docId:8XClbafeyxHtt5begKM58)

The Data Sync section lets you check your data being received from your store
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ZQsmapoKLnzOCkG_Tuie-_frame-31d.png"}
[Settings](docId\:gznStzTqCRffLFZSTAw0N)

Manage your frontend integration process, configure API and shipping
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/s4Xfp1Y4mc7oBmvxbRUkH_frame-31f.png"}
[Account Settings](docId\:r9NG74uJdtyWlvGbpnB5u)

Modify your account details, invite team members, and manage your plan
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Qk-rjsspJucNOi0A3BnTl_frame-31g.png"}
[Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m)

Manage your B2B shipping rules for your customers
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/n1P9JwI2BhqDLSBEfX1gO_frame-31l.png"}
[Test Mode](docId\:y74DZm4NK61rsUZwJ3Vcn)

Activate sandbox mode to to enable on a test store
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7DZFp5QoZ3xKFz5luN94M_group-1737.png"}
[Launching SparkLayer](docId\:YUfghEGoxe_h7uJfcshna)

Review our tips on how to launch SparkLayer to your B2B customers
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/MHIuvilv3t_VlhVAUydxf_discount2.png"}
[Discounts](docId\:WrejPw9URyjQwiQeKs_Cg)

Set powerful discounts for your customers
:::
::::


[title] The Price Editor
[path] Dashboard/Price Lists/

## Introduction

The [Price Editor](https://app.sparklayer.io/pricing/editor/) tool allows you to easily add and edit pricing in a more "adhoc" manner. For example, perhaps you need to edit a single price for product and add a new one, and you'd prefer not to upload a new CSV file to do this.The Price Editor tool works by letting you search for a product and then edit and add pricing inline, directly from within the SparkLayer Dashboard.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/JBnvEVLo1JFfgk2rvH_de_image.png)



***

## Editing and adding pricing

When you search for a product, you'll see all associated pricing grouped by your price lists. You can quickly edit pricing or "**Add a new price**" to add a brand new one.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2Fzl4G12Hhx9NwIzvlZNa6%2Fimage.png?alt=media\&token=745d7407-d6db-4bbf-b95b-969ed58695cf)

:::hint{type="info"}
**Please note the following:**

- When adding pricing for a product, there must always be at least one entry for a single unit quantity and it's not possible to remove this.
- It is not possible to edit prices for "Automatic price lists"
:::



***

## Adding a new price list

You can also associate a new price list to a product from the "Select a Price List" section at the bottom. This will show you a list of all active price lists you've set up within the [Pricing](docId\:s8XcbZGxQpgdeIGWtXseT) area of the Dashboard.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/M1KAb9c-jUZ8OrRzespfH_image.png)


[title] Activity
[path] Dashboard/

## Introduction

The **Activity** section gives you a real-time overview of all orders that are placed via SparkLayer on your eCommerce website. It's a great way to see a snapshot of your performance as well as quickly drill-down and see the details of individual orders that have been placed.

:::hint{type="info" attributes="[object Object]"}
**Please note:** the SparkLayer Activity section will only show orders that are placed via SparkLayer (i.e. B2B orders)
:::



***

## How orders are placed

When a customer uses the SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) on your website and successfully places an order, these will be routed through to your website admin in one of the following ways:

- **Draft order:** if the customer is using a manual payment method such as 'Pay by Invoice' this will by default enter as a Draft order.
- **Completed order:** if the customer is paying by an upfront payment method (i.e. Pay by Card) or if you've configured manual payment methods to be created as Completed orders, these will enter as Completed orders.&#x20;



***

## Sales Performance

The Sales Performance view lets you see the overall performance of SparkLayer on your website and updates each time an order is successfully placed.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/9WJdyNUP_RfzzqPhiXoKo_image.png)

You can filter by date increments and order tyoe using the menu on the top right and you'll also see the corresponding metrics for the previous period. For example, if you're viewing data for the last 30 days, the **Last period** will display data for the prior 30 days.



***

## What counts as a SparkLayer sale

Any order placed via SparkLayer on your website that is **successfully completed** will count as a sale. This means that a customer must reach the 'Order complete' page on your website and the order must be registered as a successful sale within your eCommerce platform.



***

## Sales History

The Order History view will list every successful SparkLayer order placed on your website, matching that in your eCommerce platform when filtering just by SparkLayer orders.

Based on how your store is setup, you'll see a variety of order "Types".

| Type                | Details                                                                                                                |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `Order`             | This is a completed order                                                                                              |
| `Quote`             | This is an order submitted as a quote (for review)                                                                     |
| `Awaiting Merchant` | This is an order that requires the merchant's review (this will show as a "Draft" order within the eCommerce platform) |
| `Awaiting Approval` | This is an order that requires approval by a [Company User](docId:_WwfeWVJY9xrSuNCQlFoZ)                               |

From the Order History view, you can see the following fields:

| Notes           | Details                                                                              |
| --------------- | ------------------------------------------------------------------------------------ |
| `Date`          | The date and timestamp of when the order was placed on your website                  |
| `Order #`       | The corresponding order number in your eCommerce platform (e.g. Shopify)             |
| `Type`          | The type of the order (e.g. Order, Quote)                                            |
| `Customer Name` | The name of the customer                                                             |
| `Items`         | The total number of items ordered, i.e. Order Line(s) x Quantity ordered             |
| `Amount`        | The gross amount paid in your specified currency                                     |
| `Link`          | This will link you to the corresponding order detail view in your eCommerce platform |

:::hint{type="info"}
**Viewing different order types in your eCommerce platform**
Please note, if the order is a type such as "Quote", when clicking the link you will be directed to the frontend of your website to view the details. In order to fully enable this, please review [our guide here](docId\:lQXaNI7IVDqna09D9soAP).&#x20;
:::

::::Tabs
:::Tab{title="🛍️ Using Shopify"}


![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/G9Gf5bJs8Gf180bT_4iSJ_image.png "How orders look in SparkLayer")

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/FFfBe_0tbpf47DHz7RZPT_image.png "Corresponding order in Shopify")


:::

:::Tab{title="🌐 Other platforms"}
Please refer to the [SparkLayer Technical Docs](https://hub.sparklayer.io/tech-docs)
:::
::::


[title] Privacy Policy
[path] Useful Links/Policies/

:::hint{type="info"}
This policy has moved to the SparkLayer Trust Center. The current version is at [www.sparklayer.io/privacy](http://www.sparklayer.io/privacy). It covers the personal data we handle as a controller and as a processor, our sub-processors, and the rights available to you.
:::


[title] Incident Management Policy
[path] Useful Links/Policies/

:::hint{type="info"}
This policy has moved to the SparkLayer Trust Center. The current version is at [www.sparklayer.io/trust/incident-management](http://www.sparklayer.io/trust/incident-management). It covers how incidents are classified, contained and resolved, and how to report a security concern.
:::


[title] Business Continuity Planning
[path] Useful Links/Policies/

:::hint{type="info"}
This plan has moved to the SparkLayer Trust Center. The current version is at [www.sparklayer.io/trust/business-continuity](http://www.sparklayer.io/trust/business-continuity). It covers how we prepare for disruption, restore service and keep customers informed.
:::


[title] Try our Demo
[path] Useful Links/

## Introduction

Our SparkLayer Demo Stores give you the chance to test some of the great features of SparkLayer, including how our [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) work. You can also try our interactive demo, which loads SparkLayer onto your own website so you can see B2B ordering running with your products and branding.

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[Product Purchasing](docId\:JkCjbYUAnjzp75I8ul7MT)
How the process works to add items to a B2B order
:::

:::LinkArrayItem
[Checkout Process](docId\:efevur-A3yCJXUHvrR7t-)
How the checkout works, such as selecting payment
:::

:::LinkArrayItem
[My Account Area](docId\:lQXaNI7IVDqna09D9soAP)
How the "self-service" My Account interface works
:::
::::

:::hint{type="success"}
**Get a live demo!**
Get a complete walk-through of our SparkLayer Demo and see how it all works under-the-hood! [Arrange a live demo](https://www.sparklayer.io/?demo#contact)
:::



***

## Interactive Demo

The fastest way to see SparkLayer is on your own store. Our interactive demo loads your website, overlays the SparkLayer B2B ordering experience on top of it, and lets you place a wholesale order against your real products and branding. Nothing is installed and nothing is changed on your site.

:::CtaButton{label="See it on your store" externalHref="https://www.sparklayer.io/how-it-works/" openInNewTab="true"}

:::



***

## Hybrid DTC and B2B

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/nlZLz5e5vq38tL_68iRP9_image.png)

This demo store features a **combined DTC (Direct to Consumer) and a B2B** store as well as **multiple currencies and&#x20;**[Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX)

:::CtaButton{label="Go the Demo Store" externalHref="https://demo.sparklayer.io/pages/b2b-login-register" openInNewTab="true"}

:::

:::hint{type="info"}
📹 [Watch our tutorial video](https://26157419.fs1.hubspotusercontent-eu1.net/hubfs/26157419/SparkLayer%20Recorded%20Demo%20Video.mp4) of how it works
:::



***

## Standalone B2B (requires login)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/NX7ty1r7nh4tLTpMfrC_h_image.png)

This demo store is built using the [Shopify B2B Dawn Theme](docId\:LHkU0_G_4GVef1jAmgXmo) and **forces customers** to sign in before being able to browse products. You can also test [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX).

:::CtaButton{label="Go to the Demo Store" externalHref="https://standalone.demo.sparklayer.io/" openInNewTab="true"}

:::

:::hint{type="info"}
📹 [Watch our tutorial video](https://26157419.fs1.hubspotusercontent-eu1.net/hubfs/26157419/SparkLayer%20Recorded%20Demo%20-%20Sales%20Agents.mp4) of how it works
:::



***

## Interactive Demo

You can explore how SparkLayer works in [our interactive demo](https://www.figma.com/proto/5FPCY5hSGl7mlwjsjMZI2t/SparkLayer-Interfaces?page-id=0%3A1\&type=design\&node-id=86-36708\&viewport=554%2C-398%2C0.33\&t=34VlPwbCqpvQOTsh-8\&scaling=min-zoom\&starting-point-node-id=35%3A7920\&hide-ui=1).&#x20;

:::Iframe{iframeHeight="0" code="<a href=&#x22;https://www.figma.com/proto/5FPCY5hSGl7mlwjsjMZI2t/SparkLayer-Interfaces?page-id=0%3A1&type=design&node-id=86-36708&viewport=554%2C-398%2C0.33&t=34VlPwbCqpvQOTsh-8&scaling=min-zoom&starting-point-node-id=35%3A7920&hide-ui=1&#x22; target=&#x22;_blank&#x22;>&#xA;<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/interactive-demo.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>&#xA;</a>"}

:::

:::hint{type="success"}
**Test out the SparkLayer frontend**
Our interactive demo shows you how all the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) work including product pages, the shopping cart, and my account area.
:::



***

## Live Customer Examples

Want to see SparkLayer in action on live customer stores?

::embed[]{url="https://www.youtube.com/watch?v=wa12SQQRLkM"}

You can also learn more about SparkLayer in our video below.

::embed[]{url="https://www.youtube.com/watch?v=23uqVqW59d0"}


[title] Customising the Design
[path] Frontend/

## Introduction

By default, the [Frontend](docId\:OgKfvQX13dHW2582D57kJ) has relatively basic styling and tries to keep things as neutral as possible. In order to allow SparkLayer to be styled to match the theme and branding of your website, a large selection of variables are exposed that can be customised via adding special CSS variables to your store.

:::hint{type="info"}
**Please note**
If you're unable to style an element to your exact needs, please [contact us ](mailto\:contact@sparklayer.io)and we'll be happy to advise on the best approach.
:::



***

## Applying the customisations

The customisations work by adding special snippets of CSS to the code of your website that subsequently then overwrite the "default" styling for SparkLayer.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7vDQr0cPNevSuKwwP--9l_image.png)

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/CSS-Edit.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

In your web browser, it's possible to isolate and view the variables really easily - by inspecting element, you'll see the variable names in the **Developer Tools** section&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ujYXgC8ra0w1HBb1X-0cs_image.png)

:::hint{type="info"}
**Making code changes**
To learn more about how to apply code changes, please refer to our [Frontend Integration Guide](docId\:QWXsYM9X5_pvIOGUteKcP) for full details.
:::



***

## Best-practise CSS

We've included our best-practise CSS below to get you started.

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<!-- SparkLayer Sample CSS Code -->

<style type="text/css">

:root {
  /* Set the brand styling */
  --b2b-brand-color: #000; /* Main brand colour */
  --b2b-brand-color-hover: #333; /* Main brand colour hover */
  --b2b-brand-font: Arial, sans-serif; /* Main brand font */
  --b2b-brand-font-heading: Arial, sans-serif; /* Main brand heading font */

  /* Update colours */
  --spark-default-body-color: #555555; /* Main body colour */
  --spark-primary-color: #000000; /* Main title colour */
  --spark-secondary-color: var(--b2b-brand-color); /* Main highlight colour */
  --spark-link-color: var(--b2b-brand-color); /* Link colour */

  /* Typefaces */
  --spark-font-default: var(--b2b-brand-font); /* Body typeface */
  --spark-font-highlight: var(--b2b-brand-font-heading); /* Highlight typeface */
  --spark-font-weight-default: 400; /* Default font weight */
  --spark-font-weight-medium: 500; /* Medium font weight */
  --spark-font-weight-heavy: 600; /* Bold font weight */

  /* General */
  --spark-border-radius-default: 0; /* Default border radius */
  --spark-drawer-max-width: 700px; /* Width of overlay */
  --spark-drawer-max-width-wide: 1000px; /* Width of overlay in maximised view */

  /* Font sizes */
  --spark-font-default-size: 14px; /* Default font size*/
  --spark-font-default-size-small: 14px; /* Default font size - small screens */
  --spark-header-font: var(--b2b-brand-font-heading); /* Header typeface */
  --spark-header-font-weight: 500; /* Header font weight */
  --spark-h1-fontsize: 24px; /* Header 1 font size */
  --spark-h2-fontsize: 22px; /* Header 2 font size */
  --spark-h3-fontsize: 20px; /* Header 3 font size */
  --spark-h4-fontsize: 16px; /* Header 4 font size */
  --spark-h5-fontsize: 15px; /* Header 5 font size */
  --spark-h6-fontsize: 14px; /* Header 6 font size */

  --spark-pricing-fontsize: 20px; /* Font size of pricing */
  --spark-pricing-font-weight: 500; /* Font weight of pricing */
  --spark-pricing-fontsize-small: 14px; /* Font size of pricing on mobile */

  --spark-product-code-fontsize: 16px; /* Font size of product code */
  --spark-product-code-font-weight: 500; /* Font weight of product code */
  --spark-product-code-fontsize-small: 14px; /* Font size of product code on mobile */
  --spark-product-stockstatus-align: flex-start; /* Alignment of stock status for single variants */

  /* Buttons */
  --spark-button-font-family: var(--b2b-brand-font-heading); /* Button typeface */
  --spark-button-color: var(--b2b-brand-color); /* Default sutton colour */
  --spark-button-color-highlight: var(--b2b-brand-color-hover); /* Default button colour hover */
  --spark-button-large-color: var(--b2b-brand-color); /* Large button colour */
  --spark-button-large-color-highlight: var(--b2b-brand-color-hover); /* Large button colour hover */
  --spark-border-radius-button: 0; /* Button border radius */
  --spark-button-font-weight: 600; /* Button font weight */
  --spark-button-text-transform: none; /* Button text transform */
  --spark-button-text-letter-spacing: 0; /* Button letter spacing */
  --spark-button-padding: 1em 2.75em; /* Button padding */
  --spark-button-small-font-size: 16px; /* Small button font size */

  /* Tables */
  --spark-table-border-color: #CCCCCC; /* Table border colour */
  --spark-table-header-background-color: #F1F1F1; /* Table header background */
  --spark-table-header-text-color: #222222; /* Table header font colour */
  --spark-table-header-font-weight: 500; /* Table header font weight */

  /* Product Card */
  --spark-product-card-button-radius: 0; /* Button radius */
  --spark-product-card-button-padding: 0.75em 1em; /* Button padding */
  --spark-product-card-pricing-font-size: 15px; /* Pricing font size */
  --spark-product-card-pricing-font-size-small: 14px; /* Pricing font size on mobile */
  --spark-product-card-select-min-height: 0; /* Set a min-height for select menu */
}
</style>

<!-- End SparkLayer Sample CSS Code -->
```
:::
::::



***

## Colours

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style>
:root {
    /* Colours */
    --spark-default-body-color: #555555;
    --spark-primary-color: #000000;
    --spark-primary-color-light: #F5F5F5;
    --spark-primary-color-dark: #999999;
    --spark-secondary-color: #125EF8;
    --spark-tertiary-color: #00AF76;
    --spark-lightest-color: #FFFFFF;
    --spark-success-color: #00AF76;
    --spark-error-color: #EF0000;
    --spark-warn-color: #FF9243;
    --spark-link-color: #125EF8;
    --spark-input-color: #CCCCCC;
}
</style>
```
:::
::::

| Variable                      | Description & usage                       | Default Value |
| ----------------------------- | ----------------------------------------- | ------------- |
| `--spark-default-body-color`  | Body font colour                          | `#555555`     |
| `--spark-primary-color`       | Title font colour, e.g. price information | `#000000`     |
| `--spark-primary-color-light` | Light shading, e.g. table shading         | `#F5F5F5`     |
| `--spark-primary-color-dark`  | Dark shading                              | `#999999`     |
| `--spark-secondary-color`     | Secondary colour, e.g. a highlight colour | `#125EF8`     |
| `--spark-tertiary-color`      | Tertiary colour, e.g. large button colour | `#00AF76`     |
| `--spark-lightest-color`      | Lightest colour, e.g .white               | `#FFFFFF`     |
| `--spark-success-color`       | Success message colour                    | `#00AF76`     |
| `--spark-error-color`         | Error message colour                      | `#EF0000`     |
| `--spark-warn-color`          | Warning message colour                    | `#EDC35C`     |
| `--spark-link-color`          | Anchor link colour                        | `#125EF8`     |
| `--spark-input-color`         | Form fields border colour                 | `#CCCCCC`     |



***

## Typography

### About embedded fonts

SparkLayer by default uses two typefaces on the Frontend

- Body font: [Roboto](https://fonts.google.com/specimen/Roboto)
- Highlight font: [Poppins](https://fonts.google.com/specimen/Poppins)&#x20;

It's possible to overwrite these using the variables listed below. If you do require custom fonts for SparkLayer (e.g. using Google Fonts), please ensure these are included in your website's core CSS file and included in your site header if necessary.

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style>
:root {
    /* Typography */
    --spark-font-default: 'Roboto', sans-serif;
    --spark-font-highlight: 'Poppins', sans-serif;
    --spark-font-weight-default: 400;
    --spark-font-weight-light: 300;
    --spark-font-weight-medium: 500;
    --spark-font-weight-heavy: 600;
    --spark-header-font: 'Poppins', sans-serif;
    --spark-header-font-weight: 500;
    --spark-header-text-transform: none;
    --spark-header-letter-spacing: 0eml
    --spark-h1-fontsize: 24px;
    --spark-h2-fontsize: 22px;
    --spark-h3-fontsize: 20px;
    --spark-h4-fontsize: 16px;
    --spark-h5-fontsize: 15px;
    --spark-h6-fontsize: 14px;
    --spark-pricing-fontsize: 16px;
    --spark-pricing-font-weight: 400;
    --spark-pricing-fontsize-small: 14px;
    --spark-packsize-fontsize: 16px;
    --spark-packsize-font-weight: 400;
    --spark-packsize-fontsize-small: 14px;
    --spark-product-code-fontsize: 16px;
    --spark-product-code-font-weight: 400;
    --spark-product-code-fontsize-small: 14px;
    --spark-product-stockstatus-fontsize: 16px;
    --spark-product-stockstatus-fontsize-small: 14px;
    --spark-product-stockstatus-align: flex-start;
    --spark-product-stockstatus-back-order-display: flex;
}
</style>
```
:::
::::

| Variable                                         | Description                               | Default Value           |
| ------------------------------------------------ | ----------------------------------------- | ----------------------- |
| `--spark-font-default`                           | Main body font                            | `'Roboto', sans-serif`  |
| `--spark-font-highlight`                         | Highlight font                            | `'Poppins', sans-serif` |
| `--spark-font-weight-default`                    | Default font weight                       | `400`                   |
| `--spark-font-weight-light`                      | Light font weight                         | `300`                   |
| `--spark-font-weight-medium`                     | Medium font weight                        | `500`                   |
| `--spark-font-weight-heavy`                      | Heavy font weight                         | `600`                   |
| `--spark-header-font`                            | Header font                               | `'Poppins', sans-serif` |
| `--spark-header-font-weight`                     | Header font weight                        | 500                     |
| `--spark-header-text-transform`                  | Header transform                          | `none`                  |
| `--spark-header-letter-spacing`                  | Header character spacing                  | `0em`                   |
| `--spark-h1-fontsize`                            | H1 font size                              | `24px`                  |
| `--spark-h2-fontsize`                            | H2 font size                              | `22px`                  |
| `--spark-h3-fontsize`                            | H3 font size                              | `20px`                  |
| `--spark-h4-fontsize`                            | H4 font size                              | `16px`                  |
| `--spark-h5-fontsize`                            | H5 font size                              | `15px`                  |
| `--spark-h6-fontsize`                            | H6 font size                              | `14px`                  |
| `--spark-pricing-fontsize`                       | Pricing font size                         | `16px`                  |
| `--spark-pricing-font-weight`                    | Price font weight                         | `500`                   |
| `--spark-pricing-fontsize-small`                 | Price font size on mobile                 | `14px`                  |
| `--spark-packsize-font-weight`                   | Pack sizing font size                     | `16px`                  |
| `--spark-packsize-fontsize`                      | Pack sizing font weight                   | `400`                   |
| `--spark-packsize-fontsize-small`                | Pack sizing font size on mobile           | `14px`                  |
| `--spark-product-code-fontsize`                  | Product code font size                    | `16px`                  |
| `--spark-product-code-font-weight`               | Product code font weight                  | `500`                   |
| `--spark-product-code-fontsize-small`            | Product code font size on mobile          | `14px`                  |
| `--spark-product-stockstatus-align`              | The alignment of the stock status message | `flex-start`            |
| `--spark-product-stockstatus-back-order-display` | The display of the Pre-order message      | `flex`                  |



***

## General

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style>
:root {
    /* General */
    --spark-border-radius-default: 4px;
    --spark-border-radius-large: 8px;
    --spark-drawer-max-width: 700px;
    --spark-drawer-max-width-wide: 1000px;
    --spark-loading-background-color: #DEDEDE;
    --spark-loading-background-overlay-product: 255, 255, 255;
    --spark-container-content-top: 3em;
    --spark-container-content-bottom: 3em;
    --spark-container-content-side: 4.5em;
    --spark-container-content-reduced: 1.5em;
    --spark-spinner-default-color: #125EF8;
}
</style>
```
:::
::::

| Variable                                     | Description                             | Default Value |
| -------------------------------------------- | --------------------------------------- | ------------- |
| `--spark-border-radius-default`              | Default border radius                   | `4px`         |
| `--spark-border-radius-large`                | Overlay border radius                   | `8px`         |
| `--spark-drawer-max-width`                   | Width of overlay                        | `700px`       |
| `--spark-drawer-max-width-wide`              | Width of overlay in 'maximised' view    | `1000px`      |
| `--spark-loading-background-color`           | Loading 'skeleton' colour               | `#DEDEDE`     |
| `--spark-loading-background-overlay-product` | Loading overlay colour on product pages | `255,255,255` |
| `--spark-container-content-top`              | Overlay spacing - top                   | `3em`         |
| `--spark-container-content-bottom`           | Overlay spacing - bottom                | `3em`         |
| `--spark-container-content-side`             | Overlay spacing - sides                 | `4.5em`       |
| `--spark-container-content-reduced`          | Overlay spacing - reduced               | `1.5em`       |
| `--spark-spinner-default-color`              | Loading spinner colour                  | `#125EF8`     |



***

## Buttons

### General

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style>
:root {
    /* Buttons */
    --spark-button-font-family: 'Poppins', sans-serif;
    --spark-button-border: 0;
    --spark-button-font-size: 15px;
    --spark-button-font-weight: 400;
    --spark-button-padding: 0.875em 1.75em;
    --spark-button-radius: 4px;
    --spark-button-text-transform: none;
    --spark-button-text-letter-spacing: 0;
    --spark-button-raised-background: #25EF8;
    --spark-button-raised-background-hover: #508AFF;
    --spark-button-raised-color: #FFFFFF;
}
</style>
```
:::
::::

| Variable                                 | Description             | Default Value           |
| ---------------------------------------- | ----------------------- | ----------------------- |
| `--spark-button-font-family`             | Button font             | `'Poppins', sans-serif` |
| `--spark-button-border`                  | Button border           | `0`                     |
| `--spark-button-font-size`               | Button font size        | `15px`                  |
| `--spark-button-font-weight`             | Button font weight      | `400`                   |
| `--spark-button-padding`                 | Button padding          | `0.875em 1.75em`        |
| `--spark-button-radius`                  | Button border radius    | `4px`                   |
| `--spark-button-text-transform`          | Button text transform   | `none`                  |
| `--spark-button-text-letter-spacing`     | Button letter spacing   | `0`                     |
| `--spark-button-raised-background`       | Button background       | `#25EF8`                |
| `--spark-button-raised-background-hover` | Button background hover | `#508AFF`               |
| `--spark-button-raised-color`            | Button font colour      | `#FFFFFF`               |

### Disabled buttons

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style>
:root {
   /* Disabeld buttons */
   --spark-button-disabled-background: #DFDFDF;
   --spark-button-disabled-color: #9F9F9F;
}
</style>
```
:::
::::

| Variable                             | Description                 | Default Value |
| ------------------------------------ | --------------------------- | ------------- |
| `--spark-button-disabled-background` | Disabled button background  | `#DFDFDF`     |
| `--spark-button-disabled-color`      | Disabled button font colour | `#9F9F9F`     |

### Large buttons

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style>
:root {
    /* Large buttons */
    --spark-button-large-font-size: 18px;
    --spark-button-large-padding: 0.875em 1.75em;
    --spark-button-large-background: #25EF8;
    --spark-button-large-background: #508AFF;
}
</style>
```
:::
::::

| Variable                          | Description                   | Default Value    |
| --------------------------------- | ----------------------------- | ---------------- |
| `--spark-button-large-font-size`  | Large button font size        | `18px`           |
| `--spark-button-large-padding`    | Large button padding          | `0.875em 1.75em` |
| `--spark-button-large-background` | Large button background       | `#25EF8`         |
| `--spark-button-large-background` | Large button background hover | `#508AFF`        |



***

## Messages

### Toast notifications

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style>
:root {
    /* Toast notifications */
    --spark-toast-color: #FFFFFF;
    --spark-toast-text-color: #000000;
    --spark-toast-action-color: #125EF8;
    --spark-toast-border-color: #DDDDDD;
    --spark-toast-border-radius: 4px;
}
</style>
```
:::
::::

| Variable                          | Description                          | Default Value |
| --------------------------------- | ------------------------------------ | ------------- |
| `--spark-toast-color`             | Toast notification background colour | `#FFFFFF`     |
| `--spark-toast-text-color`        | Toast notification text colour       | `#000000`     |
| `--spark-toast-action-color`      | Toast notification link colour       | `#125EF8`     |
| `--spark-toast-border-color`      | Toast notification border colour     | `#DDDDDD`     |
| `--spark-toast-border-radius`     | Toast notification border radius     | `4px`         |
| `--spark-toast-animation-display` | Display a progress bar               | `block`       |

::::hint{type="info"}
**Hiding the toast notification**
If you'd prefer to fully hide the toast notifications from displaying, you can add this CSS code to your website's code.

:::BlockQuote
`spark-toast {display: none;}`
:::
::::

### General messages

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style>
:root {
    /* General messages */
    --spark-message-padding: 0.7em 1.25em;
    --spark-message-success-background: #E5FFF5;
    --spark-message-success-border: 1px solid #1c9665;
    --spark-message-warn-background: #FDF7E3;
    --spark-message-warn-border: 1px solid #EDC35C;
    --spark-message-error-background: #E74148;
    --spark-message-error-border: 1px solid #E74148;
}
</style>
```
:::
::::

| Variable                             | Description                | Default Value       |
| ------------------------------------ | -------------------------- | ------------------- |
| `--spark-message-padding`            | Message box padding        | `0.7em 1.25em`      |
| `--spark-message-success-background` | Message success background | `#E5FFF5`           |
| `--spark-message-success-border`     | Message success border     | `1px solid #1c9665` |
| `--spark-message-warn-background`    | Message warn background    | `#FDF7E3`           |
| `--spark-message-warn-border`        | Message warn border        | `1px solid #EDC35C` |
| `--spark-message-error-background`   | Message error background   | `#E74148`           |
| `--spark-message-error-border`       | Message error border       | `1px solid #E74148` |



***

## Forms

### Input fields

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style> 
:root {
    /* Input fields */
    --spark-form-field-text-transform: none;
    --spark-placeholder-text-color: #999999;
    --spark-input-border-color: #CCCCCC;
    --spark-input-border: 1px solid #CCCCCC;
    --spark-input-radius: 4px;
    --spark-input-background: #FFFFFF;
    --spark-input-error-color: #EF0000;
    --spark-input-success-color: #00AF76;
    --spark-input-focus-color: #125EF8;
    --spark-input-font-size: 14px;
    --spark-input-margin: 0;
    --spark-input-padding: 0.75em;
    --spark-label-font-size: 0.8em;
    --spark-input-disabled-color: #777777;
    --spark-input-disabled-solid-color: #949494;
}
</style>
```
:::
::::

| Variable                             | Description                    | Default Value       |
| ------------------------------------ | ------------------------------ | ------------------- |
| `--spark-form-field-text-transform`  | Form font text transform       | `none`              |
| `--spark-placeholder-text-color`     | Input field placeholder colour | `#999999`           |
| `--spark-input-border-color`         | Input field border colour      | `#CCCCCC`           |
| `--spark-input-border`               | Input field border             | `1px solid #CCCCCC` |
| `--spark-input-radius`               | Input field border radius      | `4px`               |
| `--spark-input-background`           | Input field background         | `#FFFFFF`           |
| `--spark-input-error-color`          | Input field error colour       | `#EF0000`           |
| `--spark-input-success-color`        | Input field success colour     | `#00AF76`           |
| `--spark-input-focus-color`          | Input field focus colour       | `#125EF8`           |
| `--spark-input-font-size`            | Input field font size          | `14px`              |
| `--spark-input-margin`               | Input field margin             | `0`                 |
| `--spark-input-padding`              | Input field padding            | `0.75em`            |
| `--spark-label-font-size`            | Label font size                | `0.8em`             |
| `--spark-input-disabled-color`       | Disabled input field colour    | `#777777`           |
| `--spark-input-disabled-solid-color` | Disabled input border colour   | `#949494`           |

### Radio buttons

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style> 
:root {
    /* Radio buttons */
    --spark-radio-fill-color: #125EF8;
    --spark-radio-empty-color: #5A5A5A;
    --spark-radio-border: 2px solid #125EF8;
}
</style>
```
:::
::::

| Variable                    | Description                    | Default Value       |
| --------------------------- | ------------------------------ | ------------------- |
| `--spark-radio-fill-color`  | Radio button selected colour   | `#125EF8`           |
| `--spark-radio-empty-color` | Radio button unselected colour | `#5A5A5A`           |
| `--spark-radio-border`      | Radio button border            | `2px solid #125EF8` |

### Select menus

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style>
:root {
    /* Select menus */
    --spark-select-border: 1px solid #CCCCCC;
    --spark-select-background: #FFFFFF;
    --spark-select-focus: 1px solid #125EF8;
    --spark-select-font-size: 14px;
    --spark-select-padding: 0.75em;
    --spark-select-radius: 4px;
    --spark-select-disabled-color: #999999;
}
</style>
```
:::
::::

| Variable                        | Description                     | Default Value       |
| ------------------------------- | ------------------------------- | ------------------- |
| `--spark-select-border`         | Select menu border              | `1px solid #CCCCCC` |
| `--spark-select-background`     | Select menu background          | `#FFFFFF`           |
| `--spark-select-focus`          | Select menu focus border colour | `#125EF8`           |
| `--spark-select-font-size`      | Select menu font size           | `14px`              |
| `--spark-select-padding`        | Select menu padding             | `0.75em`            |
| `--spark-select-radius`         | Select menu border radius       | `4px`               |
| `--spark-select-disabled-color` | Select menu disabled colour     | `#999999`           |



***

## Tables

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style>
:root {
    /* Tables */
    --spark-table-border-color: #CCCCCC;
    --spark-table-striped-color: #F5F5F5;
    --spark-table-header-background-color: #FFFFFF;
    --spark-table-header-text-color: #555555;
    --spark-table-header-font-weight: 500;
    --spark-table-header-font-size: 14px;
    --spark-table-header-text-transform: none;
    --spark-table-variants-border-color: #CCCCCCC;
}
</style>
```
:::
::::

| Variable                                | Description                                          | Default Value |
| --------------------------------------- | ---------------------------------------------------- | ------------- |
| `--spark-table-border-color`            | Table border colour                                  | `#CCCCCC`     |
| `--spark-table-striped-color`           | Table striped rows background                        | `#F5F5F5`     |
| `--spark-table-header-background-color` | Table header background                              | `#FFFFFF`     |
| `--spark-table-header-text-color`       | Table header text colour                             | `#555555`     |
| `--spark-table-header-font-weight`      | Table header font weight                             | `500`         |
| `--spark-table-header-font-size`        | Table header font size                               | `14px`        |
| `--spark-table-header-text-transform`   | Table header text transform                          | `none`        |
| `--spark-table-variants-border-color`   | Table border colour for product detail page variants | #CCCCCC       |



***

## Product Card

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/luckQbtHsVLkgelzTYm5h_image.png)

::::Tabs
:::Tab{title="Sample CSS Code"}
```css
<style>
:root {
    /* Product Card */
    --spark-product-card-button-radius: 4px;
    --spark-product-card-button-padding: 0.75em 1em;
    --spark-product-card-pricing-font-size: 15px;
    --spark-product-card-pricing-font-size-small: 14px;
    --spark-product-card-select-min-height: 50px;
    
    --spark-product-card-stockstatus-fontsize: 16px;
    --spark-product-card-stockstatus-fontsize-small: 14px;
    --spark-product-card-stockstatus-align: center;
    --spark-product-stockstatus-back-order-display: none;
    
    --spark-product-card-tiered-pricing-display: flex;
    --spark-product-card-tiered-pricing-font-size: 12px;

}
</style>
```
:::
::::

| Variable                                          | Description                            | Default Value               |
| ------------------------------------------------- | -------------------------------------- | --------------------------- |
| `--spark-product-card-button-radius`              | Button radius                          | `4px`                       |
| `--spark-product-card-button-padding`             | Button padding                         | `0.75em 1em`                |
| `--spark-product-card-pricing-font-size`          | Pricing font size                      | `15px`                      |
| `--spark-product-card-pricing-font-size-small`    | Pricing font size on mobile            | `14px`                      |
| `--spark-product-card-select-min-height`          | Minimum height for select menu wrapper | `50px`                      |
| `--spark-product-card-tiered-pricing-display`     | Display of tiered pricing widget       | `flex`                      |
| `--spark-product-card-stockstatus-fontsize:`      | Stock status font size                 | 16px                        |
| `--spark-product-card-stockstatus-fontsize-small` | Stock status font size on mobile       | 14px                        |
| `--spark-product-card-stockstatus-align`          | Stock status alignment                 | `center`                    |
| `--spark-product-card-tiered-pricing-display`     | Tiered pricing info display            | `flex` (use `none` to hide) |
| `--spark-product-card-tiered-pricing-font-size`   | Tiered pricing font size               | `12px`                      |



***

## Dark mode

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-3Je9VdkbZizdPYiUIyqM_image.png)

If your Shopify store theme is set up to use a dark theme, you can enable a special 'Dark Mode' in SparkLayer.  Within your [SparkLayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP), simply add the following.

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
  display: {
    darkTheme: true,
    /* Other settings should show below */
  },
/* End of code */
```

You can also customise the look and feel by adding the following CSS overwrites.

| Variable                                     | Description                | Default Value |
| -------------------------------------------- | -------------------------- | ------------- |
| `--spark-pdp-price-summary-color`            | Default price colour       | `#ffffff`     |
| `--spark-dark-mode-lightest-color,`          | Default font colour        | `#ffffff`     |
| `--spark-dark-mode-status-in-stock`          | In stock colour            | `#5ecfad`     |
| `--spark-dark-mode-status-back-order`        | Backorder colour           | `#96b1ef`     |
| `--spark-dark-mode-status-out-of-stock`      | Out of stock colour        | `#ff9a9a`     |
| `--spark-dark-mode-table-border-color`       | Table border colour        | `#555`        |
| `--spark-dark-mode-table-header-background`  | Table header colour        | `#000`        |
| `--spark-dark-mode-table-row-background`     | Table row colour           | `#333`        |
| `--spark-dark-mode-table-row-alt-background` | Table alternate row colour | `#222`        |
| `--spark-dark-mode-qty-background`           | Quantity box colour        | `#000`        |
| `--spark-dark-mode-qty-background-hover`     | Quantity box hover colour  | `#222`        |
| `--spark-dark-mode-qty-border-color`         | Quantity box border colour | `#555`        |



***

## Using "slots" to extend the interface

Custom Slots (or "Targets") allow you to enhance a range of the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) by adding your own custom code in predefined areas.&#x20;

::embed[]{url="https://www.youtube.com/embed/pAfXYvYnY2M"}

It's a great way to further enhance your B2B customer experience using SparkLayer and you can learn more in [our guide here](docId\:l_2ooHJiY-rAx2chBMgP2).

[title] Shopify B2B Registration & Login
[path] Integrations/Shopify/Shopify Customisations/

## Introduction

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7yF-5JKxbh_nTQ_tjTY8c_image.png)

When you’re setting out to build and implement your B2B eCommerce store, one of the most integral elements is the B2B Registration and Login area.

The B2B registration flow is simply a way to allow prospective customers to register with your website and to typically have some variety of “moderation” process built-in that also you to verify their details before granting access.

We've set out a number of ways you can approach this, read on to learn more!



***

## B2B Login and Register Page

:::hint{type="success"}
**Need help setting this up?**
Our team is happy to setup the B2B login and register page on your Shopify store. [Contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll action this for you!
:::

When SparkLayer is used with Shopify, the **existing** Shopify login functionality is used whereby a customer can sign in with an email address and password via the `/account` URL (e.g. `www.yourstore.com/account`).&#x20;

Since your standard (DTC) customers will also use this page, you may want to adapt it or even direct your B2B customers t&#x6F;**&#x20;a different page** on your website. You can see this setup on our [example store here](https://standalone.demo.sparklayer.io/).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/_KidoYG3sLFIcZAGqCrJG_image.png)

To set this up on your own Shopify store, you can use **our ready-made functionality** by following the guide below. Once setup, customers can access a URL of `/pages/b2b-login` to login or apply for access.&#x20;

::embed[]{url="https://www.youtube.com/embed/hI_KwFMV4SQ"}

To get started, please follow the steps below.

::::WorkflowBlock
:::WorkflowBlockItem
**Add the code samples**
You'll need to create **two new files** within your Shopify theme codebase.

- Within the `/sections/` directory, create a file named `main-b2b-login.liquid `and [add this code](https://gist.github.com/cm-sl/c725a1de3c926257f9f81ee5fc70a029)
- Within the `/templates/ `directory, create a file named `page.b2b-login.json` and [add this code](https://gist.github.com/cm-sl/1c18244e75ed401b217f15eb1c9d6308)
- Should you wish to make code changes, you can simply edit the contents of these files within your Shopify theme.
:::

:::WorkflowBlockItem
**Create a page within your Shopify store**

Next, you'll need to create the page within your Shopify store. Once setup, it'll allow users to access the page via `/pages/b2b-login`

- Within your Shopify admin, go to Online Store > Pages and click "Add New".
- Create a new page with title "**B2B Login'** and within "Search engine listing
  " ensure it has a URL handle of `b2b-login `(it should do this automatically)
- Under "Templates", assign the `b2b-login` template to the page

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bnJQZ2tAQqwMlTyEg0vPh_image.png)
:::

:::WorkflowBlockItem
**Customize and visit the new page**

- You can edit how the page looks and functions by going to Online Store > Themes and click the "**Customize**" button.
- Search for `b2b-login` to begin making changes. You can customise nearly all areas of the page such as colours, form fields, text, and more.
- To see how the page works, in your browser, visit `www.yourstore.com/pages/b2b-login` and you should see the new login page.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/8-mrqdqZnFRkGADKcDVi-_image.png)
:::
::::

## Customising the registration process

You can customise how you want applications to work within the **Customizer** tool of your Shopify store. To get started, go to Online Store > Themes and click the "Customize" button.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/D9PGoq6-geTnLwZz6DEQG_image.png)

It's possible to select from 3 options

| Option                             | Details                                                                                               |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `Send an email to the store owner` | This will send an email to the store owner of the Shopify store                                       |
| `Embed custom contact form`        | This allows you to embed a third party form (e.g. an app, see below)                                  |
| `Go to new page URL`               | This allows you to direct customers to a new page URL where you may have an existing application form |

### Send an email to the store owner

The login page allows prospective customers to apply for an account and is set up to use the [built in Shopify contact form](https://help.shopify.com/en/manual/online-store/themes/os/customize/add-contact-form) to trigger an email.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/SqybT-tBpD0XMTf2gFoRe_image.png)

When a customer fills in this form, an email will automatically be sent to the Shopify store's email address and include any additional fields you've added. The email will typically have a subject of **"New customer message on \[Date of submission]".**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/SaYqrdhL20B7kwmN-LALy_image.png)

:::hint{type="warning" attributes="[object Object]"}
**Please note:**
When this form is filled in, it will **not** automatically create a customer record in your Shopify store. You will need to manually create the customer by going to your Shopify admin and going to the Customers section. You can then proceed to invite your new customer by following [these steps.](docId\:YUfghEGoxe_h7uJfcshna)
:::

Adding custom fields is simple, and you can customise the fields exactly as you need. To add new fields, within the Customizer tool, under Login Page, select "Form Field".&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TVfWNEhg8IrxBJ8QGdLw6_image.png)

You can then specify the name of the field and the default text you wish to show.

:::hint{type="warning" attributes="[object Object]"}
**Please note:**
The form created uses the standard ["Shopify contact form"](https://help.shopify.com/en/manual/online-store/themes/customizing-themes/add-contact-page) and in rare instances, you may not receive emails when a form is submitted (e.g. your email recipient address is bouncing or being blocked by Shopify). If you do experience this issue, we recommend speaking directly to Shopify Support, noting that your store's contact form isn't working as expected.&#x20;
:::

### Embed SparkLayer Form

If you'd prefer to use a SparkLayer Form to manage applications to your B2B store rather than the Shopify contact form, you can embed it directly into your B2B login page via the Customizer.

1. **Get your embed code** - In the SparkLayer Dashboard, go to [Forms](https://app.sparklayer.io/forms), open your form, and click the **Preview** tab. Click "Copy code to clipboard" to copy the HTML embed code. The code will look something like this:

:::BlockQuote
\<spark-form form-id="your-form-id" site-id="your-site-id">\</spark-form>\<script src="https\://cdn.sparklayer.io/spark-form.v1.0.0.js">\</script>
:::

1. **Add to your B2B login page** - In your Shopify admin, go to Online Store > Themes and click "Customize". Navigate to your B2B login page, then select "Embed custom contact form" from the "Form Action" menu. Paste in the embed code you copied.
2. **Save and test** - Save your changes, then visit the page in your browser to check the form is displaying and working as expected.

You can build and customise your form in the [SparkLayer Dashboard](https://app.sparklayer.io/forms) - learn more about [SparkLayer Forms](docId\:nn5qnfmfGkXlyUmAMpSnq).

### Embed custom contact form

If you'd prefer to use a custom form to manage applications to your B2B store rather than the Shopify contact form, you can enable this via the Customizer.

Simply select the "Embed custom contact form" from the "Form Action" menu and paste in your contact form HTML code.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ve-Zh-uhEbFt9iVRvbX1N_image.png)

### Go to new page URL

If you'd prefer to not include an application form on this page, you can instead direct the user to a specific page URL. For example, you may have an existing registration page on your store or a URL on a different website address.

Simply select the "Go to new page URL" from the "Form Action" menu and specify the URL within the "Redirect URL" field.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/680oyunLcPorA8JmpM4HE_image.png)

### Important notes & considerations

Please note the following:

- The example login and registration page detailed above is essentially standard Shopify code and is not technically part of the SparkLayer App. It is built using best-practice Shopify Liquid code and standard CSS and can easily be modified by a Shopify developer
- The built-in registration form uses the standard Shopify contact form system - it is no different to adding a generic contact page to your Shopify store and as such is technically a form supported by Shopify (and not SparkLayer)
- If a customer submits the login form with incorrect credentials (e.g. an incorrect email and/or password), the page will redirect to the standard Shopify login page with the standard validation to notify the customer that their login details are incorrect.



***

## Translating the B2B Login & Register Page

If your Shopify store uses Shopify Markets to display different languages based on a user's location, you can fully translate the SparkLayer B2B Login and Registration forms to match.

:::hint{type="info"}
**Please note**
Before starting, ensure your Shopify store is correctly configured to use **Shopify Markets**. You must have languages specified for your target markets (e.g., French for France, German for Germany).
:::

We recommend using Shopify's native solution for the best compatibility. Install the [Shopify Translate & Adapt app](https://apps.shopify.com/translate-and-adapt) from the Shopify App Store. This app provides a visual interface to apply translations side-by-side with your default content.

Open the **Shopify Translate & Adapt** app. At the top of the dashboard, use the dropdown menu to select the language you wish to edit.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7Gd53NMX5N9e21evSmsNM_image.png)

Then click "**Templates**" under "**Themes**".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Fwn73m-DfInaAB_Wg3xm__image.png)

In the resource list, search for and select the B2B Login page. This is typically named **Page: B2B Login**, unless you have manually renamed the page title.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GAVQFn70c00BOyWo5AWhM_image.png)

Once the page is selected, you will see the translatable fields on the right side of the screen. You have two options:

- **Manual Translation:** Type your specific translations into the corresponding fields.
- **Auto-translate:** Click the **Auto-translate** button (if enabled) to automatically generate translations for all fields using Shopify's translation engine.



***

## SparkLayer Forms

::embed[]{url="https://www.youtube.com/embed/_M4QphRF9_k"}

If you're looking for more control over your B2B registration process, SparkLayer Forms is our built-in, no-code form builder that lets you create and manage registration forms directly within SparkLayer - no third-party apps needed.

With SparkLayer Forms, you can:

- Build forms visually using a drag-and-drop builder with flexible field types including text, email, dropdowns, file uploads, addresses and more
- Set up approval workflows to review and approve applications before granting access
- Automatically tag customers, assign them to customer groups, and sync data to your platform
- Get started quickly using the ready-made Customer Registration Form template

Since everything is managed within SparkLayer, you can handle the entire process from application through to approval and customer creation in one place.

[Learn more about SparkLayer Forms](docId\:nn5qnfmfGkXlyUmAMpSnq)



***

## Inviting & activating B2B customers

To begin inviting and activating B2B customers, please see [our full guide here](docId\:YUfghEGoxe_h7uJfcshna).&#x20;



***

## Forcing customers to login

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/YbcJ7Fih0hxncmj0Fp029_image.png)

If you're wanting to **restrict your entire website** to be locked down until a customer successfully logs in, you can do so by editing the `theme.liquid` file within your storefront theme.&#x20;

We've included an example on how to setup this up and works as follows:

::::WorkflowBlock
:::WorkflowBlockItem
Code is added to the `theme.liquid` file
:::

:::WorkflowBlockItem
For **logged out** users, all visitors are redirected to the account login page `/account/login`
:::

:::WorkflowBlockItem
For **logged in** users and those tagged with `b2b`, they'll then be able to view the entire website as normal.
:::
::::

```html
<!-- Add this code to theme.liquid before the closing head tag
template refers to files within your theme
request.path refers to URLs on your store
-->

 {%- if customer.metafields.sparklayer.authentication -%}
 <!-- Don't redirect for B2B customers -->
 
{%- else -%} 

{%- if request.design_mode -%}

<!-- Don't redirect if using Shopify Customiser tool -->

{%- else -%} 
 
   {%- if template contains 'customers/' 
      or request.path == '/challenge' 
      or request.path == '/pages/contact-us' 
      or request.path == '/pages/b2b-login' 
      or request.path == '/pages/about-us' 
      or request.path == '/pages/terms-and-conditons' 
     -%}
  
     <!-- Do nothing -->
  
   {%- else -%}

     <script>
       window.location.href = '/account/login';
     </script>

   {%- endif -%}

{%- endif -%}

{%- endif -%} 

<!-- End of redirect code -->
```



***

## B2B Onboarding page

A great way to encourage your customers to use your new B2B store is to **explain the benefits**. To help you get started, you can use our ready-made "onboarding landing page" that gives a great overview of the features to your customers.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/4_tcO7rdfhTWX98AQBVLU_image.png)

:::::ExpandableHeading
**To install the onboarding landing page, please follow these steps:**

::::WorkflowBlock
:::WorkflowBlockItem
In Shopify, go to **Online Store** and click **Pages** (or [go here](https://admin.shopify.com/pages))
:::

:::WorkflowBlockItem
Click the "Show HTML" button and then paste in the [code from here](https://gist.github.com/cm-sl/47d750425f90d527e1210efe3735dc7f)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zFOBIqABCi7DYG7Hy3-BO_image.png)
:::

:::WorkflowBlockItem
You can then customise the page title, URL, and any of the content as required.&#x20;

We recommend give the page a URL of `b2b-onboarding`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/N_E3EMEJe4Y7asWggYO1g_image.png)

Finally, set the page to "**Visible**" to publish it on your store and you can then click "**View**" to see the page.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/A9FsEBDR1BXEUli7HwRxQ_image.png)
:::

:::WorkflowBlockItem
To make customers aware of your new page, you could add this to your website navigation (such as your website header or footer). If you're using our ready-made [Shopify B2B Registration & Login](docId\:Gfc0UW7mJnMNpnNO6EdRl) you can also link to the page from there.
:::
::::


:::::



***

## B2B Activation Emails

Depending on how your Shopify accounts are set up, you can also customise the activation emails that your B2B customers receive when you invite them to your Shopify store. Learn more in [Shopify Email Notifications](docId\:FAW11UwvEk1KN06woxik0).&#x20;

[title] Credit, Net Terms, & Invoicing
[path] Features/Configurations/

## Setting Credit Limits & Account Balances

If some of your B2B customers have a credit limit in place, it's possible to display this when they login to your website, giving them visibility on their credit status.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FhYnhK2ciAMtWy5h3rZpp%2Fimage.png?alt=media\&token=75e040a8-d052-4c7a-a119-5a844bba4655)

Credit limits work by specifying an amount against a customer record and, when the customer signs in, and places an order using [Pay on Account](docId\:efevur-A3yCJXUHvrR7t-), they'll be notified if they are about to place an order that exceeds their credit limit.&#x20;

In our example below, the customer has exceeded their credit limit and their ability to "Pay on Account" has been blocked (i.e. they are only able to "Pay Online by Card")

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FwMzt3TsvDvJ7nfHbnlAx%2Fimage.png?alt=media\&token=077aae97-3552-4be7-b42b-32d0c053e343)

This feature works by enabling a special setting against a customer that can then be manually adjusted according to their agreed terms. You can also specify an account balance that will automatically update each time a successful order is placed (this can also be adjusted manually if required).

:::hint{type="success"}
**Payments Visbility**
Looking to allow your customers to see their current financial standing right in the 'My Account' area? See our guide to setting up [Payments Visibility](docId\:ibIKczvHM085BkeJIfFYv).
:::

:::hint{type="info"}
**Please note**
By default, if a customer exceeds their credit limit, the "Pay on Account" payment method will be disabled. If you'd prefer to still allow the order to be placed by this payment method, you can [enable this setting here](https://app.sparklayer.io/configuration/settings/general).
:::

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                                                                                  |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields)                                                          |
| `Metafield type`   | This must be set as an `JSON` string                                                                                                     |
| `Namespace`        | This must be set as `sparklayer`                                                                                                         |
| `Key`              | This must be set as `payment_on_account`                                                                                                 |
| `Value`            | This is applied on a specific customer record.<br />This must be specified in the following format:`{"credit_limit":1000,"balance":250}` |
::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                                                              |
| ------------------ | ------------------------------------------------------------------------------------ |
| `Custom data type` | Customers                                                                            |
| `Metafield type`   | This must be set as an `JSON` string                                                 |
| `Namespace`        | This must be set as `sparklayer`                                                     |
| `Key`              | This must be set as `payment_on_account`                                             |
| `Value`            | This must be specified in the following format:`{"credit_limit":1000,"balance":250}` |

For more information, please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::

If you're using multiple currencies for your B2B customers (see [Shopify Markets & Currencies](docId\:vex5XjFlT6Pvb0AzhlKQD)), you can specify their exact currency when viewing the credit limit and account balanace. To set this up, simply change the value key against a customer to the below format, changing `usd` to your required currency:

| Item    | Details                                                                                                         |
| ------- | --------------------------------------------------------------------------------------------------------------- |
| `Value` | This is applied on a specific customer record.<br />`{"credit_limit":1000,"currency_code":"usd","balance":250}` |

:::hint{type="info"}
**Real-time "Account Balance"**
SparkLayer also has the ability to show a real-time Account Balance with the use of our **Payments Visibility** toggle. You can [find our guid on this here](https://docs.sparklayer.io/payment-methods#payments-account-balance)
:::

You can also modify the text that is shown to a customer by updating the SparkLayer language strings.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/6p1DjxMv-2GjI4Bi2huyI_image.png)

They'll see special messaging both in their My Account area and during the checkout if they exceed their credit limit.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/nysFMexuKWPx88hT6qj87_image.png)

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "account.main.my-details.payment-on-account.detail": "Your account balance is {balance} with a credit limit of {creditLimit}.",
    "account.main.my-details.payment-on-account.detail-without-limit": "Your account balance is {balance}.",
    "account.main.my-details.payment-on-account.net-terms": "Your payment terms are {type}.",
    "account.main.my-details.payment-on-account.sub-text": "Payments may take some time to be updated. Please contact us to discuss payments or credit.",
    
    "cart.checkout.payment-method.credit-unavailable.title": "Your cart currently exceeds your available credit limit",
    "cart.checkout.payment-method.credit-unavailable.message": "Please choose an alternative payment method to complete your order. If you'd like to discuss your payment terms, please contact us.",
    "cart.checkout.payment-method.credit-limit-hit.title": "Your cart currently exceeds your available credit limit",        
    "cart.checkout.payment-method.credit-limit-hit.message": "You can place an order but it may be delayed and subject to approval. If you'd like to discuss your payment terms, please contact us.",
  }
},
/* End of code */
```



***

## Setting Net Terms (Payment on Account)

It's possible to set specific "Net terms" for a customer (such as Net 30, Net 60) giving the customer visibility on their payment terms. Once it's set up, this will display in the customer's [My Account](docId\:lQXaNI7IVDqna09D9soAP) area under "Financials'.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/3yJjWNX6RQtzTayv4mTZj_image.png)

When the customer then goes through the checkout, they can simply select "Pay on Account" to trigger their net payment terms.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FKIMmP3aGLn107YljD6It%2Fimage.png?alt=media\&token=b969f2ed-8a20-4be6-8143-902bdd15a661)

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
First, you'll need to ensure the "Payment on Account" payment method is enabled within the **Customer Groups&#x20;**&#x61;rea of the [SparkLayer Dashboard](https://app.sparklayer.io/customers/groups) for your chosen customer group. Click the **Edit** icon and you'll see a section called **Payment Methods**. From here, simply ensure that "Payment on Account" is ticked.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/FjjF9sv-FAvuI_MDxEwBs_image.png)

When an order then arrives into Shopify, it will be created as a **Draft** order. With the payment terms set (as above), this will then update the "Payment due later" setting and populate the "Payment terms" and "Issue date" fields.&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2F2DmantM0gRQlmpe4mIqT%2Fimage.png?alt=media&token=97cb99de-a56e-4031-b835-bbe23d25bd12)

You can even automatically convert the **Draft** order into a **Completed** order within Shopify and then manually collect payment at a later date (such as offline via your accounting system). To activate this, from the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/settings/general), turn on "Auto-complete Shopify Draft orders" and ensure "Payment on Account orders - automatically mark as paid" is **turned off**. If you do want to automatically mark the order as paid, you can achieve this via Shopify Flow. [Learn more](docId\:ddIv5TDAnCayWTOJ0Vyb7).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/i6ui6ZHuNND94RyknZ45B_image.png)

:::hint{type="info"}
**Setting up metafields on Shopify**
🤖 Automatically add this to your Shopify store by going to [configure metafields](https://app.sparklayer.io/configuration/integrations/platform).
📖 Learn more about how metafields work in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                                                                                                                                                                                                                          |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields)                                                                                                                                                                                                  |
| `Metafield type`   | This must be set as an `JSON` string                                                                                                                                                                                                                                             |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                                                                                                 |
| `Key`              | This must be set as `payment_on_account`                                                                                                                                                                                                                                         |
| `Value`            | This is applied on a specific customer record.<br />This must be specified in the following format:`{"net_terms":"30_days"}`<br />If you're also the credit feature (see above), this should be populated as follows:`{"credit_limit":1000,"balance":250,"net_terms":"30_days"}` |

In terms of configuring the net terms, the following values are supported:

| **Net terms** | **Value** |
| ------------- | --------- |
| `7 days`      | 7\_days   |
| `15 days`     | 15\_days  |
| `30 days`     | 30\_days  |
| `45 days`     | 45\_days  |
| `60 days`     | 60\_days  |
| `90 days`     | 90\_days  |
::::

:::Tab{title="🌐 Other platforms"}
Please refer to the [SparkLayer Technical Docs](https://docs.sparklayer.io/tech-docs)
:::
:::::

:::hint{type="info"}
**Please note**
If you're using the SparkLayer setting to [automatically mark 'Payment on Account' orders as Paid](https://app.sparklayer.io/configuration/settings/general)  on your store setup, this will not work in parallel to customers using "Payment on Account" with specific net terms (as detailed above)
:::

:::hint{type="success"}
**Shopify automations**
You can also automate how your net payments work with our ready-made Shopify Flows. You can learn more in [our guide here](docId\:ddIv5TDAnCayWTOJ0Vyb7)
:::



***

## Sending invoices

Are you looking to create and send invoices for your B2B customers? SparkLayer offers a variety of ways to allow invoices to be sent, streamlining your B2B operations:

| Method                                | Details                                                                                                                                 | Use-case                                                                                                                                                                         |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SparkLayer Invoices`                 | Customers can view & download invoices directly via SparkLayer.                                                                         | Your invoicing requirements are relatively simple and you don't want to use additional third-party apps.<br />[Learn more](docId\:NKh8H14Ffna5DD71SwwNd)                         |
| `Send invoices via your online store` | Depending on which eCommerce platform you're using, it's also possible to send invoices directly from your store administration area.   | You have relatively basic requirements and you want to use your existing eCommerce platform to manage the process.<br />*Learn more in the guide below.*                         |
| `Metafield and attaching invoices`    | Add custom invoice details within your store using special metafields that can be associated with an order (manually or automatically). | You have an existing back-office system that is already generating invoices for your store and you can access these as files (e.g. a PDF).<br />*Learn more in the guide below.* |
| `Third-party app`                     | Tools such as Sufio allow you to automatically integrate their solution into SparkLayer.                                                | You require invoicing beyond B2B (e.g. for your regular cusotmers also) and need more design customisation.<br />*Learn more in the guide below.*                                |

### SparkLayer Invoices

To learn about SparkLayer's own invoicing solution, please see [our guide here](docId\:NKh8H14Ffna5DD71SwwNd).&#x20;

### Send invoices via your online store

Depending on which eCommerce platform you're using, it's also possible to send invoices directly from your store administration area. Whilst the functionality may be basic, it can act as a good way to start testing your B2B invoicing process before using a more comprehensive invoicing solution.

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
**When an order is placed (as a draft order)**

When a customer places an order via your website via a [manual payment method](docId\:ibIKczvHM085BkeJIfFYv) (such as *Payment by Invoice*), it's possible to have this order come into Shopify as a 'Draft' order.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/s-UKqYf18JAFSi2vFfouh_image.png)

Shopify then has the ability to **'Send an invoice'&#x20;**&#x74;hat allows you to send a customise message and a link to the Shopify checkout to make payment. This uses the 'Send invoice' feature of Shopify Draft orders and you can learn more about [how this works here](https://help.shopify.com/en/manual/orders/create-orders#share-checkout-link-with-customers).

Once the customer completes their purchase by making payment, the order is then marked as paid and will then display within your **Shopify Orders** area.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VzjkMj9NzFirTHi5t1wJA_image.png)

:::hint{type="info" attributes="[object Object]"}
You can edit this email template by going to **Settings > Notifications** within Shopify and search for the **Draft order invoice** template
:::

If the customer hasn't made payment for any reason or you are processing it manually, within Shopify you can open the order and easily resend or manually mark as paid. Please note, the order will stay as a Draft order until action has been taken.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5S8zfxv_o3DNG93Yl4gLF_image.png)
::::

:::Tab{title="🌐 Other platforms"}
Please refer to the [SparkLayer Technical Docs](https://hub.sparklayer.io/tech-docs)
:::
:::::

### Metafield - attaching an invoice to an order

When a customer places an order and payment has been completed against it, the order will appear in their [My Account](docId\:lQXaNI7IVDqna09D9soAP) area. When viewing an order, in addition to the order details (such as products ordered, order status, address), it's possible to attach an invoice against an order that the customer can subsequently download.

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
To get started, you'll need to add a custom metafield to your Shopify store, using the "Orders" metafields

:::hint{type="info"}
**Setting up metafields on Shopify**
To learn more about how to configure metafields on Shopify for SparkLayer, please refer to [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

| Item               | Details                                                                                                                                                                                                   |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | [Orders](https://admin.shopify.com/settings/custom_data/order/metafields)                                                                                                                                 |
| `Metafield type`   | This must be set as an`URL` or `File`. One value or lists of values are supported.                                                                                                                        |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                                                          |
| `Key`              | This must be set as `invoice_url`                                                                                                                                                                         |
| `Value`            | **NOTE: It's very important the file name or URL is not guessable. We recommend having a&#x20;**[UUID](https://www.uuidgenerator.net/)**&#x20;placed within the URL which makes it impossible to guess.** |

Once you've set up the metafield, simply navigate to an order in Shopify and you'll see the field appear to specify the invoice URL.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/PBI4f1la9i-0xun7dnqqM_image.png)

If you don't already have the invoice file(s) hosted, you can use the built-in [Shopify content system](https://admin.shopify.com/content/files?selectedView=all) to do this. Simply upload the file and copy the link to your clipboard. This can then be pasted within the filed detailed above.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/RY4iq-MjeHx4Iwo1USR0L_image.png)

Once the B2B customer logs in, they'll then be able to download this from their order history on your website. As this is using the Shopify metafield system, the process of attaching invoices could be actioned in bulk or you could even automate this process from your backend system (e.g. ERP, CRM).

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2F9VvbGw3V1ivMIj38UXGA%2Fimage.png?alt=media&token=ed9a3454-07ce-41e2-84e4-f534aea1806d)
::::

:::Tab{title="🌐 Other platforms"}
| Item               | Details                                                                                                                                                                     |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom data type` | Orders                                                                                                                                                                      |
| `Metafield type`   | This must be set as a text string.<br />We strongly recommend the file names are secure and you can even use a [tool such as this to help](https://www.uuidgenerator.net/). |
| `Namespace`        | This must be set as `sparklayer`                                                                                                                                            |
| `Key`              | This must be set as `invoice_url`                                                                                                                                           |
| `Value`            | N/A                                                                                                                                                                         |

For more information, please refer to the [SparkLayer Technical Docs](https://hub.sparklayer.io/tech-docs)
:::
:::::

### Using third-party apps for invoices

If you're looking for a more feature-rich invoicing solution, you may also want to consider using a third-party app such as [Sufio Invoicing](docId\:qlBasATpzOCOF5eXC99O3)

[title] Custom Slots ("Targets")
[path] Features/Frontend Interfaces/

:::hint{type="success"}
**🚀 Upgrading to the latest SparkLayer version**
To benefit from our latest updates, please upgrade your [SparkLayer Core Script](https://app.sparklayer.io/integrations/widgets/core). You can learn about how the Core Script works in [our guide here](docId\:QWXsYM9X5_pvIOGUteKcP).
:::

## Introduction

Custom Slots (or "Targets") allow you to enhance a range of the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) by adding your own custom code in predefined areas.&#x20;

::embed[]{url="https://www.youtube.com/embed/pAfXYvYnY2M"}

It's a great way to further enhance your B2B customer experience and use-cases could include any of the following:

| Use-Case              | Details                                                                                                                                                              |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Promotional content` | Adding promotional content to the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) that customers see as soon as they login (e.g. announcing a new product line) |
| `Adding links`        | Adding links in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) area that your B2B customers can access (e.g. downloadable CSV templates)                      |
| `Upsell content`      | Adding upsells and promotional content when a customer [completes an order](docId\:efevur-A3yCJXUHvrR7t-) (e.g. asking for a rating)                                 |

In addition to this, you could also set up more advanced content that varies based on specific rules:

| Use-Case            | Details                                                                                                                                                                             |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Customer-specific` | Based on who the customer is and which [customer group](docId:5_lWMNohhjBJJppg9E6Vh) they belong to, show different content (e.g. customer group `VIP`, show a promotional message) |
| `Order-specific`    | Based on the order contents or order total, show a message (e.g. if the order is under $100, encourage them to add more products)                                                   |

Custom Slots allow a lot of flexibility in how they're used and it's really up to you how creative you can be!



***

## How it works

Custom Slots work by adding special **template slots** to your website that are then displayed in specific locations of the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa). You can learn how to begin using them under *"Getting Started"* below.

### My Account

The "My Account" template slot is displayed at the top of the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) when a B2B customer signs in.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/3tBkNcGyFECajydjtS6Mu_image.png)

### My Order

The "My Order" template slot is displayed at the top of the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) when a B2B customer signs in.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/3Hzeu-VvOuGlXBhog-9NS_image.png)

### Order Complete

The "Order Complete" template slot is displayed when a B2B customer customer [completes an order](docId\:efevur-A3yCJXUHvrR7t-).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Lc9-HabMyT0uc0zKbsGrI_image.png)

### Cart Shipping Step

The "Cart Shipping Step" template slot is displayed on the "Shipping" step of the checkout.

### Cart Payment Step

The "Cart Payment Step" template slot is displayed on the "Payment" step of the checkout.

### Purchase Summary Header

The "Purchase Summary Header" template slot is displayed above the purchase summary when viewing a purchase.

### Purchase Summary Footer

The "Purchase Summary Footer" template slot is displayed below the purchase summary when viewing a purchase.

### Cart Line Item

The "Cart Line Item" template slot is displayed below a product line item within the My Cart.



***

## Getting Started

### Configuring your store

To begin using Custom Slots, you'll need to add some specific code to the [SparkLayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP) within the `display` section.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/template-slot-code.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

Based on the locations you intend to add to your website, you can include the below code in your SparkLayer Core Script.

```javascript
 display: {
    showSlots: [
  'spark-slot-my-account',
  'spark-slot-my-cart',
  'spark-slot-order-complete',
  'spark-slot-cart-shipping-step',
  'spark-slot-cart-payment-step',
  'spark-slot-purchase-summary-header',
  'spark-slot-purchase-summary-footer',
  'spark-slot-my-cart-line-item',
],
  },

```

| Name                                 | Details                                         |
| ------------------------------------ | ----------------------------------------------- |
| `spark-slot-my-account`              | This enables the "My Account" slot              |
| `spark-slot-my-cart`                 | This enables the "My Order" slot                |
| `spark-slot-order-complete`          | This enables the "Order Complete" slot          |
| `spark-slot-cart-shipping-step`      | This enables the "Cart Shipping Step" slot      |
| `spark-slot-cart-payment-step`       | This enables the "Cart Payment Step" slot       |
| `spark-slot-purchase-summary-header` | This enables the "Purchase Summary Header" slot |
| `spark-slot-purchase-summary-footer` | This enables the "Purchase Summary Footer" slot |
| `spark-slot-my-cart-line-item`       | This enables the "Cart Line Item" slot          |

### Adding & customising the slots

Once you've adjusted the SparkLayer Core Script with the above changes, you can then proceed to add custom content for each of the locations.

To get started, you simply need to add a **template element** within your website code, referencing the `id` of one of the slot locations above.&#x20;

```html
<!-- Example code for the My Account slot -->
<template id="spark-slot-my-account">
   <div class="my-content">
       Content here will show in the My Account section.
   </div>
</template>

<!-- Example code for the My Cart slot -->
<template id="spark-slot-my-cart">
   <div class="my-content">
       Content here will show in the My Order section.
   </div>
</template>

<!-- Example code for the My Order slot -->
<template id="spark-slot-order-complete">
   <div class="my-content">
       Content here will show in the Order Complete section.
   </div>
</template>

<!-- Example code for the Cart Shipping Step slot -->
<template id="spark-slot-cart-shipping-step">
   <div class="my-content">
       Content here will show in the Cart Shipping Step section.
   </div>
</template>

<!-- Example code for the Cart Payment Step slot -->
<template id="spark-slot-cart-payment-step">
   <div class="my-content">
       Content here will show in the Cart Payment Step section.
   </div>
</template>

<!-- Example code for the Purchase Summary Header slot -->
<template id="spark-slot-purchase-summary-header">
   <div class="my-content">
       Content here will show in the Purchase Summary Header section.
   </div>
</template>

<!-- Example code for the Purchase Summary Footer slot -->
<template id="spark-slot-purchase-summary-footer">
   <div class="my-content">
       Content here will show in the Purchase Summary Footer section.
   </div>
</template>
```

You could include these template elements within the main template file of your website (e.g. `layout/theme.liquid` for Shopify), or any other appropriate location that is easy for you to access and update.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/template-slot-code-editor.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

The template markup can be very simple with some basic text or you could extend this with more extensive HTML, CSS, images, and other elements. It is really up to you!

:::hint{type="info"}
**Please note**
It's important to note the following:

- Any code added within the **template element**s will show within the specific SparkLayer interface (e.g. the `spark-slot-my-cart` template element will show in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).
- These template elements **will not be shown anywhere else** on your website and will be invisible to logged out customers.
:::



***

## Examples you can use   &#x20;

To help you get started, we've included some examples you could use. &#x20;

:::ExpandableHeading
**Show a custom HTML message with coloured backgrounds**

```html
    <!-- Template element for My Order Interface-->

    <template id="spark-slot-my-cart">
    
        <style>
          .b2b-message-cart {
              background: #3875F3;
              color: #fff;
              padding: 12px;
              border-radius: 8px;
              text-align: center
          }
          .b2b-message-cart a {
              color: #fff;
              text-decoration: underline
          }
        </style>
        <div class="b2b-message-cart">
          🎉 For this week only, get an extra 10% off your B2B order! 🎉
        </div>
        
    </template>


    
    <!-- Template element for My Account Interface-->

    <template id="spark-slot-my-account">
    
        <style>
          .b2b-message-account {
              background: #FF4CBF;
              color: #fff;
              padding: 12px;
              border-radius: 8px;
              text-align: center
          }
          .b2b-message-account a {
              color: #fff;
              text-decoration: underline
          }
        </style>
        <div class="b2b-message-account">
          👋 Welcome back, Claire! Don't forget to check our <a href="link-here">latest special offers here</a>!
        </div>
      
    </template>



    
    <!-- Template element for Order Complete -->

    <template id="spark-slot-order-complete">
    
        <style>
          .b2b-message-complete {
              background: #FF4CBF;
              color: #fff;
              padding: 12px;
              border-radius: 8px;
              text-align: center
          }
          .b2b-message-complete a {
              color: #fff;
              text-decoration: underline
          }
        </style>
        <div class="b2b-message-complete">
          😊 Whilst you're here, would you be able to <a href="link-here">leave feedback on your B2B experience</a>? It would really help us improve our website!
        </div>
        
    </template>

```
:::

:::ExpandableHeading
**Show a custom HTML message with gradient coloured backgrounds**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/4I7Hy9ZbDeBEiJlv2-zAu_screenshot-2024-06-08-at-202312.png)

```html
  <template id="spark-slot-my-account">
    
        <style>
          .b2b-message-account {
            position: relative;
            overflow: hidden;
            padding: 1em;
            border: 2px solid #a68eee;
            border-radius: 6px;
            text-align: center;
            display: flex;
            column-gap: 8px;
            color: #444;
            text-align: left
          }
          .b2b-message-account:after {
            background: linear-gradient(136deg, #54ff96 0%, #80c0ff 48.78%, #f860ff 100%);
            pointer-events: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            background-position: 50%;
            background-repeat: no-repeat;
            content: "";
            background-size: auto 100%;
            z-index: 1;
            background-size: 800px;
            height: 60px;
            filter: blur(100px);
            opacity: 0.9;
           
          }
          .b2b-message-account a {
              color: #5b36f5;
              text-decoration: underline
          }

          .b2b-message-account span {
            background: linear-gradient(54deg, #5B36F5 5.48%, #FF4CBF 44.27%, #3875F3 75.97%, #5B36F5 94.09%);
            display: inline-flex;
            text-transform: uppercase;
            font-size: 11px;
            border-radius: 4px;
            align-items: center;
            padding: 0 6px;
            color: #fff;
            font-weight: 600;
          }
        </style>

      
        <div class="b2b-message-account">
          <span>NEW!</span>
          Show custom content here for specific customers, such as new promotions 🚀 
        </div>
      
    </template>

   <template id="spark-slot-my-cart">
    
        <style>
          .b2b-message-account {
            position: relative;
            overflow: hidden;
            padding: 1em;
            border: 2px solid #a68eee;
            border-radius: 6px;
            text-align: center;
            display: flex;
            column-gap: 8px;
             color: #444;
            margin: -6px 0 0 ;
            text-align: left
          }
          .b2b-message-account:after {
            background: linear-gradient(136deg, #54ff96 0%, #80c0ff 48.78%, #f860ff 100%);
            pointer-events: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            background-position: 50%;
            background-repeat: no-repeat;
            content: "";
            background-size: auto 100%;
            z-index: 1;
            background-size: 800px;
            height: 60px;
            filter: blur(100px);
            opacity: 0.9;
           
          }
          .b2b-message-account a {
              color: #5b36f5;
              text-decoration: underline
          }

          .b2b-message-account span {
            background: linear-gradient(54deg, #5B36F5 5.48%, #FF4CBF 44.27%, #3875F3 75.97%, #5B36F5 94.09%);
            display: inline-flex;
            text-transform: uppercase;
            font-size: 11px;
            border-radius: 4px;
            align-items: center;
            padding: 0 6px;
            color: #fff;
            font-weight: 600;
            text-align: left
          }
        </style>
        <div class="b2b-message-account">
          <span>NEW!</span>
          Show content to your B2B customers such as promoting free shipping 🚀 
        </div>
      
    </template>

  <template id="spark-slot-order-complete">
    
        <style>
          .b2b-message-account {
            position: relative;
            overflow: hidden;
            padding: 1em;
            border: 2px solid #a68eee;
            border-radius: 6px;
            text-align: center;
            display: flex;
            column-gap: 8px;
            color: #444;
            text-align: left
          }
          .b2b-message-account:after {
            background: linear-gradient(136deg, #54ff96 0%, #80c0ff 48.78%, #f860ff 100%);
            pointer-events: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            background-position: 50%;
            background-repeat: no-repeat;
            content: "";
            background-size: auto 100%;
            z-index: 1;
            background-size: 800px;
            height: 60px;
            filter: blur(100px);
            opacity: 0.9;
            
          }
          .b2b-message-account a {
              color: #5b36f5;
              text-decoration: underline
          }

          .b2b-message-account span {
            background: linear-gradient(54deg, #5B36F5 5.48%, #FF4CBF 44.27%, #3875F3 75.97%, #5B36F5 94.09%);
            display: inline-flex;
            text-transform: uppercase;
            font-size: 11px;
            border-radius: 4px;
            align-items: center;
            padding: 0 6px;
            color: #fff;
            font-weight: 600;
          }
        </style>
        <div class="b2b-message-account">
          <span>NEW!</span>
          When an order is placed, you can include further content here.
        </div>
      
    </template>

```
:::

:::ExpandableHeading
**Show a message using ready-made SparkLayer components (e.g. "success")**

```html
    <!-- 
    
    You can change the message type using the following
    
    type="success"
    type="info"
    type="warn"
    type="error"
    
    -->
    
    <!-- Template element for My Order Interface-->

    <template id="spark-slot-my-cart">
       <spark-message 
          type="success"
          title="Title here"
          message="Message here">
        </spark-message>    
    </template>


    
    <!-- Template element for My Account Interface-->

    <template id="spark-slot-my-account">
       <spark-message 
          type="info"
          title="Title here"
          message="Message here">
        </spark-message>   
    </template>

    
    <!-- Template element for Order Complete -->

    <template id="spark-slot-order-complete">
       <spark-message 
          type="warn"
          title="Title here"
          message="Message here">
        </spark-message>         
    </template>

```
:::

:::ExpandableHeading
**Show a message that shows customer metafields**

```html
    <!-- 
    
   Replace custom.field_name with the metafield namespace and key
    
    -->
    
    <!-- Template element for My Account Interface-->
    {% if customer.metafields.custom.field_name %}
       <template id="spark-slot-my-account">
          Your message here.
          You can output a metafield like this
          {{ customer.metafields.custom.field_name }}
      </template>
    {%  endif %}
```
:::

:::ExpandableHeading
**Show a message that includes the customer's name&#x20;**

```html

    <!-- Template element for My Order Interface-->
    <template id="spark-slot-my-cart">
       Hello {{ customer.name }}, here's a message for you.
    </template>


    <!-- Template element for My Account Interface-->
    <template id="spark-slot-my-account">
      Hello {{ customer.name }}, here's a message for you.
    </template>
    
    <!-- Template element for Order Complete -->
    <template id="spark-slot-order-complete">
      Hello {{ customer.name }}, here's a message for you.
    </template>
```
:::

:::ExpandableHeading
**Show a message based on the Shopify tag assigned to a customer (e.g. b2b-vip)&#x20;**

```html
<template id="spark-slot-my-cart">

{% for tag in customer.tags %}

 {% if tag == "b2b-group-1" %}
   As a Group 1 customer, you qualify for special B2B pricing!
 {% elsif tag == "b2b-group-2" %}
   As a Group 2 customer, you qualify for special B2B pricing!
  {% else %}  
   Message to show for regular B2B customers
 {% endif %} 
  
{% endfor %}
   
</template>
```
:::

:::ExpandableHeading
**Show a message that includes text and an image**

```html
  <!-- Template element for My Order Interface-->
    <template id="spark-slot-my-cart">
      <p>Here is a message</p>
      <img src="link-to-image" style="max-width: 100%">
    </template>


    <!-- Template element for My Account Interface-->
    <template id="spark-slot-my-account">
      <p>Here is a message</p>
      <img src="link-to-image" style="max-width: 100%">
    </template>
    
    <!-- Template element for Order Complete -->
    <template id="spark-slot-order-complete">
      <p>Here is a message</p>
      <img src="link-to-image" style="max-width: 100%">
    </template>
```
:::

::::ExpandableHeading
**Show a message at a cart line-item level**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/BA15Alj4v_qy566_CT4v0_image.png)

This allows you to display a custom slot on a cart line-item level, such as a message that references the product name and ID ("slug").&#x20;

We recommend using web components to isolate state for slots that need unique messaging or functionality per line item such as the example below.

This slot can access the following `data-` attributes from the parent node using \`this.parentNode.dataset:

- `data-sku`
- `data-slug`
- `data-spark-id`
- `data-platform-id`
- `data-item-key`

```html
  <script>
        class LineItemInfo extends HTMLElement {
          connectedCallback() {
            let data = this.parentNode.dataset;
            this.innerHTML = `<p class="line-item-info-messsage">${data.sku} - ${data.slug} requires special handling.</p>`;
          }
        }
        customElements.define('line-item-info', LineItemInfo);
      </script>
      <template id="spark-slot-my-cart-line-item">
        <style>
          .line-item-info-messsage {
              background: #f5f5f5;
              padding: 8px;
              border-radius: 4px;
          }
        </style>
        <line-item-info></line-item-info>
      </template>
```

:::hint{type="warning"}
**Important:** please note that you can only modify elements in *your custom slot template*. Please do not attempt to modify the DOM of any SparkLayer widget elements as the structure and selectors of SparkLayer elements changes regularly, and any DOM interactions will stop working.
:::
::::

:::hint{type="success"}
**Come up with an interesting use-case?**
We've love to know how you're using custom slots. Let our team know by emailing **product\@sparklayer.io**
:::


[title] Quantity Pricing & Settings
[path] Dashboard/Price Lists/

## Quantity Pricing (Tiered pricing)

:::hint{type="warning"}
Please note: Quantity pricing is only supported with manual CSV price lists (not automatic price lists). Learn more about [Managing Pricing](docId\:NX9Q00eWV_kbjxc3tg1ut)
:::

SparkLayer supports the option to configure quantity pricing (sometimes called *tiered pricing*), allowing you to offer discounted prices based on the unit quantities ordered by your customers.&#x20;

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/quantity-pricing.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

Let's use an example:

- For **1 unit** of a product, you want your B2B customers to pay `$14.99 `
- For **5 units** of a product, the price to pay is `$10.99`
- For **10 units** of a product the price to pay is `$8.99`

This is all possible to set up using SparkLayer's built-in pricing tools.

### Setting up quantity pricing

To get started, you'll need to use the [manual pricing upload](docId\:NX9Q00eWV_kbjxc3tg1ut) feature within the [SparkLayer Dashboard](https://app.sparklayer.io/pricing).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jHFuvnsoxX7hQs-H6_CKJ_image.png)

In order for the CSV file to import your quantity pricing successfully, it must have the following columns:

| **Column** | **Details**                                                                      | **Required**              |
| ---------- | -------------------------------------------------------------------------------- | ------------------------- |
| `sku`      | The product SKU as set up in your eCommerce platform or backend system           | `Yes`                     |
| `price`    | The unit price for the SKU at the quantity set in column 3 (qty)                 | `Yes`                     |
| `qty`      | The quantity of the SKU for the specified price for quantity pricing (see below) | `No`<br />(defaults to 1) |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ISZAmPJjHurEESOJyd7m-_image.png)

The quantity field in the sample CSV file (named `qty`) lets you define the price the customer pays for that **specific** **quantity** of the item. In example below, we've illustrated how the price for SKU `123-abc` changes from a quantity of `1` to a quantity of 5 e.

:::hint{type="warning"}
**Please note**
When setting up quantity pricing, you must specify a unit price for a quantity of `1` even if you don't intend to allow customers to be able to purchase single units (i.e. you intend to set up minimum quantities or pack sizing: see [our guide here](docId\:CmxfrPgjQxfz9vJzTVv0D).)
:::

In addition to using the manual CSV upload to configure your pricing, you can also configure quantity pricing manually via [The Price Editor](docId\:fWW4Oh09nSO1-G9TXUTOP) tool, allowing you to make manual adhoc changes if required.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2Fw0Qq3n6nykHFqrJIokVS%2Fimage.png?alt=media\&token=8a5861b5-ceab-4e3d-ac5d-a0b54c3ef35a)

On set up, the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) will clearly show the quantity pricing to your customers.&#x20;

:::hint{type="info"}
**Please note**
By default, the quantity pricing will show a 'Savings' amount based off **the single unit price** of the product (or variant). If you'd prefer for the savings amount to be based off the RRP (i.e. retail price), you can set this via [Configurations](docId\:SBEaOaCq_A7FfbTatX8bD)
:::

### Quantity pricing for multi-variant products

When setting up quantity pricing for products that have variants (e.g. colour, size), it's possible to configure how the quantity pricing gets applied.

| **Type**                       | **Behaviour**                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Applying across all variants` | `Default behaviour`<br /><br />The quantity pricing will take affec&#x74;**&#x20;across all variants&#x20;**&#x6F;f the product. For example, if a product comes in Small, Medium, and Large and you've set up quantity pricing to take effect with a quantity of 5, the customer would receive the discounted pricing no matter the combination. e.g.<br />1 x Small<br />2 x Medium<br />3 x Large                                              |
| `Applying to a single variant` | `Configuration`<br /><br />If you'd prefer to restrict quantity pricing to a specific variant, you can do this by *disabling* a special setting within the [Dashboard](docId\:nzsx6U_DAWtzVzSehf4oR). In this example, if a product comes in Small, Medium, and Large, you can set the quantity pricing to **only** apply to the Large size.<br />To disable this, [please click here](https://app.sparklayer.io/configuration/settings/general). |

### Understanding the unit price calculation

When using quantity pricing, th&#x65;**&#x20;unit price** for an item will be dependent on the quantity the customer is adding to their order. When calculating the unit price, SparkLayer will take the "requested quantity" and calculate the quantity "tier" the pricing is applicable to.&#x20;

If the customer has any discounts configured, these will then additionally be deducted from the unit price.



***

## Unit of Measure Pricing

SparkLayer supports the option to configure your pricing with **units of measure**, allowing you to offer discounted prices based on specific purchasing quantities.&#x20;

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/uom.mp4?v=42&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

It's a great way to allow customers to order in pre-defined units such as boxes, pallets, or cases. When setting these up, you can then specify how pricing works for these specific units, as well as handle units that 'fall outside' these.&#x20;

Generally speaking, unit of measure pricing works in a similar way to quantity pricing - customers are essentially buying in quantity and you're giving a discount on the price (per unit). How it differs to quantity pricing is how the "line total" and "unit price" for a product is calculated. Let's use an example:

:::hint{type="success"}
**Unit of Measure Example**

You have a product that can be purchased as **single units**, in **boxes&#x20;**&#x6F;r in **pallets**. To fill a box you require **7 units**. To fill a pallet you require **150 units**.

- The **single unit** price for a product is `$14.99`&#x20;
- For a **box** of a product, the **unit price** to pay is $10.99
- For a **pallet** of a product, the **unit price** to pay is $8.99

If a customer is requesting to purchase **320** units of a product, SparkLayer will distribute the requested quantity across the configured units of measure and then calculate the line total and unit price as so:

- 300 units at the **pallet&#x20;**&#x75;nit price: $8.99 \* 300 = $2,697.00 *(2 pallets)*
- 14 units at the **box&#x20;**&#x75;nit price: $10.99 \* 14 = $153.86 *(2 boxes)*
- 6 units at the **single unit** price: $14.99 \* 6 = $89.94
- **Line total&#x20;**= $2940.80
- **Unit price&#x20;**= Average price across all units = $2940.80 / 320 = $9.19
:::

:::hint{type="warning"}
**Please note**
The unit price displayed will be the average unit price across the total quantity purchased.
:::

### How it shows to a customer

Within the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT), SparkLayer widget we will provide a breakdown detailing how the unit price has been calculated and the applicable units of measure.

This will also carry through to the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), ensuring the customer can clearly see how the overall and unit pricing has been calculated.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/FhOYRXbNRVFTIznB1uwjD_image.png)

### Configuring Unit of Measure

To get started, you'll need to use the [manual pricing upload](docId\:NX9Q00eWV_kbjxc3tg1ut) feature within the [SparkLayer Dashboard](https://app.sparklayer.io/pricing). In order for the CSV file to import your quantity pricing successfully, it must have the following columns, with the addition of `unit_of_measure` as shown below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/QM72fUkAeUyGcUbNR12Wf_image.png)

| **Column**        | **Details**                                                                                                                                                                                | **Required**              |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------- |
| `sku`             | The product SKU as set up in your eCommerce platform or backend system                                                                                                                     | `Yes`                     |
| `price`           | The unit price for the SKU at the quantity set in column 3 (qty)                                                                                                                           | `Yes`                     |
| `qty`             | The quantity of the SKU for the specified price for quantity pricing (see below)                                                                                                           | `No`<br />(defaults to 1) |
| `unit_of_measure` | The unit of measure the quantity is associated to. The `unit_of_measure` value may only be alpha numeric and use **hyphens** as a separator.<br />For example: `box` `pallet` `pallet-box` | `No`                      |

:::hint{type="info"}
**Please note**
When setting up unit of measure pricing, you must specify a unit price for a quantity of `1` even if you don't intend to allow customers to be able to purchase single units (i.e. you intend to set up minimum quantities or pack sizing: see [our guide here](docId\:CmxfrPgjQxfz9vJzTVv0D).)
:::

You can also configure unit of measure pricing manually via [The Price Editor](docId\:fWW4Oh09nSO1-G9TXUTOP) tool simply by adding (or editing) your prices and specifying the unit of measure and the associated unit price.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/unit-of-measure.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

### Unit of Measure Language Strings

You may configure language strings for unit of measure. This allows us to pluralise quantities when displaying feedback to the customer. To modify how a unit of measure is translated and pluralised, specify the translation using the key configured for the unit of measure when setting up the price list. For example:

```javascript
/* Add the below code into the SparkLayer Core Script */
translations: {
  en: {
    "unit-of-measure.unit-type.box": "{uomQuantity, plural, =1 {box} other {boxes}}",
    "unit-of-measure.unit-type.pallet_box": "{uomQuantity, plural, =1 {pallet box} other {pallet boxs}}"
  }
},
/* End of code */
```

:::hint{type="info"}
**Learn more**
You can [read more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about updating language strings that contain dynamic variables.
:::



***

## Display a quantity pricing widget

If you've set up [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe) for your products, SparkLayer will by default show this to your customers within the [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT).&#x20;

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/quantity-pricing.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

It's also possible to display the tiered pricing breaks table anywhere on your product detail page by adding a special code snippet to your website. Learn more in [Pricing Display](docId\:S_VTlJBorGmnwjjfSMom9)

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FHRMIhkxQU3fFjfGJPEiZ%2Fimage.png?alt=media\&token=f24d1fe1-44d2-48d7-b509-414e57c79331)



***

## Pack sizing

SparkLayer has full support for pack sizing (sometimes called *quantity increments*), meaning you can ensure customers to always add items to an order in your predefined packs (e.g. packs of 3, packs of 6). Learn more in [Quantity Rules](docId\:CmxfrPgjQxfz9vJzTVv0D)



***

## Minimum and Maximum quantities

SparkLayer has support for a variety of different quantity product settings including:

- Minimum product quantities at a variant level (e.g. products that have colours)
- Minimum product quantities at a parent level (allowing you to apply rules to the product as a whole. If it has variants, it can apply across multiple variants)
- Maximum product quantities at a variant level
- Maximum product quantities at a parent level

You can learn more about this in [Quantity Rules](docId\:CmxfrPgjQxfz9vJzTVv0D)

[title] Settings
[path] Dashboard/

## Introduction

The **Settings** section is the centralised location where you manage all elements of the SparkLayer integration on your website. To begin with, it is used as part of the Onboarding Process, and once you're up and running, it can then be used as a ongoing systems health-check.



***

## Onboarding

The Onboarding section guides you through the process of configuring SparkLayer. You can learn more about this [Getting Started](docId:-5djX1YCIgzAI6MRkq0u6). Once all steps are completed, your integration is ready to go!

Each step can be clicked either to take you to the appropriate area of the Dashboard to be configured, or expanded to show you information right there. For the last two steps, manual testing is required and you'll be asked to check a variety of boxes before marking the step as complete.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/A6a0VgrI4bM1Gs_ICxW5l_image.png)



***

## API Keys

:::hint{type="info" attributes="[object Object]"}
**Please note**
Access to the SparkLayer API is only available on the [Pro and Enterprise Plans](https://www.sparklayer.io/pricing/)
:::

In order to interact with the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT), you'll first need to generate a unique API key that you'll use as part of your integration.

To get started, from within the API Key section, click the 'Create new API Key' button

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/gOuOQsDgksBidkXO_-zr-_image.png)

When you click 'Create API Key', you'll then see your unique **Client ID** and **Client Secret** that you'll need for the [SparkLayer API](docId\:LhKqO8T7-A0HaRgVYFgtT).



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/2nQSeAa1X25SKj2Dd5rKo_image.png)

:::hint{type="warning" attributes="[object Object]"}
**Important**
You will only see the Client Secret code once when you create your API Key so make sure to make a note of it.
:::

Once you've created an API Key, you'll then see this listed on the page and you can begin your integration. If you require additional API keys to be created, simply follow the same process noted above.



***

## Configurations

Configurations let you configure specific options for your customers when they're using the [Frontend](docId\:OgKfvQX13dHW2582D57kJ).

:::hint{type="info"}
**Learn more about configurations**
To see all available configurations on SparkLayer, please refer to [our guide here](docId\:SBEaOaCq_A7FfbTatX8bD).
:::

::::Tabs
:::Tab{title="🌐 General"}
| Setting                                | Details                                                                                                                                                                                                                                                    |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Stock level display limit`            | If you're displaying stock levels on a product page, you can choose the maximum stock number customers see. For example, if you enter 51, on the frontend this will display as 50+ to the customer if you have more than 50 in stock.                      |
| `Apply tiered pricing across variants` | If a product has variants (e.g. sizes), tiered pricing will by default be applied across all variants. You can adjust this to apply only so specific variants instead.                                                                                     |
| `Internal Purchase ID Prefix/Postfix`  | When a purchase is internal to SparkLayer, we use an internal ID. This is the case for purchases that are not in Shopify, e.g. orders for approval, and quotes. You can customise this ID to have a prefix and/or postfix. By default, the prefix is `#P`. |
:::
::::

### Store Details

:::hint{type="info"}
**Please note**
If you're using [company user email notifications](docId:_WwfeWVJY9xrSuNCQlFoZ), this feature allows you to customise the store name used in emails sent from SparkLayer.
:::

By default, the store name displayed in your SparkLayer account is synchronised directly from your eCommerce platform. This ensures consistency across platforms, so any updates you make to the store name in your eCommerce platform will automatically appear in SparkLayer.

To customise the name of your B2B store, you can overwrite the default settings by following these steps:

1. Log in to your SparkLayer Dashboard.
2. From the left-hand sidebar, select **Configurations**.
3. Under **Store Settings**, go to **Store Details** and click **Edit**.
4. In the side pop-up, update the **Store Name** field with your preferred name.
5. Save your changes by clicking **Update Settings**.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/uEMyRGCc3YsfbU2EGNvXg_image.png "Modified Store Details")

:::hint{type="info"}
**Please note**
Enabling the "Modify store data" setting will overwrite the default data synchronised from your Shopify store.
:::

**Additional Details:**

- Once you modify the store name in SparkLayer, these changes will not sync back to your eCommerce platform.
- After enabling the modification setting, any future updates to the store name in your eCommerce platform will no longer reflect in SparkLayer.
- If you disable the "Modify store data" setting, the store name will automatically revert to the default, synchronised name from your eCommerce platform.

By following these steps, you can ensure your B2B store's details reflect your preferences while understanding how changes interact between SparkLayer and your eCommerce platform.



***

## Shipping

To learn about how shipping works, please refer to our [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) guide.



***

## Templates

:::hint{type="info" attributes="[object Object]"}
**Please note**
The Templates feature is only available on the SparkLayer *Pro* and *Enterprise* plan. You can [change your plan here](https://app.sparklayer.io/settings/plan) or [learn more](https://www.sparklayer.io/pricing/) about our how pricing works.
Templates are also specific to your SparkLayer setup and have no impact on storefront "themes' that you may be using for your website design.
:::

Templates allow you to customise the look, layout and data for emails and PDFs generated by SparkLayer. These currently include the following areas:

| Template type         | Details                                                                                                                                       |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `Order review emails` | Used in parallel to [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ) when an order needs to be reviewed by a company user member                  |
| `Invoices`            | Used to generate the [Invoices](docId\:NKh8H14Ffna5DD71SwwNd) PDF that customers can download.                                                |
| `Quotes`              | Used in notifications sent when using the [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo) as well as the Quote PDF that customers can download. |

We've included a top-level overview of how Templates work below and you can also explore how they work in more detail in our [Tech Docs](https://docs.sparklayer.io/tech-docs/templates).

:::ExpandableHeading
**Creating a Template**

In order to use a template, first you'll need to create a template in the Template Editor, and then publish it.

By default, a template is empty and therefore falls back to the SparkLayer core templates and language files.&#x20;
:::

::::ExpandableHeading
**Adding files to your Templates**

:::hint{type="info"}
**Please note**
You should only add templates when you intend to change them. This is because once a template is added, it can’t be automatically updated based on the core template. For instance, if a new feature rolls out and it adds a section to a template, this will not be applied to a merchants custom templates. You will need to either copy those changes to their template or create a new template.
:::

When adding a new file to a template, you have a few options:

| Type       | Details                                                                                                                                                                                                                                                                                                                                                      |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Language` | A language file to be used by the templates. Even if you haven't created any templates, providing it matches your store's language, the SparkLayer core templates will use this language file, and fall-back to the SparkLayer language files if a key’s not found. Ultimately, SparkLayer falls back on the SparkLayer `en` language file as a last resort. |
| `Sections` | Sections are currently only used in emails. This template allows a merchant to have a re-usable header and footer for their email templates.                                                                                                                                                                                                                 |
| `Emails`   | For managing emails sent via SparkLayer                                                                                                                                                                                                                                                                                                                      |
| `PDF`      | For managing PDFs sent via SparkLayer                                                                                                                                                                                                                                                                                                                        |
::::

:::ExpandableHeading
**Templating language**

Please note the following:

- All templates are [written in liquid](https://shopify.github.io/liquid/\)). They must have valid HTML markup and CSS should be written in the template. All CSS is in-lined when the template is rendered for the best compatibility, particularly with email clients.
- For email templates, it’s advised to consider email client compatibility. Tools like Litmus allow developers to test emails in various email clients. SparkLayer only supports modern email clients from the last few years.
- All language files are written in JSON and should be keyed appropriately for use in templates. See the technical docs for details on the language filter.
:::

::::ExpandableHeading
**Using the editor and making revisions**

Once a file has been added, it can be edited in the SparkLayer editor. The editor has a basic code editor ideal for making quick or small changes. Once done, click Save and this will then create a revision (previous revisions can be viewed from the Revisions drop down). If a revision is viewed and saved, this will become the current revision and therefore used when rendering a template.

:::hint{type="info"}
**Please note**
Alternatively, from the Template selection, you can also download a ZIP file of your template to provide to a developer, and use proper development tools such as an IDE and versioning control. Once ready this can be zipped back up and uploaded to a template. Only the known templates will be processed, any additional files such as custom templates and assets like images **will not** be processed or added to the template.
:::
::::


[title] Payment Methods
[path] Features/Configurations/

## Enabling payment methods

:::hint{type="info"}
**Payment methods**
Please refer to [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) for full details on what payment methods SparkLayer supports and how they work.
:::



***

## Request for Quote

The SparkLayer [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo)  introduces a unified solution that streamlines the entire "quote-to-order" process directly from your existing online store. It allows you to handle quotes more effectively, converting them into completed orders faster than ever!

::embed[]{url="https://www.youtube.com/embed/Lmjwg4RK0r8"}

The SparkLayer [Quoting Engine](docId:8A4OpNIndUyfs3Pup-tuo) works by allowing your B2B customers to easily submit quotes for review, and for your sales team to then communicate with the customer until they're ready to complete their order. Learn more in [our full guide](docId:8A4OpNIndUyfs3Pup-tuo).&#x20;



***

## Enabling net payment terms

:::hint{type="info"}
**Looking to enable net payment terms?**
Please refer to [our guide here](docId\:yWm70oQUosyKOoIqb4Z4G) for full details on how this works.
:::



***

## Credit & Credit Limits

:::hint{type="info"}
**Looking to enable credit limits?**
Please refer to [our guide here](docId\:yWm70oQUosyKOoIqb4Z4G) for full details on how this works.
:::



***

## Custom payment messages

On the final step of the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), Review & Pay, it's possible to display a "custom payment messages" that let you add additional details about a payment method. For example, if a customer is paying by "Pay by Invoice", you could add some additional text to inform them on how this process works.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/JDHHIkn-7h-9qi-cqa0Qr_image.png)

Learn more about how to set this up in [our guide here](docId\:o3nDhZBCxisWH6M6satDt).



***

## Updating payment method names

By default, SparkLayer will show the payment methods to customers with the names shown below:

| Payment method       | Name shown to customers |
| -------------------- | ----------------------- |
| `Payment by invoice` | Pay by Invoice          |
| `Payment on Account` | Pay on Account          |
| `Upfront Payment`    | Pay Online by Card      |
| `Request for quote`  | Request for Quote       |

:::hint{type="info"}
**Updating language and text**
You can update the default text by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:kLrS7wtxn3WnCDy8z5Zvu) about how to update text on SparkLayer.
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
translations: {
  en: {
    "cart.checkout.payment-method.full.paymentByInvoice": "Pay by Invoice",
    "cart.checkout.payment-method.full.paymentOnAccount": "Pay on Account",
    "cart.checkout.payment-method.full.upfrontPayment": "Pay Online by Card",        
    "cart.checkout.payment-method.full.quote": "Request for Quote",       
    "cart.checkout.payment-providers.quote.message": "Please note: when requesting a quote for your order, our team will review and notify you within 2 working days before processing.",
  }
},
/* End of code */
```

**Custom payment messages**

On the final step of the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), Review & Pay, it's possible to display a "custom payment messages" that let you add additional details about a payment method.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/JDHHIkn-7h-9qi-cqa0Qr_image.png)

For example, if a customer is paying by "Pay by Invoice", you could add some additional text to inform them on how this process works. See [our guide here](docId\:o3nDhZBCxisWH6M6satDt) to get started.



***

## Changing the order of payment methods

:::hint{type="info"}
**Setting up payment methods**
If you're looking to adjust which payment methods your B2B customers can see, you can manage this via the [SparkLayer Customer Groups](https://app.sparklayer.io/customers/groups) area. [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)
:::

When a customer reaches the payment step of the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), they'll see all available payment methods you've set against their customer group.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/YhwU_MR6hEEoxy2EeVUII_image.png)

If you'd like to configure the order of the payment methods and which payment method shows by default, you can apply a special setting to your website as shown below.

:::hint{type="info"}
**Updating the display**
You can update the default display by adding code to your [Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).
[Learn more](docId\:QWXsYM9X5_pvIOGUteKcP) about how to update display settings on SparkLayer
:::

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
 paymentMethodsOrder: [
  "paymentOnAccount",
  "paymentByInvoice",
  "upfrontPayment",
  "quote",
],
/* End of code */
```



***

## Setting the default payment method

:::hint{type="info"}
**Setting up payment methods**
If you're looking to adjust which payment methods your B2B customers can see, you can manage this via the [SparkLayer Customer Groups](https://app.sparklayer.io/customers/groups) area. [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)
:::

If you'd like to change the default payment methods customers see, you can modify the code sample detailed in "Changing the order of payment methods". In the example detailed above, *Payment on account* is listed first, making it the default shown to customers.&#x20;

You can amend the ordering using the naming conventions below.

| Payment method       | Setting name       |
| -------------------- | ------------------ |
| `Payment by invoice` | `paymentByInvoice` |
| `Payment on Account` | `paymentOnAccount` |
| `Upfront Payment`    | `upfrontPayment`   |
| `Request for quote`  | `quote`            |

For example, if you wanted "Upfront Payment" to be the default, you would modify the code as shown below:

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
 paymentMethodsOrder: [
  "upfrontPayment",
  "paymentOnAccount",
  "paymentByInvoice",
  "quote",
],
/* End of code */
```



***

## Customising "upfront" payment methods

SparkLayer supports a payment method called "Pay Online by Card" that B2B customers can select during the payment step of the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-XzxOqBqeomgCt45tZrL6_image.png)

Once selected, the customer will then be directed through to your standard checkout process to make payment. Depending on which platform you're using, it's possible to customise which  payment methods show.

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
By default, when your B2B customers select "Pay Online by Card", they'll be taken to the Shopify checkout and will see all Shopify payment methods you have set up (e.g. card payment, Paypal, etc). You can learn more about [Shopify payment methods here](https://help.shopify.com/en/manual/payments/additional-payment-methods).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/UfMQghk7NVBdNK-LRMVMW_image.png)
:::

:::Tab{title="🌐 Other platforms"}
No customisations applicable., they'll be directed to the Shopify checkout.&#x20;
:::
::::

It's possible to **conditionally** hide and show payment methods should you require your B2B customers to only see specific payment types when they checkout.&#x20;

- To get started, visit the Shopify App store and search for apps that support "hiding payment methods". One such app is ["ETP Hide and Sort Payment Methods"](https://apps.shopify.com/etp-hide-sort-payments?)
- Within the app, you can then configure rules. To detect a B2B customer, simply add a rule that filters on a tag of `b2b` being present.&#x20;
- It's important to note that the payment type "Credit card" can only be hidden if your Shopify store is on the Shopify Plus plan (this is due to limitations with the *Shopify Payment Customization API*)

In the example below, the payment types "Paypal" and "Cash on Delivery (COD)" have both been hidden for B2B customers.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/guU0Rg4uwAzhZ25V-MVgs_image.png)



***

## Payments Visibility

Give your customers full transparency over their payment statuses directly within the My Account area.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DBzcyD3RwVEjepHjjObPH_image.png)

By enabling Payments Visibility, customers can track order payment statuses, view detailed transaction histories, and track outstanding balances without needing to contact your support team.

To get started, go to your SparkLayer Dashboard, open **Settings** from the left-hand menu, and select [Configurations](https://app.sparklayer.io/configuration/settings/general). Find the **Enable Payments Visibility** option, switch the toggle to **On**, and save your changes.

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
When updating the payment status within Shopify, this will simply reflect within the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP) giving the customer an easy way to see the full status of their order.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/uxk8JWplXJFoMx3LJs5ao_image.png)

For any order, the customer can see the Payment status in a new column "Payment".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TMhny3IGGxy7t3hQUoxBR_image.png)

In addition to the payment status updating, the [Timeline & Communications](docId\:Kf-Gd3nHSXlrn2zZvla1Y) view will also give a log of when the payment was made and the payment total.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/93Fl80xR9ErUsp7LH2AMt_image.png)
:::

:::Tab{title="🌐 Other platforms"}
This feature is not currently available for other platforms.
:::
::::



***

## Payments - Account Balance

SparkLayer calculates a real-time "Account Balance" for your customers. To get started, go to your SparkLayer Dashboard, open **Settings** from the left-hand menu, and select [Configurations](https://app.sparklayer.io/configuration/settings/general). Find the **Enable Payments Visibility** option, switch the toggle to **On**, and save your changes.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/lQn9AK_HGVoUVFgf8eEZM_image.png)

It does this by taking a starting point (the **Opening Balance**) and then automatically tracking all subsequent orders and payments.

- **Self-service tracking:** Customers can see exactly which orders are paid or outstanding.
- **Reduced admin:** Decreases "balance inquiry" emails and phone calls to your team.
- **Multi-platform support:** Compatible with Shopify, Xero, and QuickBooks Online.

**Setting an Opening Balance**

To show an accurate balance, SparkLayer needs a starting point. This is a "point-in-time" snapshot of what the customer owes your business.

You can set this up using **Customer Metafields**. If you haven't enabled these yet, please see our [Credit, Net Terms, & Invoicing guide](https://docs.sparklayer.io/credit-net-terms-and-invoicing).

To set the opening balance, update the **Credit Limit and Account Balance** metafield for a specific customer using the format below:

| Property       | Description                                         | Example                     |
| -------------- | --------------------------------------------------- | --------------------------- |
| `balance`      | The amount owed at a specific date.                 | `150.00`                    |
| `balance_date` | The date the balance was recorded (RFC3339 format). | `2025-01-01T18:00:00+08:00` |

:::CodeblockTabs
Example snippet

```json
{
  "credit_limit": 10000,
  "balance": 150,
  "balance_date": "2025-01-01T18:00:00+08:00"
}
```
:::

:::hint{type="info"}
**Need help formatting the balance\_date?&#x20;**&#xA;You can use a free online [RFC3339 converter](https://time.now/tool/rfc-3339-converter/) to generate the correct string.
:::

Whenever you manually update the metafield values, SparkLayer will automatically recalculate the customer's balance based on the new information.

**FAQs**

:::ExpandableHeading
**How often does the customer's balance update?**

SparkLayer recalculates the balance automatically whenever a new order is placed or a payment is synced from your store or accounting tool (Xero/QuickBooks).
:::

:::ExpandableHeading
**Can I update balances in bulk?**&#x20;

Yes, you can use Shopify’s bulk editor or a CSV import tool to update the "Credit Limit and Account Balance" metafield for multiple customers at once.
:::

:::ExpandableHeading
**Why is the "Payment on Account" metafield not updating?**

When using the real-time account balance then the metafield will not update from the time you first set it up. The balance will be calculated and held within SparkLayer&#x20;
:::




[title] Languages & International
[path] Features/Configurations/

## Supported languages

SparkLayer supports a range of languages and when a customer signs in, they'll see the appropriate language native to your store. SparkLayer currently supports the following languages:

| Variable | Language                                       |
| -------- | ---------------------------------------------- |
| `en`     | <font color="#3b9f0f">English (default)</font> |
| `ar`     | Arabic (with full RTL support)                 |
| `zh`     | Chinese                                        |
| `hr`     | Croatian                                       |
| `cs`     | Czech                                          |
| `da`     | Danish                                         |
| `nl`     | Dutch                                          |
| `fi`     | Finnish                                        |
| `fr`     | French                                         |
| `de`     | German                                         |
| `el`     | Greek                                          |
| `he`     | Hebrew (with full RTL support)                 |
| `hu`     | Hungarian                                      |
| `is`     | Icelandic                                      |
| `it`     | Italian                                        |
| `ja`     | Japanese                                       |
| `lt`     | Lithuanian                                     |
| `lv`     | Latvian                                        |
| `no`     | Norwegian                                      |
| `pl`     | Polish                                         |
| `pt`     | Portugese                                      |
| `ro`     | Romanian                                       |
| `ru`     | Russian                                        |
| `sk`     | Slovak                                         |
| `sl`     | Slovenian                                      |
| `es`     | Spanish                                        |
| `sv`     | Swedish                                        |
| `th`     | Thai                                           |

By default, SparkLayer **automatically** detects the default language of your store but it is possible to manually overwrite this with the modification of the language variable in the SparkLayer Core Script.

```javascript
/* Modify the below code with the language variable above, e.g. fr*/
language: {{ request.locale.iso_code | json }},
/* End of code */
```

:::hint{type="info"}
**Need a language not listed above?**
If you require a language that isn't on our list, please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we can send details on how to supply translations.
:::

### Product data translations

SparkLayer also supports showing product data in the customer's language.&#x20;

:::::Tabs
::::Tab{title="🛍️ Using Shopify"}
:::hint{type="info"}
**Please note**
This is not enabled by default and you'll need to follow the steps below
:::

There are a few things to consider if you'd like this enabled on your store:

- You'll need to define your translations in Shopify
- You'll need to assign languages to Shopify markets
- Languages must be published in Shopify
- Your SparkLayer Core Script must be at [least version 3.13](https://app.sparklayer.io/configuration/frontend/core)
- Within your Shopify theme, inside `theme.liquid` , set the language SparkLayer Core Script option (see below)
- You'll need to [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) to enable syncing translations into SparkLayer

**Setting language in SparkLayer Core Script**

```javascript
language: "{{ localization.language.iso_code }}-{{ localization.country.iso_code }}",
```

Once set up, product data displayed by SparkLayer should align with the rest of your site, according to the languages you have set up in Shopify and assigned to markets.
::::

:::Tab{title="🌐 Other platforms"}
Not currently supported
:::
:::::



***

## Locale configuration

SparkLayer provides an intuitive formatting system for dates and currency symbols by utilising the **locale** of the user's browser. This ensures dates and currency symbols are displayed according to the user's regional setting, enhancing the user experience.&#x20;

However, if you prefer to implement a standard formatting across your user base, SparkLayer offers the option to set a specific locale. By adjusting the locale option, you can establish a fixed format for all of your users, irrespective of their individual browser settings.

```javascript
/* Modify the below code with the locale required e.g. en-AU*/
 locale: 'en-AU',
/* End of code */
```

The locale option requires a string input, comprised of a combination of a language code and a two-letter country code, delineated by a hyphen (-).&#x20;

- For instance, to set the locale for British English, you would use `'en-GB'`
- For American English, `'en-US'`
- For Australian English, `'en-AU'`
- For German `'de-DE'`
- etc

This format ensures that the chosen locale accurately reflects both the language and the regional conventions for date formatting and currency symbols.

For your B2B pricing, any currency prefixes will be removed and instead default to the locale you've set. For example, if you set the locale to `locale: 'en-US',` this would remove the `US` prefix before your pricing.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/2C5iZ8r_RfCAZzFVB8u8b_image.png)

:::hint{type="info"}
The locale option only affects the *formatting* of prices, not the values.
:::



***

## Text and language overwrites

SparkLayer uses "language strings" to render the text used in the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) and any string can be modified with custom text (i.e. overwritten).

If you're wanting to update specific text elements, it's possible to turn on a special setting within the SparkLayer Core Script that exposes specific code snippets that you can then reference with your overwrites.

```javascript
/* Add the below to your SparkLayer Core Script */
showTranslations: true,
/* End of code */
```

When this setting is enabled, the SparkLayer interface will then render the special language code snippets. In our example below, you can see the language code for the Product Page Interface

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ZOj_hYpKqMGyuaBcfVkM1_image.png)

:::hint{type="info"}
**Please note**
We recommend enabling this setting temporarily or onto a non-published theme to ensure it isn't seen by your logged in B2B customers.
:::

### Modifying languages

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
Add the following to your theme's `theme.liquid` file, just before the closing `</head>` tag:

For example, to set the language and account redirect URL:

```html
<script>
  window.sparkOptions = {
    translations: {
       en: {
         "pdp.table.price": "Price",
       }
    },
  };
</script>
```
:::

:::Tab{title="🌐 Other platforms"}
To overwrite the text, you need to add specific code snippets to the [SparkLayer Core Script](docId\:QWXsYM9X5_pvIOGUteKcP).&#x20;

To install the SparkLayer Core Script, it simply needs to be included within the main "header" of your website's source code within the `<head>...</head>` tags. For BigCommerce, this is typically within the file `/templates/layout/base.html`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vMYsiehB3_WTJkt7gZtqu_image.png)

To get started, head over to the SparkLayer Dashboard and you'll see your customised SparkLayer Core Script within the [Frontend Configurations](https://app.sparklayer.io/configuration/frontend/core).&#x20;

```html
<script async src="https://sparkcdn.io/sparkjs/yourstorehere/live"></script>
```

When you first install SparkLayer, you'll automatically use the latest version and you can also manually update this via the "SparkLayer Core Script version" section. To see what's new, please see make sure to bookmark [What's New!](docId\:WDCEwpeMoHPbrR96TaYCL).

### Technical details

From a technical point of view, the Core Script provides SparkLayer with key information that controls how it works on your website.&#x20;

```html
<!-- Go to app.sparklayer.io/configuration/frontend/core -->

<script>
  window.sparkOptions = {
    siteId: "examplestore", // your unique site id
    platform: "shopify", // your platform
    rootUrl: {{ routes.root_url | json }},
    language: {{ request.locale.iso_code | json }},
    accountRedirect: {
      urlRegex: /\/account/g,
      goTo: "/index", // page to redirect logged in users to
    },
    display: {
      stock: {
        show: false, // set to true to show stock level display
        max: 50, // highest stock level to show
        last: 5, // last remaining stock
        low: 15, // low stock threshold
        last: true, // set to false to hide last stock message
      },
    },
    auth: {
      user: {{ customer.email | json }},
      token: {{ customer.metafields.sparklayer.authentication | json }},
    },
  };
</script>
<script async src="https://sparkcdn.io/sparkjs/yourstorehere/live"></script>
```

This information includes:

| Item              | Details                                                                             |
| ----------------- | ----------------------------------------------------------------------------------- |
| `siteId`          | The website's unique identifier ([learn more](docId\:r9NG74uJdtyWlvGbpnB5u))        |
| `platform`        | The eCommerce platform of the website                                               |
| `language`        | The language to be used                                                             |
| `accountRedirect` | The URL to redirect logged in customers to                                          |
| `display`         | Which display configurations to enable ([learn more](docId\:SBEaOaCq_A7FfbTatX8bD)) |
| `auth`            | The authentication details of the logged in customer                                |
:::
::::

Some important items to note:

- The variable `en` must be replaced with the specific language of your store (see our [supported languages](docId\:kLrS7wtxn3WnCDy8z5Zvu) with their special codes)
- The text overwrites must always end the line with a comma

### Updating text that contains dynamic variables

For some text content, SparkLayer includes dynamic variables, such as pack sizing or special settings.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/huXuzmdw5H3biUXif3sT__image.png)

Dynamic variables are always wrapped in 'camel case' , for example `{packSize}` and you can find a list of all dynamic text below:

```javascript
<script>
  window.sparkOptions = {
/* Add the below code into the SparkLayer Core Script */
translations: {
  en: {
  
    // Global
    "global.per-unit": "{price} per unit",
    "global.product-settings.pack-size": "This product comes in pack sizes of {packSize}",
    "min-order-quantity": "Each variant has a minimum order quantity of {minOrderQuantity}",
    "max-order-quantity": "Each variant has a maximum order quantity of {maxOrderQuantity}",
    "min-order-parent-quantity": "This product has a minimum quantity of {minOrderParentQuantity} across all variants",
    "max-order-parent-quantity": "This product has a maximum quantity of {maxOrderParentQuantity} across all variants",
    
    // Products
    "pdp.setting-info.pack-size": "This product comes in pack sizes of {packSize}",
    "pdp.price.pack-size": "Pack ({packSize}): {price}",
    "pdp.messaging.back-order-due": "Due: {restockDate}",
    "pdp.messaging.stock-qty.low-stock": "Only {qty} available",
    "pdp.messaging.stock-qty.last-stock": "Last {qty} available",
    "pdp.messaging.stock-qty.in-stock": "{qty} available",
    "product-card.price-breaks.cheapest": "From {price} for {qty}+",
    "product-card.price-breaks.saving": "(Save {per}%)",
    "product-card.messaging.back-order-due": "Due: {restockDate}",
    
    // My Order
    "cart.no-of-order-lines": "{numberOf} {numberOf, plural, =1 {line} other {lines}}",
    "cart.no-of-order-items": "{numberOf} {numberOf, plural, =1 {item} other {items}}",
    "cart.validation-messages.minimum-order-totals": "Your order must be more than {amount} to meet the order requirements.",
    "cart.validation-messages.maximum-order-totals": "Your order must be less than {amount} to meet the order requirements.",
    "cart.validation-messages.minimum-parent-quantity": "Please note, {productName} has a minimum order quantity of {minimum}.",
    "cart.validation-messages.maximum-parent-quantity": "Please note, {productName} has a maximum order quantity of {maximum}.",
    "cart.validation-messages.out-of-stock": "Sorry, {sku} is now unavailable. Please remove this product from your order before checkout",
    "cart.validation-messages.limited-stock-available": "Sorry, we only have {qty} of {sku} available right now, please adjust the quantity in your order before checkout",
    "cart.checkout.confirm-btn.complete": "Complete Order: {total}",
    "cart.checkout.confirm-btn.checkout": "Complete Payment: {total}",
    "cart.checkout.confirm-btn.quote": "Submit Quote: {total}",
    "cart.thanks.payment.blurb": "Your order has now been placed and you will shortly receive email confirmation to {email}. You can check the status of your order at any time by going to 'My Account'.",
    
    // My Account
    "account.main.my-details.payment-on-account.detail": "Your account balance is {balance} with a credit limit of {creditLimit}.",
    "account.main.my-details.payment-on-account.detail-without-limit": "Your account balance is {balance}.",
  }
},
/* End of code */
   },
  };
</script>
```


[title] Magento Limitations
[path] Integrations/Magento/

## Introduction

Currently, there are a small number of limitations to be aware of with the SparkLayer and Magento Integration.

| Limitation                                 | Notes                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Product SKUs`                             | Within Magento, the product must have a SKU and this must be unique per product.                                                                                                                                                                                                                                                                                        |
| `Price lists`                              | Currently price lists can only be managed though SparkLayer.                                                                                                                                                                                                                                                                                                            |
| `Sales Agents`                             | [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) lets your sales team place orders on behalf of customers. During the checkout process, sales agents won't be able to select "Pay Online by Card" for a customer, payments must be "offline" methods (e.g. net terms, pay by invoice)                                                                               |
| `Company Users`                            | If you're using [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ) and a customer is inviting a team member, the team member will not receive a 'confirmation email' asking them to approve access. They will need to be manually informed of their login email address and to use the "Forgot password" feature on the Magento store to create a password for their account. |
| `Multi-stock Inventory module is required` | The magento setup must have the MSI (Multi-Stock Invenetory) module enabled.                                                                                                                                                                                                                                                                                            |


[title] Sufio Invoicing
[path] Integrations/Customer Experience/

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2F4Qh7kwL1adC7jV4Yu41V%2FSufio.png?alt=media\&token=88e34376-829b-4ebf-a674-731799cdd3dd)

:::hint{type="info"}
**Requirements**

- Plan: Merchants must be signed up to Sufio
- Platform: Merchants must be using Shopify
:::

## Introduction

:::hint{type="success"}
**Sending invoices via SparkLayer**
SparkLayer has it's own built-in invoice solution and you can [learn more here](docId\:NKh8H14Ffna5DD71SwwNd).&#x20;
:::



​[Sufio](https://sufio.com/shopify/invoice/?ref=sparklayer-2) is a leading invoicing solution for major eCommerce platforms such as Shopify and BigCommerce, allowing merchants to create and send beautifully designed invoices. With powerful features such as customizable design and support for multiple currencies, Sufio makes it easy for merchants to automate their invoicing and grow their business.&#x20;

Learn more about Sufio in the [Shopify App Store](https://apps.shopify.com/sufio)



***

## How it works

The Sufio integration for SparkLayer is available for all Shopify merchants that already use Sufio and allows you to enable **downloadable invoices** for your B2B customers.&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FEd9VUYSTbMEfUQHsQ0J1%2Fimage.png?alt=media\&token=7f885c44-0750-4a06-b029-da52d5556d53)

Each time a B2B customer places an order on your store, they can view and download their invoice right from within the [SparkLayer My Account](https://docs.sparklayer.io/sparklayer-frontend/overview-of-features/my-account-interface#order-history) area. You can see this in action in our video below\.Within the order detail view, the customer simply clicks the button and they are then taken off to their specially designed, Sufio-powered invoice where they can view details and download as a PDF.

:::hint{type="success"}
See this in action in our [B2B demo store](https://b2b-demo-store-usd.myshopify.com/pages/b2b-login-register). Simply sign in and view an order from the My Account area.
:::

**Emailing customers an invoice**

Sufio also allows you to email customers a copy of their invoice as well as set reminders, giving you a simple way to manage your invoicing process. [Learn more here](https://sufio.com/articles/shopify/send-invoices-customers/when-send-invoices/custom/)



***

## Configuring on SparkLayer

:::hint{type="warning"}
Please note, your Shopify store must already have the [Sufio Shopify App](https://apps.shopify.com/sufio) installed before enabling this feature.
:::

Once the Sufio app has has been installed on your Shopify store, you're ready to activate it on SparkLayer! Within the [SparkLayer Dashboard](https://docs.sparklayer.io/sparklayer-dashboard/the-sparklayer-dashboard), go to the **Integrations** section and click **Partner Integrations.&#x20;**&#x55;nder **Invoicing**, click the toggle on the right to activate the Sufio integration.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FK663Aun8RH9ZWpph7fIB%2Fimage.png?alt=media\&token=1983e64f-7285-45ac-b479-5da3209899dc)

This completes the set up process and you can follow the below steps to test the integration.

- Log in to your Shopify store as a B2B customer
- Place an order using the available payment methods
- If the order is via a manual payment method (e.g. Payment by Invoice), within Shopify, mark this as complete to ensure it shows up in the **Orders** area of Shopify
- Within your Shopify store, as a B2B customer, click the My Account tab, click the order and you will see the option to **View or Download Invoice**.



***

## Known limitations

Please note the following:

- If you're installing Sufio for the first time, invoices will only show for **new orders** placed


:::hint{type="info"}
If you're looking for a more manual way to attach invoices to an order, see [Credit, Net Terms, & Invoicing](docId\:yWm70oQUosyKOoIqb4Z4G)
:::


[title] WooCommerce Limitations
[path] Integrations/WooCommerce/

## Introduction

Currently, there are a small number of limitations to be aware of with the SparkLayer and WooCommerce Integration.

| Limitation            | Notes                                                                                                                                                                                                                                                                                                                                                                       |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Product SKUs`        | Within WooCommerce, the product must have a SKU and this must be unique per product.                                                                                                                                                                                                                                                                                        |
| `Price lists`         | Currently price lists can only be managed though SparkLayer.                                                                                                                                                                                                                                                                                                                |
| `Sales Agents`        | [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) lets your sales team place orders on behalf of customers. During the checkout process, sales agents won't be able to select "Pay Online by Card" for a customer, payments must be "offline" methods (e.g. net terms, pay by invoice)                                                                                   |
| `Company Users`       | If you're using [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ) and a customer is inviting a team member, the team member will not receive a 'confirmation email' asking them to approve access. They will need to be manually informed of their login email address and to use the "Forgot password" feature on the WooCommerce store to create a password for their account. |
| `HTTPS Compatibility` | The SparkLayer B2B plugin will only work with WooCommerce stores which have HTTPS **enabled**                                                                                                                                                                                                                                                                               |
| `Permalink Structure` | In order for the SparkLayer B2B plugin to interact with the WordPress & WooCommerce API, the WordPress permalink structure must be configured to a setting other than *"Plain"*                                                                                                                                                                                             |


[title] Uninstalling & Transferring accounts
[path] Integrations/BigCommerce/

## Uninstalling SparkLayer

SparkLayer works just like any other app in BigCommerce and you can uninstall it very easily.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/PBHx2W4tW0IiQKsb5B4r2_screenshot-2023-07-06-at-142056.png)

Please follow the below steps:

::::WorkflowBlock
:::WorkflowBlockItem
From your BigCommerce admin, click **Apps**, and then click **My Apps.**
:::

:::WorkflowBlockItem
Click **Uninstall**
:::
::::

Once you've removed the sales channel, this will then **cancel** the SparkLayer recurring billing charges with immediate effect.

:::hint{type="info"}
**More information**
You can learn more about removing apps in this [BigCommerce guide](https://support.bigcommerce.com/s/article/How-do-I-access-and-install-the-new-single-click-apps-within-my-Bigcommerce-store-control-panel?language=en_US#uninstalling).
:::

:::hint{type="warning"}
**Please note**

- If you've also added the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) to your BigCommerce store, these will need to be removed manually.
- When you follow the uninstall process, this will disable customers, product and order updates to SparkLayer but will **not** delete the data until you [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) to remove your account.
- Please note, depending on when your billing cycle to SparkLayer began, you may see charges you're not expecting. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) if you would like us to investigate.
:::



***

## Pausing your account

If you'd prefer to pause your SparkLayer account and resume your subscription in the near future, we recommend the following steps:

- Follow the uninstall process above to remove the **B2B Ordering** sales channel.
- Retain any codes changes in your BigCommerce storefront theme (you can always 'Duplicate' the theme to create a backup).
- Notify our team and once you're ready to resume your subscription, we can assist where necessary.

:::hint{type="info"}
**Please note**
Any configurations you've set up in the SparkLayer [Dashboard](docId\:nzsx6U_DAWtzVzSehf4oR) will be retained such as price lists and customer group set up.
:::



***

## Transferring to another BigCommerce store

When you first sign up to SparkLayer, you'll be asked to associate your account with your BigCommerce store. Once that's done, SparkLayer will be locked to that URL and will begin synchronising products, customers, and enable you to install the Frontend code snippets to test it out.

You may be wanting to trial SparkLayer on a **test or development BigCommerce store** just to see how it works before you fully commit to using it. The good news is, it's possible to transfer accounts by following the below steps!

- First, sign into your BigCommerce store and uninstall SparkLayer via the steps above. This will disconnect SparkLayer from the BigCommerce store
- Next, [sign into SparkLayer](https://app.sparklayer.io/Login) with the original account you created and go to Configuration and click [Integrations](https://app.sparklayer.io/configuration/integrations/platform)
- Select **BigCommerce** and re-enter the new BigCommerce URL you wish to connect
- You'll then be taken to the BigCommerce admin and asked to reinstall SparkLayer and select a plan.
- Once that's completed, you'll then be returned to the SparkLayer Dashboard. SparkLayer will then begin synchronising your products and customers and you can then re-install the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) on the new store

:::hint{type="info" attributes="[object Object]"}
**Need assistance?**
If you require any assistance in transferring your BigCommerce store, please feel free to [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.
:::


[title] BigCommerce Metafields & Data Mapping
[path] Integrations/BigCommerce/

## Introduction

Metafields help you to customise the functionality and appearance of your BigCommerce store by letting you save specialised information that isn't usually captured in the BigCommerce admin. You can use metafields for internal tracking, or to display specialised information on your online store in a variety of ways.&#x20;

In the context of SparkLayer, metafields are used to capture additional B2B data that you can then use in a variety of ways:

| Type                  | Details                                                                                                                                                                                             |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Product metafields`  | Updating the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) by adding configurations such as [pack sizing](docId\:CmxfrPgjQxfz9vJzTVv0D), [RRP prices](docId\:S_VTlJBorGmnwjjfSMom9), and more |
| `Customer attributes` | Updating a customer's information by adding information such as [credit limits](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                       |
| `Order metafields`    | Updating an order with [invoicing information](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                                                        |



***

## How to add metafields to BigCommerce

BigCommerce has a variety of ways to access and edit metafields and you may already have your preferred way of doing this. You can also refer to our guide below.

### Useful resources

| Item           | Details                                                                                                                                                                                               |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Approved apps  | [Metafields Manager&#xA;](https://www.bigcommerce.co.uk/apps/metafields-manager-by-space-48/)This provides a simple way to manage metafield data within BigCommerce with the exception of "Customers" |
| Developer docs | We also recommend referring to the [official BigCommerce guide](https://developer.bigcommerce.com/docs/rest-catalog/products/metafields) on accessing metafield data                                  |

### Configuring different types of metafields

:::ExpandableHeading
**Product metafields**

We recommend using an app listed above in "Approved apps". This allows you to access metafield data at both a product parent and product variant-level.
:::

:::ExpandableHeading
**Order metafields**

We recommend using an app listed above in "Approved apps"


:::

:::ExpandableHeading
**Customer attributes**

There are currently no BigCommerce apps that allow customer attribtues to be added to Customer data. We therefore recommend a more technical approach to accessing and updating this data.

Currently customer settings can be added though the use of BigCommerce customer attributes. Before these attribute fields are shown on the customer "Create" and 'Edit" screens in BigCommerce, the attribute type&#x73;**&#x20;must be manually created f**or each store.

This can be done using the shell command below. You will need to replace `YOUR_STORE_HASH` and `YOUR_STORE_API_TOKEN` values. You can find the store hash in the URL of the store admin page:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/v6FXv-ARYyMHvOcUNI2us_image.png)

You will need to create an API token by going to **Settings -> Store-level API accounts,** clicking the **Create API Account&#x20;**&#x62;utton, entering a descriptive name (e.g. SparkLayer Support), and selecting the **Modify** value of the **Customers** scope:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/PtRUvBVFalvr6iQ52Sc_v_image.png)

Click **Save**. You will now see a popup with the credentials, which are also downloaded to your computer. You will need the access token value.

Replace the two values in the command below and run it in your terminal (please note that you can remove the attributes that are not needed to only create the required attributes):

```curl
curl --request POST \
  --url https://api.bigcommerce.com/stores/YOUR_STORE_HASH/v3/customers/attributes \
  --header 'Content-Type: application/json' \
  --header 'X-Auth-Token: YOUR_STORE_API_TOKEN' \
  --data '[
	{
		"name": "SparkLayer - Price Lists",
		"type": "string"
	},
	{
		"name": "SparkLayer - Payment On Account",
		"type": "string"
	},
	{
		"name": "SparkLayer - Accounting ID",
		"type": "string"
	},
	{
		"name": "SparkLayer - Discount Percentage",
		"type": "number"
	},
	{
		"name": "SparkLayer - Sales Agent Groups",
		"type": "string"
	},
	{
		"name": "SparkLayer - Parent Customer ID",
		"type": "string"
	}
]'
```

You will now see the attributes and be able to edit them in the customer create and edit pages.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ut95DDqwjNpDiS55UF9GF_image.png)
:::



***

### Order history: importing historical orders into SparkLayer

It's possible to import historical B2B order data into SparkLayer, allowing customers to see their previous order history once they access their account on your store.

To do this add a metafield to the order as shown below:

| Item        | Details                                |
| ----------- | -------------------------------------- |
| `Namespace` | This must be set as `sparklayer`       |
| `Key`       | This must be set as `order_import`     |
| `Value`     | This must be set as a string of `true` |

Any orders that are imported this way must also belong to a customer that has a B2B customer group assigned.

Even though the order metafield above can be setup manually using one of the many metafield management apps available, for large numer of orders you might want to automate this using the BigCommerce Order Metafields API.

:::hint{type="info"}
**Please note**
The note attribute must be added to the order **after** SparkLayer is installed for the order to be synchronised correctly. Orders synced in this way can then be reported upon and will appear in the Orders section of the SparkLayer Dashboard.
:::

:::hint{type="warning"}
**Troubleshooting**
If your store was installed before the ***14th of November, 2024***, you might need to contact the SparkLayer customer support to re-save your BigCommerce integration in order to register the required order metafield webhooks. These webhooks notify our system of new metafields added to orders.
:::



***

## Order Data

### Order ID ("Visible ID") and setting a custom order number

It's possible to use a custom order ID instead of the standard order ID generated from BigCommerce. A typical use-case is customising the Order ID to match order numbers generated from a back-office system (e.g. an ERP), ensuring consistency across systems.

When the "Visible ID" is set, this will then take effect when the customer views their orders from the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5d6xB53DfFAoDBhsTL_mI_image.png)



| Item               | Details                                   |
| ------------------ | ----------------------------------------- |
| `Custom data type` | Order                                     |
| `Metafield type`   | This must be set as an `single line text` |
| `Namespace`        | This must be set as `sparklayer`          |
| `Key`              | This must be set as `visible_id`          |

:::hint{type="warning" attributes="[object Object]"}
**Please note**
If you're using the "Visible ID" configuration, any orders that do not have this populated will fallback to the standard BigCommerce order number.
:::



***

## Important considerations

In order for SparkLayer to work with BigCommerce metafields, please note the following:

:::hint{type="warning"}
**Product metafields**
Metafields are always added at the product variant level, even if the product only comes in a single variant.&#x20;

**JSON data**
Some SparkLayer settings require metafields to be set up as JSON strings. These will need to be carefully added, making sure the formatting is set correctly.
:::



***

## Advanced settings

To learn about more advanced settings, including customer-level product metafield settings, please see [Product Settings](docId\:Cm9B1I6Cz0vOlc67g-fJI)

[title] Cin7 Core
[path] Integrations/ERPs & Operations/

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/F2f6-0EBI91WZbvvrucsB_heacder.png)

:::hint{type="info"}
**Requirements**

- Plan: Merchants must be signed up to the Professional or Enterprise plan
- Platform: Merchants must be using Shopify
:::

## Introduction

**Cin7 Core** is a powerful inventory management system designed for retailers, wholesalers, and manufacturers. From inventory and stock control, to order management and fulfilment, Cin7 Core helps automate and streamline your eCommerce operations. You can learn more about Cin7 Core [here](https://www.cin7.com/solutions/core/?utm_term=cin7%20core\&utm_campaign=mm_search_brand_emea\&utm_source=google\&utm_medium=cpc\&hsa_acc=9060130901\&hsa_cam=18133732967\&hsa_grp=149955377884\&hsa_ad=655886024565\&hsa_src=g\&hsa_tgt=kwd-1942910059907\&hsa_kw=cin7%20core\&hsa_mt=e\&hsa_net=adwords\&hsa_ver=3\&gad_source=1\&gbraid=0AAAAABIS0PhOnUtzfradDOQy0k8dbkFvX\&gclid=Cj0KCQjwzrzABhD8ARIsANlSWNMwImmV0ASbE-CkR02KSmpeD1_CXtjX8K6GG-JAFKFXpD2ZucWP8DkaArZFEALw_wcB).



***

## How it works

The Cin7 Core integration for SparkLayer is available for all [Shopify merchants](https://docs.sparklayer.io/integrations/shopify-introduction#introduction) that already use Cin7 Core and allows you to bring **B2B pricing and B2B ordering&#x20;**&#x20;into SparkLayer and your Shopify store.&#x20;

The integration works in the following ways:

| **Item**    | **Details**                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Customers` | Cin7 becomes the 'master' of your B2B customer data, and any changes to customer records that have the assigned Customer Type will automatically be synchronised to Shopify and SparkLayer. SparkLayer will maintain a customer on your E-Commerce platform for every contact of each customer it syncs from Cin7. The Customer's Default contact is treated as the Main account with its other contacts treated as [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ) under it. |
| `Orders`    | Orders placed via SparkLayer are synchronised from your E-Commerce platform into Cin7 using your [existing Cin7 integration](https://help.core.cin7.com/hc/en-us/articles/9034589848335-Shopify-Integration). Prices that show on orders will be the special B2B pricing as set up in Cin7.                                                                                                                                                                                |
| `Pricing`   | Price lists and product prices are imported into SparkLayer via pricing rules you set up in Cin7                                                                                                                                                                                                                                                                                                                                                                           |
| `Sync`      | The automatic sync is carried out **every hour**.                                                                                                                                                                                                                                                                                                                                                                                                                          |

:::hint{type="info"}
**Please note**
We recommend also familiarising yourself with the "Known limitations" below
:::



***

## Configuring  the integration

:::hint{type="info"}
**Before you begin**
You'll need to have an approved account with Cin7 Core - Please visit the [Cin7 website](https://www.cin7.com/solutions/core/?tm=tt\&ap=gads\&aaid=adaCskrnITi18\&utm_term=cin7%20core\&utm_campaign=mm_search_brand_emea\&utm_source=google\&utm_medium=cpc\&hsa_acc=9060130901\&hsa_cam=18133732967\&hsa_grp=149955377884\&hsa_ad=655886024565\&hsa_src=g\&hsa_tgt=kwd-1942910059907\&hsa_kw=cin7%20core\&hsa_mt=e\&hsa_net=adwords\&hsa_ver=3\&gad_source=1\&gclid=CjwKCAiA9bq6BhAKEiwAH6bqoN9Zbb8pUMLtFpMfCor1fMKdHdEJRPTDznpBDkKQO2T_1xAiwqwu-RoCkIwQAvD_BwEC) to learn more.&#x20;
:::

To get started, the integration needs to be enable within the [SparkLayer Dashboard. ](https://app.sparklayer.io/configuration/integrations/partners)Go to the **Integrations** section and click **Partner Integrations.** Under **Multi-channel management**, click the toggle on the right to activate the Cin7 Core integration.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/F0kKwGI7pAISNdw_4Cc___image.png)

You'll then be prompted to enter the following details:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/WHOD0HPYWMwU-2AJKnTw4-20251103-114903.png)

| **Item**                       | **Details**                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `API ID`                       | You can find this within your Cin7 Core admin under **Integration, API**                                                                                                                                                                                                                                                                                                                                                                                                    |
| `API Key`                      | You can find this within your Cin7 Core admin under **Integration,  API**                                                                                                                                                                                                                                                                                                                                                                                                   |
| `Customer Sync Tags`           | Customers that have any of these tags within Cin7 Core will be **synchronised to Shopify** by SparkLayer. The customer tag should match a customer group that exists in SparkLayer.<br />**Please note:** The tag must match the SparkLayer **customer group name** exactly and be seperated by a **comma** (e.g. `GROUP1, GROUP2)`. For the purposes of testing, we recommend creating a new group and testing with a dummy customer first before using an existing group. |
| `Additional Customer Tags`     | When a customer is syncronised to Shopify, **if it has any of these tags within Cin7 Core: it will have those tags within Shopify** as well (prefixed with `spark-`).  These must be **valid Shopify tags**, and must not **conflict with your SparkLayer customer groups**.<br />This feature is **currently exclusive to Shopify** If your store uses a different E-Commerce platform this setting will be ignored.                                                       |
| `Tax-Exempt Codes`<br /><br /> | This is the code that you want to sync across the customer across as tax-exempt.                                                                                                                                                                                                                                                                                                                                                                                            |
| `Ignore Non-Default Contacts`  | When checked, **only the Default contact** of each customer will by synced through to SparkLayer.                                                                                                                                                                                                                                                                                                                                                                           |



***

## Configuring Customers

Broadly speaking, Cin7 Core is your **central location&#x20;**&#x66;or managing B2B customer data. When customers are configured in Cin7 as B2B customers, SparkLayer can **automatically** retrieve this data and then enable the B2B ordering experience on your Shopify site.

::::ExpandableHeading
**Step 1 - setting up a customer &#x20;**

When you have set up the [integration with SparkLayer](https://app.sparklayer.io/configuration/integrations/partners) within your Cin7 Dashboard, go to **Sale** and then **Customer**. In this page you are able to set up the customer account with your required customer details. You **must&#x20;**&#x68;ave a first and last name set in General and Contacts

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/J-Stk9eOJwFQQtDoImzJf_image.png)

Next, navigate to your **SparkLayer Dashboard** and [Customer Groups](https://app.sparklayer.io/customers/groups). Here you'll need to create the customer groups and, once you have done this, you are then able to add the customer group name as tags within your customer in Cin7 under "Tags".&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/G7FfMsPklBP3-DFM3zrhz_image.png)

In our example, we have `Base` and `Gold`. Within Cin7, and add the tag `base` and `gold`.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/wpAIYZ2iJugIIjoqAaERc_image.png)

You will also need to select the **Tax Rule.&#x20;**&#x4F;nce you have done this, take the tax exemption rule and add this into the final stage of the SparkLayer integration. This means any customers that have been set as tax exempt in Cin7 will automatically be tax exempt in Shopify.

Next, go to the [Partner Integrations](https://app.sparklayer.io/configuration/integrations/partners) section of SparkLayer and click **Modify** within the Cin7 integration. Finally, add the **Customer Tags** you have created for your customer groups that you want to sync across the customer from Cin7 to SparkLayer/Shopify. In our example, we've added them for `base` and `gold`.

:::hint{type="warning"}
**Please note**
Customer Tags **must** be seperated by a comma with **no** spacing to sync correctly e.g. `base, gold`
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/FuH9N7GKr-y9PuSAq7DLx_image.png)
::::

::::ExpandableHeading
**Step 2 - syncing your customers&#x20;**

To sync your customers, you'll need to create your customers in your Cin7 Dashboard if you haven't already. When doing this you are able to allocate them add a **Tag.&#x20;**&#x54;his will assign them into the specific [customer group](https://app.sparklayer.io/customers/groups) within SparkLayer when they are synced across.&#x20;

The **Tag&#x20;**&#x74;hat you assign must match a customer group name that you have created in your SparkLayer dashboard already. For example, if you are using the tags in the above screenshots, your customer groups would look like the below:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VCpaeUVexzGyLicOpq8_U_image.png)

:::hint{type="info"}
**Please note**
The customer would not need be tagged with this customer group within Shopify. Instead, the customer group information is synced to Shopify as a metafield.
:::

When setting up your customers in Cin7, please ensure you set up:

**General:**

- Name (first and last)
- Currency
- Sale Price Tier
- Tax Rule
- Tags

**Addresses**

- &#x20;A full address

**Contacts**

- Name (first and last)
- Assign a valid email address. This must be set up in order to sync to SparkLayer and Shopify.
- Tick main contact as "Default"

:::hint{type="info"}
**Please note**
If you have multiple contacts to sync, the primary contact must be marked as **Default** in Cin7 Core. All additional contacts will be synced as child accounts under the Default (parent) contact.
:::

**Syncing across to SparkLayer and Shopify**

Ensure the correct **Customer Tag** is added in Cin7 Core to match what you've configured in SparkLayer. SparkLayer syncs with Cin7 Core every 4JJ hours. During each sync, any new or updated records are automatically pushed to Shopify.

Customers are mapped between the systems based on the&#x20;**&#x20;contact email** set within Cin7 Core. Once this is mapped, SparkLayer will then synchronise the following data into Shopify.

| **Cin7 Core**                                        | **Shopify / Spark Layer**                                                    |
| ---------------------------------------------------- | ---------------------------------------------------------------------------- |
| Address                                              | Shows against customer record in Shopify                                     |
| Primary Telephone                                    | Shows against customer record in Shopify                                     |
| First / Last Name                                    | Shows against customer record in Shopify                                     |
| Customer Group                                       | Shown via metafields in Shopify (see above)                                  |
| Credit Limit / On hold                               | Shown via metafields in Shopify                                              |
| Tax Codes (using the mapping in config)              | Shows against customer record in Shopify                                     |
| Cin7 Core Price List Tier / Customer specific prices | Shown via metafields in Shopify to show the correct pricing for the customer |
| Tags                                                 | Only **Additional Tags** show against customer record in Shopify.            |

:::hint{type="warning"}
**Please note**
All customer data is managed via Cin7 and any amends made directly in Shopify will **not** synchronise back to Cin7.
:::
::::

:::ExpandableHeading
**Step 3 - giving access & notifying new customers**

Since Cin7 is the central source for customer data, any new customers created in Cin7 will **automatically** be added to Shopify (following the above steps).&#x20;

When new customer records are added to Shopify, they will by default be added as **Pending** customer accounts and receive an **automatic email** to enable their account by setting a password.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GV5ZpXyW0LI0xshPzNf6Z_image.png)

This uses the **Customer account invite** notification email which can be edited in the [Notifications section within Shopify](https://admin.shopify.com/settings/notifications/customer).

If you prefer **not** to send the customer account invite automatically, you can easily check if this option has been activated. Simply go to your SparkLayer Dashboard, navigate to [Partner Integrations](https://app.sparklayer.io/sparklayerunleashedtest/live/configuration/integrations/partners). When modifying your Cin7 integration, you can enable or disable this via the setting at the bottom.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/xkOjDbRmhSXYC4PD5VIyA_image.png)
:::



***

## Configuring Pricing

In Cin7, you can utilise **up to 10 price lists**, allowing you to create multiple pricing tiers tailored to your various customer levels. On top of this limit, you have the flexibility to set customer-specific and product-specific discounts, providing even more granular control over your pricing strategy.

::::ExpandableHeading
**Step 1 - price list setup**

In Cin7, navigate to **Settings&#x20;**> **General Settings** > **Sell Price Tier Names**. Here, you can customise the names of your price tiers, which are initially labelled as "Sell Price Tier 1" through to "Sell Price Tier 10".&#x20;

:::hint{type="warning"}
**Please note**
SparkLayer **does not** support the custom names meaning they will show in SparkLayer as "Sell Price Tier X"
:::
::::

:::ExpandableHeading
**Step 2 - viewing price lists**

When you view a product within your Cin7 Dashboard, under the **Prices** tab you’ll see the available price tiers listed. For products offered to your wholesale customers, you can specify the exact price for each tier, depending on which pricing list is assigned to the customer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/P9Rd1bVRvwUOfefjF3v3h_image.png)
:::

::::ExpandableHeading
**Step 3 - assigning a price list**

Within your Cin7 Dashboard, navigate back to the customer account that you are working on. You are then able to assign them a price list directly to the customer account within **Sell Price Tier**. This means when they login they will see the product pricing you've assigned to them.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/j8fjCMkGzvH4xTEXG85iM_image.png)

:::hint{type="warning"}
**Please note**
These price lists will be asigned directly to the customer account through the SparkLayer price list metafield which is set up differently to standard price lists. You can learn more in [Metafields](docId\:OTLHhi8sQ6oS4PAt23-8H)&#x20;
:::
::::

:::ExpandableHeading
**Setting up product specific discounts**

Within the Cin7 Dashboard, navigate to a customer record and click Product Prices. Here you are able to set product specific pricing for this customer account.&#x20;

You are able to search for a product, specify a fixed price on the product. When doing this, it will create a new price list within the [SparkLayer Price Lists](https://app.sparklayer.io/pricing/lists) section.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ggaYMArO_hcR_hBNbgETc_image.png)
:::

:::ExpandableHeading
**Assiging prices to the Shopify Customer account**

Once you have finished configuring your customers pricing and a sync has taken place, you can then check the customer account in Shopify to ensure they have been assigned the correct pricing.&#x20;

The price list will be assigned directly to the customer account in a **Price List metafield** (this gets added automatically when you first set up the SparkLayer integration). It will also create the price list within your SparkLayer Dashboard > Price lists as an "Integration" Price List.

With this metafield it will **always** work in a hierarchy order, which means when a customer searches a SKU it will check the first price list and will cascade through the price lists untill it finds a price.&#x20;

In the example below you are able to see a number of price lists.&#x20;

1. An&#x79;**&#x20;customer product specific discounts** you have created within the customer in Cin7.&#x20;
2. The **normal price list&#x20;**&#x74;hat you have assigned to the customer&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/9R9dF4lBfIoxoR8Zd-o4O_image.png)
:::

***

## Data mapping

We've detailed how data is mapped between SparkLayer and Cin7.

:::ExpandableHeading
**Customer data mapping**

| Item                        | Details                                                                                               |
| --------------------------- | ----------------------------------------------------------------------------------------------------- |
| `First and Last name`       | Assigned to the customer account in Shopify                                                           |
| `Email and Phone number`    | Assigned to the customer account in Shopify                                                           |
| `Addresses`                 | Assigned to the customer account in Shopify                                                           |
| `Tax Exemptions`            | Assigned to the customer account in Shopify                                                           |
| `SparkLayer Customer Group` | This will be assigned to the customer account through a Shopify Metafield called "Group"              |
| `Company Name`              | This will be assigned to the customer account through a Shopify Metafield called "Company"            |
| `Discount Percentage`       | This will be assigned to the customer account through a Shopify Metafield called "Disount Percentage" |
| `Credit limit`              | This will be assigned to the customer account through a Shopify Metafield called Payment On Account   |
:::

:::ExpandableHeading
**Pricing data mapping**

| Item                                 | Details                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Creating Price Lists`               | SparkLayer generates several types of price lists based on the product prices available in Cin7.                                                                                                                                                                                                                                                                                                                        |
| `Sell Price Tiers`                   | If Cin7 has specific Sell Price Tiers set up (e.g., "Sell Price Tier 1", "Sell Price Tier 2", etc.), SparkLayer creates separate price lists for these tiers. Cin7 supports up to 10 Sell Price Tiers that you can assign to different groups of customers.                                                                                                                                                             |
| `Customer-Specific Prices`           | If any customer has unique prices specified under the Customer/Product Price tab in Cin7, SparkLayer creates a Customer-Specific Price List for that customer. This ensures that individual customer agreements or special pricing arrangements are captured.                                                                                                                                                           |
| `Handling Different Currencies`      | If a customer uses a currency other than the base currency, SparkLayer will create Alternative Currency Price Lists based on the existing price lists. For example, if your store is GBP you will have "Dear Tier Price 1" set as GBP, if you assign a customer USD then SparkLayer will create a new price list "Dear Tier Price 1 USD"set as USD. This will take the GBP and convert it at the live going rate to USD |
| `Assigning Price Lists to Customers` | Price lists will be assigned directly to the customer account through the use of a Customer Metafield. When assigning prices to customers, SparkLayer follows this order of priority:<br />* First, the Customer-Specific Price List (if available).
* Then, a Sell Price Tier (if assigned in Cin7).<br />If a customer has multiple currencies or discounts, they will get additional price lists accordingly.        |
| `Why Prefixed Price Lists?`          | SparkLayer may apply generic "prefixed" price lists to every customer. This is to ensure that a basic Sell Price Tier is always in place, even if the customer’s Cin7 configuration doesn’t explicitly assign one.                                                                                                                                                                                                      |


:::





***

## Known limitations

The following limitations apply:

- Internally SparkLayer will use the internal SellPriceTier naming for simplicity between mapping, not the custom naming that can be setup via the Cin7 Core Settings
- Changing the customer's email address, will create an additional customer in Shopify. The old account will need to be disabled manually.
- When you change a customer's default contact in Cin7 Core: you will need to manually disable the account in Shopify that corresponds to the the old default contact.
- A customer that is removed by removing the tag will not be disabled within Shopify.
- Default addresses in Cin7 Core will be mapped to Shipping and Billing address in Shopify (Shopify doesn't support independent addresses).
- Addresses are a 1-way sync from Cin7 Core into Shopify. It's recommended to not allow address editing in SparkLayer otherwise new addresses added won't appear in Cin7 Core and will be replaced on next integration run.



***

## Troubleshooting

:::ExpandableHeading
**My customers are not appearing in Shopify**

- Ensure that customers in Cin7 Core have been assigned the correct tags matching the **SparkLayer Customer Group Names.**
- Confirm the tag formatting: tags must be separated by commas without spaces (e.g., base,gold).
- Check that the customer has a valid Default Contact with a valid email address.
:::

:::ExpandableHeading
**Customer account invites are not being sent**

- By default, Shopify will send a Customer Account Invite email when a new customer is created.
- Check if automatic invitations are disabled in the SparkLayer Partner Integration settings.
:::

:::ExpandableHeading
**Customer-specific pricing is not displaying**

- After updating pricing, allow up to 6 hours for the next sync to complete.
- Verify that the correct Price List metafield exists against the Shopify customer record.
:::

:::ExpandableHeading
**Changes made in Shopify are not reflected in Cin7 Core**

- The integration is one-way (Cin7 Core ➔ Shopify). Changes must always be made in Cin7 Core.
- If you update customer information directly in Shopify, it will be overwritten by the next sync.
:::

:::ExpandableHeading
**Product pricing appears incorrect for customers**

- Double-check that the customer is assigned to the correct Sell Price Tier or Product-Specific Pricing.
- In Cin7 Core, ensure that price tiers have the expected values for your products.
- Confirm that no old price lists or tags are incorrectly linked to the customer in SparkLayer.
:::

:::ExpandableHeading
**Customer duplicates appear in Shopify**

- Double-check that the customer is assigned to the correct Sell Price Tier or Product-Specific Pricing.
- In Cin7 Core, ensure that price tiers have the expected values for your products.
- Confirm that no old price lists or tags are incorrectly linked to the customer in SparkLayer.
:::




[title] Shopify B2B-only Content
[path] Integrations/Shopify/Shopify Customisations/

:::hint{type="warning"}
**Important to note**
If you are looking to customise the behaviour of your Shopify store, we strongly recommend engaging a Shopify expert to assist. Whilst we can provide an overview of how to approach making customisations, our team cannot assist in applying any code changes.
:::

## B2B-only products (hiding products)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/XEMdIZcFA-Ps3PNtiiK2D_image.png)

If you're running both B2B and DTC within the **same Shopify store**, there may be a range of products that you want to only show and be purchasable to logged in B2B customers. Perhaps they can only be purchased in high-volumes or they are exclusive to your B2B customers.&#x20;

[B2B Catalogs ](https://apps.shopify.com/sparklayer-b2b-catalogs)is a free SparkLayer app that lets you control which products are visible to different types of customers on your Shopify store. Hide products from B2C customers, restrict items to B2B-only, or show different product ranges to different customer groups - all using simple tags, no code required.

[Install B2B Catalogs](https://apps.shopify.com/sparklayer-b2b-catalogs) from the Shopify App Store, then head to our [B2B Catalogs documentation](https://docs.sparklayer.io/b2b-catalogs/) for the full setup guide.

:::hint{type="info"}
**Hiding variants**
Looking to hide variants for specific B2B customer groups? [Read our guide](docId\:m3DF4f0Eyc2rM-vUaRG9H)
:::



***

## Hiding prices

If you have a dedicated B2B Shopify store and want to fully hide prices from your logged out customers, you can do this by adding special code to your storefront theme. Typically you could apply this to:

- The product cards that show on your collection pages (e.g. on `/collections/all`). The code for product cards is typically found in the /snippets/ directory, e.g. `/snippets/card-product.liquid`
- The product details page. This is typically found in the /sections/ directory, e.g. `/sections/main-product.liquid`

To get started, you can adapt our example code below. This code simply shows some HTML code if the customer browsing the site is not a logged in B2B customer. &#x20;

```html
{%- if customer.metafields.sparklayer.authentication -%}

<!-- B2B content here -->
<spark-product-card parent-id="{{ product.id }}"></spark-product-card>

{%- else -%}

  <div style="font-size: 14px; position: relative; z-index: 10">
    Please 
    <a href="/account/login?return_url={{ request.path }}" style="color: #000; text-decoration: underline">sign in</a> to see pricing
      to see  pricing
  </div>
  <style>
    [data-spark="b2c-only"] { display:none !important; }
  </style>
  
{%- endif -%}
```

::embed[]{url="https://www.youtube.com/embed/cUqWPCS-dOE"}



***

## B2B-only content

Within Shopify, you can very easily adapt your Shopify code to show (or hide) content based on who the customer is. This means, for B2B customers, you could show additional links in the navigation, content on the homepage or product pages, or even hide content from showing.

The code to do this is very simple and we've included a sample below.

```html
{% if customer.tags contains 'b2b' %}

    Show this content to logged-in B2B customers

{% else %}

    Show this content to logged-out customers

{% endif %}
```



***

## B2B-only metafields

Shopify also has a powerful feature called *metafields&#x20;*&#x74;hat allows you to extend product data to include additional content specific to a product SKU. In the context of wholesale (B2B) ordering, it can be a great way to enrich your product pages with additional wholesale-specific information such as bar codes, marketing content, and anything else. You can learn more about metafields in [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/dETAdpjd8d4XV6mSXKCz6_image.png)

:::hint{type="info"}
**Setting up metafields on Shopify**
To learn more about how to configure metafields on Shopify for SparkLayer, please refer to [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

Once you've populated additional content against your products, you can then update your product detail template to render the data. Here's a sample that renders additional product information but **only** if a customer is signed in and has a tag of `b2b` assigned against them. For any other customer, this additional content will be hidden from view.

```html
{% if customer.tags contains 'b2b' %}

  {%assign custom_attributes = product.metafields.products %}
  
  {%if custom_attributes.size > 0 %}  
  
  <div class="product-meta">
    <p><strong>Additional wholesale information:</strong></p>
    <ul>
      {% for field in custom_attributes %}
        {% assign attribute_code = field | first %}
        {% assign attribute_value = field | last %}
        <li class="custom-attribute-item">
        <span class="custom-attribute-name">{{ attribute_code }}</span>: 
        <span class="custom-attribute-value">{{attribute_value}}</span> 
        </li>
      {% endfor %}
    </ul>
    </div>
  {%endif%}

{% endif %}
```

If you're using [metafields](docId\:BxWnGB6b1n7QFfhTnu7pk) on your Shopify store and want to display these to the customer (e.g. on a collection page or product detail page), you can do this by adding special Liquid code to your Shopify theme.&#x20;

```html
<!-- Only show this to logged in B2B customers -->

{% if customer.tags contains 'b2b' %}

  {% if product.metafields.sparklayer.pack_size %}

    <!-- In this example, we're outputting the pack size -->
    Pack size: {{ product.metafields.sparklayer.pack_size }}
  
  {% endif %}

{% endif %}
```

:::hint{type="info"}
**Learn more about metafields**
For learn more about how metafields work on Shopify, please [see this guide](https://help.shopify.com/en/manual/custom-data/metafields).
:::



***

## B2B-only navigation menu

It's possible to create a B2B-only navigation menu for your store that you can show to logged in customers. It works by using Shopify's built-in menu system and then applying some special logic that shows for B2B customers.&#x20;

::::WorkflowBlock
:::WorkflowBlockItem
First, you'll need to create a new menu in your Shopify store from the "Navigation" section of Shopify (you [can access it here](https://admin.shopify.com/menus)). Proceed to set up your menu, making note of the "Handle".

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FGvsA5a0NNm6t20mRplM9%2Fimage.png?alt=media&token=a2d2c70b-79a3-40ae-a80d-f77199337e46)
:::

:::WorkflowBlockItem
Next, you'll need to locate the liquid file where the menu is setup (normally this is within `/sections/header.liquid`) You should see a line of code that looks roughly like this:

`{%- for link in menu.links -%}`

Once you've located this, replace this with the below code, making a note to change `b2b-menu `to the Handle set up above.

```javascript
{%- if customer.metafields.sparklayer.authentication -%}
{% assign menu = linklists.b2b-menu %}
{%- else -%}
{% assign menu = linklists.main-menu %}
{%- endif -%}
{%- for link in menu.links -%}
```

If you're using the [Shopify B2B Dawn Theme](docId\:LHkU0_G_4GVef1jAmgXmo), you can edit the following files:

- `/snippets/header-drawer.liquid`
- `/snippets/header-dropdown-menu.liquid`
- `/snippets/header-mega-menu.liquid`
:::

:::WorkflowBlockItem
You can repeat this process for your website footer if you want that to vary based on a B2B customer being logged in or logged out.
:::
::::

:::hint{type="info"}
**Using the Shopify B2B Dawn Theme?**
This theme comes with a ready-made B2B navigation menu. [Learn more.](docId\:LHkU0_G_4GVef1jAmgXmo)
:::



***

## B2B-only promotional banner

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/T4H1xxGV3y__xlZen6R9G_image.png)

You can enhance the experience for your wholesale partners by displaying a dedicated banner that only appears for logged-in B2B customers. This is an excellent way to confirm they are receiving wholesale pricing or to provide quick links to bulk order forms.

To add this to your store, you will need to edit your theme's liquid files. Most merchants place this code in `layout/theme.liquid` (for a site-wide banner) or within `sections/header.liquid`.

```html
{% if customer and customer.tags contains 'b2b' %}
    <style>
    .b2b-banner-premium {
        background: linear-gradient(90deg, #1a1a1a 0%,rgb(35, 35, 35) 100%);
        color: #fff;
        padding: 10px 20px;
        text-align: center;
        font-family: 'Inter', sans-serif;
        font-size: 14px;
        letter-spacing: 0.5px;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }
    .b2b-banner-premium .badge {
        background: #fff;
        color:rgb(50, 50, 50);
        padding: 2px 8px;
        border-radius: 4px;
        font-weight: 900;
        font-size: 11px;
        text-transform: uppercase;
    }
    .b2b-banner-premium a {
        color: #fff;
        font-weight: bold;
        margin-left: 15px;
        text-decoration: none;
        border-bottom: 1px dotted #fff;
        transition: opacity 0.2s;
    }
    .b2b-banner-premium a:hover { opacity: 0.8; }
  </style>

  <div class="b2b-banner-premium">
    <span class="badge">B2B Partner</span>
    <span>Welcome back! You are accessing <strong>Exclusive Wholesale Pricing.</strong></span>
    <a href="/collections/all">Shop Wholesale →</a>
  </div>
 {%- endif -%}
```



***

## Hiding content for B2B customers (via CSS)

Just as above in "Showing B2B-only content", it's also possible to do the inverse and **hide** content from B2B customers. One of the easiest ways to do this is by using special CSS which allows you to selectively hide elements based on whether a customer is logged in or not. In the example below, this CSS is only loaded when a B2B customer is signed into your store.

```css
{%- if customer.metafields.sparklayer.authentication -%}
<style>
.element-name {
display: none !important;
}
</style>
{%- endif -%}
```

:::hint{type="info"}
**Please note**
When hiding content via CSS, the content will technically still be loaded on your website and can be access in the source code (such as via search engines). Please bear this in mind when controlling the display of content via CSS.
:::



***

## Conditional content based on customer tag

It's possible to apply logic to render different behaviour within the SparkLayer Core Script code. For example, you may have a [custom checkout field](docId\:o3nDhZBCxisWH6M6satDt) that you only want to show to customers with a specific tag. You can use the example code below as a starting point.

```javascript
<!-- SparkLayer core script code -->
{% for tag in customer.tags %}

{% if tag == "b2b-group-1" %}
   -- Code in here for group-1 --
   
{% elsif tag == "b2b-group-2" %}
    -- Code in here for group-2--

{% else %}
    -- Code in here as fallback --
{% endif %} 

{% endfor %}
 
<!-- SparkLayer core script code -->
```



***

## Redirecting URLs based on URL

Within Shopify, it's possible to redirect a logged in B2B customer based on a specific URL. For example, you may want to redirect the B2B customer from the homepage (the `index` URL) to a dedicated B2B collection page (e.g. `collections/b2b`)

To set this up, within the `layout/theme.liquid` file, before the closing `</head> `tag, simply add the below code, adjusting to your needs.

```javascript

{%- if customer.metafields.sparklayer.authentication -%}

 {%- if template contains 'index' 
      or request.path == '/index' 
      or request.path == '/pages/your-specific URL' 
     -%}
  
   <script>
       window.location.href = '/collections/all';
   </script>

   {%- endif -%}

{%- endif -%}
```



***

## Redirecting URLs for logged out customers

If you're looking to 'block' specific URLs based on a customer being logged in or logged out, this can be done relatively easily within Shopify. If a customer is signed in or logged out, you can perform a simple redirect using JavaScript. To set this up, within the `layout/theme.liquid` file, before the closing `</head> `tag, simply add the below code, adjusting to your needs.

```javascript

{%- if customer.metafields.sparklayer.authentication -%}
<!-- Do nothing for logged in B2B customers -->
{%- else -%}

{%- if  request.path == '/path-to-page-here' or request.path == 'path-to-another-page-here' -%}

   <script>
   window.location.href = '/url-to-redirect-to';
   </script>
{%- endif -%}
{%- endif -%}
```

##


[title] ERPs & Operations
[path] Integrations/

::::LinkArray
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Vk2mT_ntWt6lPDP5BAjqb_brighpearl.png"}
[Brightpearl](docId\:UdCRf8baae6izSgXo5uPB)
⚙️ Integrates Directly

Multi-channel eCommerce
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7mm9NPLs7kyK4R8IiJWXL_cin7a.png"}
[Cin7 Core](docId\:L2xOOZGjB4uqMK5L2EDp3)
⚙️ Integrates Directly

ERP Software
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/xfNiGBSgEn4kQgHpgIuNy_linnworks.png"}
[Linnworks](docId\:ZvLT9mGlh1mVn8xHM4JIQ)
⚙️ Integrates Directly

Multi-channel eCommerce
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/sXyIVQX8jqcgyBLnlwuR2_unleashed.png"}
[Unleashed](docId:83JVcRRNGWsKjpUzf-WYm)
⚙️ Integrates Directly

Inventory Management
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ceApPKUYZPfAcAeLjXgt8_katana.png"}
[Katana](docId\:goIlaInwUK3DbAJ0snj6t)&#x20;
⚙️ Integrates Directly

Inventory Management
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/C8m2i3Hp3fLgqCGIVek-i_patchworks.png"}
[Patchworks ](https://www.sparklayer.io/partners-patchworks/)↗
✅ Trusted Partner

iPaaS solution
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/YTgjfLnAuv9ufeGE5bRvi_zynk.png"}
[Zynk ](https://www.sparklayer.io/partners-zynk/)↗
✅ Trusted Partner

iPaaS solution
:::
::::


[title] Xero
[path] Integrations/Accountancy/

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/9Us3SAj99ALGdnP62h6QF-20251127-073941.jpg)

:::hint{type="info"}
**Requirements**

**Plan:** Merchants must be signed up to the Professional or Enterprise plan
**Platform:** Merchants must be using Shopify
:::

## Introduction

Xero provides online accounting tools for managing finances, invoices, and customer records. With the SparkLayer integration, your B2B orders automatically sync to Xero to create invoices and contacts - reducing manual data entry and removing the need for additional apps or systems to keep your platforms in sync.



***

## Getting started

To get started, login to your SparkLayer dashboard and navigate to **Integrations -> Partner Integrations -> Accountancy -> Xero** and enable the integration. You will then be redirected to Xero to complete authentication. You will also be notified about which data we require access to at this stage.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bESmJofI4q1BxxRG72oC5_image.png)

:::hint{type="info"}
**Please note**
If your Xero account is associated to multiple organisations then you will be requested to select which organisation you want to connect with SparkLayer. Only one organisation can be connected to your SparkLayer dashboard.
:::

Once you are connected, you can navigate back to the **Partner Integrations&#x20;**&#x70;age and modify the integrations configuration. You'll need to follow the steps below ("Configuration") to complete the setup.



***

## Configuration

Below details the configuration options available in the integration.

| Setting                                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Automatic Contact Creation`                     | <font color="#15803D">**Default: Disabled**</font><br />Controls whether SparkLayer should create contacts in Xero during the invoice synchronisation process.<br /><br />When creating invoices, each invoice must be associated with a contact in Xero. We first attempt to match an existing contact (as outlined in the Contact Matching section). If no match is found, this setting determines what happens next:<br />* **Enabled -&#x20;**&#x53;parkLayer will automatically create a new contact in Xero using the customer data held in SparkLayer.&#xA; You can read more about contact creation [here](https://docs.sparklayer.io/xero#ZR11G).&#x20;
* **Disabled -** SparkLayer will not create new contacts in Xero. This assumes that contacts are either:&#x20;
  - Being created by another system, or&#x20;
  - Being managed manually within Xero.&#x20;
* In this case, if no matching contact is found, invoice creation may fail. |
| `Default Line Item Account Code`                 | <font color="#15803D">**Default: 200**</font><br />Specifies the Xero account code that invoice line items will be associated with. For example, `200`<br /><br />You can find your account codes within the **Chart of Accounts** section in Xero.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `Shipping Line Account Code`                     | <font color="#15803D">**Default: Falls back to what is configured for "Default Line Item Account Code"**</font><br />Allows you to specify a Xero account code to use for shipping line items. For example, `260`<br /><br />If left empty, the account code used will fallback to what is configured for the `Default Line Item Account Code` setting.<br /><br />You can find your account codes within the **Chart of Accounts** section in Xero.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `Invoice creation for Payment on account orders` | <font color="#15803D">**Default: On order**</font><br />Controls when an invoice should be created for orders using the payment on account payment method.<br />* **On order&#x20;**&#x77;ill create an invoice for the whole order one it reaches the `processing` status.
* **On shipment&#x20;**&#x77;ill create an invoice per shipment, once any fulfilments on the order have been created.<br />You can read more about payment on account orders below.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `Invoice Line Item Mapping`                      | `Map Line Items to Item Codes`<br /><br /><font color="#15803D">**Default: Disabled**</font><br /><br />Controls whether or not, during the creation of invoices, we map invoice line items to Xero Items (Products) based on the SKU held for the line item in SparkLayer.<br />* **Enabled&#x20;**- When creating an invoice, we will map the line item to an existing item (product) held in Xero based on the SKU. If no item in Xero exists for a given SKU, the invoice will not be created.
* **Disabled&#x20;**- When creating an invoice, we will not attempt to map line items to items (products) held in Xero.<br /><br />You can read more about **Invoice Line Item Mapping&#x20;**&#x62;elow.                                                                                                                                                                                                                                            |
| `Tracking categories`                            | <font color="#15803D">**Default: None**</font><br /><br />Allows you to specify which tracking category or categories we should map line items to when creating SparkLayer invoices.<br /><br />Mappings pairs should be formatted as a comma-separated list in the format:<br /><br />`CategoryName:Option`<br /><br />**For example;**<br /><br />`Channel:B2B,Source:SparkLayer`<br /><br />**In this example:**<br /><br />* The **Channel** tracking category will be set to **B2B**
* The **Source&#x20;**&#x74;racking category will be set to **SparkLayer**<br /><br />**Note:** Xero supports a maximum of two tracking categories per line item. Any additional mappings beyond this limit will be ignored.                                                                                                                                                                                                                                  |



***

## Invoice Creation

SparkLayer automatically creates invoices in Xero for eligible customer orders as soon as the order is received from your platform.&#x20;

:::hint{type="info"}
**Please note**
This process runs in the background to keep the checkout experience fast and uninterrupted, which means there may occasionally be a short delay before the invoice appears in Xero.
:::

### Orders eligible for invoicing

Whether an invoice is created depends on several conditions, including your integration settings and the specific details of the order.&#x20;

| Item                | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Fulfilment status` | We only create invoices for orders that are in either the *processing* or *shipped* fulfilment status.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `Payment method`    | Invoices are generated only for orders using either the **Payment by Invoice** or **Payment on Account** payment methods.<br />* **Payment by Invoice**&#xA;For Payment by Invoice orders, the invoice is created as soon as the order reaches the `processing` status.
* **Payment on Account**&#xA;For Payment on Account orders, invoices are created depending on the integrations configuration. You can read more about payment on account orders here.<br />You can learn more about configuring these methods [our guide here](docId\:ibIKczvHM085BkeJIfFYv)  |

### Payment on account orders & split shipments

The integration configuration allows you to decide when invoices are created for orders that use the payment on account payment method. Invoices can be created either **on order&#x20;**&#x20;or **on shipment.**

If you have configured your integration for **on order&#x20;**&#x74;hen an invoice will be created when the SparkLayer order reaches the `processing` state.&#x20;

If the integration is configured for **on shipment&#x20;**&#x74;hen an invoice will be created at the time an fulfillment has been fulfilled on the order. This handling caters for **split fulfillments&#x20;**&#x61;s will we will create an invoice per fulfillment, containing only the line items fulfilled.

Customers will be able to download all invoices associated with an order from their my account section.

:::hint{type="info"}
**Shipping**
In the case of split shipments, the shipping method associated with the order will always be attached to the invoice created for the **first&#x20;**&#x73;hipment on the order.
:::

:::hint{type="warning"}
**Rounding issues**
Split shipments are in some cases susceptible to rounding issues. This is due to the differences between how your platform, SparkLayer and Xero calculate tax for line items across shipments.

If we detect a rounding issue on an invoice, we will automatically apply a "Rounding adjustment" line item to the affected invoice, assigned to Xeros rounding account code 860. This ensures totals on the Xero invoices match the order in SparkLayer.
:::

### How invoices are created

Invoices are generated using the Xero API. You can verify that an invoice was created via the SparkLayer integration by checking the **History & Notes** section in Xero, where an automatic note identifies SparkLayer as the source.

Each invoice is created using a combination of:

- Data from the SparkLayer order&#x20;
- Your integration configuration&#x20;
- Relevant settings within Xero&#x20;

The specific fields and logic used are outlined below.

| Item                                     | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Invoice Status`                         | By default, invoices are created in a **Submitted** status in Xero.<br />In some cases, invoices may be created in a **Draft** status if we are unable to determine a valid due date.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `Contact`                                | We attempt to match the invoice to an existing Xero contact using the customer details from the SparkLayer order. If a match is found, the invoice is associated with that contact. You can read more about how contact matching and syncing works in detail [here](https://docs.sparklayer.io/xero#ZR11G).                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `Billing Address`                        | The billing address shown on the invoice is taken from the billing address associated with the matched Xero Contact.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `Due Date`                               | The due date calculated for an invoice is dependant on three factors:<br />* The order date&#x20;
* The payment type&#x20;
* The customers payment terms                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `Due Date for Payment by Invoice orders` | For orders using the **payment by invoice&#x20;**&#x70;ayment method, the due date is set to the order date.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `Due Date for Payment on Account orders` | For orders using the **payment on account** type, the due date is calculated in the following hierarchical order:<br />1) If the customer has **net terms** configured in SparkLayer, these are applied to the order date. You can read more about configuring net terms [here](docId\:yWm70oQUosyKOoIqb4Z4G).
2) If not, any **payment terms** configured for the contact in Xero are applied.&#x20;
3) If neither of the above are set, any **global payment terms** configured in Xero are applied.&#x20;
4) If none of these are set, the due date defaults to the order date.                                                                                                                                                           |
| `Line Item`                              | - **Item Code**&#xA;If you have configured your integration to map line items to item codes in Xero, we'll use the line items SKU as the item code.
- **Account Code**&#xA;Each line item uses the default account code set in your integration settings.&#x20;
- **Description**&#xA;A combination of the line item’s SKU and parent / child name is used as its description. If the item also has any custom attributes associated with it, these are also appended.
- **Quantity**&#xA;The quantity matches the value recorded on the order in SparkLayer.&#x20;
- **Unit Amount, Line Amount & Tax Amount**&#xA;All monetary values, unit amount, line amount, and tax amount, are calculated by SparkLayer and passed directly to Xero. |
| `Shipping`                               | We attach shipping details to the invoice as a line item at the bottom of the invoice. We'll use the shipping method name & SKU to form the line item description alongside the relevant monetary values.<br /><br />The account code used is the same as other line items, using the default account code set in your integration settings.                                                                                                                                                                                                                                                                                                                                                                                                 |
| `Tracking`                               | Xero allows you to associate each invoice line item with up to two tracking categories.<br /><br />If tracking category mappings are configured in the integration settings, **all** line items on generated invoices will automatically be assigned to the specified tracking categories.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

:::hint{type="info"}
**Please note&#x20;**
Xero supports only a single billing address per contact. If a SparkLayer customer has multiple addresses, the billing address shown on the invoice may differ from the one stored in SparkLayer. We sync a customer’s billing address only when the contact is first created in Xero. Any changes made afterwards in SparkLayer are not automatically reflected and may require manual updates on the invoice or Xero contact record.
:::

### Mapping Line Items to Xero Items (Products)

In the integration configuration section `Invoice Line Item Mapping` you may enable `Map Line Items to Item Codes`.

This setting assumes you have already pre-configured items in Xero for all of the products in your platform, using the product SKU as the item code in Xero.

When enabled, we'll map each line item to its corrersponding item in Xero based on the SKY held in SparkLayer.

:::hint{type="warning"}
If a line item is for a SKU which **does not&#x20;**&#x65;xist as an item (product) in Xero then we'll fail to create the invoice. Once any missing items are added, the invoice will be created.
:::



***

## Viewing Invoices

Once an invoice has been created in Xero, customers can access it directly from the **My Account** section of your store. When the invoice is ready, a **View & Download Invoice** button will appear on the relevant order.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2F9VvbGw3V1ivMIj38UXGA%2Fimage.png?alt=media\&token=ed9a3454-07ce-41e2-84e4-f534aea1806d)

Selecting this button will take the customer to the publicly accessible invoice URL generated by Xero. If this button is not visible, please review our troubleshooting steps below.



***

## Contact matching & creation

When creating an invoice, we first attempt to associate it with the correct Xero contact using the customer details from the SparkLayer order.

### How contact matching works

Contacts are matched in the following order:

1. **Account number match&#x20;**- we check for an existing Xero contact with an account number that matches the accounting ID configured against the customer in SparkLayer. [Read more on how to configure accounting IDs](https://docs.sparklayer.io/account-and-addresses#advanced-account-settings)
2. **Email match&#x20;**- If no account number match is found, we attempt to match using the customer’s email address.

If a match is found for either of these conditions, the invoice is associated with the matching contact.&#x20;

### Multiple contacts for a single email

In SparkLayer, email addresses are unique - only one customer account can exist per email address.  In Xero, email addresses are not unique, meaning multiple contacts can share the same email.

If multiple Xero contacts exist for the customer’s email address, we will create the invoice for the first matching contact returned by Xero.

:::hint{type="warning"}
**Please note**
If your organisation uses multiple contacts with the same email address, we recommend configuring unique account numbers for each contact to ensure reliable matching.
:::

### Automatic contact creation

If no existing contact can be matched using the methods above, SparkLayer will automatically create a new contact in Xero using the customer data from the order. This behaviour is controlled by the **Automatic Contact Creation** setting in your integration configuration. &#x20;

### Data synced on contact creation

When a contact is created in Xero, the following information is synced once and is not automatically updated if changes occur later in SparkLayer:

- Company name
- First name & last name&#x20;
- Email address&#x20;
- Billing & shipping address (based on the order being invoiced at the time of matching)&#x20;
- Payment terms (if configured via the payment terms metafield). Contacts are created using Xero’s *days after bill date* payment term type.

### Unique contacts in Xero

Xero requires each contact **name** within an organisation to be unique. To ensure successful contact creation, we use a multi-stage naming strategy when creating new contacts.

**Contact creation stages:**

- **Stage 1:&#x20;**&#x49;f the [SparkLayer Company Name ](https://docs.sparklayer.io/account-and-addresses#advanced-account-settings)metafield is populated, this is used as the contact name.
  *Example: “The Company”*
- **Stage 2:&#x20;**&#x49;f a contact with this name already exists in Xero, we append the customer’s first and last name.
  *Example: “The Company (Jane Doe)”*
- **Stage 3:&#x20;**&#x49;f the above name is also already in use, we fall back to using only the customer’s first and last name.
  *Example: “Jane Doe”*

If all of the above naming conventions fail to create a unique contact in Xero, to ensure an invoice is created we'll attempt each again but with a timestamp appended to the end. *Example:* "*The Company (20260520093837)*"



***

## Payment Visibility

If [payment visibility](https://docs.sparklayer.io/payment-methods#payments-visibility) is enabled in your SparkLayer Dashboard configuration then you will see any payments made against invoices in Xero reflected as transactions on the order in SparkLayer.

We track the following Xero payment types as transactions on orders:

- Payments / Offline Payments
- Credit Notes applied to invoices
- Overpayments applied to invoices

All payment types will be displayed as transactions on the order and modify the balance due on the order held in SparkLayer.

:::hint{type="info"}
**Please note**
Even if the payment visibility setting is **disabled&#x20;**&#x77;e will continue to track Xero payments as transactions on SparkLayer orders in the background.
:::

### Refunds

We do not currently track refunds on card payments as refunds are not typically applied directly to an invoice but instead reflected as a credit note on the customer account.

We do however track when any of the above payment types are removed from an invoice, and reflect this accordingly on the order in SparkLayer.

### Credit Limits

As SparkLayer tracks payments made against invoices, if you have configured credit limits and account balances as outlined in [Credit, Net Terms, & Invoicing](docId\:yWm70oQUosyKOoIqb4Z4G), any payments made on Xero invoices for **Payment on Account** orders will automatically modify the customers unpaid balance accordingly.

:::hint{type="warning"}
**Xero Contact Credit Limits**
In Xero you ahve the ability to set credit limits for contacts. Unforunately this information is not exposed in the Xero APIs. As a result, we’re unable to automatically sync credit limits configured in Xero with customers in SparkLayer.

To apply credit limits to customers, you will need to follow our documentation on[Credit, Net Terms, & Invoicing](docId\:yWm70oQUosyKOoIqb4Z4G)
:::

### Credit Notes

Whilst we are able to sync credit that's been applied to invoices as a payment, we are currently unable to reflect any unallocated credit held against the contact record in Xero, against the customer balance in SparkLayer.

Currently, in order to keep these in sync we'd recommend manually modifying the balance on the customers metafield to reflect any unallocated credit. Once you have allocated the credit to an invoice, you will then need to modify the balance back accordingly.



***

## Disabling the integration

To disable the integration, log in to your SparkLayer Dashboard and navigate to **Integrations → Partner Integrations → Accountancy → Xero**, then toggle the integration off.

To disable the integration, log in to your SparkLayer Dashboard and navigate to **Integrations → Partner Integrations → Accountancy → Xero**, then toggle the integration off.

:::hint{type="warning"}
**Please note**
If the integration is disabled, all related features will stop working.

- No invoices will be created for orders placed while the integration is disabled.&#x20;
- Customers will no longer be able to access their Xero invoices via the link in their **My Account** section.
:::



***

## FAQ's

:::ExpandableHeading
**How do I disconnect from Xero?**

To disconnect from your Xero organisation from SparkLayer you will need to login to your SparkLayer Dashboard and navigate to **Integrations -> Partner Integrations -> Accountancy -> Xero&#x20;**&#x74;hen disable the integration. This will remove the connection from your Xero organisation. Please read further information here on what happens when the integration is disabled [here](https://docs.sparklayer.io/xero#OjTtC).
:::

:::ExpandableHeading
**Does the integration work for D2C orders?**

No. The integration only supports B2B orders that are created through your platforms connection with SparkLayer. Direct-to-consumer (D2C) orders are not included in the sync and will not be pushed to Xero as invoices.
:::

:::ExpandableHeading
**What level of access does the integration require in Xero?**

When connecting SparkLayer to your Xero organisation, you’ll see a list of the exact permissions requested. We follow Xero best-practice and only ask for the minimum access needed for the integration to function. Currently, this includes:

- **View & manage contacts** - To match invoices to existing contacts and create new contacts for SparkLayer customers if your integration configuration allows.
- **View & manage business transactions** - To create invoices in Xero for SparkLayer B2B orders and in the future, view payments made on invoices.
- **View organisation settings** - To read configuration details such as global payment terms when calculating invoice due dates.
:::



***

## Troubleshooting

Below are some common issues and steps to help resolve them. If your issue isn’t listed, or the problem persists after following these steps, please contact our support team.

:::ExpandableHeading
**Customers cannot access their invoice from the My Account section**

If links to invoices are not showing in a particular customers My Account section, it could be due to a number of reasons.

- Ensure the integration is enabled in the SparkLayer Dashboard by navigating to **Integrations -> Partner Integrations -> Accountancy -> Xero**.
- Ensure the order is in a `processing` or `shipped` fulfilment status. We **do not&#x20;**&#x63;reate invoices for orders which are in the `awaiting merchant` status.
- Ensure an invoice exists in Xero for the given order. In some cases it may take a little time for orders to sync across. If there appears to be a large delay, or an invoice has not been created, please contact support, providing the customer and order id.
- Ensure the invoice is not in a **draft&#x20;**&#x73;tatus. Xero does not provide public urls for invoices which are in a **draft&#x20;**&#x73;tatus.

If you are still experiencing issues after checking the above, or invoice urls are not showing for **all&#x20;**&#x6F;f your customers, please contact support.
:::

:::ExpandableHeading
**The address on the invoice is different to the address the customer used during checkout**

The address(es) used on an invoice in Xero come directly from the related contact record. Whilst in SparkLayer we allow for a customer to have multiple billing & shipping addresses, Xero only offers support for a single billing and shipping address per contact record.

We will only use the addresses held in SparkLayer if we create the contact as part of the contact matching and creation flow detailed above. If any of these addresses change after the contact has been created, we will not automatically update them.
:::



***

## Known limitations

Please note the following:

- Multiple tax rates per line item are not currently supported.
- Invoice creation in Xero is one-way. Any changes made to invoices in Xero, such as modifications to line items or customer details will **not&#x20;**&#x62;e reflected back in SparkLayer or your platform.

[title] Shopify Reporting & Filtering
[path] Integrations/Shopify/Shopify Customisations/

## Introduction

Because SparkLayer works as a [Sales Channel](https://help.shopify.com/en/manual/online-sales-channels) within Shopify, it makes filtering and reporting by SparkLayer orders easier. In most areas of the Shopify Admin, it's possible to filter by Sales Channel and, in the case of SparkLayer, you simply need to filter by Sales Channel **B2B Ordering** to apply specific filters.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/uQ0iwPxNyNjZkIC69HWjW_image.png "Filtering data in Shopify by the B2B Ordering Sales Channel")

As well as this, SparkLayer also adds tags and additional data against orders placed by B2B customers and this can also be a used to generate reports within Shopify.

| Attribute | Notes                                                                                                                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tag`     | A tag of `b2b` is added to any order placed via SparkLayer. This is particularly useful for filtering and segmenting orders, or even adding more advanced automations                               |
| `note`    | Order Note: `sparkCartId`<br />This is added as an **order note.**<br />This is primarily for internal use for debugging                                                                            |
| `note`    | Order Note: `sparkPaymentType`<br />This is added as an **order note.**<br />This contains the name of the payment option used:<br />* upfrontPayment
* paymentOnAccount
* paymentByInvoice
* quote |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/_l_V7z7BG7Ppqn-68KYa4_image.png)






[title] Shopify Companies
[path] Integrations/Shopify/

## Introduction

:::hint{type="info"}
**Please note**
It is not necessary to use Shopify Companies alongside SparkLayer. This guide gives an overview of how SparkLayer works alongside Shopify Companies.
Using Shopify Companies may incur additional transaction costs from Shopify and we recommend speaking to Shopify Support to confirm.
:::

SparkLayer and Shopify's "Companies" feature are **two different systems for managing B2B customers**. They don't currently share data - but we're actively building compatibility so they can work alongside each other.

If you're a SparkLayer merchant, your B2B customer management, pricing, and ordering continues to work exactly as it does today. Shopify's Companies feature doesn't interfere with SparkLayer - but you should understand how the two systems relate.



***

## What Is Shopify Companies?

Shopify has expanded its native B2B features to all plan tiers. At the core of this is the **Companies** feature (found at Customers > Companies in your Shopify admin).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fROLYnOOWrkzH48qQ5uXu_image.png)

A Shopify Company is a structured record that represents a business you sell to. It includes:

- **Company profile** - the business name, tax ID, and general information
- **Company locations** - physical locations (offices, warehouses, branches) with their own shipping/billing addresses
- **Customers** - individual buyers linked to a company location, each with their own login and permissions
- **Catalogs** - pricing and product visibility assigned to the company or location
- **Payment terms** - net terms, deposit requirements, and checkout rules per company

When a B2B customer logs in via Shopify's native B2B, they select their company and location, and Shopify automatically shows them the right pricing, products, and payment options.



***

## How SparkLayer Works

SparkLayer uses a **tag-based system** to identify and manage B2B customers. Instead of Shopify's Company → Location → Customer hierarchy, SparkLayer works like this:

- **Customer tags** in Shopify identify which customers are B2B buyers
- **Customer groups** in SparkLayer define pricing tiers, payment methods, and rules
- Customers are assigned to groups, and those groups control their B2B experience
- SparkLayer overlays a full B2B frontend on top of your existing Shopify theme

This means SparkLayer doesn't use Shopify's Company or Company Location records to determine who sees what pricing. You can learn more [in our guide here](docId:5_lWMNohhjBJJppg9E6Vh).&#x20;



***

## Do They Conflict?

**No.** SparkLayer and Shopify Companies can coexist on the same store without breaking anything. However, they currently operate independently:

- SparkLayer reads **customer tags** to identify B2B buyers and assign them to groups
- Shopify's native B2B reads **Company records** to determine pricing and catalogs
- If a customer is set up in both systems, each system handles them separately

The important thing to understand: **SparkLayer does not currently read from or write to Shopify's Company, Company Location, or Catalog records.** Your SparkLayer pricing, groups, and ordering features are managed entirely within SparkLayer.



***

## Draft Order Company Association

When SparkLayer creates a draft order on behalf of a B2B customer, it **associates that order with the correct Shopify Company, Contact, and Location IDs**. This means:

- B2B orders created through SparkLayer appear correctly under the Company in Shopify's admin
- Order attribution is accurate - Shopify's reporting recognises these as B2B orders from a specific company
- This addresses the Shopify warning: *"Some apps may not attribute B2B orders correctly on your current plan. Check that B2B orders are assigned to a company, not just an individual customer."*

### How It Works

1. B2B customer places an order via SparkLayer
2. SparkLayer creates a draft order in Shopify
3. The order is linked to both the **customer** AND their **Shopify Company and Location**
4. In Shopify's admin, the order appears correctly under both the customer and the Company

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Hi-yWVO98OJEvOMESZ2OG_image.png)



***

## What You Need to Do

**If you're an existing SparkLayer customer:**

**Nothing changes with your B2B setup.** SparkLayer continues to manage your customer groups, pricing, and ordering independently of Shopify's Companies feature.

The company association feature is now live - if your Shopify customers are linked to Company records, SparkLayer will **automatically** associate draft orders with the correct Company and Location. To take advantage of this:

- Ensure your B2B customers in Shopify are linked to the appropriate Company records
- Orders placed through SparkLayer will then appear under the Company in Shopify's admin
- No additional SparkLayer configuration is needed

**If you're setting up SparkLayer for the first time:**

You can set up Shopify Companies alongside SparkLayer from day one. The two systems work independently, and SparkLayer's company association ensures orders are attributed correctly from the start.

**Do I need to create Shopify Companies?**

It depends on your needs:

- **If you want Shopify's admin to show B2B orders grouped by company** → Yes, create Company records for your B2B customers. When SparkLayer's company association feature goes live, orders will be linked automatically.
- **If you only use SparkLayer for B2B management** → Company records are optional. SparkLayer's customer groups handle everything.
- **If you want the best of both worlds** → Create Company records for reporting and admin organisation, and use SparkLayer for the full B2B ordering experience.



***

## Vaulted credit cards

Because SparkLayer associates draft orders with the correct Shopify company and location, your B2B customers can take advantage of [Shopify's vaulted credit card](https://help.shopify.com/en/manual/b2b/checkout-and-orders/vaulted-cards) feature - allowing them to securely save a card once and reuse it across future orders without re-entering payment details.

### How it works

Shopify's vaulted cards **are tied to a company location.&#x20;**&#x57;hen a customer saves a card - either at checkout or through their customer account - that card becomes available to any customer linked to the same company location.

With SparkLayer, vaulted cards work in two ways:

**Pay online by card**
When a B2B customer checks out via SparkLayer and selects **"Pay Online by Card"**, any vaulted cards saved against their company location will appear as a payment option. The customer can select a saved card to complete the order without re-entering their details.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/l4AXzKRakjLBupjbeVG7y_image.png)

**Draft orders and invoices**
When a customer places an order using another payment method in SparkLayer (e.g. pay by invoice), the **resulting draft order** in Shopify can have a vaulted card charged against it. This means you can collect payment on invoice orders directly from the Shopify admin using a card already on file.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Qd27EZFZfOI32p8CHMh8-_image.png)

### Getting started

To use vaulted cards with SparkLayer, you need the following in place:

1. **Shopify Payments must be enabled** - Vaulted cards require Shopify Payments as your payment provider.
2. **Customers must be linked to a Shopify company** - The customer's account in Shopify needs to be assigned to a company record. SparkLayer's company association feature handles the order attribution, but the customer-to-company link must exist in Shopify's admin.
3. **A card must be saved** - A customer within that company location needs to have saved a card during a previous checkout, or added one via their customer account. Once saved, the card is available to all customers at that location.

No additional SparkLayer configuration is needed. As long as your customers are linked to Shopify company records and Shopify Payments is active, vaulted cards will work automatically during the SparkLayer checkout process.

### Controlling access&#x20;

If you want to prevent certain team members from using vaulted cards, SparkLayer's [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ) feature gives you a simple way to do this. When a company user is assigned the "Limited" role, they can browse products and build an order - but they can't complete the checkout themselves. Their order is sent to the main company user for approval instead. Because limited users never reach the Shopify checkout, they won't have access to any vaulted cards saved against the company location. This makes the limited role an easy way to restrict who can charge a saved card while still allowing them to participate in the ordering process.

:::hint{type="info"}
**Please note**
Vaulted cards are available on all Shopify plan tiers that support the companies feature. We recommend confirming any transaction fee implications with Shopify support, as using Shopify companies may incur additional costs depending on your plan.
:::



***

## Limitations

While SparkLayer now supports Shopify Companies for order attribution, there are some scenarios to be aware of:

- **Multiple companies or locations:** If a customer is connected to more than one Shopify Company, or to multiple locations within a company, the draft order will not be placed against a company. SparkLayer requires a single, unambiguous company-location match to associate the order correctly.
- **Company records must exist first:** SparkLayer doesn't create Shopify Company records - it reads them. If a B2B customer doesn't have a Company record set up in Shopify's admin, the order will be linked to the customer only (as before).
- **SparkLayer doesn't read Shopify catalogs or payment terms:** Pricing, product visibility, and payment rules are still managed entirely within SparkLayer's customer groups. Shopify's catalog assignments and payment term settings on Company records are not used by SparkLayer.
- **No two-way sync between systems:** Changes made in SparkLayer's customer groups (adding a price list, changing a payment method) are not reflected in Shopify's Company records, and vice versa. The two systems are linked for order attribution but managed independently.
- **Customer must be linked in Shopify:** The customer placing the order must be associated with a Company record in Shopify's admin. If the customer exists in SparkLayer's customer groups but isn't linked to a Shopify Company, the association won't happen.



***

## Migrating Companies to Customers

If you'd prefer to manage your B2B customers entirely through SparkLayer's tag-based system and don't need Shopify Company records for reporting, you can remove customers from Companies and convert them to regular Shopify customers. This simplifies the setup and avoids any potential conflicts between the two systems."

:::ExpandableHeading
**How to migrate a customer manually**

The easiest way to migrate a customer is to go into a company record within Shopify and, in the right hand side, click the "Remove customers" button. This will then allow you to remove a customer from the company record.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7osSS_Tbf7_D4NVjDCnIv_image.png)

Next, go to the "Customers" area of Shopify and locate the customer. From the top right, click "Send account invite". When you click this button, this will then send the customer an "activation email", allowing them to set a password (not a 6 digit code) and subsequently be able to login to your store.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/QW_ZypDiRCK-oa7KU4ifN_image.png)
:::

:::ExpandableHeading
**How to migrate a customer in bulk**

If you're looking to migrate customers in bulk, our recommended approach is to the Shopify App, [Matrixify](https://apps.shopify.com/excel-export-import?st_source=autocomplete). Built-in to this tool is the ability to bulk 'Un-assign" customers from a Company by **deleting** the Company, converting them into regular customers (who you can subsequently invite to your store).

To get started, set up a new export and specify "**Companies**" as the source "**Sheet**"

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/90TrjQFeGSLJy1z9Hjy6S_image.png)

Within the exported file, you'll see a column "Command" with an entry of "MERGE" next to each Company record.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fZr_5tVdB2aPd28mkPcrw_image.png)

Simply update the column "Command" to "DELETE" and re-import the file into Matrixify.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5cEj5-al6MCFkXF4c4uhB_image.png)

This will then fully delete the Company record from Shopify and all associated customers will then become regular customers. You can then individually invite the customers (see above), or even use Matrixify to bulk activate and invite your customers in one go.
:::



***

## FAQs

:::ExpandableHeading
**Will SparkLayer break if I enable Shopify's B2B features?**

No. SparkLayer operates independently. You can enable Shopify's Companies feature without affecting your SparkLayer setup.
:::

:::ExpandableHeading
**Can I use both SparkLayer and Shopify's native B2B at the same time?**

SparkLayer and Shopify's native B2B checkout cannot run simultaneously for the same customer session - it's one or the other for the ordering experience. However, you can have Shopify Companyrecords set up for admin/reporting purposes while using SparkLayer for the actual B2B ordering.
:::

:::ExpandableHeading
**Should I allocate tags to customers or set up Shopify Companies?**

For SparkLayer to work, you need **customer tags** - this is how SparkLayer identifies B2B buyers. Shopify Company records are optional but recommended for better order attribution and admin organisation. Both can coexist.
:::

:::ExpandableHeading
**Do I need Shopify Markets to use Shopify Companies?**

Companies and Markets are technically separate features, but on non-Plus plans they're closely linked.

You can create Company records in Shopify's admin without enabling Markets - they work as structured customer profiles with locations, contacts, and payment terms. However, to assign pricing catalogs to those companies, you need Markets. On Basic, Grow, and Advanced plans, catalogs are assigned through Markets (customer groupings), not directly to companies. So you can have Companies without Markets, but they won't have custom pricing - which limits them to an admin organisational tool.

On Shopify Plus, you can bypass Markets entirely and assign catalogs directly to individual company locations. This is the only plan where Companies and catalogs work independently of Markets.

SparkLayer doesn't use either system for pricing. Your customer groups, price lists, and payment methods are managed entirely within SparkLayer, regardless of whether you have Markets or Companies enabled in Shopify.
:::

:::ExpandableHeading
**What about that Shopify warning about apps not attributing B2B orders correctly?**

This is already handled. SparkLayer now correctly associates draft orders with the relevant Shopify Company and Location, ensuring accurate B2B order attribution in Shopify's admin. As long as your B2B customers are linked to Company records in Shopify, orders placed through SparkLayer will appear under the correct Company.
:::

:::ExpandableHeading
**When will company association be available?**

It's live now. No additional configuration is needed on the SparkLayer side - just ensure your Shopify customers are linked to the appropriate Company records.
:::


[title] WooCommerce FAQs
[path] Integrations/WooCommerce/

## Introduction

We've included some of our most commonly asked questions below. If you can't find the answer you're after, please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.



***

## Frequently Asked Questions

### Plans and pricing&#x20;

:::ExpandableHeading
**Which SparkLayer plans do you offer for WooCommerce?**

All SparkLayer plans are compatible with WooCommerce, from "Starter" right through to "Enterprise". [Learn more](https://www.sparklayer.io/pricing/) about our plans and pricing.
:::

:::ExpandableHeading
**How does billing work?**

When you sign up to SparkLayer, billing is managed via the SparkLayer Dashboard under Acccount > Plan
:::

### WooCommerce setup

:::ExpandableHeading
**Where do I find the SparkLayer WooCommerce app?**

Currently, SparkLayer can only be setup on your WooCommerce store by registering directly via [SparkLayer](http://app.sparklayer.io/register)
:::

:::ExpandableHeading
**What WooCommerce plan do I need to be on to use SparkLayer?**

You must already have [WooCommerce](https://woocommerce.com/) installed on your Wordpress website

- WooCommerce: version 9 and above
- Wordpress: version 6 and above

If you're using a "Block theme", SparkLayer can be automatically installed (otherwise this is a manual installation process).
:::

:::ExpandableHeading
**Can I have DTC and B2B on the same store?**

Yes, it's possible to install SparkLayer onto your existing WooCommerce DTC store (i.e. retail), meaning you can run both DTC and B2B on the same store. We call this a 'hybrid setup'; when your B2B customers sign in, they simply see the special SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) interface that allow them to see their prices and place orders.

If you want to see this in action, you can try our [B2B/B2C demo store here](https://demo.woocommerce.sparklayer.io/)
:::

### Store setup

:::ExpandableHeading
**Can you help me install SparkLayer on my WooCommerce website?**

By default, the SparkLayer widges will be automatically installed on your store. If you do require assistance, you can [contact our support team](docId\:NNUw1G9z7eaJ4M78vk7t9) and we will be happy to advise.
:::

:::ExpandableHeading
**Does SparkLayer work on any WooCommerce theme?**

You must already have [WooCommerce](https://woocommerce.com/) installed on your Wordpress website

- WooCommerce: version 9 and above
- Wordpress: version 6 and above

If you're using a "Block theme", SparkLayer can be automatically installed (otherwise this is a manual installation process).
:::

:::ExpandableHeading
**How does SparkLayer affect my current WooCommerce theme?**

The SparkLayer B2B widgets, including B2B pricing, cart and my account area, are only loaded once a customer who has been added to a B2B customer group successfully signs in to your store.

For all other users, your store will remain completely unaffected.

This allows you to have full control over which customers are able to see your B2B pricing and place B2B orders.
:::

:::ExpandableHeading
**What if I'm already using a wholesale B2B app on my website?**

If you already have a B2B / Wholesale app installed on your store, SparkLayer can work alongside this. It's a great way to test out SparkLayer and, once you're happy, you can simply uninstall any previous B2B apps you were using. If your previous B2B app has made code changes to your WooCommerce store, you may want to ask the app developer to remove these although this is optional.
:::

### Payments

:::ExpandableHeading
**Can I use my existing payment methods on the checkout?**

If your customers choose "Pay Online by Card" during the SparkLayer checkout process, they will simply be taken to the WooCommerce checkout. From there, any payment methods you have set up in WooCommerce (e.g. Paypal, Affirm Pay) will show up, allowing the customers to pay by this method.&#x20;

In short, if WooCommerce support specific payment methods, your B2B customers could select it during the checkout providing they choose "Pay Online by Card".
:::

### Products

:::ExpandableHeading
**How do I hide products or set up B2B-only products?**

There are a few things we recommend to make the experience better:

You could **create a B2B-only collection** and redirect customers to this once they login.&#x20;

You could also configure your WooCommerce theme to hide and show products based on tag via custom coding.


:::

:::ExpandableHeading
**Can I use my WooCommerce prices for my B2B pricing?**

Yes! SparkLayer allows you to automatically synchronise your WooCommerce prices (e.g. your main WooCommerce retail price), making it really easy to set up B2B pricing for your customers. For example, you could set your B2B prices to be 20% off your WooCommerce prices and we can even make provisions for your tax set up in WooCommerce (e.g. exclusive or inclusive of tax).
:::

:::ExpandableHeading
**How do I set up pre-order and backorder products?**

In terms of pre-ordering, SparkLayer has full support for different stock status messages and it's possible to set up products as pre-order/back-order easily - it does rely on some configuration within WooCommerce, but it's relatively easy to do!

We've [full information here](docId\:Gj_Ao_gQ6oA-jx0D27Hys) on how it works and you can even set up "due in" dates to give your customers visibility.
:::

:::ExpandableHeading
**Do I need to use product SKUs?**

In terms of product SKUs, SparkLayer relies on these being added to your products within Wix so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.

If you don't already have SKUs in Wix, it's relatively quick to do. You can either edit individual products and add them manually, or you can use Wix 'Import' or 'Edit products' feature to do this in bulk.
:::

:::ExpandableHeading
**How do I show inventory (stock) levels?**

It's possible to show inventory levels and a stock status when your B2B customers log in. You can learn more about how to enable this in [our guide here.](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;
:::

::::ExpandableHeading
**How do I restrict B2B customers from DTC inventory (and vice versa)**

If you're installing SparkLayer on a single website and you are looking to run both DTC and B2B at the same time, it will be necessary to **use the same stock pool&#x20;**&#x62;ehind the scenes. From an inventory point of view, this essentially means that both DTC and B2B customers will be ordering from the same stock source which can pose challenges.&#x20;

:::hint{type="info"}
**Important**
It is not possible to block DTC customers from ordering from your inventory and there is no mechanism in WooCommerce to do this. If you are wanting to implement this, you will need to consider:

- Creating B2B-specific products on your store&#x20;
- Creating a separate store just for your B2B customers, effectively separating out your inventory completely.&#x20;
:::


::::

### User Experience

:::ExpandableHeading
**How do I set up a B2B registration form?**

If you're looking to enable a wholesale/B2B registration form there are a few good options for this and

In summary, these are the options we recommend:

- You could use your current login/registration page and enhance the registration page with some additional fields
- You could create a brand new registration page and direct prospective B2B customers to this.&#x20;

It's also worth noting that you can manually add customers via the admin by going to **Wordpress/WooCommerce > Users** and from there you could moderate your wholesale applications.
:::

:::ExpandableHeading
**How do I invite a B2B customer to my website?**

When you're ready to invite your B2B customers to begin using your store, there are a variety of ways you can do this.&#x20;

You could  think about sending a marketing newsletter to your customers to notify them of your new B2B store and to sign in. We also have some example messaging you can use when inviting your customers and you can explore more in [our guide here](docId\:YUfghEGoxe_h7uJfcshna). &#x20;
:::

:::ExpandableHeading
**Will SparkLayer slow down my WooCommerce website?**

No. For performance, the SparkLayer Frontend only loads when a valid B2B customer successfully logs into a website; for your standard (DTC) customers, no code is loaded at all. When a B2B customer logs in, all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.
:::

:::ExpandableHeading
**How do I setup B2B-specific content on my WooCommerce website?**

This is possible but would require custom coding. We recommend consulting with a WooCommerce expert developer before making changes to your website.&#x20;
:::

### Orders

:::ExpandableHeading
**Where do I find my B2B orders in WooCommerce?**

| Payment Method                    | Notes                                                                                                                                                                                             |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment by Invoice`              | The order will be created within **WooCommerce > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means) |
| `Payment on Account`              | The order will be created within **WooCommerce > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means) |
| `Upfront Payment (Card payments)` | The order will be created within **WooCommerce > Orders** with a payment status of "PAID". You can then proceed to fulfil the order.                                                              |
:::

:::ExpandableHeading
**How do I edit orders?**

It is possible to edit orders within WooCommerce when an order is placed via SparkLayer providing payment hasn't already been processed. From WooCommerce > Oders, navigate to an order. You'll then see the option to **Edit order** allowing you to make changes.
:::

:::ExpandableHeading
**How do I send an invoice?**

In terms of invoicing, SparkLayer doesn't send invoices directly.

When sending an invoice, this is managed outside of SparkLayer and it will require you to collect payment by your preferred means. Once you've received payment, you can then mark the order as paid within Wix and then fulfil it as normal.
:::

:::ExpandableHeading
**How do I set a minimum order quantity?**

Within SparkLayer, we support the ability to set minimum/maximum order level spends for your B2B customers. You can configure these by going to the [Customer Groups](https://app.sparklayer.io/customers/groups) area of the SparkLayer Dashboard.
:::


[title] Shopify Error Codes
[path] Integrations/Shopify/

## Introduction

If SparkLayer detects an error on your Shopify store, you may notice one of the following error codes display within the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-). We've detailed the most common errors along with the associated way to resolve them.

## Error codes

:::hint{type="danger"}
- **SHOPIFY:001&#x20;**&#x59;ou've assigned a price list in a specific currency (e.g. AUD) to a B2B customer but this currency has not been enabled in your [Shopify Markets & Currencies](docId\:vex5XjFlT6Pvb0AzhlKQD). In a market that includes multiple countries / regions, there is a setting to "Show prices to customers in their local currency". SparkLayer does not currently support this setting and **it will need to be disabled** for B2B customers in this market to successfully place orders.
- **SHOPIFY:002** You've assigned a price list in a specific currency (e.g. AUD) to a B2B customer but the destination shipping country isn't set up in your [Shopify Markets & Currencies](docId\:vex5XjFlT6Pvb0AzhlKQD).
- **SHOPIFY:003** There's an issue with your product data such as a missing variant SKU for the product in your order. Try removing the affected product from the order.
- **SHOPIFY:005&#x20;**&#x54;he email being used for the order is failing "DNS checks" by Shopify and is being restricted from checking out. Try checking the email address to ensure it is valid.
- **SHOPIFY:006&#x20;**&#x59;ou're trying to checkout with a shipping address in a country that is not in any of your store's configured Shopify Markets. Please ensure all available shipping countries have an associated Shopify Market set.
- **SHOPIFY:007** You're trying to checkout but your customer record is missing either an email address, shipping phone number, or shipping address. These are all required for stores using Managed Markets.
- **PRICING:001&#x20;**&#x54;he B2B customer has two price lists assigned to their customer group with different currencies (e.g. GBP and USD). Try changing their customer group settings to ensure only one currency type is assigned.
:::


[title] Installing SparkLayer on Wix
[path] Integrations/Wix/

## Introduction

SparkLayer enables B2B functionality on your existing Wix store, allowing your B2B customers to login, place orders, manage their account, and much more.&#x20;

:::hint{type="success"}
**👋 We're here to help!**
Our team can help get everything set up on your Wix store. You can [book a call here](https://connect.sparklayer.io/onboarding-meeting) and we'll walk you through the process! If you'd prefer, you can also use our guide below to try setting things up yourself.
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vWNSkcGu-6SYP5BrvL_hF_image.png)



***

## ⚠️ Requirements - important!

Before installing SparkLayer on your Wix store, please ensure the following are setup before proceeding:

| Item                   | Details                                                                                                                                                                                                                                                           |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Site Member Settings` | You’ll need to make sure that your store is set up to allow "Site members". You can check this within your admin by going to **Settings >** **Site Member Settings > Signup & Login Security**. Under "Who can be a site member", select "Everyone who signs up". |
| `Product SKUs`         | In order for SparkLayer to save B2B prices for your products, all products must have **SKUs**. Within your admin, go to a product and you'll see the option to set a SKU either on a product or variant level. You can learn more about this below.               |
| `Contacts`             | For your B2B customers to see the SparkLayer, they must have a label of `b2b`. You can set this up by going to **Customers & Leads > Contacts** and editing a customer record. You can learn more about this below.                                               |
| `Payments`             | Please ensure you have payment methods enabled. You can check this within your admin by going to **Settings > Accept Payments**.                                                                                                                                  |
| `Shipping`             | In order to place an order, please ensure you have shipping rules set up. Within your admin, go to **Settings > Shipping and Delivery.**                                                                                                                          |

**Areas of Wix Dashboard you'll be using**

As part of setting up SparkLayer, you'll primarily be using the following areas:

| Area       | Details                                                                                                                                                                                                                     |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Products` | This will be used to setup which products you want to make available to B2B customers. See "Setting up your B2B pricing" below.<br /><font color="#9900ef">*In Wix, go to Catalog &gt; Store Products &gt; Products*</font> |
| `Contacts` | This will be used to setup your B2B customers. See "Setting up your B2B customers" below<br />*I*<font color="#9900ef">*n Wix, go to Customers &amp; Leads &gt; Contacts*</font>                                            |
| `Orders`   | This will be used to review and process and orders that are placed by your B2B customers. See "Placing a B2B order" below.<br /><font color="#9900ef">*In Wix, go to Sales &gt; Orders*</font>                              |

:::hint{type="warning"}
**Limitations**
We recommend familiarising yourself with [current limiitations](docId\:DKZzbjeYVKG6YrJGVKjpW) of SparkLayer for Wix
:::



***

## 🟢 Quick-start guide

If you're looking to get setup quickly and just review the key steps, you can use our step by step guide below!

:::ExpandableHeading
**See step-by-step instructions (click to expand)**

<font color="#9900ef">**STEP 1 - Install App**</font>
Install the [SparkLayer for Wix App](https://www.wix.com/app-market/web-solution/sparklayer-b2b-wholesale) and select the Wix store you’d like to install on (ensuring it is a **Wix Editor** store).

***

<font color="#9900ef">**STEP 2 - Register with SparkLayer**</font>
Install the app and then register an account with SparkLayer****
**⚠️ IMPORTANT: Please ensure you make a note of the email address and password you use**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfI_AKCpS8BiPE3P4mB1ybiX5SAzYy8VhMcTVVFQ9IROUHQE1uXqKPsvIqaYjggVkQH9h-wdaNdGXr8CRZLCRVrNSGmyL-HMn4FepuIK8se4Q_mG5yu6K0bh6JwokPp5bTC86UkfWzu2LssbiiHrrnAd0Lk?key=RhMN3NgcEKjpHz7xeuQ0--J8)

***

<font color="#9900ef">**STEP 3 - App Onboarding Steps**</font>
You’ll then be taken to an onboarding page where it guides you through setting SparkLayer up.
**⚠️ IMPORTANT: all set up takes place via the&#x20;**[SparkLayer Dashboard](https://app.sparklayer.io/)**&#x20;and NOT in Wix**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcIleyRvOiUfDRz9rPQdZ9fe4S9sfP2p8T6PxIUoFEbe8FCdPEMoO6YXaE-h__ngNlIgagera3S-tc4bC600Cpgp18nEb9jwHnVNTCx-Nyj4wzjY8K_cBUfU9WEZxrD_YYpH936aV1BduvSzhGoteZquAXI?key=RhMN3NgcEKjpHz7xeuQ0--J8)

***

<font color="#9900ef">**STEP 4 - Sign into SparkLayer**</font>
Log in to the [SparkLayer Dashboard](https://app.sparklayer.io/). This is where you will set up B2B pricing and B2B customer rules primarily.&#x20;
⚠️**IMPORTANT: you will be prompted to “confirm your SparkLayer plan”, you can ignore this. This will be relevant in due course once the app is live and merchants want to&#x20;**[select a plan](https://www.sparklayer.io/pricing/)

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdL6bFWKepymYiP-pOwAEAUPwuLa7a1DQTeIZQ7Fj2JIfQRmNVyE1j0kSpodWYxrVbjoCjoKxeT8R_B-DJrFldVuzZESCOYxZBRPwPfbfgQ_RVnRWQkk1y14mGK36OSmcG_Y4YFY64_t8SB2mUue52MFao?key=RhMN3NgcEKjpHz7xeuQ0--J8)

***

<font color="#9900ef">**STEP 5 - Setup B2B Pricing**</font>
Go to the [Price Lists section](https://app.sparklayer.io/pricing/lists) and set up an example price list. For example, you could set up an “automatic pricing” which is 50% off your Wix pricing.
When you click “Create Price List” you’ll be prompted to assign this to your default B2B customer group (this is optional, you can change it later). Depending on your tax setup in Wix, you can also automatically calculate the correct tax rate to set your automatic pricing.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcZs-a5O5D68Tu9fbPpvPdnbCV0tzVUDVHab9q9xI6f9CDS71wWoLHV1entcNfVr2ZSXa8yy8aU5FK18h8aWFaZj4Gt2vVHGTPu_qh9xRTwdEQzBI8Wz2fHXBAGoCZvkB7lZA5Wrx9jydG9A48FTz5bEGeT?key=RhMN3NgcEKjpHz7xeuQ0--J8)

***

<font color="#9900ef">**STEP 6 - Setup B2B Customer Rules**</font>
Go to the [Customer Groups section](https://app.sparklayer.io/customers/groups) where you can configure your B2B customer rules. At a minimum, ensure that a “Price List” has been assigned.
**⚠️ IMPORTANT: You’ll see a column “WIX LABEL”, this is the label you will need to add to your Wix Contacts (‘Customers”) once ready (see step 9 below)**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeSMFssIfMkcEqoYG9X9UEPBJzaj5XivbDZ49IxpNW0GpsJovi4uy4oZcxiinXQGCbebnodcFuSv0LRY_DDCAbGhaTqqL4HUmvdzoh1H42Jl_sLLAFmwD3hQh3Vh9gw8jOlaAlMtNyFLj8oYT8R3l2yhds?key=RhMN3NgcEKjpHz7xeuQ0--J8)

***

<font color="#9900ef">**STEP 7 - Complete Onboarding Steps**</font>
From the main “Home” section, you can check off any steps you take as you go****
**⚠️ IMPORTANT: this step is manual and doesn’t do anything other than mark the step(s) as complete.**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdw77HdDk1J-3wvZT6bGmO_z5dPvCObFNl7RR8ADteeux2DxsIKTw2bFawLiHueHBw-n3P-4YE2MZMG1vamYUm1rIW5kg2fsGuY7ATJKk4nPpdy_Po7sRZmgLvjAU14e1Dn15tKjhS8T3fVP-_k-9Sq9G_t?key=RhMN3NgcEKjpHz7xeuQ0--J8)

***

<font color="#9900ef">**STEP 8 - Product Catalog**</font>
In Wix, go Catalog > Store Products > Products to view your product catalogue. These are the products that show on your Wix Online store.
**⚠️ IMPORTANT: for SparkLayer to show B2B prices, products&#x20;*****MUST*****&#x20;have a&#x20;*****unique*****&#x20;SKU added. If no SKU(s) are added, it will not be possible for B2B customers to purchase.**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeTukLv1XcNgvbvCfM1pc5lmdCy3F5ba8OiQ9p_BY7QBi02CYPMjTS64h3vgfPtA_2qbxYBypQ9R8JFNS8hnyCdh_8S1SPNoJhEyV2iOM2rfVh01dhb6oswl25SPCLJZn8TLin6kHHmCil74sdokPVMaUP_?key=RhMN3NgcEKjpHz7xeuQ0--J8)

***

<font color="#9900ef">**STEP 9 - Setup a B2B Customer**</font>
In Wix, go Customers & Leads. We’re going to create a brand new B2B customer record, click “Create New Contact” and complete the details. ****
**⚠️  IMPORTANT: please ensure that a valid address is added. Make a note of the email address you’ve added as you will need to access this to login.**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXer9bkp3tmqMmgd0y2Hwuv4_2FZZB4xBgTTzy8lrO0Zy6e9gcVUINfXdA3QQbTYjm2vIL2gDZbNuM7ASFVeBUIy0JmGlVBml4XMzG7zccgge1eHZmMEBLezDBjvIEfEdRrsbYl0kujuv1vpQMyjarGoSvrq?key=RhMN3NgcEKjpHz7xeuQ0--J8)

Under “Label”, assign a label of “b2b” to the contact. If you don’t see this, you can view the Contact record and then add it

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXevSyAmlsyboQCSr-XYdZ2fegW_Xe9QJ617NIPd2T2MxjujNT3Qcrnlvx81t4wQvk9bleILeN01cCKRWS5tcuSFArGgyKikGHjr9rhrakcKAV67uqntGFrcQ_D0uEepQk978bdrUpty1tmPbZb_i5MHYisA?key=RhMN3NgcEKjpHz7xeuQ0--J8)

**⚠️  IMPORTANT: Please also note:**

On a new B2B customer (whether new or existing), when they get labelled b2b for the first time:

- SparkLayer will attempt to sync their address only this one time - however, if there are missing required fields (e.g. name, address line, postcode) SparkLayer will not sync the address at all and will not output any sync error logs
- Any subsequent address edits from the Wix dashboard on a Wix contact will **not** sync back to SparkLayer
- Any address book edits from SparkLayer will not sync back to Wix

***

<font color="#9900ef">**STEP 10 - Set Contact as Member**</font>
In Wix, find the contact record and under Member Info, click **Set Contact as Member**

This will then send the contact an email to confirm their account.

**⚠️ IMPORTANT: all contacts must be set as “Members” to sign in as a B2B customer**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdnwgLs78rQNrnXgrPVrCQLlkq3w-h4f1ImoNWq-z1JbVHIstjmlOXqRpyRDf1_ApfmJGNz1-d4ZaSgON4z4lL8vJK0J5VUnv3BYsYNQhXrJzn3A409zLqM1B0Xrbg9aRMKtXkeXmm5rUP799m9tcl6lm9j?key=RhMN3NgcEKjpHz7xeuQ0--J8)

***

<font color="#9900ef">**STEP 11 - Activate Account**</font>****
In your emails, you’ll receive an email from Wix to activate your account.

Click “Create New Password” and follow the instructions.

Customers can also use the “Reset password” feature on the online store to do this.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcv6Le7sEfyoSdWrNYcj8qsKMo2kabpQLQryxSHaqOuZWNNONvjO6OhAEx6SZK3rYXgJ5o6cBM4o1deqaTRcr8U_ZywcgHO9tCPaY3TlvTcWAwlVxtjrbB8meSS7lFXnF50mRdyBHcooGJVjtqJVztEr-d6?key=RhMN3NgcEKjpHz7xeuQ0--J8)

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXd4PhSBYoSKCuhJ9RirOOWMUFPL9Udzr6_95EobH0hid5jyZj8VSoV7hsRradDvNLO35Ew8sWX-mNjQmvzBbtxJC5QEnZ_hjLNYctgPmpNRZMC6vLjh8K8NjtAV7zgumrhuE6jUuFdABWwrAjIvKblW8fp8?key=RhMN3NgcEKjpHz7xeuQ0--J8)

***

<font color="#9900ef">**STEP 12 - Sign in as a B2B Customer**</font>
On your Wix store, sign in with the credentials you’ve created in the previous step.

Next, navigate to a product page. Providing that the product has a valid SKU, you will then see your SparkLayer B2B pricing rules show and you can begin adding products to your order.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdfivK6x_KkHh4rhnaCJyoaGl42J6dZJadXscXi_3rWjNCk29ZF_XR-prHo5igyvNrsh5-IYRezrkL08OfQb34nnyUbk7jcMK3Gz5z9AZINlWQsDKSmgNdj5Dz253UoFSstWjtQz0DLuFVBRqqqkYFhEchm?key=RhMN3NgcEKjpHz7xeuQ0--J8)
:::



***

## 🚢 The Onboarding process

:::hint{type="info"}
**Important**
When setting up SparkLayer, some activities take place via the [SparkLayer Dashboard](https://app.sparklayer.io/) alongside Wix. You'll use the SparkLayer Dashboard primarily for setting up your B2B pricing and B2B customer rules.
:::

When you create an account on SparkLayer, you'll get access to the [SparkLayer Dashboard](https://app.sparklayer.io/). The Dashboard has a customised onboarding process that gently guides you through all the necessary steps before you're ready to start inviting your B2B customers and taking orders on your website.

::::WorkflowBlock
:::WorkflowBlockItem
**🔗 Connecting your Wix store**
This enables SparkLayer to connect to your Wix store and begin synchronising the information it requires.

➡️ [View in dashboard](https://app.sparklayer.io/integrations/platform)
:::

:::WorkflowBlockItem
**📓 Setting up your B2B price lists**
You'll then set up the B2B price lists that you want your customers to see when they login. These can be automated or you can manually upload specific pricing.
➡️ [View in dashboard](https://app.sparklayer.io/pricing)
:::

:::WorkflowBlockItem
**👪 Setting up your B2B customer groups**
You'll then set the ordering rules for your customers such as minimum order values, available payment methods and price lists they are assigned to.
➡️ [View in dashboard](https://app.sparklayer.io/customers/groups)
:::

:::WorkflowBlockItem
**✅ Testing & launching**
You'll then need to run through some final checks (such as placing a test order). Once you're happy, you can then launch SparkLayer and start taking orders!&#x20;
➡️ [View in dashboard](https://app.sparklayer.io/configuration/onboarding)
:::
::::

Let's now dive into each of them!



***

## 🔗 Connecting your Wix store

Once you've installed the [SparkLayer for Wix app](https://www.wix.com/app-market/search-result?query=sparklayer) this step of the onboarding process happens automatically. Once SparkLayer is connected to your Wix store, it will **automatically synchronise product and customer data** and then allow you to upload price lists and customise how you want your B2B customer rules to work.

:::hint{type="info"}
**Installing for the first time?**
When installing for the first time, the process works as follows:

1. You'll need to install the SparkLayer app (much like you would any other app). You can do this within your admin by going to **Apps** and clicking **App Market&#x20;**&#x61;nd then searching for SparkLayer.
2. You'll then be asked to **create an account on SparkLayer**, or sign in if you already have one.&#x20;
3. Finally, you need to confirm acceptance of our billing plan within Wix to begin your free trial
:::

Once the above is complete, you can then return back to the [SparkLayer Dashboard](https://app.sparklayer.io/) to continue with the onboarding process. You can also access the SparkLayer app within your Wix store by going to the **Apps** and clicking **Manage Apps** and clicking the **SparkLayer app** where you'll find a summary of your onboarding process.



***

## 📓 Setting up your B2B pricing

:::hint{type="warning"}
**Please note**
Setting up your B2B pricing happens within the [SparkLayer Dashboard](https://app.sparklayer.io/), not via your Wix admin.
:::

Within the [Price Lists](https://app.sparklayer.io/pricing) area of the SparkLayer Dashboard, you can create and manage your B2B pricing rules.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Cmklo58u5mgFluJjHKGF9_image.png)

SparkLayer allows you to set the following pricing types:

| Type        | Details                                                                                  |
| ----------- | ---------------------------------------------------------------------------------------- |
| `Manual`    | You can manually upload a CSV file with specific prices and even enable quantity pricing |
| `Automatic` | You can use your Wix prices and apply a discount, e.g. 50% off Wix retail prices         |

To get started, please following the below steps:

::::WorkflowBlock
:::WorkflowBlockItem
For any products that you want your B2B customers to be able to buy, these products **must** have unique SKUs assigned. You can check this by going to **Catalogue > Store Products > Products** and editing a product.

For regular products, you'll see the option to add a SKU within the **Inventory and shipping** section.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/AxJLfxEJF7sXxZaqlPmzH_image.png)

For products that have variants (e.g. colour, size), you'll need to edit a variant and add this within the **Product variants** section and ensure the setting **"Manage pricing and inventory for each product variant"** is turned on.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Bc9tuvHqENppsI-okLIej_image.png)
:::

:::WorkflowBlockItem
Next, go to [Price Lists](https://app.sparklayer.io/pricing/lists) within SparkLayer and click "Create Price List" to create your first B2B Price list. You can choose between an automatic or manual price list and configure how this works.
:::
::::

:::hint{type="success"}
**Ready to set your pricing?**
To learn more about pricing, please see our [full guide here](docId\:s8XcbZGxQpgdeIGWtXseT).
:::



***

## 👪 Setting up your B2B customers

:::hint{type="warning"}
**Please note**
Setting up your B2B customer rules happens within the [SparkLayer Dashboard](https://app.sparklayer.io/), not via your Wix admin.
:::

[Customer Groups](https://app.sparklayer.io/customers/groups) let you configure specific rules for your customers, from defining their minimum order values and which price lists they see, through to what payment methods they're allowed to use when checking out.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/yH2lPzBB0tu7XUKXi5gp2_image.png)

Much like with Price Lists, you can fully manage this via the [SparkLayer Dashboard](https://app.sparklayer.io/customers/groups).

To get started, please following the below steps:

:::::WorkflowBlock
::::WorkflowBlockItem
Within Wix, go to **Customers & Leads** and click **Contacts.&#x20;**&#x59;ou can either create a new customer or edit an existing one.

:::hint{type="warning"}
**Please note**
Please ensure that a valid address is added and all address fields are populated. Make a note of the email address you’ve added as you will need to access this to login.
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/yasbN2UmzPABqPUAYyD4R_image.png)
::::

::::WorkflowBlockItem
To synchronise to SparkLayer, the customer must have a label of `b2b` assigned to them and be a **Site Member**.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/wix-admin-labels.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

You can set this up by clicking the **Add Label** button when editing a customer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pclEA1XohgIVsFe-J6qgG_image.png)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/t2Z4CihI4u6oyA1eMDawa_image.png)

:::hint{type="warning"}
**Please note the following on customer groups**

- SparkLayer will only synchronise customers that have a label of `b2b` assigned
- If you have created additional [customer groups](https://app.sparklayer.io/customers/groups) within SparkLayer, please ensure that the labels are added to the contact record in Wix exactly as shown. e.g. `b2b` `b2b-additional-group`
- Customers must be set up as **Site Members** to be able to sign in to your online store.
- When adding a new label in Wix, please ensure that it is not subsequently edited.
:::
::::

:::WorkflowBlockItem
Once your customers have been set up in Wix (i.e. those with a label of `b2b`), and you've assigned the customer group to **at least** one customer, you can then manage specific rules within the [Customer groups area.](https://app.sparklayer.io/customers/groups)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/2uN16n6T_LYeyWMgwx60Y_image.png)
:::

:::WorkflowBlockItem
You'll see a default **Base** customer group that you can use for your B2B customers. If you want to set up additional rules, you can simply click **Create Customer Group** and configure accordingly. For any additional customer groups you create, you'll need to update the labels on the customer record in Wix to match (e.g. `b2b` and `b2b-account`)
:::

:::WorkflowBlockItem
To simulate logging in as a B2B customer, please see **✅ Testing & launching** below.
:::

:::WorkflowBlockItem
You can also check if your customer record is syncing by using the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. Within Wix, navigate to a Contact record that has a label of b2b. Within the URL, you'll see a unique ID at the end of the URL. In the example below, the unique ID is `66b4c99a-3431-47d6-995d-309e4e8c5908`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GVKla6zDdNg2IEVmcqV7m_image.png)

With this unique ID, you can then paste this into the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. If the search results show the customer details, this confirms the customer is synchronosing correctly.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/c5I3ypE5OwwZzNDGPMsaV_image.png)
:::
:::::

:::hint{type="success"}
**Ready to configure your customer groups?**
To learn more about customer groups, please see our [full guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::



***

## 🛒 Placing a B2B order

Once you've logged into your Wix store as a B2B customer, you can then place an order by going to any product page and adding items to your order. When you add items, they will then appear in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) and you can then proceed to checkout to complete the order.

**How payment methods work**

When customers reach the payment step, they'll see a variety of available payment methods and can select their preference.

| Payment method       | Description                                                                                                                                                                                                                                                            |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment on Account` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** needing to enter any payment details.                                                                                                                                           |
| `Payment by invoice` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** having to enter in payment details.                                                                                                                                             |
| `Pay Online by Card` | **👪 For the B2B customer:**<br />The customer will be directed to your **standard checkout process&#x20;**&#x61;nd will be required to make payment right away (e.g. by card or via another payment processor). This is sometimes referred to as "Pro-forma payment". |
| `Request for quote`  | **👪 For the B2B customer:**<br />The customer can submit their order **without** choosing a payment method.                                                                                                                                                           |

**How orders arrive into Wix**

Depending on which [payment method](docId\:ibIKczvHM085BkeJIfFYv) you've selected, orders will arrive into Wix in the following ways:

| Payment Method       | Flow                                                                                                                                                                                                                                                       |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Pay by Invoice`     | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                |
| `Pay on Account`     | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                |
| `Pay Online by Card` | The order will be created within **Sales > Orders** with a payment status of "PAID". You can then proceed to fulfil the order. Note: this is termed "Upfront Payment" within the [Customers](docId:5_lWMNohhjBJJppg9E6Vh) area of the SparkLayer Dashboard |
| `Request for Quote`  | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                |

**"Unpaid" orders and "Paid" orders**

By default **all payment methods** other than Upfront Payment will be generated as "Unpaid" orders.&#x20;

**Wix checkout payment methods**

If a customer selects "Pay Online by Card" (i.e. "Upfront payment"), they'll be directed to the Wix checkout. By default, they will see all Wix payment methods you have set up (e.g. card payment, Paypal, etc).&#x20;

**Additional order details**

When an order is placed via SparkLayer, it will also include the following additional data:

| Attribute | Notes                                                                                                                                                                 |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tag`     | A tag of `b2b` is added to any order placed via SparkLayer. This is particularly useful for filtering and segmenting orders, or even adding more advanced automations |

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jCTKS9eZImZ85w2XOErxs_image.png)



***

## 🛠️ The frontend widgets

When you install SparkLayer on your Wix store, the special SparkLayer widgets are automatically added to **your product detail pages.** There's no coding or configuration to do!

Once set up, your approved B2B customers (see above "Setting up your B2B customers") will then see your B2B pricing and can begin placing orders. You can learn more about how this works in [our guide here](docId\:ccZ1vnH0O6D_722w35Xpa).&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/xOpit3AbQHYG16nn6zmxv_image.png)

**Customising the branding (via CSS)**

By default, the SparkLayer widgets will show with generic fonts and colours, however it is possible to "overwrite" the styling to better match your store by using special CSS rules.

There are a variety of ways to do this via Wix.&#x20;

:::ExpandableHeading
**Using Wix Editor 'Custom Code'&#x20;**

Within your Wix Dashboard, go to **Settings** and then click **Custom Code**.

Clic&#x6B;**&#x20;"Add Custom Code"** and add the CSS into the field named **"Paste the code snippet here".** You'll also need to ensure it is set to **"Load code on each new page"**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TTkYt4gsRSlsfCfBn9FO3_image.png)

For example, you could overwrite the colours and fonts by using the following CSS

```css
<style>
:root {
  /* Set the brand styling */
  --b2b-brand-color: #5b36f5; /* Main brand colour */
  --b2b-brand-color-hover: #82ACFF; /* Main brand colour hover */
  --b2b-brand-font: Roboto, sans-serif; /* Main brand font */
  --b2b-brand-font-heading: Roboto, sans-serif; /* Main brand heading font */

  /* Update colours */
  --spark-default-body-color: #555555; /* Main body colour */
  --spark-primary-color: #000000; /* Main title colour */
  --spark-secondary-color: var(--b2b-brand-color); /* Main highlight colour */
  --spark-link-color: var(--b2b-brand-color); /* Link colour */

  /* Typefaces */
  --spark-font-default: var(--b2b-brand-font); /* Body typeface */
  --spark-font-highlight: var(--b2b-brand-font-heading); /* Highlight typeface */
  --spark-font-weight-default: 400; /* Default font weight */
  --spark-font-weight-medium: 500; /* Medium font weight */
  --spark-font-weight-heavy: 600; /* Bold font weight */

  /* General */
  --spark-border-radius-default: 0; /* Default border radius */
  --spark-drawer-max-width: 700px; /* Width of overlay */
  --spark-drawer-max-width-wide: 1000px; /* Width of overlay in maximised view */

  /* Font sizes */
  --spark-font-default-size: 14px; /* Default font size */
  --spark-font-default-size-small: 14px; /* Default font size - small screens */
  --spark-header-font: var(--b2b-brand-font-heading); /* Header typeface */
  --spark-header-font-weight: 500; /* Header font weight */
  --spark-h1-fontsize: 24px; /* Header 1 font size */
  --spark-h2-fontsize: 22px; /* Header 2 font size */
  --spark-h3-fontsize: 20px; /* Header 3 font size */
  --spark-h4-fontsize: 16px; /* Header 4 font size */
  --spark-h5-fontsize: 15px; /* Header 5 font size */
  --spark-h6-fontsize: 14px; /* Header 6 font size */

  --spark-pricing-fontsize: 16px; /* Font size of pricing */
  --spark-pricing-font-weight: 500; /* Font weight of pricing */
  --spark-pricing-fontsize-small: 14px; /* Font size of pricing on mobile */

  --spark-product-code-fontsize: 16px; /* Font size of product code */
  --spark-product-code-font-weight: 500; /* Font weight of product code */
  --spark-product-code-fontsize-small: 14px; /* Font size of product code on mobile */
  --spark-product-stockstatus-align: flex-start; /* Alignment of stock status for single variants */

  /* Buttons */
  --spark-button-font-family: var(--b2b-brand-font-heading); /* Button typeface */
  --spark-button-color: var(--b2b-brand-color); /* Default sutton colour */
  --spark-button-color-highlight: var(--b2b-brand-color-hover); /* Default button colour hover */
  --spark-button-large-color: var(--b2b-brand-color); /* Large button colour */
  --spark-button-large-color-highlight: var(--b2b-brand-color-hover); /* Large button colour hover */
  --spark-border-radius-button: 0; /* Button border radius */
  --spark-button-font-weight: 600; /* Button font weight */
  --spark-button-text-transform: none; /* Button text transform */
  --spark-button-text-letter-spacing: 0; /* Button letter spacing */
  --spark-button-padding: 1em 2.75em; /* Button padding */
  --spark-button-small-font-size: 16px; /* Small button font size */

  /* Tables */
  --spark-table-border-color: #CCCCCC; /* Table border colour */
  --spark-table-header-background-color: #F1F1F1; /* Table header background */
  --spark-table-header-text-color: #222222; /* Table header font colour */
  --spark-table-header-font-weight: 500; /* Table header font weight */

  /* Product Card */
  --spark-product-card-button-radius: 0; /* Button radius */
  --spark-product-card-button-padding: 0.75em 1em; /* Button padding */
  --spark-product-card-pricing-font-size: 15px; /* Pricing font size */
  --spark-product-card-pricing-font-size-small: 14px; /* Pricing font size on mobile */
  --spark-product-card-select-min-height: 0; /* Set a min-height for select menu */
  }
</style>
```

Once saved, you can then make edits at any point.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Pn1IO65NZxQwNslYcOZy7_image.png)
:::

::::ExpandableHeading
**Using Wix Studio 'Code Mode'**

Within your Wix Dashboard, go to **Site & Mobile App** and then click **Edit Site**.

:::BlockQuote
Within "edit mode", click **Code** in the left navigation. Within the CSS section, you'll see a file global.css that you can use to add our special [CSS variables](docId\:qCt2Zk8wjhYIV2ZbVBJYy) to customise your design.
:::

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/wix-frontend-css02.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

For example, you could overwrite the colours and fonts by using the following CSS

```css
<style>
:root {
  /* Set the brand styling */
  --b2b-brand-color: #5b36f5; /* Main brand colour*/
  --b2b-brand-color-hover: #82ACFF; /* Main brand colour hover */
  --b2b-brand-font: Roboto, sans-serif; /* Main brand font */
  --b2b-brand-font-heading: Poppins, sans-serif; /* Main brand heading font */
  }
 </style> 
```
::::



***

## ✅ Testing & launching

The final step is to run some tests and checks to ensure SparkLayer is fully configured. Within the SparkLayer Dashboard, you'll see a number of [Launch checks](https://app.sparklayer.io/?expand=launch) to perform, from logging in as a B2B customer, through to placing an order.

We recommend following the below steps:

::::WorkflowBlock
:::WorkflowBlockItem
**Set up a customer record**
Within your Wix admin, you'll need to ensure you have an example customer record set up (either a new one or an existing). Most importantly, a customer must be associated with a label of `b2b` and be a Site Member. Any customer that has a label of `b2b` will automatically synchronise with SparkLayer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pclEA1XohgIVsFe-J6qgG_image.png)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/iKKqCk7rxlXCTSM6W-hBi_image.png)
:::

:::WorkflowBlockItem
**Place a test order**
Once you've logged in as a B2B customer (i.e. a customer with a label of `b2b`), proceed to add items to your cart and complete the checkout.

Please see *"Placing a B2B order"* above for more details on how this works.
:::

:::WorkflowBlockItem
**Invite your customers**
When you're ready to invite your B2B customers to begin using your store, there are a variety of ways you can do this. One of the easiest ways is to use the built-in Wix messaging system to simply notify your customer to sign in and begin placing orders.&#x20;

You can access this by going to your Wix Dashboard, clicking **Customers & Leads** and then **Contacts**. You'll see a tab called **Inbox** that allows you to send direct messages.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5kdTEgvaPekbMdybdqosS_image.png)

You could also think about sending a marketing newsletter to your customers to notify them of your new B2B store and to sign in. You can access this by going to your Wix Dashboard, clicking **Customers & Leads** and then **Contacts**. You can then search and filter your customers and click **Send Email Campaign** to send an email.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bQ8LaAASXrGmv2S4ESMlD_image.png)

We also have some example messaging you can use when inviting your customers and you can explore more in [our guide here](docId\:YUfghEGoxe_h7uJfcshna). &#x20;
:::
::::



***

## ⚙️ Advanced configurations

In addition to the above setup, there are a number of other configurations that are possible at this time.

:::ExpandableHeading
**Setting minimum stock levels**

It's possible to set minimum stock level for items you may want to sell as pre-orders. This means that your B2B customers can add products to an order and you can limit how many are available.

To get started, in your Wix Dashboard, navigate to a product. You'll need to ensure **Track inventory** and **Pre-order** are both turned on.&#x20;

Within **Pre-order limit**, simply enter the stock number, e.g. `50`.&#x20;



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/50oDrGi2PgEBtMkxnWs73_image.png)
:::

:::ExpandableHeading
**Adjusting tax settings**

SparkLayer supports tax calculations and simply 'inherits' the rules you've set up in your Wix Dashboard. You can learn more about how tax works [in this Wix guide](https://support.wix.com/en/article/including-tax-in-the-product-price).

One key configuration you may want to check is how Tax is calculated during the checkout. From your Wix Dashboard, go to **Settings > Tax** and you can amend accordingly.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VD10eWtb7K39NbYcGOCjN_image.png)
:::

:::ExpandableHeading
**Enabling SparkLayer JavaScript modifications (e.g. checkout customer fields, language updates)**

SparkLayer supports a range of advanced configurations that rely on updating JavaScript via **"Spark Options"**. Within our [Configurations](docId\:SBEaOaCq_A7FfbTatX8bD), you can apply any of the modifications by updating the code within your Wix store.&#x20;

To get started, go to **Settings > Custom Code** and then click **Add Custom Code**. You can then paste in any JavaScript as required. For example, the below sample enables a special checkout custom field to collect a Delivery Date.

```javascript
<script>
  window.sparkWixOptions = {
  termsAndConditionsLink: "/policies/terms-of-service",

    checkoutCustomElements: [
      {
        name: 'shipping-date',
        translations: {
          en: {
            title: 'Preferred Shipping Date',
            detail: 'Shipping unavailable on weekends.',
          },
        },
        attributes: {
          required: true,
          type: 'date',
        },
      },
    ],
  };
</script>
```
:::

:::ExpandableHeading
**Enabling a URL redirect when signing in&#x20;**

SparkLayer supports a range of advanced configurations that rely on updating JavaScript via **"Spark Options"**. Within our [Configurations](docId\:SBEaOaCq_A7FfbTatX8bD), you can apply any of the modifications by updating the code within your Wix store.&#x20;

To get started, go to **Settings > Custom Code** and then click **Add Custom Code**. You can then paste in any JavaScript as required. For example, the below sample enables a special checkout custom field to collect a Delivery Date.

```javascript
<script>
  window.sparkWixOptions = {
   accountRedirect: {
      urlRegex: /\/account/g,
      goTo: "/index", // page to redirect logged in users to
   },
  };
</script>
```
:::

:::ExpandableHeading
**Enabling "Dark mode" for high contract websites**

If your Wix store is set up with a darker theme, it's possible to enable a special "Dark Mode" for SparkLayer, ensuring colours and fonts are easily readable.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/2OhjBZD-eclNsunPkGyy-_image.png)

To get started, go to **Settings > Custom Code** and then click **Add Custom Code**. You can then paste in the code below.

```javascript
<script>
  window.sparkWixOptions = {
     display: {
         darkTheme: true,
      },
  };
</script>
```
:::

:::ExpandableHeading
**Enabling SparkLayer shipping methods**

SparkLayer has a built-in [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) system that lets you customise how shipping works for your B2B customers. By default, your existing shipping methods in your Wix Dashboard will be used, however it's possible to update this to use SparkLayer.

To get started, in your Wix Dashboard, go to **Settings > Shipping, Delivery & Fulfillment**.

You'll need to make sure you have at least one shipping region set up (e.g. USA, UK). Once you've done that, click the **Manage Your Apps** link below the shipping region.

You'll then see the option to enable **SparkLayer Shipping.**

Finally, you'll then need to set up your SparkLayer shipping rules via the [SparkLayer Dashboard here](https://app.sparklayer.io/configuration/shipping).



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/gpYnnQgwOZGfaI4vmfSvu_image.png)
:::

:::ExpandableHeading
**Enabling pre-order (or "back orders")**

SparkLayer has built-in support for pre-orders (someimtes referred to as "back orders"). To enable this, simply edit a product in Wix and turn on the Pre-order setting as shown below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Zo_r1o9EsyZWyCA5P8uUE_image.png)

Once enabled, this will then show a message to the B2B customer on the product page and allow purchasing.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/KpfP8bTDeaOUPE7joFYxr_image.png)
:::

:::::ExpandableHeading
**Enabling Sales Agents**

SparkLayer has full support for the [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) feature on Wix, letting your sales team login and place orders on behalf of your B2B customers. You can learn more about how it works in [our guide here](docId\:Uw8mDbMEfwWKqZrVB5CqX).

:::hint{type="info"}
**Please note**
To setup a sales agent, you'll first need to ensure your SparkLayer plan supports this.
:::

::::WorkflowBlock
:::WorkflowBlockItem
To get started, you'll first need to set up a Contact in Wix and ensure they have a full address added and a label of `b2b` added.

Next, you'll need to copy the unique contact ID which you can retreive via the browser URL.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/gHQpbElOBRypaB2zlOZiY_image.png)
:::

:::WorkflowBlockItem
Within the SparkLayer Dashboard, go to the [Sales Agent area](https://app.sparklayer.io/sales-agents) and paste in the contact ID
:::

:::WorkflowBlockItem
You can then specify which role you'd like to assign to their account. You can learn more about how it works in [our guide here](docId\:Uw8mDbMEfwWKqZrVB5CqX).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TiLOj0tZsSew660XmwduA_image.png)
:::
::::
:::::



***

## 📁 Troubleshooting

To troubleshoot the most common issues (such as issues with pricing), please see [our guide here](docId\:BlCEkkx3I30nkUcglsfw7). You can also [contact our support team](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to assist.



***

## ℹ️ Frequently Asked Questions

### Plans and pricing&#x20;

:::ExpandableHeading
**Which SparkLayer plans do you offer for Wix?**

All SparkLayer plans are compatible with Wix, from "Starter" right through to "Enterprise". [Learn more](https://www.sparklayer.io/pricing/) about our plans and pricing.
:::

:::ExpandableHeading
**How does billing work?**

When you sign up to SparkLayer, billing is managed via your Wix admin and processed monthly or annually if you've selected this option.
:::

### Wix setup

:::ExpandableHeading
**Where do I find the SparkLayer Wix app?**

You can find the official SparkLayer for Wix app in the [Wix App Market](https://www.wix.com/app-market/search-result?query=sparklayer).
:::

:::ExpandableHeading
**What Wix plan do I need to be on to use SparkLayer?**

SparkLayer works on all versions of Wix. All you need is an active Wix store and you're good to go.
:::

:::ExpandableHeading
**Can I have DTC and B2B on the same store?**

Yes, it's possible to install SparkLayer onto your existing Wix DTC store (i.e. retail), meaning you can run both DTC and B2B on the same store. We call this a 'hybrid setup'; when your B2B customers sign in, they simply see the special SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) interface that allow them to see their prices and place orders.

If you want to see this in action, you can try our [B2B/B2C demo store here](https://demo.wix.sparklayer.io/)
:::

### Store setup

:::ExpandableHeading
**Can you help me install SparkLayer on my Wix website?**

Yes! Within the [SparkLayer Dashboard](https://app.sparklayer.io/help), you'll see an option to request our team to install SparkLayer for you. Typically we can do this within 1-2 working days and you're then good to go. We then offer an onboarding session to walk you through how everything works.
:::

:::ExpandableHeading
**Does SparkLayer work on any Wix theme?**

Yes! SparkLayer is compatible with all Wix themes. Once you install the SparkLayer app, our special B2B widgets are automatically added to your Wix store and you're good to go.
:::

:::ExpandableHeading
**How does SparkLayer affect my current Wix theme?**

The SparkLayer B2B widgets, including B2B pricing, cart and my account area, are only loaded once a customer who has been added to a B2B customer group successfully signs in to your store.

For all other users, your store will remain completely unaffected.

This allows you to have full control over which customers are able to see your B2B pricing and place B2B orders.
:::

:::ExpandableHeading
**What if I'm already using a wholesale B2B app on my website?**

If you already have a B2B / Wholesale app installed on your store, SparkLayer can work alongside this. It's a great way to test out SparkLayer and, once you're happy, you can simply uninstall any previous B2B apps you were using. If your previous B2B app has made code changes to your Wix store, you may want to ask the app developer to remove these although this is optional.
:::

### Payments

:::ExpandableHeading
**Can I use my existing payment methods on the checkout?**

If your customers choose "Pay Online by Card" during the SparkLayer checkout process, they will simply be taken to the Wix checkout. From there, any payment methods you have set up in Wix (e.g. Paypal, Affirm Pay) will show up, allowing the customers to pay by this method.&#x20;

In short, if Wix support specific payment methods, your B2B customers could select it during the checkout providing they choose "Pay Online by Card".
:::

:::ExpandableHeading
**Can I use multiple currencies for my B2B customers?**

Currently, Wix [doesn't allow](https://support.wix.com/en/article/wix-stores-request-selling-in-multiple-currencies) a Wix store to accept multiple currencies (e.g. USD, EUR, GBP etc).&#x20;

If you do set up multiple currencies within SparkLayer in the [Price List section](https://app.sparklayer.io/pricing/lists), it's important to note the following:

- Customers will see the correct currency when browser your store as a logged in B2B customer. The price they see will be the currency exchange rate at that time
- If they proceed to place an order in a different currency to your Wix store's default currency, this will create an order however the pricing will show in your default currency. We've illustrated this below

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Q79pcwJvs2aCzOWqHSSY-_image.png)

How the order shows in Wix. Note how the totals are the same but the currency (EUR) has defaulted to the Wix store currency (£ GBP)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VM5aX0DMb7P4BoNyi5UFv_image.png)
:::

### Products

:::ExpandableHeading
**How do I hide products or set up B2B-only products?**

There are a few things we recommend to make the experience better:

You could **create a B2B-only collection** and redirect customers to this once they login. Within Wix, you can set pages to have **Permissions** for **Site members**. You create a **Member Role** of `B2B Customers` and then assign this to specific pages on your Wix website. You can see [their full guide here](https://support.wix.com/en/article/wix-stores-creating-restricted-store-pages).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/n2lVpF2KmEsziagFvpYok_image.png)

If you wanted to show special B2B-only products, you would need to create these as separate products within Wix (i.e. with unique SKUs, etc)

With SparkLayer pricing, if you don't upload a price against a SKU, the B2B custome&#x72;**&#x20;won't be able to purchase it.** So this is a way to prevent them from adding items you don't want them to purchase


:::

:::ExpandableHeading
**How do I hide prices on my regular (B2C) Wix store?&#x20;**

Within your Wix store, you can easily hide the regular (B2C) retail price from showing. This is a great way to make your Wix store "B2B only" and only show prices once a customer signs in.

To view more details on how to do this, please see the [official Wix guide here](https://support.wix.com/en/article/wix-stores-hiding-product-prices).


:::

:::ExpandableHeading
**Can I use my Wix prices for my B2B pricing?**

Yes! SparkLayer allows you to automatically synchronise your Wix prices (e.g. your main Wix retail price), making it really easy to set up B2B pricing for your customers. For example, you could set your B2B prices to be 20% off your Wix prices and we can even make provisions for your tax set up in Wix (e.g. exclusive or inclusive of tax).
:::

:::ExpandableHeading
**How do I set up pre-order and backorder products?**

In terms of pre-ordering, SparkLayer has full support for different stock status messages and it's possible to set up products as pre-order/back-order easily - it does rely on some configuration within Wix, but it's relatively easy to do!

We've [full information here](docId\:Gj_Ao_gQ6oA-jx0D27Hys) on how it works and you can even set up "due in" dates to give your customers visibility.
:::

:::ExpandableHeading
**Do I need to use product SKUs?**

In terms of product SKUs, SparkLayer relies on these being added to your products within Wix so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.

If you don't already have SKUs in Wix, it's relatively quick to do. You can either edit individual products and add them manually, or you can use Wix 'Import' or 'Edit products' feature to do this in bulk.
:::

:::ExpandableHeading
**How do I show inventory (stock) levels?**

It's possible to show inventory levels and a stock status when your B2B customers log in. You can learn more about how to enable this in [our guide here.](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;
:::

::::ExpandableHeading
**How do I restrict B2B customers from DTC inventory (and vice versa)**

If you're installing SparkLayer on a single website and you are looking to run both DTC and B2B at the same time, it will be necessary to **use the same stock pool&#x20;**&#x62;ehind the scenes. From an inventory point of view, this essentially means that both DTC and B2B customers will be ordering from the same stock source which can pose challenges.&#x20;

:::hint{type="info"}
**Important**
It is not possible to block DTC customers from ordering from your inventory and there is no mechanism in Wix to do this. If you are wanting to implement this, you will need to consider:

- Creating B2B-specific products on your store&#x20;
- Creating a separate store just for your B2B customers, effectively separating out your inventory completely.&#x20;
:::


::::

### User Experience

:::ExpandableHeading
**How do I set up a B2B registration form?**

If you're looking to enable a wholesale/B2B registration form there are a few good options for this and

In summary, these are the options we recommend:

- You could use your current login/registration page and enhance the registration page with some additional fields
- You could create a brand new registration page and direct prospective B2B customers to this. Wix [have a guide here](https://support.wix.com/en/article/wix-forms-an-overview) on ways to do this.

It's also worth noting that you can manually add customers via the admin by going to **Customers & Leads > Contacts** and from there you could moderate your wholesale applications.
:::

:::ExpandableHeading
**How do I invite a B2B customer to my website?**

When you're ready to invite your B2B customers to begin using your store, there are a variety of ways you can do this. One of the easiest ways is to use the built-in Wix messaging system to simply notify your customer to sign in and begin placing orders.&#x20;

You can access this by going to your Wix Dashboard, clicking **Customers & Leads** and then **Contacts**. You'll see a tab called **Inbox** that allows you to send direct messages.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5kdTEgvaPekbMdybdqosS_image.png)

You could also think about sending a marketing newsletter to your customers to notify them of your new B2B store and to sign in. You can access this by going to your Wix Dashboard, clicking **Customers & Leads** and then **Contacts**. You can then search and filter your customers and click **Send Email Campaign** to send an email.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bQ8LaAASXrGmv2S4ESMlD_image.png)

We also have some example messaging you can use when inviting your customers and you can explore more in [our guide here](docId\:YUfghEGoxe_h7uJfcshna). &#x20;
:::

:::ExpandableHeading
**Will SparkLayer slow down my Wix website?**

No. For performance, the SparkLayer Frontend only loads when a valid B2B customer successfully logs into a website; for your standard (DTC) customers, no code is loaded at all. When a B2B customer logs in, all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.
:::

:::ExpandableHeading
**How do I setup B2B-specific content on my Wix website?**

We recommend consulting with a Wix expert developer before making changes to your website.&#x20;
:::

### Orders

:::ExpandableHeading
**Where do I find my B2B orders in Wix?**

| Payment Method                    | Notes                                                                                                                                                                                       |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment by Invoice`              | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means) |
| `Payment on Account`              | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means) |
| `Request for Quote`               | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means) |
| `Upfront Payment (Card payments)` | The order will be created within **Sales > Orders** with a payment status of "PAID". You can then proceed to fulfil the order.                                                              |
:::

:::ExpandableHeading
**Why do orders show up as "Awaiting Merchant"?**

When a B2B customer first places an order, it will show as **Awaiting Merchant** when they view it in their [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP). This status means that the order requires the merchant (the Wix store owner) to view the order and then confirm payment (e.g. such as sending the customer an invoice or arranging payment via other means).

Once you then mark the order as paid within Wix, this will then update the order status from **Awaiting Merchan**t to **Processing** and you can then fulfil the order as normal.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/lIfhmsNf5OVvjRkSUnqhv_image.png)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fgaZ0LGKXdMlO1m7DgCiy_image.png)
:::

:::ExpandableHeading
**How do I edit orders?**

It is possible to edit orders within Wix when an order is placed via SparkLayer providing payment hasn't already been processed. From your Wix Dashboard, navigate to an order and click the **More Actions** button. You'll then see the option to **Edit order** allowing you to make changes.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/EGDa7f7lc5jRcL_A1cEiq_image.png)
:::

:::ExpandableHeading
**How do I send an invoice?**

In terms of invoicing, SparkLayer doesn't send invoices directly but there are some good ways to do this within Wix. When viewing an order within your Wix Dashboard, you'll see the option to **Create Invoice** under **More Actions**.

When sending an invoice, this is managed outside of SparkLayer and it will require you to collect payment by your preferred means. Once you've received payment, you can then mark the order as paid within Wix and then fulfil it as normal.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/0rzfB2XOjJVqsPgieUX2c_image.png)
:::

:::ExpandableHeading
**How do I set a minimum order quantity?**

Within SparkLayer, we support the ability to set minimum/maximum order level spends for your B2B customers. You can configure these by going to the [Customer Groups](https://app.sparklayer.io/customers/groups) area of the SparkLayer Dashboard.
:::

:::ExpandableHeading
**How do I send order notifications to customers and my team?**

You can manage notifications and emails that are sent by going to your Wix Dashboard, clicking **Settings** and then **Outgoing Notifications**.
:::

:::hint{type="info"}
**Need assistance?**
We'd be happy to help guide you through this process. Please refer to [our guide here](docId\:NNUw1G9z7eaJ4M78vk7t9)
:::






[title] WooCommerce
[path] Integrations/

## Introduction

:::hint{type="info"}
**Join our Early Access programme**
We're launching WooCommerce immentently on SparkLayer. If you'd like to be one of the first to access it, please email *support\@sparklayer.io* and our team will be in touch.
:::

SparkLayer is the powerful platform that transforms your existing WooCommerce website into a fully featured B2B solution. Say goodbye to complicated and costly installation processes and hello to a hassle-free setup that gets you up and running in no time!

::embed[]{url="https://www.youtube.com/watch?v=23uqVqW59d0"}

Once you've installed SparkLayer on your WooCommerce store SparkLayer enables a B2B-ready frontend interface that simply "overlays" sections of your WooCommerce store. The best part is you can retain your *existing* WooCommerce store design and layout and enable B2B alongside your retail operation (DTC).

## Supported WooCommerce Plans

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-A9-hygpvUCDGfK0Q5M1DO-20250715-075057.png)

SparkLayer works with WooCommerce version 9 and above and Wordpress version 6 and above.



***

## WooCommerce Demo Store

Want to see SparkLayer & WooCommerce in action? Try it out on our WooCommerce demo store using the details below:

| Item      | Details                                                                                                                                                                                                                                                        |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Login URL | [demo.woocommerce.sparklayer.io/&#xA;](https://demo.woocommerce.sparklayer.io/my-account/)This is an example DTC + B2B store. To login as a B2B customer, [go to this link](https://demo.woocommerce.sparklayer.io/my-account/) and use the credentials below. |
| Username  | woocommerce\@sparklayer.io                                                                                                                                                                                                                                     |
| Password  | I6qxPvpww42#3hsz0hTC%U2b                                                                                                                                                                                                                                       |



***

## Get started

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[Installing SparkLayer on WooCommerce](docId:1GjKXB51dfFbw2rbsYxuH)

Learn about the steps to install SparkLayer on your WooCommerce store
:::

:::LinkArrayItem
[WooCommerce Metafields & Data Mapping](docId\:DL0CTVwncNk8ZGJmYihy4)

Learn how to use the powerful WooCommerce metafields feature
:::

:::LinkArrayItem
[WooCommerce FAQs](docId\:laOn_6ALBpQigc7rIvb5v)

See some of our most commonly asked questions!
:::
::::


[title] Intuitive Shipping
[path] Integrations/Customer Experience/

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-8WWw_pHIUNPqPgf4X5FLg-20250211-121627.png)

:::hint{type="info"}
**Requirements**

- Plan: Merchants must be signed up to Intuitive Shipping
- Platform: Merchants must be using Shopify or BigCommerce
:::

## Introduction

​[Intuitive Shipping](https://intuitiveshipping.com/) is a leading shipping solution major eCommerce platforms such as Shopify and BigCommerce, allowing merchants to manage powerful shipping rules for their online store.

In the context of SparkLayer, it's possible to integrate Intuitive Shipping seamlessly within the checkout, allowing B2B customers to view shipping rates specific to them.



***

## Configuring on SparkLayer

:::hint{type="warning"}
**Please note the following before starting**

- Your Shopify store must already have the [Intuitive Shipping app](https://apps.shopify.com/intuitive-shipping) installed before enabling this feature.
- You must turn on the [SparkLayer shipping system](https://app.sparklayer.io/configuration/shipping) - this will disable showing shipping methods from your eCommerce platform that you do not want to show
:::

Once the Intuitive Shipping app has has been installed on your store, you're ready to activate it on SparkLayer! Within the [SparkLayer Dashboard](https://docs.sparklayer.io/sparklayer-dashboard/the-sparklayer-dashboard), go to the **Integrations** section and click **Partner Integrations.**

Under **Shipping**, click the toggle on the right to activate the Intuitive Shipping integration.

You'll then be prompted to enter an **API Key** to complete the setup. You can retrieve this within your Intuitive Shipping Dashboard by going to **Settings**, going to **Partner Integrations** and copying the **API Key**.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/8Ge5_nmoWPje5iH14Uzyt_image.png)

This completes the set up process and you can follow the below steps to test the integration.

- Log in to your Shopify store as a B2B customer
- Go through the checkout process until you reach the "Review & Pay step"
- The available shipping methods will correlate with those setup in the Intuitive Shipping Dashboard

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/zR00eIM3MeOlw1ZcmYErH_image.png)



***

## Known limitations

Please note the following:

- The integration will not factor in any "Shipping dates" configured in Intuitive Shipping
- The integration will only work for physical products (i.e. not digital products)
- Pricing will always be displayed in net pricing (excluding tax)



[title] Installing SparkLayer on Magento
[path] Integrations/Magento/

## Introduction

SparkLayer enables B2B functionality on your existing Magento store, allowing your B2B customers to login, place orders, manage their account, and much more.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vWNSkcGu-6SYP5BrvL_hF_image.png)

To familiarise yourself with SparkLayer, we also recommend reviewing the following guides:

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[How SparkLayer Works](docId:_2g8HwCXnN7OFy4o199y1)

The fundamentals of what SparkLayer does
:::

:::LinkArrayItem
[Frontend](docId\:OgKfvQX13dHW2582D57kJ)

The special "interfaces" SparkLayer enables
:::

:::LinkArrayItem
[Features](docId\:SSzdKXuNMlEIDOOITHQcU)

The available features and functions.
:::
::::



***

## ⚠️ Requirements - important!

Before installing SparkLayer on your Magento store, please ensure the following:

| Item                | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Magento`           | You must be using one of the following Magento versions.<br />* Magento Open Source - version 2.4.2 or later
* Adobe Commerce - version 2.4.2 or later<br />The Multi-Stock Inventory module should be enabled (this should be the case on most Magento installs by default).                                                                                                                                                                               |
| `Product SKUs`      | In order for SparkLayer to save B2B prices for your products, all products must have **SKUs**.                                                                                                                                                                                                                                                                                                                                                              |
| `Customers`         | For your B2B customers to see the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa), they must be assigned an appropriate B2B "Role" within Wordpress > users                                                                                                                                                                                                                                                                                  |
| `Payment Processor` | If you’re installing SparkLayer on a test store, please ensure you have an example payment method enabled. You can manage this within **Magento > Sales > Payment Services**                                                                                                                                                                                                                                                                                |
| `Shipping`          | In order to place an order via the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), please ensure you have shipping rules set up. You can manage this within Magento under **Stores >Configuration > Delivery Methods** or via SparkLayer's own [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) solution                                                                                                                                                         |
| `Theme`             | You have a technical Magento partner or developer to integrate the SparkLayer Magento module with your theme. Luma and Luma based themes are automatically supported by the SparkLayer module. Other themes will need manual integration work to ensure SparkLayer web components are output instead of normal magento PDP/PLP cards, the SparkLayer script is loaded for B2B customers, and customer authentication is connected to the SparkLayer script. |

**Areas of Magento you'll be using**

As part of setting up SparkLayer, you'll primarily be using the following areas:

| Area        | Details                                                                                                                                                                                 |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Catalog`   | This will be used to setup which products you want to make available to B2B customers. See "Setting up your B2B pricing" below.                                                         |
| `Customers` | This will be used to setup your B2B customers. See "Setting up your B2B customers" below                                                                                                |
| `Sales`     | This will be used to review and process and orders that are placed by your B2B customers. See "Placing a B2B order" below.<br /><font color="#9900ef">*In Magento, go to Orders*</font> |



***

## 🔗 Connecting your Magento store

:::hint{type="info"}
**Please note**
Setting up SparkLayer will require generating API keys within your Magento store. If you're unsure how to do this, our team is happy to assist. To get in touch, please [click here](docId\:NNUw1G9z7eaJ4M78vk7t9).&#x20;
:::

To get started with SparkLayer on your Magento store, there are a number of steps to follow. Once you've completed this step, you can then begin the process of configuring SparkLayer such as pricing and customer rules.

::::WorkflowBlock
:::WorkflowBlockItem
**Install the SparkLayer Magento module and create an Integration**
First, you'll need to install the SparkLayer for Magento module on your store. Please get in touch with your SparkLayer Account Manager for access to the module.

Once installed, open the SparkLayer B2B module tab in the Magento admin, and create an integration for the correct Magento store by clicking the "Create and Activate Integration" button:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/CuBwvUEd4R4hR09m-8AXz_image.png)

Then go to Stores > Configuration > SparkLayer > B2B and ensure the "Enabled" option is set to "Yes" for your store:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/gpNam9agCKsE5jMuqmepx_image.png)
:::

:::WorkflowBlockItem
**Access the Integration API credentials**
Next, you'll need to access the SparkLayer Integration API credentials within Magento. From your Magento admin dashboard, you can find this within System > Integrations > SparkLayer B2B for "your store name" > Edit > Integration Details. You will need these credentials to in the following steps to connect and authorise your SparkLayer account to connect to the Magento store.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/aKVbqta3FXvnBZqdgvbwy_image.png)
:::

:::WorkflowBlockItem
**Register with SparkLayer**
Next, you'll need to create a SparkLayer account by [registering here](http://app.sparklayer.io/register)
:::

:::WorkflowBlockItem
**Connect your Magento Store**
Once registered, go to [Integrations > Platform Connection](https://app.sparklayer.io/integrations/platform) and select Magento. You'll then be prompted to enter your store URL (this should be the URL of the website you are installing SparkLayer on, e.g. `www.mystore.com`)
:::

:::WorkflowBlockItem
**Enter the API credentials in SparkLayer**
From with the SparkLayer Dashboard [Integrations > Platform Connection](https://app.sparklayer.io/integrations/platform) paste the provided credentials from the earlier step.

Press save and wait a few seconds whilst SparkLayer connects to the Magento store and performs the SparkLayer plugin initialisation.
:::

:::WorkflowBlockItem
**Store connected**
This completes the process of connecting your Magento store to SparkLayer!&#x20;
:::
::::



***

## 🚢 The Onboarding process

:::hint{type="info"}
**Important**
When setting up SparkLayer, some activities take place via the [SparkLayer Dashboard](https://app.sparklayer.io/) alongside Magento. You'll use the SparkLayer Dashboard primarily for setting up your B2B pricing and B2B customer rules.
:::

When you create an account on SparkLayer, you'll get access to the [SparkLayer Dashboard](https://app.sparklayer.io/). The Dashboard has a customised onboarding process that gently guides you through all the necessary steps before you're ready to start inviting your B2B customers and taking orders on your website.

::::WorkflowBlock
:::WorkflowBlockItem
**📓 Setting up your B2B price lists**
You'll then set up the B2B price lists that you want your customers to see when they login. These can be automated or you can manually upload specific pricing.
➡️ [View in dashboard](https://app.sparklayer.io/pricing)
:::

:::WorkflowBlockItem
**👪 Setting up your B2B customers**
You'll then set the ordering rules for your customers such as minimum order values, available payment methods and price lists they are assigned to.
➡️ [View in dashboard](https://app.sparklayer.io/customers/groups)
:::

:::WorkflowBlockItem
**🛠️ Installing the frontend widgets**
You'll need to check the special code snippets ("widgets") are installed on your Magento store in order to show the special SparkLayer B2B interfaces.
➡️ [View in dashboard](https://app.sparklayer.io/integrations/widgets/core)
:::

:::WorkflowBlockItem
**✅ Testing & launching**
You'll then need to run through some final checks (such as placing a test order). Once you're happy, you can then launch SparkLayer and start taking orders!&#x20;
➡️ [View in dashboard](https://app.sparklayer.io/configuration/onboarding)
:::
::::



***

## 📓 Setting up your B2B pricing

:::hint{type="warning"}
**Please note**
Setting up your B2B pricing happens within the [SparkLayer Dashboard](https://app.sparklayer.io/), not via your Magento admin.
:::

Within the [Price Lists](https://app.sparklayer.io/pricing) area of the SparkLayer Dashboard, you can create and manage your B2B pricing rules.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/crsQ_5urd85zzUuDR514L_image.png)

SparkLayer allows you to set the following pricing types:

| Type        | Details                                                                                                             |
| ----------- | ------------------------------------------------------------------------------------------------------------------- |
| `Manual`    | You can manually upload a CSV file with specific prices and even enable quantity pricing                            |
| `Automatic` | You can use your Magento prices and apply a discount. You can choose from your main Magento price or the RRP price. |

::::WorkflowBlock
:::WorkflowBlockItem
For any products that you want your B2B customers to be able to buy, these products **must** have unique SKUs assigned. In Magento, you can check this by going to **Catalog** and editing a product.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/x2l9OWPur3IUZu5PIB-x7_image.png)
:::

:::WorkflowBlockItem
Next, go to [Price Lists](https://app.sparklayer.io/pricing/lists) within SparkLayer and click "Create Price List" to create your first B2B Price list. You can choose between an automatic or manual price list and configure how this works.
:::
::::

:::hint{type="success"}
**Ready to set your pricing?**
To learn more about pricing, please see our [full guide here](docId\:s8XcbZGxQpgdeIGWtXseT).
:::



***

## 👪 Setting up your B2B customers

:::hint{type="warning"}
**Please note**
Setting up your B2B customer rules happens within the [SparkLayer Dashboard](https://app.sparklayer.io/), not via your Magento admin.
:::

[Customer Groups](https://app.sparklayer.io/customers/groups) let you configure specific rules for your customers, from defining their minimum order values and which price lists they see, through to what payment methods they're allowed to use when checking out.

Much like with Price Lists, you can fully manage this via the [SparkLayer Dashboard](https://app.sparklayer.io/customers/groups).

::::WorkflowBlock
:::WorkflowBlockItem
Within SparkLayer, create a customer group. You can follow our guide, [Customer Groups](https://app.sparklayer.io/customers/groups)
:::

:::WorkflowBlockItem
SparkLayer will sync any customer groups you create into Magento as a "Group" which can then be assigned to individual customers with Magento. Groups synced from SparkLayer will be automatically prefixed with "B2B".



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fwlRoDpBpKeAEAzjaPdg-_image.png)
:::

:::WorkflowBlockItem
Once your customers have been set up in Magento (i.e. those with a B2B group assigned), and you've assigned the customer group to **at least** one customer, you can then manage specific rules within the [Customer groups area.](https://app.sparklayer.io/customers/groups)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Jx9PeVQOiWjZoksJniFNE_image.png)
:::

:::WorkflowBlockItem
You'll see a default **Base** customer group that you can use for your B2B customers. If you want to set up additional rules, you can simply click **Create Customer Group** and configure accordingly. For any additional customer groups you create, you'll need to update the role on the customer record in Wordpress/Magento to match.
:::

:::WorkflowBlockItem
To simulate logging in as a B2B customer, please see **✅ Testing & launching** below.
:::

:::WorkflowBlockItem
You can also check if your customer record is syncing by using the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. Within Magento, navigate to the Customers section, search for a customer, and note the ID.

With this unique ID, you can then paste this into the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. If the search results show the customer details, this confirms the customer is synchronising correctly.
:::
::::

:::hint{type="success"}
**Ready to configure your customer groups?**
To learn more about customer groups, please see our [full guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::



***

## 🛠️ Installing the frontend widgets

SparkLayer comes with ready-made B2B-optimised "widgets" that we collectively call the SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ). The widgets simply overlay sections of your existing Magento store and enable our powerful B2B features.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/xOpit3AbQHYG16nn6zmxv_image.png)

Once set up, your approved B2B customers (see above "Setting up your B2B customers") will then see your B2B pricing and can begin placing orders. You can learn more about how this works in [our guide here](docId\:ccZ1vnH0O6D_722w35Xpa).&#x20;

**Installing SparkLayer widgets**

:::hint{type="warning"}
**Please note**
Due to the nature of high level of customisation of many Magento stores and themes, you will need a Magento developer to install and integrate the SparkLayer frontend core scripts and widgets.
:::

The SparkLayer Magento module provides out-of-the-box setup for the Magento Luma theme (which should work for any luma based themes). Your developers can use this implementation as a reference of how to set this up.

To enable the frontend integration on your store for Luma based themes go to Stores > Configuration > SparkLayer > B2B in the Magento Admin dashboard, and enable the Frontend Widgets option which will automatically add the required frontend integration setup:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/UXErSx9kdWz5LjOZwtHpu_image.png)

**Steps required to integrate the SparkLayer frontend widgets:**

::::::WorkflowBlock
:::WorkflowBlockItem
**Install the&#x20;**[SparkLayer Core Script
](https://app.sparklayer.io/configuration/frontend/core)Within your main website header you'll need to add the SparkLayer Core Script that activates the SparkLayer functionality when a customer tagged with a SparkLayer B2B group is logged in.
:::

:::::WorkflowBlockItem
**Install the&#x20;**[Product Detail Interface](https://app.sparklayer.io/configuration/frontend/pdp)
You'll need to update your storefront's product detail page with the SparkLayer Product Purchasing Interface. When a customer logs in and SparkLayer recognises them as being a B2B customer, this will load a special interface with their specific prices and a way to purchase.&#x20;

::::ExpandableHeading
**🛠️ View instructions**

```javascript
<spark-pdp parent-id="{{id}}"></spark-pdp>
```

:::hint{type="info"}
To get started, add the code snippet above to your product detail pages. The exact location of the files may vary based on your Magento theme.

Once this is added, the interface will display for all logged in B2B customers and they can begin placing orders.
:::

:::hint{type="warning"}
**Important!**
If you're using SparkLayer on your existing website, you will need to hide elements that you don't want your B2B customers to see. To do this, you can hide elements by adding `data-spark="b2c-only"` to any element in the code.&#x20;

::embed[]{url="https://www.youtube.com/embed/rmMv-l98JoI?controls=0"}

You will need to do this for any code that renders a price, quantity selection, product options, buy now buttons, and anything else you want to hide from your B2B customers.

Please see our [full guide here](docId\:QWXsYM9X5_pvIOGUteKcP) for more details.
:::
::::
:::::

:::::WorkflowBlockItem
**Install the&#x20;**[Product Card Interface](https://app.sparklayer.io/configuration/frontend/pdp)
When you install SparkLayer, the product card interface should automatically be added. If for any reason it isn't, you'll need to update your product collection pages to show the Product Card Interface. This allows your customers to see their unique pricing and add items to their order from anywhere on your website.

::::ExpandableHeading
**🛠️ View instructions**

```javascript
<spark-product-card parent-id="{{id}}"></spark-product-card>
```

:::hint{type="info"}
To get started, add the code snippet above to the file that renders products on your collection pages.&#x20;

Once this is added, the interface will display for all logged in B2B customers and they can begin placing orders.
:::

:::hint{type="warning"}
**Important!**
If you're using SparkLayer on your existing website, you will need to hide elements that you don't want your B2B customers to see. To do this, you can hide elements by adding `data-spark="b2c-only"` to any element in the code.&#x20;

::embed[]{url="https://www.youtube.com/embed/rmMv-l98JoI?controls=0"}

You will need to do this for any code that renders a price, quantity selection, product options, buy now buttons, and anything else you want to hide from your B2B customers.

Please see our [full guide here](docId\:QWXsYM9X5_pvIOGUteKcP) for more details.
:::
::::
:::::

:::::WorkflowBlockItem
**Add the&#x20;**[CSS customisations](https://app.sparklayer.io/configuration/frontend/css)
You can customise the look and feel of SparkLayer by editing special CSS controls that overwrite the SparkLayer defaults. For example, you can change button colours, font sizes, spacing, even typefaces.

::::ExpandableHeading
**🛠️ View instructions**

:::hint{type="info"}
To get started, within your Magento theme, add the [sample CSS here](https://app.sparklayer.io/integrations/widgets/css). Once added, these then overwrite the "default" styling for SparkLayer to match your website's look and feel. [Learn more](docId\:QWXsYM9X5_pvIOGUteKcP).
:::
::::
:::::
::::::

:::hint{type="success"}
**Finished adding the code widgets?**

- Please review our [Frontend Integration Checkout](docId\:QWXsYM9X5_pvIOGUteKcP)
- You can also explore all the configurations and customisations we have available that you may want to activate on your Shopify store! [Learn more](docId\:SBEaOaCq_A7FfbTatX8bD)
:::



***

## 🛒 Placing a B2B order

Once you've logged into your Magento store as a B2B customer, you can then place an order by going to any product page and adding items to your order. When you add items, they will then appear in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) and you can then proceed to checkout to complete the order.

**How payment methods work**

When customers reach the payment step, they'll see a variety of available payment methods and can select their preference.

| Payment method       | Description                                                                                                                                                                                                      |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment on Account` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** needing to enter any payment details.                                                                                     |
| `Payment by invoice` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** having to enter in payment details.                                                                                       |
| `Pay Online by Card` | **👪 For the B2B customer:**<br />The customer will be directed to your **standard checkout process&#x20;**&#x61;nd will be required to make payment right away (e.g. by card or via another payment processor). |

**How orders arrive into Magento**

Depending on which [payment method](docId\:ibIKczvHM085BkeJIfFYv) you've selected, orders will arrive into Magento in the following ways:

| Payment Method       | Flow                                                                                                                                                                                                                                                                                                                        |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Pay by Invoice`     | The order will be created within&#x20;**&#x20;Magento > Sales** with a payment status of "Pending". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                                                                    |
| `Pay on Account`     | The order will be created within&#x20;**&#x20;Magento > Sales** with a payment status of "Pending". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                                                                    |
| `Pay Online by Card` | The order will be created within **Magento > Sales** with a payment status of "Processing" providing you have this already configured within Magento. You can then proceed to fulfil the order. Note: this is termed "Upfront Payment" within the [Customers](docId:5_lWMNohhjBJJppg9E6Vh) area of the SparkLayer Dashboard |

**"Unpaid" orders and "Paid" orders**

By default **all payment methods** other than Upfront Payment will be generated as "Pending" orders. You will need to capture payment either via your Magento Admin or via offline methods (e.g. bank transfer)

**Magento checkout payment methods**

If a customer selects "Pay Online by Card" (i.e. "Upfront payment"), they'll be directed to the Magento checkout. By default, they will see all Magento payment methods you have set up (e.g. card payment, Paypal, etc).&#x20;

**Additional order details**

When an order is placed via SparkLayer, it will also include additional data within an order under **SparkLayer Order Information**.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/blikGo7KbUhIReC9wTBMz_image.png)



***

## ✅ Testing & launching

The final step is to run some tests and checks to ensure SparkLayer is fully configured. Within the SparkLayer Dashboard, you'll see a number of [Launch checks](https://app.sparklayer.io/?expand=launch) to perform, from logging in as a B2B customer, through to placing an order.

We recommend following the below steps:

::::WorkflowBlock
:::WorkflowBlockItem
**Set up a customer record**
Within your Magento admin, you'll need to ensure you have an example customer record set up (either a new one or an existing). Most importantly, a customer must be associated with an appropriate role.

*Please see "Setting up your B2B customers" above for more details on how this works.*
:::

:::WorkflowBlockItem
**Place a test order**
Once you've logged in as a B2B customer, proceed to add items to your cart and complete the checkout.

Please see *"Placing a B2B order"* above for more details on how this works.
:::

:::WorkflowBlockItem
**Invite your customers**
You could also think about sending a marketing newsletter to your customers to notify them of your new B2B store and to sign in. We also have some example messaging you can use when inviting your customers and you can explore more in [our guide here](docId\:YUfghEGoxe_h7uJfcshna). &#x20;
:::
::::



***

## ⚙️ Advanced configurations

In addition to the above setup, there are a number of other configurations that are possible at this time.

:::ExpandableHeading
**Displaying stock (inventory) levels**

You can configure SparkLayer to show [stock levels](docId\:Gj_Ao_gQ6oA-jx0D27Hys) in a variety of ways. If you want to show inventory numbers (e.g. 100), you'll need to make sure this is turned on within Magento. Within Magento, go to Stores> Configuration > Inventory and turn on **Manage Stock**
:::

:::ExpandableHeading
**Adjusting tax settings**

SparkLayer supports tax calculations and simply 'inherits' the rules you've set up in your Magento settings.&#x20;
:::

:::ExpandableHeading
**Enabling SparkLayer JavaScript modifications (e.g. checkout customer fields, language updates)**

SparkLayer supports a range of advanced configurations that rely on updating JavaScript via **"Spark Options"**. Within our [Configurations](docId\:SBEaOaCq_A7FfbTatX8bD), you can apply any of the modifications by updating the code within your Magento theme store.&#x20;

Within the "Core Script Options" you can add the below code.

```javascript
{
  termsAndConditionsLink: "/policies/terms-of-service",

    checkoutCustomElements: [
      {
        name: 'shipping-date',
        translations: {
          en: {
            title: 'Preferred Shipping Date',
            detail: 'Shipping unavailable on weekends.',
          },
        },
        attributes: {
          required: true,
          type: 'date',
        },
      },
    ],
  }
```
:::

:::ExpandableHeading
**Enabling a URL redirect when signing in&#x20;**

SparkLayer supports a range of advanced configurations that rely on updating JavaScript via **"Spark Options"**. Within our [Configurations](docId\:SBEaOaCq_A7FfbTatX8bD), you can apply any of the modifications by updating the code within your Wix store.&#x20;

Under **"Core Script Options"** you can add the below code.

```javascript
{
   accountRedirect: {
      urlRegex: /\/account/g,
      goTo: "/index", // page to redirect logged in users to
   },
}
```
:::

:::ExpandableHeading
**Enabling "Dark mode" for high contract websites**

If your Magento store is set up with a darker theme, it's possible to enable a special "Dark Mode" for SparkLayer, ensuring colours and fonts are easily readable.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/2OhjBZD-eclNsunPkGyy-_image.png)

Under **"Core Script Options"** you can add the below code.

```javascript
{
     display: {
         darkTheme: true,
      },
  }
```
:::

:::ExpandableHeading
**Enabling SparkLayer shipping methods**

SparkLayer has a built-in [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) system that lets you customise how shipping works for your B2B customers. By default, your existing shipping methods in your Magento store will be used, however it's possible to update this to use SparkLayer via the [SparkLayer Dashboard here](https://app.sparklayer.io/configuration/shipping).
:::

:::ExpandableHeading
**Enabling pre-order (or "back orders")**

SparkLayer has built-in support for pre-orders (someimtes referred to as "back orders").&#x20;

Once enabled, this will then show a message to the B2B customer on the product page and allow purchasing.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/KpfP8bTDeaOUPE7joFYxr_image.png)
:::



***

## 📁 Troubleshooting

To troubleshoot the most common issues (such as issues with pricing), please see [our guide here](docId\:BlCEkkx3I30nkUcglsfw7). You can also [contact our support team](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to assist.



***

## ℹ️ Frequently Asked Questions

### Plans and pricing&#x20;

:::ExpandableHeading
**Which SparkLayer plans do you offer for Magento?**

Our "Enterprise" plan is required to use the SparkLayer Magento integration. [Learn more](https://www.sparklayer.io/pricing/) about our plans and pricing.
:::

:::ExpandableHeading
**How does billing work?**

When you sign up to SparkLayer, billing is managed via the SparkLayer Dashboard under Acccount > Plan
:::

### Magento setup

:::ExpandableHeading
**Where do I find the SparkLayer Magento module?**

Please get in touch with our support team to get access to the SparkLayer Magento module.
:::

:::ExpandableHeading
**What Magento plan do I need to be on to use SparkLayer?**

SparkLayer supports the following Magento Plans

- Magento Open Source (version 2.4.2+)
- Adobe Commerce (Cloud, version 2.4.2+)
:::

:::ExpandableHeading
**Can I have DTC and B2B on the same store?**

Yes, it's possible to install SparkLayer onto your existing Magento DTC store (i.e. retail), meaning you can run both DTC and B2B on the same store. We call this a 'hybrid setup'; when your B2B customers sign in, they simply see the special SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) interface that allow them to see their prices and place orders.

If you want to see this in action, you can try our [B2B/B2C demo store here](https://demo.woocommerce.sparklayer.io/)
:::

### Store setup

:::ExpandableHeading
**How does SparkLayer affect my current Magento theme?**

The SparkLayer B2B widgets, including B2B pricing, cart and my account area, are only loaded once a customer who has been added to a B2B customer group successfully signs in to your store.

For all other users, your store will remain completely unaffected.

This allows you to have full control over which customers are able to see your B2B pricing and place B2B orders.
:::

:::ExpandableHeading
**What if I'm already using a wholesale B2B app on my website?**

If you already have a B2B / Wholesale app installed on your store, SparkLayer can work alongside this. It's a great way to test out SparkLayer and, once you're happy, you can simply uninstall any previous B2B apps you were using. If your previous B2B app has made code changes to your Magento store, you may want to ask the app developer to remove these although this is optional.
:::

### Payments

:::ExpandableHeading
**Can I use my existing payment methods on the checkout?**

If your customers choose "Pay Online by Card" during the SparkLayer checkout process, they will be taken to our Magento payment methods checkout. From there, any payment methods you have set up in Magento (e.g. Paypal, Affirm Pay) will show up, allowing the customers to pay by this method.&#x20;

In short, if Magento support specific payment methods, your B2B customers could select it during the checkout providing they choose "Pay Online by Card".
:::

### Products

:::ExpandableHeading
**How do I hide products or set up B2B-only products?**

There are a few things we recommend to make the experience better:

You could **create a B2B-only collection** and redirect customers to this once they login.&#x20;

You could also configure your Magento theme to hide and show products based on tag via custom coding.


:::

:::ExpandableHeading
**Can I use my Magento prices for my B2B pricing?**

Yes! SparkLayer allows you to automatically synchronise your Magento prices (e.g. your main Magento retail price), making it really easy to set up B2B pricing for your customers. For example, you could set your B2B prices to be 20% off your Magento prices and we can even make provisions for your tax set up in Magento (e.g. exclusive or inclusive of tax).
:::

:::ExpandableHeading
**Do I need to use product SKUs?**

In terms of product SKUs, SparkLayer relies on these being added to your products within Magento so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.

If you don't already have SKUs in Magento, it's relatively quick to do. You can either edit individual products and add them manually, or you can use Magento 'Import' or 'Edit products' feature to do this in bulk.
:::

:::ExpandableHeading
**How do I show inventory (stock) levels?**

It's possible to show inventory levels and a stock status when your B2B customers log in. You can learn more about how to enable this in [our guide here.](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;
:::

::::ExpandableHeading
**How do I restrict B2B customers from DTC inventory (and vice versa)**

If you're installing SparkLayer on a single website and you are looking to run both DTC and B2B at the same time, it will be necessary to **use the same stock pool&#x20;**&#x62;ehind the scenes. From an inventory point of view, this essentially means that both DTC and B2B customers will be ordering from the same stock source which can pose challenges.&#x20;

:::hint{type="info"}
**Important**
It is not possible to block DTC customers from ordering from your inventory and there is no mechanism in Magento to do this. If you are wanting to implement this, you will need to consider:

- Creating B2B-specific products on your store&#x20;
- Creating a separate store just for your B2B customers, effectively separating out your inventory completely.&#x20;
:::


::::

### User Experience

:::ExpandableHeading
**How do I set up a B2B registration form?**

If you're looking to enable a wholesale/B2B registration form there are a few good options for this and

In summary, these are the options we recommend:

- You could use your current login/registration page and enhance the registration page with some additional fields
- You could create a brand new registration page and direct prospective B2B customers to this.&#x20;

It's also worth noting that you can manually add customers via the admin by going to **Magento > Customers** and from there you could moderate your wholesale applications.
:::

:::ExpandableHeading
**How do I invite a B2B customer to my website?**

When you're ready to invite your B2B customers to begin using your store, there are a variety of ways you can do this.&#x20;

You could  think about sending a marketing newsletter to your customers to notify them of your new B2B store and to sign in. We also have some example messaging you can use when inviting your customers and you can explore more in [our guide here](docId\:YUfghEGoxe_h7uJfcshna). &#x20;
:::

:::ExpandableHeading
**Will SparkLayer slow down my Magento website?**

No. For performance, the SparkLayer Frontend only loads when a valid B2B customer successfully logs into a website; for your standard (DTC) customers, no code is loaded at all. When a B2B customer logs in, all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.
:::

:::ExpandableHeading
**How do I setup B2B-specific content on my Magento website?**

This is possible but would require custom coding. We recommend consulting with a Magento expert developer before making changes to your website.&#x20;
:::

### Orders

:::ExpandableHeading
**How do I edit orders?**

It is possible to edit orders within Magento when an order is placed via SparkLayer providing payment hasn't already been processed. From Magento > Sales, navigate to an order. You'll then see the option to **Edit order** allowing you to make changes.
:::

:::ExpandableHeading
**How do I send an invoice?**

In terms of invoicing, SparkLayer doesn't send invoices directly.

When sending an invoice, this is managed outside of SparkLayer and it will require you to collect payment by your preferred means. Once you've received payment, you can then mark the order as paid within Wix and then fulfil it as normal.
:::

:::ExpandableHeading
**How do I set a minimum order quantity?**

Within SparkLayer, we support the ability to set minimum/maximum order level spends for your B2B customers. You can configure these by going to the [Customer Groups](https://app.sparklayer.io/customers/groups) area of the SparkLayer Dashboard.
:::




[title] BigCommerce
[path] Integrations/

## Introduction

SparkLayer is the powerful platform that transforms your existing BigCommerce website into a fully featured B2B solution. Say goodbye to complicated and costly installation processes and hello to a hassle-free setup that gets you up and running in no time!

::embed[]{url="https://www.youtube.com/watch?v=23uqVqW59d0"}

Once you've installed the [official SparkLayer for BigCommerce app](https://www.bigcommerce.com/apps/sparklayer-b2b-wholesale/), SparkLayer enables a B2B-ready frontend interface that simply "overlays" sections of your BigCommerce store. The best part is you can retain your *existing* BigCommerce store design and layout and enable B2B alongside your retail operation (DTC).

## Supported BigCommerce Plans

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/g7BL3An_00F0MRgV9LDf5_logo-bigcommerce.png)

SparkLayer requires Customer Groups to work. BigCommerce *Plus* through to BigCommerce *Enterprise&#x20;*&#x69;s supported.



***

## BigCommerce Demo Store

::embed[]{url="https://youtu.be/6QCPV7_V_Ps"}

Want to see SparkLayer & BigCommerce in action? Try it out on our BigCommerce demo store using the details below:

| Item              | Details                                                                                                                                                                                                                      |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Login URL         | [](https://demo.bigcommerce.sparklayer.io/login.php)<br />This is an example DTC + B2B store. To login as a B2B customer, [go to this link](https://demo.bigcommerce.sparklayer.io/login.php) and use the credentials below. |
| Username          | bigcommerce+user\@sparklayer.io                                                                                                                                                                                              |
| Password          | Spark123^7\&jj1                                                                                                                                                                                                              |
| App store listing | [SparkLayer BigCommerce App](https://www.bigcommerce.com/apps/sparklayer-b2b-wholesale/)                                                                                                                                     |



***

## Get started

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[Installing SparkLayer on BigCommerce](docId\:x6xahBJ_9KYJTHD80_1QH)

Learn about the steps to install SparkLayer on your BigCommerce store
:::

:::LinkArrayItem
[BigCommerce Metafields & Data Mapping](docId\:bkHor8d6QhgZX_yxsdt56)

Learn how to use the powerful BigCommerce metafields feature
:::

:::LinkArrayItem
[BigCommerce FAQs](docId\:KZrw-fFscozjvGMLwPoIB)

See some of our most commonly asked questions!
:::
::::


[title] Shopify B2B Store Setup
[path] Integrations/Shopify/Shopify Customisations/

## Standalone vs Hybrid&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VxPvZEWNSYyNyLpcTgfJg_image.png)

When you're in the process of setting up your Shopify B2B store, there are two ways to go about this:

1. Set up as a **new** standalone Shopify store&#x20;
2. Enable wholesale functionality on **existing** Shopify store

Both have positives and negatives and it's ultimately a business decision as to which is the best route to take.&#x20;

:::hint{type="info" attributes="[object Object]"}
**Considerations to bear in mind**
A major benefit of SparkLayer is being able to integrate it without needing to duplicate stores. If you're looking to implement SparkLayer in this way, it's important to consider the following:

- **Stock and warehouses:** currently, it's not possible to route B2B orders to use specific stock locations in Shopify when using the checkout. This means that, if you're installing SparkLayer on your main Shopify store, B2B orders will need to **share the same stock pool**. This can have knock-on effects on stock allocation and the impact needs to be carefully considered.
- **Verify your apps***:* Do you have any apps installed that may interfere with the B2B experience? E.g. apps that send 'leave a review' emails or any post-purchase follow ups. Many will allow you to exclude interactions based on customer tags; remember, all customers that use SparkLayer will have a tag of `b2b` assigned.&#x20;
- **Analytics and reporting**: SparkLayer will show in Shopify as a **Sales Channel** called **SparkLayer B2B & Wholesale** which makes it easy to split out your reports. Within Shopify, you should be able to segment data (e.g. Orders) by this Sales channel
- **Affiliate and tracking pixels:** your Shopify site and Shopify checkout may have special tracking code installed to monitor sales; you'll need to make sure this is excluded for B2B customers (e.g. by filtering out any customers that have a tag of `b2b`). This will likely require input from a Shopify developer so consideration will need to be given. [Learn more](https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status#add-additional-scripts)
:::



***

## Creating an additional store

It may be necessary to create a **separate** Shopify store to manage your B2B channel. Although this may sound daunting, the good news is it's relatively straightforward to set up and you can automate a lot of the process.

The most common reasons why you'd create a secondary Shopify store include:

- **Stock levels:** You need to separate out your B2B stock from your DTC&#x20;
- **Products:** You want to create a totally different product catalogue for your B2B customers
- **Integrations**: you need to integrate your B2B channel with a different system and keep it separate from your DTC channel
- **Website URL**: you need to create a separate website URL to access the store such as `b2b.yourstore.com`.

Our recommended approach is as follows:

1. **Set up your main B2B store.** This will mean installing SparkLayer, and then configuring and customising your Shopify store as you require. For example, setting up a storefront theme, customising the homepage and product pages, etc.&#x20;
2. **Set up your storefront theme**. It's likely you'll want these to use the same design, so the first step is to export your theme from your main B2B store and import it into your additional stores. [This Shopify guide](https://help.shopify.com/en/manual/online-store/themes/managing-themes/downloading-themes) shows you how to do this.
3. **Install SparkLayer on your additional stores**. Just as with your main store, you will need to install SparkLayer on each additional store. We're happy to assist in this process and also discuss a combined pricing rate.
4. **Synchronise your data**. The final step is to set up a mechanism to synchronise data between all your stores. This can include product data, CMS content, even orders. We recommend two highly rated Shopify apps to do this: [Matrixify](https://apps.shopify.com/excel-export-import) and [Syncio](https://apps.shopify.com/syncio).

It's likely that you will need someone with Shopify expertise to help in this process and we are happy to advise where possible.&#x20;

[title] Shopify Flow for B2B
[path] Integrations/Shopify/Shopify Customisations/

## Introduction

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5AoXM2GdloinC8OnNdvrW_image.png)

[Shopify Flow ](https://help.shopify.com/en/manual/shopify-plus/flow)is powerful feature for merchants on the Shopify, Advance, or Shopify Plus plans that allow automations to be configured based on certain actions.&#x20;

We've included some additional ready made **Shopify Flow workflows** that you can [import](https://help.shopify.com/en/manual/shopify-plus/flow/create-workflow/import-export#import-workflows) into your Shopify admin.&#x20;



***

## Order automations

| Trigger                                                   | Details                                                                                                                                                                                                                                         | Download                                                                                                                                          |
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Mark order as paid`                                      | When a B2B customer places an order via manual payment methods, the order will automatically be marked as paid                                                                                                                                  | [Download](https://cdn.shopify.com/s/files/1/0565/7500/0728/files/Mark_B2B_orders_as_paid_0a29877b-9fb6-4d8a-9f10-ca27ba055b66.flow?v=1635839553) |
| `Mark Payment on Account order as paid`                   | When a B2B customer places an order specifically via "Payment on Account", the order will automatically be marked as paid                                                                                                                       | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Mark_B2B__Payment_on_Account__orders_as_paid.flow?v=1710337044)                 |
| `Archive B2B orders`                                      | Automatically archive B2B orders from your Shopify Orders view; useful if you want to hide them from your standard DTC orders                                                                                                                   | [Download](https://cdn.shopify.com/s/files/1/0565/7500/0728/files/Archive_B2B_Orders.flow?v=1635838493)                                           |
| `Tag pre-orders`                                          | Set up a rule to tag an order when pre-order products are purchased                                                                                                                                                                             | [Learn more](docId\:Gj_Ao_gQ6oA-jx0D27Hys)                                                                                                        |
| `Tag order with the net terms applicable to the customer` | Based on the [net terms](docId\:yWm70oQUosyKOoIqb4Z4G) that are set against the customer (via a metafield), this will then automatically tag their orders with a special Net Terms tag.                                                         | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Tag_order_with_what_net_terms_the_customer_is_on.flow?v=1722499862)             |
| `Populate order metafield from custom checkout fields`    | When using [customer checkout fields](docId\:o3nDhZBCxisWH6M6satDt) (e.g. a date selector), this will pull the data from the draft order and populate metafields on the completed order.                                                        | [Download](https://cdn.shopify.com/s/files/1/0631/8453/5705/files/Update_order_Metafield_with_SparkLayer_Custom_Attributes_1.flow?v=1754639426)   |
| `Control B2B Order Fulfilment Flow`                       | Automatically route orders from your wholesale customer group to a specific stock location for fulfilment in Shopify. This works with the Shopify Stock Location feature to ensure B2B orders are handled separately from standard (B2C) flows. | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/B2B_Fulfilment_location_11.flow?v=1760365759)                                   |



***

## Customer automations

| Trigger                                                                   | Details                                                                                                                                                                                                        | Download                                                                                                                                                                                      |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Switch tag on first order`                                               | When a B2B customer places their first order, replace their existing tag with a new one and send an internal email                                                                                             | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/B2B_-_switch_tag_assigned_to_a_B2B_customer_after_their_first_order_acb41199-9408-48f9-8e5e-f1228e836ceb.flow?v=1714641440) |
| `Automatically adjust customer tag for customer group depending on spend` | If you have different customer groups (e.g. Gold, Silver, Bronze), you can automatically update the customer's tag based on their order spend. This allows you to automatically change a customer's B2B group. | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Automatically_adjust_customer_tag_for_customer_group_depending_on_spend.flow?v=1722499466)                                  |



***

## Product automations

| Trigger                                                                           | Details                                                                                                                                                                  | Download                                                                                                                                                           |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Remove restock date in metafield when variant back in stock`                     | If you're using [pre-orders](docId\:Gj_Ao_gQ6oA-jx0D27Hys) and you've set a restock date, this automation removes the restock date when the product comes back in stock. | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Remove_restock_date_in_metafield_when_variant_back_in_stock.flow?v=1722499600)                   |
| `Automatically mark new products with B2B ordering & Online store sales channels` | When adding new products to your Shopify store, this will automatically assign the B2B Ordering and Online Store sales channel                                           | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Automatically_mark_new_products_with_B2B_ordering_Online_store_sales_channels.flow?v=1722499725) |
| `Add RRP metafield when product status updated`                                   | When a product’s status changes, this automation adds the RRP metafield if it doesn’t already exist.                                                                     | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Add_RRP_when_product_status_updated.flow?v=1772815525)                                           |
| `Update RRP metafield when product updated`                                       | When a product is updated, this automation updates the RRP metafield to ensure the value stays in sync.                                                                  | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Update_RRP_Metafield_when_product_updated.flow?v=1772815525)                                     |



***

## Email automations

| Trigger                                                                | Details                                                                                                                                                                                                      | Download                                                                                                                                                             |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Send an email with order details`                                     | Send an email to a specified email address when a B2B customer places an order via a specific B2B payment status; great if you need to notify other members of your team who handle B2B accounts (see below) | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/B2B_-_Draft_order-_Send_email_to_verify_the_order.flow?v=1762519098)                               |
| `Send notification based on custom checkout fields (Draft Orders)`     | Based on specific [custom checkout fields](docId\:o3nDhZBCxisWH6M6satDt), trigger an action such as an internal email                                                                                        | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/B2B_-_Draft_Checkout_Custom_Attributes_-_Send_email_based_on_criteria.flow?v=1717486893)           |
| `Send notification based on custom checkout fields (Completed Orders)` | Based on specific [custom checkout fields](docId\:o3nDhZBCxisWH6M6satDt), trigger an action such as an internal email                                                                                        | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/B2B_-_Completed_Order_Checkout_Custom_Attributes_-_Send_email_based_on_criteria.flow?v=1717486893) |
| ` Email sales agent when order placed by customer`                     | Based on specific rules you set, you can send notifications to sales agents when an order is placed.                                                                                                         | [Download](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/Sales_Agents_-_Email_sales_agent_when_order_placed_by_customer.flow?v=1726494991)                  |

Using Shopify Flow, you can modify the contents of the email to include dynamic content. In the example below (*Send an email with order details*), customer details and order details are included and sent to a specific email address.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/b4JFLjuxs1Rt1JG06uB4s_image.png)


[title] Katana
[path] Integrations/ERPs & Operations/

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-TGn0yJ2eE6VnBjSZW86sT-20250604-124134.jpg)

:::hint{type="info"}
**Requirements**

- Plan: Merchants must be signed up to the Professional or Enterprise plan
- Platform: Merchants must be using Shopify
:::

## Introduction

Katana is a manufacturing ERP that gives you a live look at all the moving parts of your business - sales, inventory, and production. You can learn more about Katana [here.](http://brightpearl.com/)



***

## How it works

The Katana integration for SparkLayer is available for all Shopify merchants that already use Katana and allows you to bring **B2B pricing** to your Shopify store. The integration works in the following ways:

| Item              | Details                                                                                                                                                         |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Customers`       | Katana becomes the 'master' of your B2B customer data, and any changes to tagged customer records will automatically be synchronised to Shopify and SparkLayer. |
| `Product Pricing` | Price lists and product prices are imported into SparkLayer via pricing rules you set up in Katana                                                              |



***

## Configuring on SparkLayer

To configure Katana on SparkLayer, you'll need to have an approved account with Katana. Please visit the [Katana website](http://katanamrp.com/) to learn more. To get started using Katana on SparkLayer, you'll first need to enable the integration.&#x20;

Within the [SparkLayer Dashboard](https://docs.sparklayer.io/sparklayer-dashboard/the-sparklayer-dashboard), go to the **Integrations** section and click **Partner Integrations**. Under **Multi-channel management**, click the toggle on the right to activate the Katana integration. You'll then be prompted to authorise SparkLayer to access your Katana account.



***

## Configuring Customers

Broadly speaking, Katana is your **central location&#x20;**&#x66;or managing B2B customer data. When customers are configured in Katana as B2B customers, SparkLayer can automatically retrieve this data and then enable the B2B ordering experience on your Shopify site.

You can then create specific rules for this customer group, e.g. minimum orders, price lists, via the [Customer Group](https://docs.sparklayer.io/sparklayer-dashboard/the-sparklayer-dashboard/settings#customer-groups) section within SparkLayer.

:::ExpandableHeading
**Step 1 - Customer mapping**

Customers are mapped between the systems based on the **primary email** set within Katana. Once this is mapped, SparkLayer will then synchronise the following data into Shopify.

| **Katana**          | **Shopify / SparkLayer**                                             |
| ------------------- | -------------------------------------------------------------------- |
| `Address`           | Shows against customer record in Shopify                             |
| `Primary Telephone` | Shows against customer record in Shopify                             |
| `First / Last Name` | Shows against customer record in Shopify                             |
| `Customer Category` | Shows against customer record in Shopify - matches to customer group |
| `Company Name`      | Shown via metafields in Shopify                                      |
| `Discount Rate`     | Shown via metafields in Shopify                                      |
| `Price List`        | Shown via metafields in Shopify                                      |


:::

:::ExpandableHeading
**Step 2 - Adding new B2B customers**

Katana will be the **central source for your customer data**. When creating a new customer in Katana and you want to set them up as a wholesale customer through SparkLayer, you will need to assign them to a Catagory which should match the **Customer group tag** of the group you want to assign them to.

For example, if you want to assign them to the below **B2B - Canada** customer group. The Category name in Katana would be `b2b-ca`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VCpaeUVexzGyLicOpq8_U_image.png)

In our example, the Category name in the customer in Katana is set to match `b2b-ca`&#x20;

When new customer records are added to Shopify, they will by default be added as **Pending** customer accounts and receive an **automatic email** to enable their account by setting a password.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/t-ZxF8zpLQX4PcTBbpTgA_image.png)

This uses the **Customer account invite&#x20;**&#x6E;otification email which can be edited in the Notifications section within Shopify.

You can configure whether the email is sent or not from the SparkLayer Katana settings.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/I9-8ha-7n-jVHoSpHcD4X_image.png)
:::



***

## Configuring Product Pricing

Once customers are mapped between Katana and SparkLayer, the next step is to configure your B2B pricing. As with customers, Katana is your centralised source for managing your B2B pricing.

:::ExpandableHeading
**Step 1 - Setting up B2B pricing in Katana**

Within Katana, go to **Price Lists**. To add a new price list, click the Add new price list button and complete as necessary.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Z8UwOizZ2b46rvTjipmD2_image.png)

In the example above, we've created two price lists; B2B and UKVIP. When creating your price list(s) in Katana, you'll be able to add pricing rules for products. In the example below, you can see pricing for the UKVIP price list.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/v9Iwakbh_3MjLGxTKidL2_image.png)

In order for SparkLayer to map this data, price list records are **automatically** imported each time you add a price list in Katana. The mapping works as follows:

| **Field name in SparkLayer** | **Field name in Katana** |
| ---------------------------- | ------------------------ |
| Handle / ID                  | Price list ID            |
| Name                         | Price list name          |
| Currency                     | Currency                 |

Price lists will be made using the Katana's base currency. Automatic price lists with currency conversion will be created for customers that are given a different currency in Katana.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/gWNT8bJIjX9Y68Rmkm2pi_image.png)
:::



***

## Known limitations

Please note the following:

- Default addresses in Katana will be mapped to Shipping and Billing address in Shopify as Shopify doesn't support independent addresses.
- A customer that is removed from the customer group will also need their allocated 'b2b' tag removed from their customer account in Shopfiy.
- Addresses are a 1-way sync currently, from Katana into Shopify. Its recommended to not allow address editing in SparkLayer otherwise new addresses added won't appear in Katana.
- Deleted pricing in Katana will not sync back to the Shopify. You will need to manually delete the pricing from the SparkLayer dashboard.



***

## Troubleshooting

:::ExpandableHeading
**Why isn’t my customer data syncing from Katana to Shopify?**

- Confirm the primary email address is set in Katana; it's used for mapping.
- Check that the SparkLayer integration has been authorised within Katana under **Configuration > Integrations > Partners**.
:::

:::ExpandableHeading
**Why are customer addresses not updating in Katana when edited in SparkLayer?**

- Address sync is one-way: from Katana to Shopify. Changes made in SparkLayer will not reflect in Katana.
- To maintain data consistency, it's recommended to disable address editing in SparkLayer.
:::

:::ExpandableHeading
**New customers in Katana aren’t appearing in Shopify. What should I check?**

- Make sure the Katana integration is active and authorised.
- Ensure new customers have all required fields, especially the email.
- Check Shopify’s **Customer account invite** email settings to ensure invites are sent or disabled correctly via SparkLayer settings.
:::

:::ExpandableHeading
**My price list changes in Katana are not visible in SparkLayer. What might be wrong?**

- Price lists must be created or updated directly in Katana.
- Deleted pricing in Katana does **not** automatically sync — you must manually remove obsolete pricing from the SparkLayer Dashboard.
:::

:::ExpandableHeading
**Why is the wrong price showing for a B2B customer?**

- Double-check that the customer is correctly assigned to the right price list in Katana.
- Verify that customer has the correct currency assigned if using a different currency than the base.
:::

:::ExpandableHeading
**My new price list isn’t appearing in SparkLayer. What should I do?**

- Confirm the price list has been properly saved in Katana.
- Allow time for SparkLayer to auto-import the price list list.
:::

:::ExpandableHeading
**Where can I change the invite email that new customers receive?**

- Go to Shopify Admin > Settings > Notifications, and edit the Customer account invite email template.
- SparkLayer uses this template when enabling new accounts created from Katana.
:::


[title] Wix Limitations
[path] Integrations/Wix/

## Introduction

Currently, there are a number of limitations to be aware of with the SparkLayer and Wix Integration.

| Item                      | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Product cards (Gallery)` | It is not possible to use the [Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) on a Wix store. This means that if you're showing products on your store (e.g. the homepage or gallery page), **pricing will simply be hidden**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `Metafields`              | SparkLayer does support [Metafields](docId\:OTLHhi8sQ6oS4PAt23-8H) however it's not currently possible to set these up in Wix. This means that features such as [pack sizing](docId\:CmxfrPgjQxfz9vJzTVv0D), [MSRP pricing](docId\:S_VTlJBorGmnwjjfSMom9), and others **are not available to use**. <br />In early 2025, Wix are likely to release functionality to better support this.                                                                                                                                                                                                                                                                                                                                           |
| `Customer syncing `       | SparkLayer will sync customer data from your Wix store into our system. It is important to note the following:<br />* Customer addresses are **only synced once** at the point where the `b2b` label is first added to a Wix Contact.
* Any future updates to Wix Contact addresses actioned via the Wix Dashboard centre will not sync back to SparkLayer
* It is possible to use the built-in [address book](docId\:lQXaNI7IVDqna09D9soAP) to add and edit addresses via the My Account area                                                                                                                                                                                                                                     |
| `Multi-currency`          | Currently, Wix [doesn't allow](https://support.wix.com/en/article/wix-stores-request-selling-in-multiple-currencies) a Wix store to accept multiple currencies (e.g. USD, EUR, GBP etc). <br />If you do set up multiple currencies within SparkLayer in the [Price List section](https://app.sparklayer.io/pricing/lists), it's important to note the following:<br />* Customers will see the correct currency when browser your store as a logged in B2B customer. The price they see will be the currency exchange rate at that time
* If they proceed to place an order in a different currency to your Wix store's default currency, this will create an order however the pricing will show in your default currency.&#x20; |
| `Checkout custom fields`  | Currently, it is not possible to use [custom checkout fields with Wix](docId\:o3nDhZBCxisWH6M6satDt) by default. If you access to a developer, it is however possible to use custom fields using the API. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) to learn more.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `Additional fees`         | SparkLayer does not currently support the Wix "additional fees" functionality ([learn more here](https://support.wix.com/en/article/wix-functions-adding-additional-fees-at-checkout))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `Pickup & local delivery` | SparkLayer does not currently support [Local Delivery](https://support.wix.com/en/article/wix-stores-setting-up-local-delivery) as a shipping option during the checkout. If you do require this as a shipping option, we suggest using the SparkLayer [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) tool and adding this as a 'manual' shipping method.                                                                                                                                                                                                                                                                                                                                                                                |
| `Subscriptions`           | SparkLayer does not currently support subscription programmes within Wix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `Loyalty`                 | SparkLayer does not currently support loyalty programmes within Wix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `Digital products`        | SparkLayer does not currently digital products within Wix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `Discounts and coupons`   | It is not possible to use the built-in Wix discount system alongside SparkLayer. If you require discounts, please use the SparkLayer [discount engine](docId\:WrejPw9URyjQwiQeKs_Cg).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `B2B Label`               | You must use the "B2B" label for SparkLayer to work, however you are able to rename the B2B label. If you have already used "B2B" and renamed this, if you go to create another "B2B" label it will actually be "B2B+x"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `Tax Exemptions`          | Tax exemptions will only be honoured when the customer checkout out using the Wix checkout (Upfront Payment). If you use manual payment methods Tax will be charged in the checkout                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |


[title] WooCommerce Metafields & Data Mapping
[path] Integrations/WooCommerce/

## Introduction

Metafields help you to customise the functionality and appearance of your WooCommerce store by letting you save specialised information that isn't usually captured in the WooCommerce admin. You can use metafields for internal tracking, or to display specialised information on your online store in a variety of ways.&#x20;

In the context of SparkLayer, metafields are used to capture additional B2B data that you can then use in a variety of ways:

| Type                  | Details                                                                                                                                                                                             |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Product metafields`  | Updating the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) by adding configurations such as [pack sizing](docId\:CmxfrPgjQxfz9vJzTVv0D), [RRP prices](docId\:S_VTlJBorGmnwjjfSMom9), and more |
| `Customer attributes` | Updating a customer's information by adding information such as [credit limits](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                       |
| `Order metafields`    | Updating an order with [invoicing information](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                                                        |



***

## How to add metafields to WooCommerce

The easiest way to add metafields is to action this via the SparkLayer Dashboard. Simply go to **Integrations > Platform Connection** and click "Configure" under "Configure metafields". You can then select which of the SparkLayer [Metafields](docId\:OTLHhi8sQ6oS4PAt23-8H) you'd like to enable.



## Important considerations

In order for SparkLayer to work with WooCommerce metafields, please note the following:

:::hint{type="warning"}
**Product metafields**
Metafields are always added at the product variant level, even if the product only comes in a single variant.&#x20;

**JSON data**
Some SparkLayer settings require metafields to be set up as JSON strings. These will need to be carefully added, making sure the formatting is set correctly.
:::



***

## Advanced settings

To learn about more advanced settings, including customer-level product metafield settings, please see [Product Settings](docId\:Cm9B1I6Cz0vOlc67g-fJI)

[title] Installing SparkLayer on WooCommerce
[path] Integrations/WooCommerce/

## Introduction

SparkLayer enables B2B functionality on your existing WooCommerce store, allowing your B2B customers to login, place orders, manage their account, and much more.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vWNSkcGu-6SYP5BrvL_hF_image.png)

To familiarise yourself with SparkLayer, we also recommend reviewing the following guides:

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[How SparkLayer Works](docId:_2g8HwCXnN7OFy4o199y1)

The fundamentals of what SparkLayer does
:::

:::LinkArrayItem
[Frontend](docId\:OgKfvQX13dHW2582D57kJ)

The special "interfaces" SparkLayer enables
:::

:::LinkArrayItem
[Features](docId\:SSzdKXuNMlEIDOOITHQcU)

The available features and functions.
:::
::::



***

## ⚠️ Requirements - important!

Before installing SparkLayer on your WooCommerce store, please ensure the following:

| Item                | Details                                                                                                                                                                                                                                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `WooCommerce`       | You must already have [WooCommerce](https://woocommerce.com/) installed on your Wordpress website<br />* WooCommerce: version 9 and above
* Wordpress: version 6 and above<br />If you're using a "Block theme", SparkLayer can be automatically installed (otherwise this is a manual installation process). |
| `Product SKUs`      | In order for SparkLayer to save B2B prices for your products, all products must have **SKUs**.                                                                                                                                                                                                                |
| `Customers`         | For your B2B customers to see the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa), they must be assigned an appropriate B2B "Role" within Wordpress > users                                                                                                                                    |
| `Payment Processor` | If you’re installing SparkLayer on a test store, please ensure you have an example payment method enabled. You can manage this within WooCommerce > Settings > Payments                                                                                                                                       |
| `Shipping`          | In order to place an order via the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), please ensure you have shipping rules set up. You can manage this within WooCommerce under Settings > Shipping or via SparkLayer's own [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) solution                                |

**Areas of Wordpress/WooCommerce you'll be using**

As part of setting up SparkLayer, you'll primarily be using the following areas:

| Area       | Details                                                                                                                                                                                                                            |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Products` | This will be used to setup which products you want to make available to B2B customers. See "Setting up your B2B pricing" below.<br /><font color="#9900ef">*In Wordpress/WooCommerce, go to Products*</font>                       |
| `Users`    | This will be used to setup your B2B customers. See "Setting up your B2B customers" below<br />*I*<font color="#9900ef">*n* </font><font color="#9900ef">*Wordpress/WooCommerce*</font><font color="#9900ef">*, go to Users*</font> |
| `Orders`   | This will be used to review and process and orders that are placed by your B2B customers. See "Placing a B2B order" below.<br /><font color="#9900ef">*In Wordpress/WooCommerce, go to Orders*</font>                              |



***

## 🔗 Connecting your WooCommerce store

:::hint{type="info"}
**Please note**
Setting up SparkLayer will require generating API keys within your WooCommerce store. If you're unsure how to do this, our team is happy to assist. To get in touch, please [click here](docId\:NNUw1G9z7eaJ4M78vk7t9).&#x20;
:::

To get started with SparkLayer on your WooCommerce store, there are a number of steps to follow. Once you've completed this step, you can then begin the process of configuring SparkLayer such as pricing and customer rules.

::::WorkflowBlock
:::WorkflowBlockItem
**Install the SparkLayer plugin**
First, you'll need to install the SparkLayer for WooCommerce plugin on your Wordpress store. This works just like any other manually installed plugin and you can see [full details here](https://wordpress.com/support/plugins/install-a-plugin/).

::File{src="https://archbee-doc-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/asHW769jR5kqneAYXGKrK-20251111-132502.zip" label="SparkLayer Plugin for WooCommerce.zip"}
:::

:::WorkflowBlockItem
**Register with SparkLayer**
Next, you'll need to create a SparkLayer account by [registering here](http://app.sparklayer.io/register)
:::

:::WorkflowBlockItem
**Connect your WooCommerce Store**
Once registered, go to [Integrations > Platform Connection](https://app.sparklayer.io/integrations/platform) and select WooCommerce. You'll then be prompted to enter your store URL (this should be the URL of the website you are installing SparkLayer on, e.g. `www.mystore.com`)
:::

:::WorkflowBlockItem
**Generate API credentials**
Next, you'll need to generate REST API credentials within WooCommerce. From your WordPress dashboard, you can find this within WooCommerce > Settings > Advanced > REST API

Create the REST API key with a username easily identifiable as linked to SparkLayer, such as **“SparkLayer API”** with Read/Write permissions.
:::

:::WorkflowBlockItem
**Enter the API credentials in SparkLayer**
From with the SparkLayer Dashboard [Integrations > Platform Connection](https://app.sparklayer.io/integrations/platform) paste the provided key and secret into the **“WooCommerce API Key”** and **“WooCommerce API Secret”** fields.

Press save and wait a few seconds whilst SparkLayer connects to the WooCommerce store and performs the SparkLayer plugin initialisation.
:::

:::WorkflowBlockItem
**Store connected**
This completes the process of connecting your WooCommerce store to SparkLayer! You can view all associated settings in WooCommerce by going to **WooCommerce > Settings > Integrations > SparkLayer B2B.**
:::
::::



***

## 🚢 The Onboarding process

:::hint{type="info"}
**Important**
When setting up SparkLayer, some activities take place via the [SparkLayer Dashboard](https://app.sparklayer.io/) alongside WooCommerce. You'll use the SparkLayer Dashboard primarily for setting up your B2B pricing and B2B customer rules.
:::

When you create an account on SparkLayer, you'll get access to the [SparkLayer Dashboard](https://app.sparklayer.io/). The Dashboard has a customised onboarding process that gently guides you through all the necessary steps before you're ready to start inviting your B2B customers and taking orders on your website.

::::WorkflowBlock
:::WorkflowBlockItem
**📓 Setting up your B2B price lists**
You'll then set up the B2B price lists that you want your customers to see when they login. These can be automated or you can manually upload specific pricing.
➡️ [View in dashboard](https://app.sparklayer.io/pricing)
:::

:::WorkflowBlockItem
**👪 Setting up your B2B customers**
You'll then set the ordering rules for your customers such as minimum order values, available payment methods and price lists they are assigned to.
➡️ [View in dashboard](https://app.sparklayer.io/customers/groups)
:::

:::WorkflowBlockItem
**🛠️ Installing the frontend widgets**
You'll need to check the special code snippets ("widgets") are installed on your WooCommerce store in order to show the special SparkLayer B2B interfaces.
➡️ [View in dashboard](https://app.sparklayer.io/integrations/widgets/core)
:::

:::WorkflowBlockItem
**✅ Testing & launching**
You'll then need to run through some final checks (such as placing a test order). Once you're happy, you can then launch SparkLayer and start taking orders!&#x20;
➡️ [View in dashboard](https://app.sparklayer.io/configuration/onboarding)
:::
::::

Let's now dive into each of them!



***

## 📓 Setting up your B2B pricing

:::hint{type="warning"}
**Please note**
Setting up your B2B pricing happens within the [SparkLayer Dashboard](https://app.sparklayer.io/), not via your WooCommerce admin.
:::

Within the [Price Lists](https://app.sparklayer.io/pricing) area of the SparkLayer Dashboard, you can create and manage your B2B pricing rules.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/NnGy_2umTxwNovSQXyaFN_image.png)

SparkLayer allows you to set the following pricing types:

| Type        | Details                                                                                                                     |
| ----------- | --------------------------------------------------------------------------------------------------------------------------- |
| `Manual`    | You can manually upload a CSV file with specific prices and even enable quantity pricing                                    |
| `Automatic` | You can use your WooCommerce prices and apply a discount. You can choose from your main WooCommerce price or the RRP price. |

::::WorkflowBlock
:::WorkflowBlockItem
For any products that you want your B2B customers to be able to buy, these products **must** have unique SKUs assigned. In WooCommerce, you can check this by going to **Products** and editing a product.&#x20;

If it's a single variant product, you'll see this under **Product data > Inventory**.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/N1L4s-tPzMCzL9djvuA2K_image.png)

If the product has variants (or "Variations"), you'll see this under **Product data > Variations**.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/tnheiuQgswg2pohbEm58O_image.png)
:::

:::WorkflowBlockItem
Next, go to [Price Lists](https://app.sparklayer.io/pricing/lists) within SparkLayer and click "Create Price List" to create your first B2B Price list. You can choose between an automatic or manual price list and configure how this works.
:::
::::

:::hint{type="success"}
**Ready to set your pricing?**
To learn more about pricing, please see our [full guide here](docId\:s8XcbZGxQpgdeIGWtXseT).
:::



***

## 👪 Setting up your B2B customers

:::hint{type="warning"}
**Please note**
Setting up your B2B customer rules happens within the [SparkLayer Dashboard](https://app.sparklayer.io/), not via your WooCommerce admin.
:::

[Customer Groups](https://app.sparklayer.io/customers/groups) let you configure specific rules for your customers, from defining their minimum order values and which price lists they see, through to what payment methods they're allowed to use when checking out.

Much like with Price Lists, you can fully manage this via the [SparkLayer Dashboard](https://app.sparklayer.io/customers/groups).

:::::WorkflowBlock
::::WorkflowBlockItem
Within Wordpress/WooCommerce, go to **Users** and click **Add User.&#x20;**&#x59;ou can either create a new customer or edit an existing one.

:::hint{type="warning"}
**Please note**
Please ensure that a valid address is added and all address fields are populated. Make a note of the email address you’ve added as you will need to access this to login.
:::
::::

::::WorkflowBlockItem
To synchronise to SparkLayer, under **SparkLayer Role**, the customer must be assigned to a Role that correlates to a [SparkLayer Group](https://app.sparklayer.io/customers/groups). For example, if you're using the "Base" group in SparkLayer, you'll see a role called **"SparkLayer B2B: Base"**. Once the customer signs in, they'll see the B2B rules you've configured within the [customer group](https://app.sparklayer.io/customers/groups).



![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/FFOpJTXYrWH6e7XmRqa6o_image.png)



:::hint{type="warning"}
**Please note the following on customer groups**

- SparkLayer will only synchronise customers that have a role assigned that starts with `SparkLayer B2B`
:::
::::

:::WorkflowBlockItem
Once your customers have been set up in Wordpress/WooCommerce (i.e. those with a role of "SparkLayer B2B" assigned), and you've assigned the customer group to **at least** one customer, you can then manage specific rules within the [Customer groups area.](https://app.sparklayer.io/customers/groups)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7fCXGoEM9kwL6w2vjhzrT_image.png)
:::

:::WorkflowBlockItem
You'll see a default **Base** customer group that you can use for your B2B customers. If you want to set up additional rules, you can simply click **Create Customer Group** and configure accordingly. For any additional customer groups you create, you'll need to update the role on the customer record in Wordpress/WooCommerce to match.
:::

:::WorkflowBlockItem
To simulate logging in as a B2B customer, please see **✅ Testing & launching** below.
:::

:::WorkflowBlockItem
You can also check if your customer record is syncing by using the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. Within Wordpress/WooCommerce, navigate to a Contact record that has a label of b2b. Within the URL, you'll see a unique ID at the end of the URL, e.g. `?user_id=3`

With this unique ID, you can then paste this into the [Customer Sync](https://app.sparklayer.io/data-sync/customers) area of SparkLayer. If the search results show the customer details, this confirms the customer is synchronising correctly.
:::
:::::

:::hint{type="success"}
**Ready to configure your customer groups?**
To learn more about customer groups, please see our [full guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::



***

## 🛠️ Installing the frontend widgets

SparkLayer comes with ready-made B2B-optimised "widgets" that we collectively call the SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ). The widgets simply overlay sections of your existing WooCommerce store and enable our powerful B2B features.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/xOpit3AbQHYG16nn6zmxv_image.png)

Once set up, your approved B2B customers (see above "Setting up your B2B customers") will then see your B2B pricing and can begin placing orders. You can learn more about how this works in [our guide here](docId\:ccZ1vnH0O6D_722w35Xpa).&#x20;

:::hint{type="success"}
**Auto-installation with "Theme blocks"**
If your theme support blocks, when you install SparkLayer, it will by default add the special frontend widgets to your WooCommerce store. Depending on your WooCommerce theme, you may prefer to do this manually and you can follow our steps below.
:::

**Installing SparkLayer yourself**

If you’re looking to install yourself, there are five steps to follow.

::::::WorkflowBlock
:::WorkflowBlockItem
**Install the&#x20;**[SparkLayer Core Script
](https://app.sparklayer.io/configuration/frontend/core)Within your main website header you'll need to add the SparkLayer Core Script that activates the SparkLayer functionality.

Providing your stores theme outputs the `wp_head()` functional call in the `<head>` section of the template, then the SparkLayer core script should automatically be injected on your page.
:::

:::::WorkflowBlockItem
**Install the&#x20;**[Product Detail Interface](https://app.sparklayer.io/configuration/frontend/pdp)
You'll need to update your storefront's product detail page with the SparkLayer Product Purchasing Interface. When a customer logs in and SparkLayer recognises them as being a B2B customer, this will load a special interface with their specific prices and a way to purchase.&#x20;

::::ExpandableHeading
**🛠️ View instructions**

```javascript
<spark-pdp parent-id="<?php echo absint( $product->get_id() ); ?>"></spark-pdp>
```

:::hint{type="info"}
To get started, add the code snippet above to your product detail pages. The exact location of the files may vary based on your WooCommerce theme, but look for references such as the following:

`woocommerce/single-product/add-to-cart/variable.php`
`woocommerce/single-product/add-to-cart/simple.php`

Once this is added, the interface will display for all logged in B2B customers and they can begin placing orders.
:::

:::hint{type="warning"}
**Important!**
If you're using SparkLayer on your existing website, you will need to hide elements that you don't want your B2B customers to see. To do this, you can hide elements by adding `data-spark="b2c-only"` to any element in the code.&#x20;

::embed[]{url="https://www.youtube.com/embed/rmMv-l98JoI?controls=0"}

You will need to do this for any code that renders a price, quantity selection, product options, buy now buttons, and anything else you want to hide from your B2B customers.

Please see our [full guide here](docId\:QWXsYM9X5_pvIOGUteKcP) for more details.
:::
::::
:::::

:::::WorkflowBlockItem
**Install the&#x20;**[Product Card Interface](https://app.sparklayer.io/configuration/frontend/pdp)
When you install SparkLayer, the product card interface should automatically be added. If for any reason it isn't, you'll need to update your product collection pages to show the Product Card Interface. This allows your customers to see their unique pricing and add items to their order from anywhere on your website.

::::ExpandableHeading
**🛠️ View instructions**

```javascript
<spark-product-card parent-id="<?php echo absint( $product->get_id() ); ?>"></spark-product-card>
```

:::hint{type="info"}
To get started, add the code snippet above to the file that renders products on your collection pages.&#x20;

Once this is added, the interface will display for all logged in B2B customers and they can begin placing orders.
:::

:::hint{type="warning"}
**Important!**
If you're using SparkLayer on your existing website, you will need to hide elements that you don't want your B2B customers to see. To do this, you can hide elements by adding `data-spark="b2c-only"` to any element in the code.&#x20;

::embed[]{url="https://www.youtube.com/embed/rmMv-l98JoI?controls=0"}

You will need to do this for any code that renders a price, quantity selection, product options, buy now buttons, and anything else you want to hide from your B2B customers.

Please see our [full guide here](docId\:QWXsYM9X5_pvIOGUteKcP) for more details.
:::
::::
:::::

:::::WorkflowBlockItem
**Add the&#x20;**[CSS customisations](https://app.sparklayer.io/configuration/frontend/css)
You can customise the look and feel of SparkLayer by editing special CSS controls that overwrite the SparkLayer defaults. For example, you can change button colours, font sizes, spacing, even typefaces.

::::ExpandableHeading
**🛠️ View instructions**

:::hint{type="info"}
To get started, go to **WooCommerce > Settings > Integrations > SparkLayer B2B.&#x20;**&#x54;he customisations work by adding special snippets of CSS that then load when a B2B customer signs in.

You can apply two actions:

- **CSS Overrides: t**hese will update the default SparkLayer CSS branding (see below)
- **CSS Hidden Selectors:** you can selectively hide elements on your WooCommerce store by adding selectors. For example, you may want to hide a banner from showing to a B2B customer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/PD_ktfZpDGFgAfb6Fslhl_image.png)

To get, you can add the sample CSS code available in the SparkLayer Dashboard. Once added, these then overwrite the "default" styling for SparkLayer to match your website's look and feel. [Learn more](docId\:QWXsYM9X5_pvIOGUteKcP).
:::
::::
:::::
::::::

:::hint{type="success"}
**Finished adding the code widgets?**

- Please review our [Frontend Integration Checkout](docId\:QWXsYM9X5_pvIOGUteKcP)
- You can also explore all the configurations and customisations we have available that you may want to activate on your Shopify store! [Learn more](docId\:SBEaOaCq_A7FfbTatX8bD)
:::



***

## 🛒 Placing a B2B order

Once you've logged into your WooCommerce store as a B2B customer, you can then place an order by going to any product page and adding items to your order. When you add items, they will then appear in the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) and you can then proceed to checkout to complete the order.

**How payment methods work**

When customers reach the payment step, they'll see a variety of available payment methods and can select their preference.

| Payment method       | Description                                                                                                                                                                                                      |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment on Account` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** needing to enter any payment details.                                                                                     |
| `Payment by invoice` | **👪 For the B2B customer:**<br />This will allow the customer to checkout **without** having to enter in payment details.                                                                                       |
| `Pay Online by Card` | **👪 For the B2B customer:**<br />The customer will be directed to your **standard checkout process&#x20;**&#x61;nd will be required to make payment right away (e.g. by card or via another payment processor). |

**How orders arrive into WooCommerce**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Jeuf6W-DXtlbYVp5E8Jhr_image.png)

Depending on which [payment method](docId\:ibIKczvHM085BkeJIfFYv) you've selected, orders will arrive into WooCommerce in the following ways:

| Payment Method       | Flow                                                                                                                                                                                                                                                                                                                                |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Pay by Invoice`     | The order will be created within&#x20;**&#x20;WooCommerce > Orders** with a payment status of "Pending Payment". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                                                               |
| `Pay on Account`     | The order will be created within&#x20;**&#x20;WooCommerce > Orders** with a payment status of "Pending Payment". You can then manually mark the order as paid once you have received payment (e.g. via offline means)                                                                                                               |
| `Pay Online by Card` | The order will be created within **WooCommerce > Orders** with a payment status of "Completed" providing you have this already configured within WooCommerce. You can then proceed to fulfil the order. Note: this is termed "Upfront Payment" within the [Customers](docId:5_lWMNohhjBJJppg9E6Vh) area of the SparkLayer Dashboard |

**"Unpaid" orders and "Paid" orders**

By default **all payment methods** other than Upfront Payment will be generated as "Pending Payment" orders. You will need to capture payment either via your WooCommerce Admin or via offline methods (e.g. bank transfer)

**WooCommerce checkout payment methods**

If a customer selects "Pay Online by Card" (i.e. "Upfront payment"), they'll be directed to the WooCommerce checkout. By default, they will see all WooCommerce payment methods you have set up (e.g. card payment, Paypal, etc).&#x20;

**Additional order details**

When an order is placed via SparkLayer, it will also include the following additional data:

| Attribute       | Notes                                                                                                                                                |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Custom Fields` | When viewing an order in WooCommerce, you'll see a section **"SparkLayer Order Information"&#x20;**&#x77;hich will include the Payment Method used.  |



***

## ✅ Testing & launching

The final step is to run some tests and checks to ensure SparkLayer is fully configured. Within the SparkLayer Dashboard, you'll see a number of [Launch checks](https://app.sparklayer.io/?expand=launch) to perform, from logging in as a B2B customer, through to placing an order.

We recommend following the below steps:

::::WorkflowBlock
:::WorkflowBlockItem
**Set up a customer record**
Within your Wordpress/WooCommerce admin, you'll need to ensure you have an example customer record set up (either a new one or an existing). Most importantly, a customer must be associated with an appropriate role.

*Please see "Setting up your B2B customers" above for more details on how this works.*
:::

:::WorkflowBlockItem
**Place a test order**
Once you've logged in as a B2B customer, proceed to add items to your cart and complete the checkout.

Please see *"Placing a B2B order"* above for more details on how this works.
:::

:::WorkflowBlockItem
**Invite your customers**
You could also think about sending a marketing newsletter to your customers to notify them of your new B2B store and to sign in. We also have some example messaging you can use when inviting your customers and you can explore more in [our guide here](docId\:YUfghEGoxe_h7uJfcshna). &#x20;
:::
::::



***

## ⚙️ Advanced configurations

In addition to the above setup, there are a number of other configurations that are possible at this time.

:::ExpandableHeading
**Displaying stock (inventory) levels**

You can configure SparkLayer to show [stock levels](docId\:Gj_Ao_gQ6oA-jx0D27Hys) in a variety of ways. If you want to show inventory numbers (e.g. 100), you'll need to make sure this is turned on within WooCommerce. Within WooCommerce, go to Settings > Products > Inventory and turn on **Manage stock**

You can also display this on the SparkLayer widgets (the product cards) by going to WooCommerce > Settings > Integrations > SparkLayer B2B.
:::

:::ExpandableHeading
**Adjusting tax settings**

SparkLayer supports tax calculations and simply 'inherits' the rules you've set up in your WooCommerce settings. You can learn more about how tax works [in this WooCommerce guide](https://woocommerce.com/document/setting-up-taxes-in-woocommerce/).
:::

:::ExpandableHeading
**Enabling SparkLayer JavaScript modifications (e.g. checkout customer fields, language updates)**

SparkLayer supports a range of advanced configurations that rely on updating JavaScript via **"Spark Options"**. Within our [Configurations](docId\:SBEaOaCq_A7FfbTatX8bD), you can apply any of the modifications by updating the code within your WooCommerce theme store.&#x20;

You can access this by going to **WooCommerce > Settings > Integrations > SparkLayer B2B.**

Under "Core Script Options" you can add the below code.

```javascript
{
  termsAndConditionsLink: "/policies/terms-of-service",

    checkoutCustomElements: [
      {
        name: 'shipping-date',
        translations: {
          en: {
            title: 'Preferred Shipping Date',
            detail: 'Shipping unavailable on weekends.',
          },
        },
        attributes: {
          required: true,
          type: 'date',
        },
      },
    ],
  }
```
:::

:::ExpandableHeading
**Enabling a URL redirect when signing in&#x20;**

SparkLayer supports a range of advanced configurations that rely on updating JavaScript via **"Spark Options"**. Within our [Configurations](docId\:SBEaOaCq_A7FfbTatX8bD), you can apply any of the modifications by updating the code within your Wix store.&#x20;

You can access this by going to **WooCommerce > Settings > Integrations > SparkLayer B2B.**

Under **"Core Script Options"** you can add the below code.

```javascript
{
   accountRedirect: {
      urlRegex: /\/account/g,
      goTo: "/index", // page to redirect logged in users to
   },
}
```
:::

:::ExpandableHeading
**Enabling "Dark mode" for high contract websites**

If your Wix store is set up with a darker theme, it's possible to enable a special "Dark Mode" for SparkLayer, ensuring colours and fonts are easily readable.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/2OhjBZD-eclNsunPkGyy-_image.png)

You can access this by going to **WooCommerce > Settings > Integrations > SparkLayer B2B.**

Under **"Core Script Options"** you can add the below code.

```javascript
{
     display: {
         darkTheme: true,
      },
  }
```
:::

:::ExpandableHeading
**Enabling SparkLayer shipping methods**

SparkLayer has a built-in [Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) system that lets you customise how shipping works for your B2B customers. By default, your existing shipping methods in your WooCommerce Dashboard will be used, however it's possible to update this to use SparkLayer via the [SparkLayer Dashboard here](https://app.sparklayer.io/configuration/shipping).
:::

:::ExpandableHeading
**Enabling pre-order (or "back orders")**

SparkLayer has built-in support for pre-orders (someimtes referred to as "back orders").&#x20;

Once enabled, this will then show a message to the B2B customer on the product page and allow purchasing.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/KpfP8bTDeaOUPE7joFYxr_image.png)
:::



***

## 📁 Troubleshooting

To troubleshoot the most common issues (such as issues with pricing), please see [our guide here](docId\:BlCEkkx3I30nkUcglsfw7). You can also [contact our support team](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to assist.



***

## ℹ️ Frequently Asked Questions

### Plans and pricing&#x20;

:::ExpandableHeading
**Which SparkLayer plans do you offer for WooCommerce?**

All SparkLayer plans are compatible with WooCommerce, from "Starter" right through to "Enterprise". [Learn more](https://www.sparklayer.io/pricing/) about our plans and pricing.
:::

:::ExpandableHeading
**How does billing work?**

When you sign up to SparkLayer, billing is managed via the SparkLayer Dashboard under Acccount > Plan
:::

### WooCommerce setup

:::ExpandableHeading
**Where do I find the SparkLayer WooCommerce app?**

Currently, SparkLayer can only be setup on your WooCommerce store by registering directly via [SparkLayer](http://app.sparklayer.io/register)
:::

:::ExpandableHeading
**What WooCommerce plan do I need to be on to use SparkLayer?**

You must already have [WooCommerce](https://woocommerce.com/) installed on your Wordpress website

- WooCommerce: version 9 and above
- Wordpress: version 6 and above

If you're using a "Block theme", SparkLayer can be automatically installed (otherwise this is a manual installation process).
:::

:::ExpandableHeading
**Can I have DTC and B2B on the same store?**

Yes, it's possible to install SparkLayer onto your existing WooCommerce DTC store (i.e. retail), meaning you can run both DTC and B2B on the same store. We call this a 'hybrid setup'; when your B2B customers sign in, they simply see the special SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) interface that allow them to see their prices and place orders.

If you want to see this in action, you can try our [B2B/B2C demo store here](https://demo.woocommerce.sparklayer.io/)
:::

### Store setup

:::ExpandableHeading
**Can you help me install SparkLayer on my WooCommerce website?**

By default, the SparkLayer widges will be automatically installed on your store. If you do require assistance, you can [contact our support team](docId\:NNUw1G9z7eaJ4M78vk7t9) and we will be happy to advise.
:::

:::ExpandableHeading
**Does SparkLayer work on any WooCommerce theme?**

You must already have [WooCommerce](https://woocommerce.com/) installed on your Wordpress website

- WooCommerce: version 9 and above
- Wordpress: version 6 and above

If you're using a "Block theme", SparkLayer can be automatically installed (otherwise this is a manual installation process).
:::

:::ExpandableHeading
**How does SparkLayer affect my current WooCommerce theme?**

The SparkLayer B2B widgets, including B2B pricing, cart and my account area, are only loaded once a customer who has been added to a B2B customer group successfully signs in to your store.

For all other users, your store will remain completely unaffected.

This allows you to have full control over which customers are able to see your B2B pricing and place B2B orders.
:::

:::ExpandableHeading
**What if I'm already using a wholesale B2B app on my website?**

If you already have a B2B / Wholesale app installed on your store, SparkLayer can work alongside this. It's a great way to test out SparkLayer and, once you're happy, you can simply uninstall any previous B2B apps you were using. If your previous B2B app has made code changes to your WooCommerce store, you may want to ask the app developer to remove these although this is optional.
:::

### Payments

:::ExpandableHeading
**Can I use my existing payment methods on the checkout?**

If your customers choose "Pay Online by Card" during the SparkLayer checkout process, they will simply be taken to the WooCommerce checkout. From there, any payment methods you have set up in WooCommerce (e.g. Paypal, Affirm Pay) will show up, allowing the customers to pay by this method.&#x20;

In short, if WooCommerce support specific payment methods, your B2B customers could select it during the checkout providing they choose "Pay Online by Card".
:::

### Products

:::ExpandableHeading
**How do I hide products or set up B2B-only products?**

There are a few things we recommend to make the experience better:

You could **create a B2B-only collection** and redirect customers to this once they login.&#x20;

You could also configure your WooCommerce theme to hide and show products based on tag via custom coding.


:::

:::ExpandableHeading
**Can I use my WooCommerce prices for my B2B pricing?**

Yes! SparkLayer allows you to automatically synchronise your WooCommerce prices (e.g. your main WooCommerce retail price), making it really easy to set up B2B pricing for your customers. For example, you could set your B2B prices to be 20% off your WooCommerce prices and we can even make provisions for your tax set up in WooCommerce (e.g. exclusive or inclusive of tax).
:::

:::ExpandableHeading
**How do I set up pre-order and backorder products?**

In terms of pre-ordering, SparkLayer has full support for different stock status messages and it's possible to set up products as pre-order/back-order easily - it does rely on some configuration within WooCommerce, but it's relatively easy to do!

We've [full information here](docId\:Gj_Ao_gQ6oA-jx0D27Hys) on how it works and you can even set up "due in" dates to give your customers visibility.
:::

:::ExpandableHeading
**Do I need to use product SKUs?**

In terms of product SKUs, SparkLayer relies on these being added to your products within Wix so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.

If you don't already have SKUs in Wix, it's relatively quick to do. You can either edit individual products and add them manually, or you can use Wix 'Import' or 'Edit products' feature to do this in bulk.
:::

:::ExpandableHeading
**How do I show inventory (stock) levels?**

It's possible to show inventory levels and a stock status when your B2B customers log in. You can learn more about how to enable this in [our guide here.](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;
:::

::::ExpandableHeading
**How do I restrict B2B customers from DTC inventory (and vice versa)**

If you're installing SparkLayer on a single website and you are looking to run both DTC and B2B at the same time, it will be necessary to **use the same stock pool&#x20;**&#x62;ehind the scenes. From an inventory point of view, this essentially means that both DTC and B2B customers will be ordering from the same stock source which can pose challenges.&#x20;

:::hint{type="info"}
**Important**
It is not possible to block DTC customers from ordering from your inventory and there is no mechanism in WooCommerce to do this. If you are wanting to implement this, you will need to consider:

- Creating B2B-specific products on your store&#x20;
- Creating a separate store just for your B2B customers, effectively separating out your inventory completely.&#x20;
:::


::::

### User Experience

:::ExpandableHeading
**How do I set up a B2B registration form?**

If you're looking to enable a wholesale/B2B registration form there are a few good options for this and

In summary, these are the options we recommend:

- You could use your current login/registration page and enhance the registration page with some additional fields
- You could create a brand new registration page and direct prospective B2B customers to this.&#x20;

It's also worth noting that you can manually add customers via the admin by going to **Wordpress/WooCommerce > Users** and from there you could moderate your wholesale applications.
:::

:::ExpandableHeading
**How do I invite a B2B customer to my website?**

When you're ready to invite your B2B customers to begin using your store, there are a variety of ways you can do this.&#x20;

You could  think about sending a marketing newsletter to your customers to notify them of your new B2B store and to sign in. We also have some example messaging you can use when inviting your customers and you can explore more in [our guide here](docId\:YUfghEGoxe_h7uJfcshna). &#x20;
:::

:::ExpandableHeading
**Will SparkLayer slow down my WooCommerce website?**

No. For performance, the SparkLayer Frontend only loads when a valid B2B customer successfully logs into a website; for your standard (DTC) customers, no code is loaded at all. When a B2B customer logs in, all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.
:::

:::ExpandableHeading
**How do I setup B2B-specific content on my WooCommerce website?**

This is possible but would require custom coding. We recommend consulting with a WooCommerce expert developer before making changes to your website.&#x20;
:::

### Orders

:::ExpandableHeading
**Where do I find my B2B orders in WooCommerce?**

| Payment Method                    | Notes                                                                                                                                                                                             |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment by Invoice`              | The order will be created within **WooCommerce > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means) |
| `Payment on Account`              | The order will be created within **WooCommerce > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means) |
| `Upfront Payment (Card payments)` | The order will be created within **WooCommerce > Orders** with a payment status of "PAID". You can then proceed to fulfil the order.                                                              |
:::

:::ExpandableHeading
**How do I edit orders?**

It is possible to edit orders within WooCommerce when an order is placed via SparkLayer providing payment hasn't already been processed. From WooCommerce > Oders, navigate to an order. You'll then see the option to **Edit order** allowing you to make changes.
:::

:::ExpandableHeading
**How do I send an invoice?**

In terms of invoicing, SparkLayer doesn't send invoices directly.

When sending an invoice, this is managed outside of SparkLayer and it will require you to collect payment by your preferred means. Once you've received payment, you can then mark the order as paid within Wix and then fulfil it as normal.
:::

:::ExpandableHeading
**How do I set a minimum order quantity?**

Within SparkLayer, we support the ability to set minimum/maximum order level spends for your B2B customers. You can configure these by going to the [Customer Groups](https://app.sparklayer.io/customers/groups) area of the SparkLayer Dashboard.
:::




[title] Shopify Email Notifications
[path] Integrations/Shopify/Shopify Customisations/

:::hint{type="warning"}
**Important to note**
If you are looking to customise the behaviour of your Shopify emails and notifications, we strongly recommend engaging a Shopify expert to assist. Whilst we can provide an overview of how to approach making customisations, our team cannot assist in applying any code changes.
:::

## Including B2B-specific content in an email

If you need to show B2B-specific content in your Shopify email notifications, it's possible to add special code snippets that give this flexibility.

To get started, go to the [Shopify Notifications admin](https://admin.shopify.com/settings/notifications) and load the template you want to edit, e.g. the Order confirmation. Within the code, simply add the following code snippet and adjust as required.

```html

  {% for tag in customer.tags %}
    {% if tag == 'b2b' %}
    
  	Content to show to B2B

    {% else %}
  
      Content to show to DTC
  
    {% endif %}
  {% endfor %}
```

To test your changes, you'll need to trigger the email notification (e.g. by placing a real order) and we advise testing with a customer that has been tagged with `b2b` and one that hasn't.



***

## Including Additional details (order Note attributes)

If you want to show additional data within your notifications, you can include the special order note attribute variables. For example, you may want to show a delivery date or a payment method to the customer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ZO8e9eeA-B8coEVQ-lI80_image.png)

Within the Shopify notification emails, simply add the following code to the following files:

- [Order confirmation](https://admin.shopify.com/email_templates/order_confirmation/preview)
- [Order invoice](https://admin.shopify.com/email_templates/order_invoice/preview)
- [Draft order invoice](https://admin.shopify.com/email_templates/draft_order_invoice/preview)

```html
<p>Name of field: {{ attributes.Name of Field }}</p>
<p>Name of field: {{ attributes.Another Name of Field }}</p>
```

For example, if you wanted to show the shipping date and the payment method in our example above, you would add the below.

```html
{{ attributes.shipping-date }}
{{ attributes.sparkPaymentType }}
```

This code will need to be added in an appropriate location and may need to be adjusted based on how your emails are formatted.

You can also show the order note by including the below code:

```html
{% if note != '' %} 
Note: {{ note }}
{% endif %}
```



***

## Hide discount pricing from showing

It's also possible to hide the discounting pricing from showing if you would prefer to just show the final price.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Xxi1qQXFBHdX1RhDnKSt4_image.png)

Within the Shopify notification emails, simply add the following CSS to the following files:

- [Order confirmation](https://admin.shopify.com/email_templates/order_confirmation/preview)
- [Order invoice](https://admin.shopify.com/email_templates/order_invoice/preview)
- [Draft order invoice](https://admin.shopify.com/email_templates/draft_order_invoice/preview)

This code will need to be added before the closing `</head>` tag in each email template.

```css
{% for tag in customer.tags %}
    {% if tag == 'b2b' %}
    <style>
        .order-list__item-original-price,
        .order-list__item-discount-allocation,
        p.total-discount {
          display: none;
        }
    </style>
    {% else %}
  
    {% endif %}
  {% endfor %}
```



***

## Customise the payment methods

The order notification email will by default show a payment method at the bottom. It's possible to customise what is shown here by adding the below code to the Order confirmation email.

```html
{% assign sparkPaymentType = attributes.sparkPaymentType %}
{% if sparkPaymentType == 'paymentByInvoice' %}
 Invoice Payment [change this to the required payment name]
{% endif %}
```



***

## B2B customer account invite email

Depending on how you've set up your [Customer Accounts ](https://admin.shopify.com/settings/customer_accounts)in Shopify, you can customise the notifications that are sent to your B2B customers.

:::hint{type="info"}
**Using Customer accounts ("New customer accounts")**
If you're using Shopify "Customer Accounts", you can simply direct your customers to your website's login page (e.g. `yourstore.com/account`) and they can then enter their email to receive a 6-digit access code. At this time, it is not possible to customise the email that is sent to the customer.
:::

If you're using "**Legacy accounts**" and you're creating a brand new customer record, you'll need to click "**Send account invite".&#x20;**

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FN1nMCUqE9AKpxfLBGTIz%2Fimage.png?alt=media\&token=268d58c4-aa72-4676-9afd-588e144d07e7)

This will then send the customer an "account invite" email with details on how to activate their account by setting a password ([learn more here](https://help.shopify.com/en/manual/customers/customer-accounts#invite-customers-to-create-accounts)).&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FdWavKJr5PzkJ76rIof4j%2Fimage.png?alt=media\&token=773b9e3c-94a9-4a3b-863a-c3bebc64b709)

By default, the email contents are relatively basic and you may want to enhance what is shown to the customer. You can also edit the contents of this email by going to Settings > Notifications within your [Shopify admin here](https://admin.shopify.com/settings/notifications/customer).

Under "Accounts and outreach", you'll see all related emails that can be modified. In the case of the "customer account invite", you can edit the contents [of this email here](https://admin.shopify.com/email_templates/customer_account_activate/preview). You could go a step-further and even make the contents specific to your B2B customers by using our guide above "Including B2B-specific content in an email").

Should you require, you can also edit further customer-related emails such as the "account welcome", "password reset" and more.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pI8eIUGpDhgptZz7MHsbQ_image.png)


[title] Shopify Metafields & Data Mapping
[path] Integrations/Shopify/

## Introduction

:::hint{type="success"}
**See what's possible with metafields**
To see all available metafields for SparkLayer, please see our [Metafields](docId\:OTLHhi8sQ6oS4PAt23-8H) guide.
:::

Metafields help you to customise the functionality and appearance of your Shopify store by letting you save specialised information that isn't usually captured in the Shopify admin. You can use metafields for internal tracking, or to display specialised information on your online store in a variety of ways. For full details, please refer to this [official Shopify guide](https://help.shopify.com/en/manual/custom-data/metafields).

In the context of SparkLayer, metafields are used to capture additional B2B data that you can then use in a variety of ways:

| Type                  | Details                                                                                                                                                                                             |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Product metafields`  | Updating the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) by adding configurations such as [pack sizing](docId\:CmxfrPgjQxfz9vJzTVv0D), [RRP prices](docId\:S_VTlJBorGmnwjjfSMom9), and more |
| `Customer metafields` | Updating a customer's information by adding information such as [credit limits](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                       |
| `Order metafields`    | Updating an order with [invoicing information](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                                                        |

:::hint{type="warning"}
**Important considerations**
In order for SparkLayer to work with Shopify metafields, please note the following:

- **Product metafields**
  Metafields are always added at the product variant level, even if the product only comes in a single variant.&#x20;
- **JSON data**
  Some SparkLayer settings require metafields to be set up as JSON strings. These will need to be carefully added, making sure the formatting is set correctly.
:::



***

## Automatically adding metafields

Within the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/integrations/platform), you can speed up the creation of metafields using our built-in tool to automatically configure them.

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
To get started, go to **Integrations, Platform Connection** and click **Configure** within the **Configure metafields** section. You'll then see all available metafields that can be configured for **Product** and **Customer** data.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/77PPtnle394bKNefuREm4_screenshot-2025-03-07-at-060054.png)

When a metafield is enabled, this will automatically be added to the [Custom Data](https://admin.shopify.com/settings/custom_data) section of your Shopify admin and will be 'pinned' for easy access when configuring metafields for products or customers.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/U8TldaNsA4KK5Zvo_vfGB_image.png)

Any metafields automatically created by SparkLayer in this way will be prefixed with `B2B - [name]` for example `B2B - Pack Size`

Should you need to modify or remove metafields, you can manage this via the [Custom Data](https://admin.shopify.com/settings/custom_data) section within your Shopify store.
:::
::::



***

## Manually adding metafields

:::hint{type="info"}
**Please note**
Shopify has built-in ways to set up metafields and we recommend referring to their [official Shopify guide](https://help.shopify.com/en/manual/custom-data/metafields) on the best ways to do this.&#x20;
:::

Within your Shopify store, navigate to **Settings** and click **Custom Data** and you'll see an interface similar to the below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Rv0JtRRRtcVrmWIcWnfjA_image.png)

In this example, you can see how [RRP (MSRP) pricing](docId\:S_VTlJBorGmnwjjfSMom9) is set up at a variant level and we've also included a video below to see the full steps.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/nOEsVY2lAZNVhxjUlZ_DT_image.png)

::embed[]{url="https://www.youtube.com/embed/Duue-ZGKp3A"}

### Setting up product metafields&#x20;

:::hint{type="success"}
**See what's possible with product metafields**
To see all available metafields for SparkLayer, please see our [Metafields](docId\:OTLHhi8sQ6oS4PAt23-8H) guide.
:::

:::hint{type="warning"}
**Metafields at a variant level**
Generally speaking, in the context of SparkLayer, all metafields are added at the [variant level](https://admin.shopify.com/settings/custom_data/productvariant/metafields) not the product level. This is very important to remember when configuring any metafields that you're looking to add.
:::

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/shopify-metafields.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

When setting up metafields in Shopify, you'll be required to specify the following at a minimum:

| Item             | Details                                                                                                                       |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `Metafield type` | This sets the data type, e.g. a text field, JSON, a selection of values                                                       |
| `Namespace`      | This defines the category and naming convention of the metafield. In the case of SparkLayer, this must be set as `sparklayer` |
| `Key`            | This defines the key to use, e.g. `pack_size`                                                                                 |
| `Value`          | This is then added against a product variant within Shopify (see below)                                                       |

When you're setting up the Namespace and Key via the Shopify admin, you'll be required to "combine" this in the "Namespace and key" field. In our example below, we've illustrated how this works for [pack sizing](docId\:CmxfrPgjQxfz9vJzTVv0D), entered as `sparklayer.pack_size`.

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; controls webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/shopify-metafields2.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::

### Setting up customer metafields

:::hint{type="success"}
**See what's possible with customer metafields**
To see all available metafields for SparkLayer, please see our [Metafields](docId\:OTLHhi8sQ6oS4PAt23-8H) guide.
:::

Customer metafields work in just the same way as product metafields (see above) and, once they are setup within Shopify, you can navigate to any customer record and add or edit data as required. In our example below, we've set up [payment terms](docId\:yWm70oQUosyKOoIqb4Z4G), a [sales agent group](docId\:Uw8mDbMEfwWKqZrVB5CqX), and a [customer-specific discount](docId\:v8dVUcJ7Ju0fH7BvINrEw).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/d_MruhBLzfzIHIu44_b4O_image.png)

### Populating metafields

Once you've set up metafields, you can navigate to a product, customer, or order record within Shopify and add your SparkLayer settings within the fields shown.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/wxp6fd_04rxxtUXKlD4OS_image.png)



***

## Importing metafields in bulk

Currently, Shopify offers no "built-in" way to bulk import metafield data at a variant-level so it's necessary to use third-party apps to get around this. One of the most recommended, is an app called [Matrixify](https://apps.shopify.com/excel-export-import) which allows you to easily "map" metafield data and import in bulk.



***

## Order Data

:::hint{type="success"}
**See what's possible with order metafields**
To see all available metafields for SparkLayer, please see our [Metafields](docId\:OTLHhi8sQ6oS4PAt23-8H) guide.
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/mzlPtH6XjGarmFFmr-N6b_image.png)

When an order is passed to Shopify, the following attributes are attached to the order:

| Attribute | Notes                                                                                                                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `note`    | Order Note: `sparkCartId`<br />This is added as an **order note.**<br />This is primarily for internal use for debugging                                                                            |
| `note`    | Order Note: `sparkPaymentType`<br />This is added as an **order note.**<br />This contains the name of the payment option used:<br />* upfrontPayment
* paymentOnAccount
* paymentByInvoice
* quote |
| `tag`     | A tag of `b2b` is added to any order placed via SparkLayer                                                                                                                                          |

On each line item, there is also a `Charged Price` attribute which contains the final line item price.

### Order Mapping

| Shopify                                                | Spark Layer                              |
| ------------------------------------------------------ | ---------------------------------------- |
| `processsed_at`                                        | `created_at`                             |
| `id`                                                   | `external_id`                            |
| `name`                                                 | `visible_id`                             |
| `currency`                                             | `currency_code`                          |
| `note`                                                 | `customer_reference`                     |
| `customer.id`                                          | `customer_id`                            |
| `billing_address`                                      | `billing_address`                        |
| `shipping_lines[0].title`                              | `packages[0].shipping_name`              |
|                                                        | `packages[0].shipping_sku` === 'shopify' |
| `shipping_address`                                     | `packages[0].shipping_address`           |
| `shopifyOrder.shipping_lines[X].price (SUM)`           | `packages[0].total_shipping_.gross`      |
| `shopifyOrder.shipping_lines[X].tax_lines.price (SUM)` | `packages[0].total_shipping_.net`        |
| `line_items[T].name`                                   | `packages[0].items[T].name`              |
| `line_items[T].quantity`                               | `packages[0].items[T].quantity`          |
| `line_items[T].id`                                     | `packages[0].items[T].variant_id`        |
| `(T)`                                                  | `packages[0].items[T].line_total.gross`  |
| `(T)`                                                  | `packages[0].items[T].line_total.net`    |

### Order history: importing orders into SparkLayer

It's possible to import historic B2B order data into SparkLayer, allowing customers to see their previous order history once they access their account on your store.

To do this apply a metafield as shown below:

| Item               | Details                                 |
| ------------------ | --------------------------------------- |
| `Custom data type` | Order                                   |
| `Metafield type`   | This must be set as an `boolean`        |
| `Namespace`        | This must be set as `sparklayer`        |
| `Key`              | This must be set as `order_import`      |
| `Value`            | This must be set as a boolean of `true` |

Any orders that are imported this way must also have a tag of `b2b` assigned to them within Shopify.

If you're working with a large data set and would prefer to do this manually, you can instead use order metafields within Shopify to do this. Our recommendation is to use a bulk import tool such as [Matrixify](https://apps.shopify.com/excel-export-import?st_source=autocomplete) to manage this more quickly. When importing using this tool, you can use the format below simply by adding the Shopify order ID in the `ID` column.

We also have a [sample CSV template](https://cdn.shopify.com/s/files/1/0612/7602/9065/files/example-historic-order-import.csv?v=1738672207) you can start with.

| ID                | Metafield: sparklayer.order\_import \[boolean] | Command  |
| ----------------- | ---------------------------------------------- | -------- |
| `[order-id-here]` | `TRUE`                                         | `UPDATE` |

:::hint{type="warning" attributes="[object Object]"}
**Please note**
The note attribute must be added to the order **after** SparkLayer is installed for the order to be synchronised correctly. Orders synced in this way can then be reported upon and will appear in the Orders section of the SparkLayer Dashboard.
:::

### Order ID ("Visible ID") and setting a custom order number

It's possible to use a custom order ID instead of the standard order ID generated from Shopify. A typical use-case is customising the Order ID to match order numbers generated from a back-office system (e.g. an ERP), ensuring consistency across systems.

When the "Visible ID" is set, this will then take effect when the customer views their orders from the [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5d6xB53DfFAoDBhsTL_mI_image.png)

| Item               | Details                                    |
| ------------------ | ------------------------------------------ |
| `Custom data type` | Order                                      |
| `Metafield type`   | This must be set as an `single line text ` |
| `Namespace`        | This must be set as `sparklayer`           |
| `Key`              | This must be set as `visible_id`           |

:::hint{type="warning" attributes="[object Object]"}
**Please note**
If you're using the "Visible ID" configuration, any orders that do not have this populated will fallback to the standard Shopify order number.
:::



***

## Advanced settings

To learn about more advanced settings, including customer-level product metafield settings, please see [Product Settings](docId\:Cm9B1I6Cz0vOlc67g-fJI)

[title] Shopify Payment Methods
[path] Integrations/Shopify/Shopify Customisations/

## Managing "offline" payments

SparkLayer supports the ability for customers to use offline payments such as "Pay by Invoice" and "Pay on Account" that allows you to review their orders before processing them. Once enabled for a [customer group](docId:5_lWMNohhjBJJppg9E6Vh), this will show as a payment method within the checkout flow.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/t3eJyd8x766GkQTo_2Hdr_image.png)

When a customer selects "Pay on Account" or "Pay by Invoice", the flow works as follows:

**A Draft Order is created**

When a customer places an order as a quote, the order will by default enter Shopify in the **Draft order** status. Just as with any order in Shopify, you'll see the customer's details on the top right and you can review and edit their order contents.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/s-UKqYf18JAFSi2vFfouh_image.png)

**Sending an invoice**

To send an invoice, simply click the Send invoice button beneath the order totals.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/NE5NFugt1oTqcCnZZpHlr_image.png)

This will then trigger an email to the customer where they can they review the order and make payment online.

:::hint{type="info" attributes="[object Object]"}
You can edit this email template by going to **Settings > Notifications** within Shopify and search for the **Draft order invoice** template
:::

Once the customer completes their purchase by making payment, the order is then marked as paid and will then display within your **Shopify Orders** area.

If you are looking for other ways to manage invoicing, please see [our guide here](docId\:yWm70oQUosyKOoIqb4Z4G).



***

## Hiding payment methods in the checkout

By default, when your B2B customers select "Pay Online by Card", they'll be taken to the Shopify checkout and will see all Shopify payment methods you have set up (e.g. card payment, Paypal, etc). You can learn more about [Shopify payment methods here](https://help.shopify.com/en/manual/payments/additional-payment-methods).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/UfMQghk7NVBdNK-LRMVMW_image.png)

It's possible to **conditionally** hide and show payment methods should you require your B2B customers to only see specific payment types when they checkout.&#x20;

- To get started, visit the Shopify App store and search for apps that support "hiding payment methods". One such app is ["ETP Hide and Sort Payment Methods"](https://apps.shopify.com/etp-hide-sort-payments?)
- Within the app, you can then configure rules. To detect a B2B customer, simply add a rule that filters on a tag of `b2b` being present.&#x20;
- It's important to note that the payment type "Credit card" can only be hidden if your Shopify store is on the Shopify Plus plan (this is due to limitations with the *Shopify Payment Customization API*)

In the example below, the payment types "Paypal" and "Cash on Delivery (COD)" have both been hidden for B2B customers.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/guU0Rg4uwAzhZ25V-MVgs_image.png)


[title] Shopify B2B Dawn Theme
[path] Integrations/Shopify/

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DdNMZMVhrCCDO9RQS3KT4_image.png)

## Introduction

Dawn is the first free [Online Store 2.0](https://themes.shopify.com/themes/dawn/styles/default) theme released by Shopify and is the ideal way to start configuring your Shopify store in a best-practice way. When you create a Shopify store for the first time, your store will by default use this theme and you can also use it for your existing Shopify store.&#x20;

:::hint{type="info"}
**Learn more**
You can [learn more](https://help.shopify.com/en/manual/online-store/themes/os20/themes-by-shopify/dawn) about the Dawn theme and [see it in action here](https://themes.shopify.com/themes/dawn/styles/default).
:::

To make it easy to get up and running with SparkLayer, we've created a **B2B optimised version** of the Dawn theme that you can download, configure, and then customise. The B2B optimised Dawn theme brings the following features:

- SparkLayer frontend code snippets fully installed
- The ability to restrict access with an optional login screen
- The ability to hide prices until a B2B customer signs in
- The ability to set B2B-only products that only show when a B2B customer signs in

:::hint{type="success" attributes="[object Object]"}
**Try the demo**
You can try our [Shopify Dawn demo store here](https://standalone.demo.sparklayer.io/)
:::



***

## How it works

The SparkLayer B2B optimised version of Dawn works by adapting specific parts of the Dawn theme, activating the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) as well as enabling a special login page. You can see how it works in our video below

::embed[]{url="https://www.youtube.com/watch?v=5bo9nCvSJCM"}

The B2B optimisations include:

- **A login page** that optionally forces the customer to sign in before accessing the store and allows prospective customers to apply for an account. This content for this page can be customised via the *Shopify Customizer*
- &#x20;[Product Card Interface](docId\:Mrp_Z0QIZQ2QksseuJylv) that display on collection pages, showing the customers B2B pricing and the ability to add to an order
- [Product Detail Interface](docId\:JkCjbYUAnjzp75I8ul7MT) that show the customers B2B pricing and the ability to add to an order
- [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP)**&#x20;and&#x20;**[My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-) using the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa)
- A **Quick Buy mode** that lets customers quickly build orders

:::hint{type="info"}
**Please note**

- The Dawn theme is maintained and built by Shopify and may be subject to periodic updates inline with their own releases.
:::



***

## Manually installing

To get started, you'll **first** need to install the Dawn theme on your Shopify store and then action a number of specific code changes. There are three ways to go about implementing the code snippets:

1. **Download our code samples** and simply replace the matching files within your Shopify theme: ideal if you've made no changes so far to your Dawn theme.&#x20;
2. **Download the full repository** via [Github here ](https://github.com/sparklayer-io/dawn/archive/refs/heads/main.zip)and then [uploading as a new theme](https://help.shopify.com/en/manual/online-store/themes/adding-themes#upload-a-theme-file-from-your-computer) in your Shopify store.
3. **Review our code samples** and manually apply them to your theme files: the best option if you've already made customisations to your Dawn theme.

Installing the code snippets involves adjusting (or adding) the following files and we've included direct links to Github to see the code.

| File Name                             | Details                                                                                                                                                                                                                                      | Code sample                                                                                       |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `layout/theme.liquid`                 | The code theme file where the SparkLayer core script is installed along with a number of other customisations for CSS and forced login. You'll need to add the [Frontend Integration Guide](docId\:NcgYlSrJkvmtcBoxwVKma) to complete set up | [Click here](https://github.com/sparklayer-io/dawn/blob/main/layout/theme.liquid)                 |
| `templates/page.b2b-login.json`       | **A new file** that creates a B2B login page (see guide below)                                                                                                                                                                               | [Click here](https://github.com/sparklayer-io/dawn/blob/main/templates/page.b2b-login.json)       |
| `sections/main-b2b-login.liquid`      | **A new file** that creates the content for the B2B login page                                                                                                                                                                               | [Click here](https://github.com/sparklayer-io/dawn/blob/main/sections/main-b2b-login.liquid)      |
| `sections/main-product.liquid`        | The product detail page with SparkLayer enabled                                                                                                                                                                                              | [Click here](https://github.com/sparklayer-io/dawn/blob/main/sections/main-product.liquid)        |
| `snippets/card-product.liquid`        | The product card with SparkLayer enabled                                                                                                                                                                                                     | [Click here](https://github.com/sparklayer-io/dawn/blob/main/snippets/card-product.liquid)        |
| `templates/customers/register.liquid` | An updated registration page that is required if using the forced login page                                                                                                                                                                 | [Click here](https://github.com/sparklayer-io/dawn/blob/main/templates/customers/register.liquid) |

:::hint{type="success" attributes="[object Object]"}
**Using Github?** [Click here](https://github.com/sparklayer-io/dawn) the full Dawn Github repository with changes for SparkLayer
:::



***

## Customisations

### Creating the B2B login page

:::hint{type="warning" attributes="[object Object]"}
**Important!**&#x20;
If you're wanting to set up a forced login page, please ensure a new page is created in Shopify as detailed below.
:::

You can optionally force all customers to login **before** they begin browsing your store and adding products to their B2B order.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/_OwiDxM8_B5YT9DHNbw7e_image.png)

**Setting up a new login page**

To enable this page, you'll need to create a **Page** within Shopify and then assign this page a special template.

::::WorkflowBlock
:::WorkflowBlockItem
First, add `sections/main-b2b-login.liquid` ([download here](https://github.com/sparklayer-io/dawn/blob/main/sections/main-b2b-login.liquid)) and the `templates/page.b2b-login.json` ([download here](https://github.com/sparklayer-io/dawn/blob/main/templates/page.b2b-login.json)) files to your theme, ensuring each file goes into the correct directory.&#x20;
:::

:::WorkflowBlockItem
Within your Shopify admin, under **Online Store**, click **Pages**, and then click the **Add page** button at the top
:::

:::WorkflowBlockItem
Give the page a title and then under **Edit website SEO** at the bottom, ensure the **URL and handle** is set to `b2b-login`Under **Online store** and **Theme template**, choose `b2b-login`
:::

:::WorkflowBlockItem
You can edit how the page looks and functions by going to Online Store > Themes and click the "**Customize**" button. Search for `b2b-login` to begin making changes. You can customise nearly all areas of the page such as colours, form fields, text, and more. To see how the page works, in your browser, visit `www.yourstore.com/pages/b2b-login` and you should see the new login page.
:::
::::

:::hint{type="info"}
**Learn more**
You can learn more about how to customise this page in [our full guide here](docId\:Gfc0UW7mJnMNpnNO6EdRl).&#x20;
:::

### Enabling the forced login page

If you'd rather force customers to login before seeing your store, you can easily adjust this within the `layout/theme.liquid file`.&#x20;

To enable the forced login page, simply change the following code to `true`.

```javascript
{% raw %}
{% assign showSiteForB2B = true %}
  {% endif %}
{%- if showSiteForB2B == blank -%}
  {% assign showB2BLogin = true %}
{% endif %}
{% endraw %}
```

### Hiding prices by default

If you want to **hide prices** until a customer is signed in, you can enable a special setting that will hide prices on product collection and product detail pages.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Jk0g1CxM10vmhicYAXkI7_image.png)

To enable the hiding of prices, simply set `hidePricesLoggedOut` to `true` in the following files:

- `/snippets/card-product.liquid`
- `/sections/main-product.liquid`

Within the above files, you can also adjust the text and styling that is show to the logged out customer.

:::ExpandableHeading
**How do I stop my Shopify pricing showing on Google Search?**

By default, Google will almost certainly index your Shopify store to show on their search listings. A result of this is your Shopify prices (retail prices) may also show within Google.&#x20;

It's very important to note that this is not related to SparkLayer and is in fact a built-in feature of Shopify. If you do not want your prices to show on Google this is a customisation that would need to be applied via your Shopify store (not via SparkLayer directly). The Shopify support team may be able to best advice here but there are a range of [Shopify community articles](https://community.shopify.com/c/forums/searchpage/tab/message?advanced=false\&allow_punctuation=false\&filter=location\&location=category\:en\&q=hide%20prices%20from%20google) that you can review.

Please note, making any changes to your Shopify store in this manner may effect your Google search results and we strongly advise speaking with a Shopify expert before making any changes.
:::



***

## Customising the design

Nearly all elements of the login page can be customised via the standard Shopify customisation tools. When you're in the **Customize** mode, navigate to the login page and you'll see all available content that can be modified.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/3WkgFZjD6jmwt5osEWOtq_image.png)



***

## B2B only products

The B2B optimised Dawn theme also has support for B2B only products. This is a great way to **hide specific products** from logged out customers and it's easy to configure within Shopify.

The feature works by **automatically hiding** any products that you have tagged with the specific tag `b2b-only` from within the Shopify Products admin.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/y0aDyoMk8dAAJKB-77jf1_image.png)

When you tag a product with `b2b-only`, this product will be invisible to all logged-out customers and won't show on any of your collections pages. If you need to customise this feature, you can edit how it works in the following files:

| File Name                              | Details                                      | Code sample                                                                                                |
| -------------------------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `sections/featured-collection.liquid`  | The homepage featured collection             | [Click here](https://github.com/sparklayer-io/dawn/blob/main/sections/featured-collection.liquid)          |
| `sections/main-collection-grid.liquid` | The main product collection page             | [Click here](https://github.com/sparklayer-io/dawn/blob/main/sections/main-collection-product-grid.liquid) |
| `sections/predictive-search.liquid`    | The quick search feature that shows products | [Click here](https://github.com/sparklayer-io/dawn/blob/main/sections/predictive-search.liquid)            |
| `sections/main-product.liquid`         | The main product detail page                 | [Click here](https://github.com/sparklayer-io/dawn/blob/main/sections/main-product.liquid)                 |



***

## B2B only navigation

The B2B optimised Dawn theme has support for B2B-specific navigation. This is a great way to have a different navigation based on the customer type, e.g. a B2B customer sees one navigation, a logged-out (DTC customer) sees another.

To get started, you'll need to create a new menu in your Shopify store from the "Navigation" section of Shopify (you [can access it here](https://admin.shopify.com/menus)). Proceed to set up your menu and for the **Handle**, enter `b2b-menu,` and click **Save menu**.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FGvsA5a0NNm6t20mRplM9%2Fimage.png?alt=media\&token=a2d2c70b-79a3-40ae-a80d-f77199337e46)

To activate the new B2B menu, open and edit the following files and set `showB2BNav` to `true` (as shown below)

- `snippets/header-mega-menu.liquid`
- `snippets/header-dropdown-menu.liquid`
- `snippets/header-drawer.liquid`

```html
{% assign showB2BNav = true %}
```

To test this, sign in as a B2B customer and you'll see the navigation on your store.



***

## Quick Buy Mode

The B2B optimised Dawn theme also has support for 'quick buy mode' that allows you to display product collection pages in a more streamlined view for your B2B customers. Once enabled, your collection pages will be displayed similar to below with pricing, variant options, product rules (e.g. pack sizing) and the ability to quickly add items to an order.

:::hint{type="success" attributes="[object Object]"}
**Try the demo**
Visit our [Demo site](https://demo.sparklayer.io/) and click [Quick Buy](https://demo.sparklayer.io/collections/sample-quick-buy) once logged in
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/_CAhvHR4W6uyByRj5GBGo_image.png)

To enable 'quick buy mode', within Shopify, go to **Products** and click **Collections** and then edit the collection page you wish to apply this to. From the **Theme template** section, simply choose **quick buy** from the list of options and click save.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/kcBjoevGRH4hAqajbKQHL_image.png)

It's also possible to apply the 'quick buy mode' to all collection pages if you'd prefer. To enable this, open the file `/templates/collection.json` and adjust the code as shown below.

```json
"product-grid": {
      "type": "main-collection-product-quick-buy",
```

From an implementation point of view, the 'quick buy mode' enables a special template view, managed within the following files:

- `/sections/main-collection-product-quick-buy.liquid` [View sample code](https://github.com/sparklayer-io/dawn/blob/main/sections/main-collection-product-quick-buy.liquid)
- `/snippets/card-product-quick-buy.liquid` [View sample code](https://github.com/sparklayer-io/dawn/blob/main/snippets/card-product-quick-buy.liquid)

It's also possible to adjust the styling of the 'quick buy mode'. Simple open `/sections/main-collection-product-quick-buy.liquid` and edit the CSS displayed at the top.

:::hint{type="warning" attributes="[object Object]"}
**Important to note**
If you apply the new 'quick buy mode' to your collection pages, this will also take effect for logged-out customers also. If you are looking to customise the behaviour of how this works, we recommend engaging a Shopify expert to assist.
:::



***

## Sample products and price lists

If you're starting your B2B store on Shopify from scratch, you can even install our sample B2B products to populate your product catalogue and price lists in SparkLayer. You can see these in action on our [demo store.](https://b2b-demo-store-dawn.myshopify.com/)

This is a great way to see how SparkLayer works on your Shopify store before then configuring it with your own products.

| Item                            | Notes                                                                                                    | Download CSV                                                                                                       |
| ------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `Shopify sample products`       | Upload CSV via the Products admin in Shopify                                                             | [Click here](https://cdn.shopify.com/s/files/1/0608/1642/5195/files/Sample_Shopify_Products.csv?v=1635762514)      |
| `SparkLayer sample B2B pricing` | Upload CSV via the [Price Lists](docId\:lDePanHogqwEGNf-jHZ6L) admin in the SparkLayer Dashboard         | [Click here](https://cdn.shopify.com/s/files/1/0608/1642/5195/files/Sample_SparkLayer_B2B_prices.csv?v=1635762514) |
| `SparkLayer sample metafields`  | Upload CSV via a third-party app such as [Metafields Guru](https://apps.shopify.com/metafields-editor-2) | Click here                                                                                                         |


[title] Shopify FAQs
[path] Integrations/Shopify/

## Introduction

We've included some of our most commonly asked questions below. If you can't find the answer you're after, please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.



***

## Frequently Asked Questions

### Shopify setup

:::ExpandableHeading
**What Shopify plan do I need to be on to use SparkLayer?**

SparkLayer works on all versions of Shopify, from Shopify Basic right through to Shopify Plus. All you need is an active Shopify store and you're good to go.
:::

:::ExpandableHeading
**How does SparkLayer compare to Shopify B2B?**

Shopify expanded native B2B features to all plan tiers, including company accounts, up to 3 pricing catalogs, net terms, PO numbers, and easy reorders. For merchants with a handful of wholesale accounts on simple terms, this covers the basics.

SparkLayer is designed for merchants who need more. Here are the key differences:

**Pricing flexibility** - Shopify's free B2B tier limits you to 3 pricing catalogs assigned to Markets (customer groupings). If you need more than 3 pricing tiers or per-customer pricing, you'd need Shopify Plus at $2,300/month. SparkLayer gives you unlimited price lists on all plans, assigned directly to customer groups.

**Sales team ordering** - Shopify offers staff accounts that can create draft orders in the admin. SparkLayer has a dedicated Sales Agent Portal where reps log in, switch between customer accounts, see customer-specific pricing, and place orders on behalf of buyers. It's a fundamentally different workflow.

**B2B ordering features** - Several capabilities are only available through SparkLayer and don't exist on any Shopify plan, including Plus: CSV and bulk order upload, AI Intelligent Cart (auto-builds carts from emailed POs), saved shopping lists, advanced discounts, a Quoting Engine for quote-to-order workflows, and self-service invoicing.

**Works on any theme** - SparkLayer overlays a B2B experience on top of your existing Shopify theme. Shopify's native B2B works best with their Trade theme.

**Transaction fees** - SparkLayer charges no transaction fees on any plan. Shopify charges variable platform fees on B2B orders across all plan tiers.

**Shopify Companies compatibility** - SparkLayer works alongside Shopify's Companies feature. Draft orders created through SparkLayer are automatically associated with the correct Shopify Company, Contact, and Location for accurate order attribution and reporting.

SparkLayer and Shopify's native B2B can't currently run side by side for the same customer session - it's one or the other for the ordering experience.

For a full feature-by-feature breakdown, read our detailed comparison: [SparkLayer vs Shopify B2B - What You Need to Know](https://sparklayer.io/blog/2026/04/03/shopify-b2b-all-plans/)
:::

:::ExpandableHeading
**Can I use SparkLayer with my development website?**

Yes! If you're setting up SparkLayer on a development store (e.g. a test account), we can enable a special developer-mode that lets you use SparkLayer until you're ready to activate a billing plan. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) for more details.
:::

:::ExpandableHeading
**Can I have DTC and B2B on the same Shopify website?**

Yes, It's possible to install SparkLayer onto your existing Shopify DTC store (i.e. retail), meaning you can run both DTC and B2B on the same store. We call this a 'hybrid setup' and [we've a guide here](https://www.sparklayer.io/blog/2022/04/04/shopify-hybrid-b2c-b2b/) that explains how works. When your B2B customers sign in, they simply see the special SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) interface that allow them to see their prices and place orders.

If you want to see this in action, you can try our [B2B/B2C demo store here](https://b2b-demo-store-usd.myshopify.com/)
﻿
﻿Sometimes it can be better to separate out your B2B store onto a secondary Shopify store and we've detailed some of the [common reasons](https://www.sparklayer.io/blog/2021/12/15/shopify-b2b-store-setup/).
:::

:::ExpandableHeading
**Which version of Shopify "Customer Accounts" is SparkLayer compatible with?**

When setting up your Shopify store, it's possible to choose from two types of 'Customer Accounts' within Shopify:

- **Legacy (Classic) customer accounts:** this is how most Shopify stores are set up and allows compatibility with third-party apps and the ability to customise the look and feel
- **New customer accounts**: this uses a 'password-less login' and has a locked down account area that uses Shopify's 'out of the box' functionality (very similar to the checkout)

**Compatibility with SparkLayer**

SparkLayer works with both versions of accounts. You can learn more in [Shopify Customisations](docId\:ddIv5TDAnCayWTOJ0Vyb7) under "Shopify customer accounts"
:::

:::ExpandableHeading
**Is there support for Shopify "Companies"?**

Yes, please refer to our full guide, [Shopify Companies](docId\:wrzSu8adFvbXOkF50hX5I).&#x20;
:::

:::ExpandableHeading
**What is the "SparkLayer B2B & Wholesae" (B2B Ordering) pixel that's added to my Customer Events within Shopify?**

When a customer places an order via the Shopify Checkout, SparkLayer needs to know when the order is completed. By adding a special Shopify pixel, this then resets contents of the customer's order and allows them to place additional orders if they wish. **Please note, this step is fully automated when you install SparkLayer and no action is typically required.**

To check the SparkLayer pixel has been added to your Shopify store, go to **Settings** and click **Customer events**. You should see a pixel added by SparkLayer and this should be set to the Connected state. When you view the pixel, you will see it called **"B2B Ordering"&#x20;**&#x77;hich corresponds to the Sales Channel used by SparkLayer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Dr2VhbtHuZaNwQFrxj1tj_pixel.png)

If you don't see the SparkLayer "B2B Ordering" pixel, you will need to reconnect your Shopify store via the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/integrations/platform). Simply click the "Save" button at the bottom, and this will activate the pixel for you.
:::

### Theme setup

:::ExpandableHeading
**Can you help me install SparkLayer on my Shopify website?**

Yes! Within the [SparkLayer Dashboard](https://app.sparklayer.io/help), you'll see an option to request our team to install SparkLayer for you. Typically we can do this within 1-2 working days and you're then good to go. We then offer an onboarding session to walk you through how everything works.
:::

:::ExpandableHeading
**Does SparkLayer work on any Shopify theme, include Online Store 2.0?**

Yes! SparkLayer is compatible with all Shopify themes, even fully customised. If you need help in the setup, our team can add all the code snippets for you. You can even try our [Shopify B2B Dawn Theme](docId\:LHkU0_G_4GVef1jAmgXmo)
:::

:::ExpandableHeading
**Can SparkLayer work with my variant "image switcher"**

SparkLayer works by updating the product page templates with our special frontend widgets - these automatically pull in your variants, SKUs, and any associated product data that is required for your B2B customers. When they are loaded into your Shopify store, they essentially 'replace' the existing Shopify purchase area that your regular DTC (retail) customers see. Very often, we see Shopify themes that have functionality whereby changing variants will auto-update the main product imagery.

This itself is almost always very specific "custom coding" to the theme that is being used - on a technical level, it will be using Shopify theme specific JavaScript coding to do this and will be engineered in a particularly way for the theme. When our SparkLayer widgets are loaded in, they won't have any handling for this specific JavaScript that controls the imagery, so this functionality isn't compatible for logged in B2B customers. As a solution to this, we have released a guide (aimed at Shopify developers) to point them in the right direction to make SparkLayer compatible based on the specific theme they are using. [Learn more](https://docs.sparklayer.io/tech-docs/javascript-sdk#qReb9)
:::

:::ExpandableHeading
**If I update my Shopify theme, will I need to re-install SparkLayer?**

SparkLayer requires adding specific code to your Shopify store and normally involves updating 3 or 4 files within your theme. When you perform a theme update, it's likely that these changes will be removed and the SparkLayer code will need adding back in. We are always happy to perform this re-install for you, please [get in touch](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.
:::

:::ExpandableHeading
**How does SparkLayer affect my current Shopify theme?**

The SparkLayer B2B widgets, including B2B pricing, cart and my account area, are only loaded once a customer who has been tagged with b2b successfully signs in to your store.

For all other users, your store will remain completely unaffected.

This allows you to have full control over which customers are able to see your B2B pricing and place B2B orders.
:::

:::ExpandableHeading
**What if I'm already using a wholesale B2B app on my website?**

If you already have a B2B / Wholesale app installed on your store, SparkLayer can work alongside this. It's a great way to test out SparkLayer and, once you're happy, you can simply uninstall any previous B2B apps you were using. If your previous B2B app has made code changes to your Shopify store, you may want to ask the app developer to remove these although this is optional.
:::

:::ExpandableHeading
**Will SparkLayer slow down my Shopify website?**

No. For performance, the SparkLayer Frontend only loads when a valid B2B customer successfully logs into a website; for your standard (B2C) customers, no code is loaded at all. When a B2B customer logs in, all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.
:::

:::ExpandableHeading
**How do I set up a B2B registration form?**

If you're looking to enable a wholesale/B2B registration form, we recommend the following options:

- **SparkLayer Forms (recommended)** - Our built-in, no-code form builder lets you create and manage B2B registration forms directly within SparkLayer. Get started with the ready-made Customer Registration Form template which includes approval workflows, automatic customer tagging, and email notifications. No third-party apps needed. Learn more about [SparkLayer Forms](docId\:nn5qnfmfGkXlyUmAMpSnq) or get started in the [SparkLayer Dashboard](http://app.sparklayer.io/forms).
- **B2B Login and Registration Page** - We offer a free, ready-made template that adds a dedicated B2B login and registration page to your Shopify store (e.g. yourstore.com/pages/b2b-login). It includes a login form for existing wholesale customers, a registration form for new applicants, and is fully customisable via the Shopify Customizer. Our team is happy to install this for you at no charge. Learn more in  [Shopify B2B Registration & Login](docId\:Gfc0UW7mJnMNpnNO6EdRl)&#x20;

It's also worth noting that you can manually add customers via the Shopify Customers admin and from there you could moderate your wholesale applications.
:::

:::ExpandableHeading
**How do I stop my Shopify pricing showing on Google Search?**

By default, Google will almost certainly index your Shopify store to show on their search listings. A result of this is your Shopify prices (retail prices) may also show within Google.&#x20;

It's very important to note that this is not related to SparkLayer and is in fact a built-in feature of Shopify. If you do not want your prices to show on Google this is a customisation that would need to be applied via your Shopify store (not via SparkLayer directly). The Shopify support team may be able to best advice here but there are a range of [Shopify community articles](https://community.shopify.com/c/forums/searchpage/tab/message?advanced=false\&allow_punctuation=false\&filter=location\&location=category\:en\&q=hide%20prices%20from%20google) that you can review.

Please note, making any changes to your Shopify store in this manner may effect your Google search results and we strongly advise speaking with a Shopify expert before making any changes.
:::

### Discounts

:::ExpandableHeading
**How do I set up discount promotional codes at checkout?**

It's possible to set up discount codes that customers can use during the checkout process. For example, you could set up a discount coupon that gives them 10% off their order.

To learn how discounts work, please see [our guide here.](docId\:WrejPw9URyjQwiQeKs_Cg)
:::

:::ExpandableHeading
**How do I set up discounts to apply across a product range?&#x20;**

Within the SparkLayer [Discounts](docId\:WrejPw9URyjQwiQeKs_Cg) , using the "Advanced requirements and rewards", you can setup discounts to apply to products with specific tags setup within your store (e.g. in Shopify). For example, you could set the discount to only apply if products within the cart have a tag of `dog-toy` applied, or match a broad term of `dog`. This allows you to setup discounts to apply to collections and product ranges easily.

There are also other workarounds without using discounts:

- You could create a brand new product in Shopify and set up a range of variants within it (e.g. all the products you want to offer within the discount)
- We have a special setting called *minimum product quantity* ([See our guide here](docId\:CmxfrPgjQxfz9vJzTVv0D)) which forces the customer to order at least X of the product (e.g. 3)
- Using the [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe), you can then set up your discounted rates (e.g. buy 3 and the price is 10% cheaper)
- Within Shopify, you could make these products 'hidden' from standard B2C customers simply by not associating them to a collection
:::

:::ExpandableHeading
**How do I set up discounts based on an order total?**

It's possible to set up discounts that apply based on a certain threshold, e.g. the order total or the number of items in a cart. To learn more about discounts, see [our guide here](docId\:WrejPw9URyjQwiQeKs_Cg)
:::

### Payments

:::ExpandableHeading
**How do B2B payments work with SparkLayer and Shopify?**

SparkLayer supports a range of B2B-specific payment methods that can be tailored on a per-customer basis. Our diagram below illustrates how they work in the context of SparkLayer and Shopify. To learn more, please see our [full guide here](docId\:efevur-A3yCJXUHvrR7t-).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/TENR2PPGjIE6eHAwrpbEG_image.png)
:::

:::ExpandableHeading
**Do vaulted credit cards work with SparkLayer?**

Yes! Shopify's vaulted credit card feature is fully compatible with SparkLayer. For it to work, the customer placing the order must be assigned to a Shopify company (under Customers > Companies in the Shopify admin). Once a customer within that company location has saved a card - either during checkout or via their customer account - any other customer linked to the same company location can use it.

Vaulted cards appear as an option when a customer selects "Pay Online by Card" during the SparkLayer checkout process. They can also be charged against draft orders created by SparkLayer - for example, if a customer places an order using "Pay by Invoice", you can collect payment on the resulting draft order using a vaulted card directly from the Shopify admin.

To get started, you need Shopify Payments enabled and your B2B customers linked to company records in Shopify. No additional SparkLayer configuration is required. You can learn more in our [Shopify Companies](docId\:wrzSu8adFvbXOkF50hX5I) guide.
:::

:::ExpandableHeading
**Can I use my existing payment methods on the checkout?**

In terms of payment methods supported by SparkLayer and Shopify. If your customers choose "Pay Online by Card" during the SparkLayer checkout process, they will simply be taken to the Shopify checkout. From there, any payment methods you have set up in Shopify (e.g. Paypal, Shop Pay, Affirm Pay) will show up, allowing the customers to pay by this method. We've attached a screenshot to illustrate this.

In short, if Shopify support this payment method, your B2B customers could select it during the checkout providing they choose "Pay Online by Card".
:::

:::ExpandableHeading
**Can I additional charges on a B2B order based on the payment type used?**

There may be scenarios where you want to add an additional charge on an order based on the payment type used (e.g. if the customer is paying by credit card, you may want to charge an additional 2%).

Currently, there is no way to do this directly via SparkLayer. One potential option is to allow the customer to place an order via a manual payment method (e.g. Pay by Invoice), and when the order arrives into Shopify as a draft order, adjust the order totals accordingly. From the draft order within Shopify, you can then use their "Collect payment" functionality to take the card payment.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/iifsJg0OaMSygfOYPPaPW_image.png)
:::

### Products

::::ExpandableHeading
**How do I hide products or set up B2B-only products?**

[B2B Catalogs ](https://apps.shopify.com/sparklayer-b2b-catalogs)is a free SparkLayer app that lets you control which products are visible to different types of customers on your Shopify store. Hide products from B2C customers, restrict items to B2B-only, or show different product ranges to different customer groups - all using simple tags, no code required.

[Install B2B Catalogs](https://apps.shopify.com/sparklayer-b2b-catalogs) from the Shopify App Store, then head to our [B2B Catalogs documentation](https://docs.sparklayer.io/b2b-catalogs/) for the full setup guide.

:::hint{type="info"}
**Hiding variants**
Looking to hide variants for specific B2B customer groups?&#x20;
:::
::::

:::ExpandableHeading
**Can I use my Shopify prices for my B2B pricing?**

Yes! SparkLayer allows you to automatically synchronise your Shopify prices (e.g. your main Shopify price, Compare-at price), making it really easy to set up B2B pricing for your customers. For example, you could set your B2B prices to be 20% off your Shopify prices and we can even make provisions for your tax set up in Shopify (e.g. exclusive or inclusive of tax).
:::

:::ExpandableHeading
**How do I set up pre-order and backorder products?**

In terms of pre-ordering, SparkLayer has full support for different stock status messages and it's possible to set up products as pre-order/back-order easily - it does rely on some configuration within Shopify, but it's relatively easy to do!

We've [full information here](docId\:Gj_Ao_gQ6oA-jx0D27Hys) on how it works and you can even set up "due in" dates to give your customers visibility.
:::

:::ExpandableHeading
**Do I need to use product SKUs?**

In terms of product SKUs, SparkLayer relies on these being added to your products within Shopify so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.

If you don't already have SKUs in Shopify, it's relatively quick to do. You can either edit individual products and add them manually, or you can use Shopify's 'Import' or 'Edit products' feature to do this in bulk.
:::

::::ExpandableHeading
**How do I restrict B2B customers from DTC inventory (and vice versa)**

If you're installing SparkLayer on a single website and you are looking to run both DTC and B2B at the same time, it will be necessary to **use the same stock pool&#x20;**&#x62;ehind the scenes. From an inventory point of view, this essentially means that both DTC and B2B customers will be ordering from the same stock source which can pose challenges.&#x20;

SparkLayer has a way to "reserve" stock for your DTC customers, essentially blocking B2B customers from ordering too much inventory for a specific product. [Learn more](docId\:Gj_Ao_gQ6oA-jx0D27Hys)

:::hint{type="info"}
**Important**
It is not possible to block DTC customers from ordering from your inventory and there is no mechanism in Shopify to do this. If you are wanting to implement this, you will need to consider:

- Creating B2B-specific products on your store (e.g. you could use an app such as [Locksmith](https://apps.shopify.com/locksmith) to do this)
- Creating a separate store just for your B2B customers, effectively separating out your inventory completely. Learn more in [our guide here](docId\:ddIv5TDAnCayWTOJ0Vyb7)
:::

###
::::

### Customers

:::ExpandableHeading
**How do I set up a customer in Shopify as B2B**

To enable a customer as B2B, this works by adding a special tag in Shopify against their customer record. This tag by default is always `b2b` and you can add additional tags based on the rules you've set for the customer in the SparkLayer [Customers](docId:5_lWMNohhjBJJppg9E6Vh) admin.&#x20;

To learn more about setting up customers as B2B, see [our guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::

:::ExpandableHeading
**How do I invite a B2B customer to my website?**

Please refer to [our guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::

### Orders

:::ExpandableHeading
**Where do I find my B2B orders in Shopify?**

For non-card payment orders (e.g. Payment by Invoice), the order is saved as a "Draft order".

- You can view these in Shopify within **Orders** and then click [Draft Orders](https://admin.shopify.com/draft_orders?selectedView=all)
- You can then convert these into approved orders by marking them as paid or marking them with payment terms (please [see this guide](https://help.shopify.com/en/manual/orders/create-orders#accept-payment) for more details).&#x20;
- It's also possible to automatically convert Draft Orders into Completed Orders with [our feature here ](https://app.sparklayer.io/configuration/settings/general)"Auto-complete Shopify Draft orders"
- By default Shopify will not send an email for Draft orders but we have a [guide here](docId:7kxW1S6TBM57MlpLJn_Uk) that explains how to do this.&#x20;

When a customer places an order via non-card payment methods, it will show with a status of "**Awaiting Merchant"&#x20;**&#x75;ntil the order ("Draft" order) is converted into a Completed order.
:::

:::ExpandableHeading
**How do I edit orders?**

Firstly, it is possible to edit orders within Shopify when an order is placed via SparkLayer. If you have it configured to create orders as 'Draft orders' you can go into the order and make changes. If you subsequently then manually complete the order (i.e. Mark as paid), you can still edit the order up until the point of fulfilment.

The issue arises in one scenario we know about which is a limitation of Shopify. If you have 'Auto-complete Shopify Draft orders' turned on within the [SparkLayer Dashboard > Settings](https://app.sparklayer.io/configuration/settings/general) this will skip the ability to make subsequent orders. This is why, when you try and edit a 'Completed order', you are seeing the "Unable to edit order" message. At this point in time, we don't have a solution to this, other than switching 'off' the SparkLayer setting that automatically completes a draft order.
:::

:::ExpandableHeading
**Can I stop pricing showing as a discount within a Shopify order?**

Yes! By default, prices from SparkLayer into Shopify will show exactly as you've set them up in the SparkLayer [Price Lists](docId\:Zv2wCfqf7CUC5j_pYJ8Pt).

If you'd prefer to show the original Shopify price, please contact our team.&#x20;
:::

:::ExpandableHeading
**How do I change the wording for "custom discount" on an order**

You can change the wording of "Custom discount" by editing the languages within your Shopify store.&#x20;

- Go to Themes and click the 3 dots next to the theme name. Select "Edit default theme content"
- Search for "Custom discount" and then edit as required.
:::

:::ExpandableHeading
**How do I send an invoice?**

Please see our guide: [Invoices](docId\:NKh8H14Ffna5DD71SwwNd)&#x20;
:::

:::ExpandableHeading
**How do I set a minimum order quantity?**

Within SparkLayer, we do have support for minimum (and maximum) quantities, but you're only able to set these at a product or product-variant level. It's not possible to currently set minimum order-level quantities but it's something we are considering as part of a future update!

There is a potential workaround for product-variant requirements and we've included our recommend approach

- You could create a brand new product in Shopify and set up a range of variants within it (e.g. all the products you want to offer within the discount)
- We have a special setting called [Minimum product quantity](docId\:CmxfrPgjQxfz9vJzTVv0D) which forces the customer to order at least X of the product (e.g. 3)
- Using the [Quantity Pricing & Settings](docId\:t2cEaOsmeOHmgZStjCnhe), you can then set up your discounted rates (e.g. buy 3 and the price is 10% cheaper)
:::

:::ExpandableHeading
**How do I set up multi-currency using Shopify Markets?**

Please refer to [Shopify Markets & Currencies](docId\:vex5XjFlT6Pvb0AzhlKQD)
:::

:::ExpandableHeading
**How do I send order notifications to customers and my team?**

At the moment, Shopify doesn't have a built-in 'notification' for when a draft order is placed so it does require workarounds for now. There are a few options:

**Receive notifications as store owner:**&#x20;

- if you are a merchant on the Shopify, Advanced or Shopify Plus plans, you can use Shopify Flow to do this. We've an example you can [download here](docId\:ddIv5TDAnCayWTOJ0Vyb7)
- It's also possible to automatically convert Draft Orders into Completed Orders with [our feature here](https://app.sparklayer.io/configuration/settings/general)

**Receive notifications as a customer:**

- If you want your customers to receive a notification, there are a few ways to do this. As above, you could activate the auto-complete [orders feature above](https://app.sparklayer.io/configuration/settings/general).
- We also recommend a really good one called Mechanic that lets you set rules/flows based on criteria. We have some ready-made templates [you can use here](docId:7kxW1S6TBM57MlpLJn_Uk)
:::

:::ExpandableHeading
**Can I import historic B2B orders into Shopify**

Yes, there are methods to do this. Please refer to [our guide here](docId\:BxWnGB6b1n7QFfhTnu7pk)
:::

:::ExpandableHeading
**Can I change the order number "prefix" in Shopify, e.g. B2B-123**

Due to current limitations in Shopify, there is currently no way to differentiate the Shopify Order Number (e.g. #123456) between regular (DTC) and B2B orders. In terms of filtering and segmenting orders between retail and B2B, SparkLayer will by default add a tag to an order `b2b`. Within Shopify, or systems you may have integrated (e.g. shipping, 3PLs), this can then be used as a way to separate out workflows to allow you to differentiate between the customers who are placing orders.
:::


[title] Locksmith
[path] Integrations/Customer Experience/

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-dujbyYloMeGp3_vS4s4g6-20240819-142148.png)

##

:::hint{type="success"}
**SparkLayer solution**
We've launched our FREE [B2B Catalogs](docId\:plxT_QlDSepZu2YqVuicC) that lets you easily hide products for B2B and B2C customers. Learn more in our [full guide here](docId\:vE83XYTnUs59EG2IYKUFZ)&#x20;

![](https://images.archbee.com/kxppJrvFK15E9wXbMKaTP/K1gxDnbxj_kaYrN15-QbN-20260430-121629.jpg?format=webp)
:::

## Introduction

:::hint{type="warning"}
**Before you start:&#x20;**&#x50;lease note, your Shopify store must already have the [Locksmith app](https://apps.shopify.com/locksmith) installed before following the below guide. Learn more in "Frequently Asked Questions" below.
:::

Locksmith lets you control access to products, collections and pages in your Shopify store. It's a great way to offer a different experience to your B2B & wholesale customers, giving you control on the content they can (and can't) see.

Locksmith allows powerful ways to restrict content based on conditions such as customer tags (e.g. `b2b`), email addresses, passcodes, secret links, geographic location, purchase history, a schedule, and more. You can see everything that's possible in the official [Locksmith app here](https://apps.shopify.com/locksmith).

In this guide, we're going to walk you through some example use-cases of using Locksmith to customise your store for your B2B customers.



***

## Example use-cases

:::hint{type="warning"}
**Please note the following**
When working on a back up theme any lock you create will automatically take effect on your live theme.&#x20;
:::

### Creating B2B-only products&#x20;

If you have products within your Shopify store that you want to make "B2B-only" and **not** accessible to your regular customers, this is a great way to manage their visibility.

**Step one: Creating the Lock**

Go into the Locksmith app within your Shopify store. Click in the **"Add new lock"** Field and you'll then see the below screen. When you select a product you are then able to browse your products or you can search by the product name.&#x20;

If you want the lock to take effect straight away you'll need to make sure you have **"Enable Lock"&#x20;**&#x73;elected, otherwise it will be set as a draft.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/F_gQqEBkMe-bFA4xLOmLv_image.png)

**Step Two: Add a Key**

Once you have selected the product you are wanting to hide and you have created the lock, you'll see the ability to **"Add a Key"** to allow specific customers view the product.

You'll also need to specify if you want to remove any links to the product and if you want this hidden from your store's native search function along with product listings.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/68eMPUOdEEq4q6CSUvXxX_image.png)

When you add a **Key** you'll see a drop down list of rules you are able to use to allow customers to view the product you are hiding.&#x20;

When using SparkLayer, we advise using **'if the customer is tagged with...'** as you are already using tags for your B2B customers (e.g. `b2b`). [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/9xRXFFQwkVG9daYamTB3r_image.png)

**Step Three: Customise your Key&#x20;**

When creating a key, you're then able to add numerous conditions your customer has to meet before gaining access to the product. In this example, we're requiring the customer to have a tag of `b2b` before being able to view the product.

As you can see below, you're able to redirect your customers who are **not** tagged B2B to a different page (or alternatively they can be given a default message supplied by Locksmith).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/-TRBc5vkeDp0BZwzK9tA__image.png)

**Step Four: Save Lock and Test**

Once you have finished setting up your customisations, simply click **Save**. Next, go to your store and check if you can view the product as logged out customer. And vice versa, try accessing it as a logged in B2B customer.

If you search for the product directly when **logged out** you should see something like the below.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/N59inL1Iw935jayGDXsiK_image.png)

If you are already logged in **without** a B2B tagged account, you'll see a notification message similar to the below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/2ov5KJog_u2u-6J4mvLG2_image.png)

### Creating B2B-only collections

This is very similar to the "Creating B2B-only products" detailed above but designed to allow you to customise how your collections work. For example, you may have a collection on your Shopify store that shows your B2B products that you don't want your regular customers to see.

**Step one: Creating the lock**

Go into the Locksmith app within your Shopify store. Click in the **"Add new lock"** Field and you'll then see the below screen. When you select a Collection you are then able to browse your collections within your store or you can search by the collection name.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/BOpmIa886BkugT-qki5uT_image.png)

If you want the lock to take effect straight away you'll need to make sure you have **"Enable Lock"&#x20;**&#x73;elected, along with "**Protect products in this collection".**

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/yho8iK0tv-o4YjAh9WxQR_image.png)

**Step Two: Add a Key**

Once you have selected the collection you're wanting to hide and you have created the lock, you'll then see the below screen that gives you the ability to **"Add a Key"** to allow specific customers view the collection.

You'll need to specify if you want to remove any links to the product and if you want this hidden from your store's native search function along with collection listings.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ETsYcZW_RTztvjO3NJ-JS_image.png)

When you add a **Key**, you'll see a drop down list of rules you are able to use to allow customers to view the collection you are hiding.&#x20;

When using SparkLayer, we advise using **'if the customer is tagged with...'** as you are already using tags for your B2B customers (e.g. `b2b`). [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ydxrK03s-ghpP_DR8Gq3h_image.png)

**Step Three: Customise your Key&#x20;**

When creating a key, you're able to add numerous conditions your customer has to meet before gaining access to the product. For this example, the customer must be tagged with `b2b` to access the collection.

You're also able to redirect your customers who are **not** tagged B2B to a different page or display a message to them.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/CifIq3sx90ZQz0ZEo3QOX_image.png)

**Step Four: Save Lock and Test**

Once you have finished setting up your customisations, simply click **Save**. Next, go to your store and check if you can view the collection as logged out customer. And vice versa, try accessing it as a logged in B2B customer.

If you search for the collection directly when **logged out** you should see something like the below.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/tRQc9ahPocljDafx01hL5_image.png)

If you are already logged in **without** a B2B tagged account, you'll see a notification message similar to the below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/2ov5KJog_u2u-6J4mvLG2_image.png)

### Creating a B2B-only page

In some scenarios, you may want to create B2B-specific pages on your store that cannot be accessed by your regular customers. This is a great way to customise the B2B experience on your store.&#x20;

**Step one: Creating the lock**

Go into the Locksmith app within your Shopify store. Click in the **"Add new lock"** Field and you'll then see the below screen. When you select a page you are then able to browse your your pages within your store or you are able to search by the page name.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/iTX4Yhxl1Bw00g4ikK71H_image.png)

If you want the lock to take effect straight away you'll need to make sure you have **"Enable Lock"&#x20;**&#x73;elected.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5krzoyw06NsjGOk4EcoV1_image.png)

**Step Two: Add a Key**

Once you've selected the page you are wanting to hide and you have created the lock, you'll then see the ability to **"Add a Key"** to allow specific customers view the product.

You'll also need to specify if you want to remove any links to the page and if you want this hidden from your store's native search function.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ETsYcZW_RTztvjO3NJ-JS_image.png)

When you add a **Key** you'll see a drop down list of rules you are able to use to allow customers to view the page you are hiding.&#x20;

When using SparkLayer, we advise using **'if the customer is tagged with...'** as you are already using tags for your B2B customers (e.g. `b2b`). [Learn more](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ydxrK03s-ghpP_DR8Gq3h_image.png)

**Step Three: Customise your Key&#x20;**

When creating a key, you're able to add numerous conditions your customer has to meet before gaining access to the page. For this example, the customer must be tagged with `b2b` to access the page.

You're also able to redirect your customers who are **not** tagged B2B to a different page or display a message to them.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/CifIq3sx90ZQz0ZEo3QOX_image.png)

**Step Four: Save Lock and Test**

Once you have finished setting up your customisations, simply click **Save**. Next, go to your store and check if you can view the page as logged out customer. And vice versa, try accessing it as a logged in B2B customer.

If you search for the page directly when **logged out** you should see something like the below.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/N59inL1Iw935jayGDXsiK_image.png)

If you are already logged in **without** a B2B tagged account, you'll see a notification message similar to the below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/2ov5KJog_u2u-6J4mvLG2_image.png)



***

## Frequently Asked Questions

:::ExpandableHeading
**How do I change the default messages for locked content**

When a customer tries to access content that is locked (e.g. a product, a collection, or a page), you can customise the messages that shows for them. Within Locksmith, you'll see a Messages section that allows you to customise the content.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fsYH9DTzsuAhj0lutEvzc_image.png)
:::

:::ExpandableHeading
**How do I create multiple locks**

You're able to create **multiple locks** that can apply to one customer group. All you  need to do is select "Force open other locks" when setting up your customisations.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/BVL315rjpi5X1v7bRw8db_image.png)
:::

:::ExpandableHeading
**How do I lock my entire store to B2B customers**

If you have a collection for a specific B2B customer group, it's possible to lock down your website so they **cannot access** anything other than the collection you have created for them.&#x20;

First, create a lock to your **Enter store**.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/yjrdRp94tUh-r_NdxMBWp_image.png)

When creating the key, use **"if customer is tagged with..."** then enter the appropriate b2b tag (e.g. `b2b`).  You'll also need to **"Invert"&#x20;**&#x74;he key, meaning that no customers can view this page **unless&#x20;**&#x74;hey are tagged B2B.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ztzl4T8hpjMSlWXstQRmB_image.png)

Once you have created this lock, you'll then need to go in and create a second lock giving your B2B customers access to the B2B collection. You would need follow the normal steps mentioned above however when creating the key on this one you need to ensure you tick **"Force open other locks"** otherwise they would not have access to the collection due to the first lock on the entire store.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Ca4KjJBn2DK4zDBUZvySb_image.png)
:::

::::ExpandableHeading
**Locks aren't taking affect on my backup theme, should they?**

:::hint{type="warning"}
**Please note**
When working on a back up theme any lock you create will automatically take effect on your live theme.&#x20;
:::

If you are conducting testing on a back up (duplicate) theme, Locksmith will only take affect on your live theme. To resolve this, once you've created the lock, go to **Help > Unpublished themes**&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vqwvMoubStgYaBBHzXfeU_image.png)

Find the theme that you are currently testing on, and select install. This would the install the latest version of Locksmith along with all of the adjustments that you have carried out.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/RCRai6E2peOAPFjESYyQt_image.png)
::::


[title] Installing SparkLayer on BigCommerce
[path] Integrations/BigCommerce/

## Introduction

SparkLayer enables B2B functionality on your existing BigCommerce store, allowing your B2B customers to login, place orders, manage their account, and much more.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vWNSkcGu-6SYP5BrvL_hF_image.png)

To familiarise yourself with SparkLayer, we also recommend reviewing the following guides:

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[How SparkLayer Works](docId:_2g8HwCXnN7OFy4o199y1)

The fundamentals of what SparkLayer does
:::

:::LinkArrayItem
[Frontend](docId\:OgKfvQX13dHW2582D57kJ)

The special "interfaces" SparkLayer enables
:::

:::LinkArrayItem
[Features](docId\:SSzdKXuNMlEIDOOITHQcU)

The available features and functions.
:::
::::



***

## Requirements

Before installing SparkLayer on your BigCommerce store, please ensure the following:

| Item                           | Details                                                                                                                                                                                                                                                                                   |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Customer Storefront Accounts` | You’ll need to make sure that customer accounts are enabled on your storefront so that customers can sign in. This is turned on by default on BigCommerce, and you can [learn more here](https://support.bigcommerce.com/s/article/Customer-Account-Creation?language=en_US).             |
| `Product SKUs`                 | In order for SparkLayer to save B2B prices for your products, all products must have **SKUs**. Please see [this guide](https://support.bigcommerce.com/s/article/Product-Options-v2?language=en_US#skus) to learn more.                                                                   |
| `Customers`                    | For your B2B customers to see the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa), they must belong to a [customer group ](https://support.bigcommerce.com/s/article/Customer-Groups?language=en_US)within BigCommerce. You can learn more below on how to configure this. |
| `Payment Processor`            | If you’re installing SparkLayer on a test store, please ensure you have an example [payment method](https://support.bigcommerce.com/s/article/Available-Payment-Gateways?language=en_US) enabled.                                                                                         |
| `Shipping`                     | In order to place an order via the [My Cart Interface](docId\:efevur-A3yCJXUHvrR7t-), please ensure you have shipping rules set up. You can manage this within BigCommerce under *Settings, Setup*.                                                                                       |

:::hint{type="success"}
Want to see BigCommerce and SparkLayer in action? Try out our [demo store](docId:6zLPH9x8-qEUITCHs2obE)
:::





***

## The Onboarding process

When you create an account on SparkLayer, you'll get access to the [SparkLayer Dashboard](https://app.sparklayer.io/). The Dashboard has a customised onboarding process that gently guides you through all the necessary steps before you're ready to start inviting your B2B customers and taking orders on your website.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/t0LTQalwS7VkTPlH2AjkW_image.png)

::::WorkflowBlock
:::WorkflowBlockItem
**🔗 Connecting your BigCommerce store**
This enables SparkLayer to connect to your BigCommerce store and begin synchronising the information it requires.

➡️ [View in dashboard](https://app.sparklayer.io/configuration/integrations/platform)
:::

:::WorkflowBlockItem
**📓 Setting up your B2B price lists**
You'll then set up the B2B price lists that you want your customers to see when they login. These can be automated or you can manually upload specific pricing.
➡️ [View in dashboard](https://app.sparklayer.io/pricing)
:::

:::WorkflowBlockItem
**👪 Setting up your B2B customer groups**
You'll then set the ordering rules for your customers such as minimum order values, available payment methods and price lists they are assigned to.
➡️ [View in dashboard](https://app.sparklayer.io/customers/groups)
:::

:::WorkflowBlockItem
**🛠️ Installing the frontend widgets**
You'll need to install special code snippets ("widgets") into your BigCommerce theme in order to show the special SparkLayer B2B interfaces.
➡️ [View in dashboard](https://app.sparklayer.io/configuration/frontend/core)
:::

:::WorkflowBlockItem
**✅ Testing & launching**
You'll then need to run through some final checks (such as placing a test order). Once you're happy, you can then launch SparkLayer and start taking orders!&#x20;
➡️ [View in dashboard](https://app.sparklayer.io/configuration/onboarding)
:::
::::

Let's now dive into each of them!



***

## 🔗 Connecting your BigCommerce store

Once you've installed the [SparkLayer BigCommerce App ](https://www.bigcommerce.com/apps/sparklayer-b2b-wholesale/)this step of the onboarding process happens automatically. Once SparkLayer is connected to your BigCommerce store, it will automatically synchronise product and customer data and then allow you to upload price lists and proceed to install the frontend widgets.

:::hint{type="info"}
**Installing for the first time?**
When installing on BigCommerce for the first time, the process works as follows:

1. You'll need to install the [SparkLayer app](https://www.bigcommerce.com/apps/sparklayer-b2b-wholesale/) (much like you would any other app). You can do this within your BigCommerce admin by going to **Apps** and clicking **Marketplace&#x20;**&#x61;nd then searching for SparkLayer.
2. You'll then be asked to **create an account on SparkLayer**, or sign in if you already have one.&#x20;
3. Finally, you need to confirm acceptance of our billing plan within BigCommerce to begin your free trial
:::

Once the above is complete, you can then return back to the [SparkLayer Dashboard](https://app.sparklayer.io/) to continue with the onboarding process. You can also access the SparkLayer app within your BigCommerce store by going to the **Apps** and clicking **My Apps** within your BigCommerce admin and you'll find a summary of your onboarding process.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/I3jTT7YkJdrucl7WNGVuN_image.png "The SparkLayer Onboarding process within BigCommerce")



***

## 📓 Setting up your B2B price lists

Within the [Price Lists](https://app.sparklayer.io/pricing) area of the SparkLayer Dashboard, you can create and manage your B2B pricing rules.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fU9lF9LEJxXspEGxHrT8__image.png)

SparkLayer allows you to set the following pricing types:

| Type        | Details                                                                                          |
| ----------- | ------------------------------------------------------------------------------------------------ |
| `Manual`    | You can manually upload a CSV file with specific prices and even enable quantity pricing         |
| `Automatic` | You can use your BigCommerce prices and apply a discount, e.g. 50% off BigCommerce retail prices |

:::hint{type="warning"}
**Please note the following on price lists**
SparkLayer will **only** use the price lists set up directly within the [SparkLayer Dashboard](https://app.sparklayer.io/pricing) and will not synchronise any price lists you may already have set up in BigCommerce.
:::

### Discounts

We also offer discounts on top of the wholesale pricing you’ve already set up. You have the ability to offer a blanket discount, free products or you can get technincal with our  "Advanced Discounts and Rewards" where you have the ability to apply discount depending on Brand, Category, Condition UPC or Search Keywords as you are able to see below.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/ILX2DSvUi1lgRipo4dE2O_image.png)

:::hint{type="success"}
**Ready to set your pricing?**
To learn more about pricing, please see our [full guide here](docId\:s8XcbZGxQpgdeIGWtXseT).
:::



***

## 👪 Setting up your B2B customer groups

[Customer Groups](https://app.sparklayer.io/customers/groups) let you configure specific rules for your customers, from defining their minimum order values and which price lists they see, through to what payment methods they're allowed to use when checking out.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Bp1LLWaeQROtxv8PrBho9_image.png)

Much like with Price Lists, you can fully manage this via the [SparkLayer Dashboard](https://app.sparklayer.io/customers/groups).

SparkLayer will **automatically** synchronise customer groups from your BigCommerce store rather than you having to manually set these up in the SparkLayer Dashboard.  To get started, please following the below steps:

:::::WorkflowBlock
:::WorkflowBlockItem
Within BigCommerce, go to **Customers** and click **Customer Groups**
:::

:::WorkflowBlockItem
You can either create a new customer group, or edit an existing one
:::

::::WorkflowBlockItem
To synchronise to SparkLayer, the customer **Group Name** must start with `B2B`. In our example below, we've set up `B2B Default`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/FT2NHlOzq50IKLBi39NCy_image.png)

For any customer groups you want to synchronise, please ensure `B2B` is added in the Group Name.

:::hint{type="warning"}
**Please note the following on customer groups**

- Once you've set up your customer groups in BigCommerce, these must be assigne&#x64;**&#x20;to at least one customer record** before SparkLayer will synchronise and show them in the [Customer Groups area](https://app.sparklayer.io/customers/groups)
- SparkLayer will only synchronise customer groups that start with **B2B** in the customer group name
:::
::::

:::WorkflowBlockItem
Once the customer groups have been set up in BigCommerce (i.e. those starting with `B2B`), and you've assigned the customer group to **at least** one customer, you'll then see these appear within the SparkLayer Dashboard, within the [Customer area.](https://app.sparklayer.io/customers/groups)&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/cDRq0pUjLX_8jZcos2kHQ_image.png)

When the customer groups are imported into Sparklayer, they will always use this format:&#x20;

| Item   | Details                                                                                                                                                                       |
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name   | The exact name set up in BigCommerce, e.g.<br />`B2B - Default`                                                                                                               |
| Handle | This will use a sequential format, e.g.<br />`bigcommerce-group-1`<br />`bigcommerce-group-2`<br />Note: you will only need to use the handle for more advanced integrations. |
:::
:::::

:::hint{type="success"}
**Ready to configure your customer groups?**
To learn more about customer groups, please see our [full guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::



***

## 🛠️ Installing the frontend widgets

SparkLayer comes with ready-made B2B-optimised "widgets" that we collectively call the SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ). The widgets simply overlay sections of your existing BigCommerce store and enable our powerful B2B features

We offer two ways to get started with SparkLayer on your BigCommerce theme:

::::WorkflowBlock
:::WorkflowBlockItem
**Installing our frontend widgets yourself**
If you're experienced in working with BigCommerce and the [stencil templating language](https://developer.bigcommerce.com/stencil-docs/overview), you should find our onboarding process a breeze (see below).
:::

:::WorkflowBlockItem
**Request us to install for you**
Our expert team can help set up the special SparkLayer frontend widgets on your BigCommerce store and some example B2B pricing. Once we're done, we can then arrange an onboarding call to walk you through it. [Contact our team](docId\:NNUw1G9z7eaJ4M78vk7t9)
:::
::::

**Installing SparkLayer yourself**

:::hint{type="info"}
**Backing up your BigCommerce theme**
If you'd prefer not to make these changes on your live BigCommerce theme, you can create a "Duplicate" and make the changes there before publishing. To make a duplicate, go to **Channels** and click **Themes** from within your BigCommerce admin.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/T_Y9TGRjwTTclzbUKxEWw_image.png)
:::

If you’re looking to install yourself, there are five steps to follow.

::::::WorkflowBlock
:::::WorkflowBlockItem
**Install the&#x20;**[SparkLayer Core Script
](https://app.sparklayer.io/configuration/frontend/core)Within `/templates/layout/base.html` you'll need to add the SparkLayer Core Script that activates the SparkLayer functionality. 

::::ExpandableHeading
**🛠️ View instructions**

:::hint{type="info"}
To get started, head over to the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/frontend/core) and you'll see your customised SparkLayer Core Script within the Frontend Configurations.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vMYsiehB3_WTJkt7gZtqu_image.png)

The script simply needs to be included within the main header of your website's source code within the` <head>...</head>` tags in your `/templates/base.html` file.&#x20;

If you are making edits to your website via the BigCommerce admin, you can access the template files via this URL:
`yourstore.mybigcommerce.com/manage/channel/1/my-themes`
:::
::::
:::::

:::::WorkflowBlockItem
**Install the&#x20;**[Product Detail Interface](https://app.sparklayer.io/configuration/frontend/pdp)
You'll need to update your storefront's product detail page with the SparkLayer Product Purchasing Interface. When a customer logs in and SparkLayer recognises them as being a B2B customer, this will load a special interface with their specific prices and a way to purchase.&#x20;

::::ExpandableHeading
**🛠️ View instructions**

```javascript
<spark-pdp parent-id="{{id}}"></spark-pdp>
```

:::hint{type="info"}
To get started, add the code snippet above to your product detail pages. Depending on which BigCommerce theme you are using, this is likely to be a file within the `/templates/pages/` directory, e.g. `/templates/pages/product.html`

If your store is setup to use components, try looking in `/templates/components/products/product-view.html`

Once this is added, the interface will display for all logged in B2B customers and they can begin placing orders. Based on the theme you're using, the variable `id` may need to be adjusted to the appropriate setting, e.g. `product.id`

If you are making edits to your website via the BigCommerce admin, you can access the template files via this URL:
`yourstore.mybigcommerce.com/manage/channel/1/my-themes`
:::

:::hint{type="warning"}
**Important!**
If you're using SparkLayer on your existing website, you will need to hide elements that you don't want your B2B customers to see. To do this, you can hide elements by adding `data-spark="b2c-only"` to any element in the code.&#x20;

::embed[]{url="https://www.youtube.com/embed/rmMv-l98JoI?controls=0"}

You will need to do this for any code that renders a price, quantity selection, product options, buy now buttons, and anything else you want to hide from your B2B customers.

Please see our [full guide here](docId\:QWXsYM9X5_pvIOGUteKcP) for more details.
:::
::::
:::::

:::::WorkflowBlockItem
**Install the&#x20;**[Product Card Interface](https://app.sparklayer.io/configuration/frontend/pdp)
You'll need to update your product collection pages to show the Product Card Interface. This allows your customers to see their unique pricing and add items to their order from anywhere on your website.

::::ExpandableHeading
**🛠️ View instructions**

```javascript
<spark-product-card parent-id="{{id}}"></spark-product-card>
```

:::hint{type="info"}
To get started, add the code snippet above to the file that renders products on your collection pages. Depending on which BigCommerce theme you are using, this is likely to be a file within the `/templates/components/` directory, e.g. `/templates/components/products/card.html`

Once this is added, the interface will display for all logged in B2B customers and they can begin placing orders. Based on the theme you're using, the variable `id` may need to be adjusted to the appropriate setting, e.g. `product.id`

If you are making edits to your website via the BigCommerce admin, you can access the template files via this URL:
`yourstore.mybigcommerce.com/manage/channel/1/my-themes`
:::

:::hint{type="warning"}
**Important!**
If you're using SparkLayer on your existing website, you will need to hide elements that you don't want your B2B customers to see. To do this, you can hide elements by adding `data-spark="b2c-only"` to any element in the code.&#x20;

::embed[]{url="https://www.youtube.com/embed/rmMv-l98JoI?controls=0"}

You will need to do this for any code that renders a price, quantity selection, product options, buy now buttons, and anything else you want to hide from your B2B customers.

Please see our [full guide here](docId\:QWXsYM9X5_pvIOGUteKcP) for more details.
:::
::::
:::::

:::::WorkflowBlockItem
**Add the&#x20;**[CSS customisations](https://app.sparklayer.io/configuration/frontend/css)
Within `/templates/base.html` or in a standalone CSS file, you can customise the look and feel of SparkLayer by editing special CSS controls that overwrite the SparkLayer defaults. For example, you can change button colours, font sizes, spacing, even typefaces.

::::ExpandableHeading
**🛠️ View instructions**

:::hint{type="info"}
The customisations work by adding a special snippet of CSS to the source code of your website. To get, you can add the sample CSS code available in the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/frontend/css).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/7vDQr0cPNevSuKwwP--9l_image.png)

Once added, these then overwrite the "default" styling for SparkLayer to match your website's look and feel. [Learn more](docId\:QWXsYM9X5_pvIOGUteKcP).

If you are making edits to your website via the BigCommerce admin, you can access the template files via this URL:
`yourstore.mybigcommerce.com/manage/channel/1/my-themes`
:::
::::
:::::

:::::WorkflowBlockItem
**Enable the&#x20;**[checkout script](https://app.sparklayer.io/configuration/frontend/checkout)
When a customer places an order via the BigCommerce Checkout, SparkLayer needs to know when the order is completed. By adding a special checkout script, this then resets contents of the customer's order and allows them to place additional orders if they wish.

::::ExpandableHeading
**🛠️ View instructions**

:::hint{type="info"}
To get started, head over to the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/frontend/checkout) and you'll see your customised SparkLayer Checkout Script within the Frontend Configurations. Within your checkout order confirmation page (typically&#x20;
`/pages/order-confirmation.html`) simply add this code at the very end of the file.
:::
::::
:::::
::::::

:::hint{type="success"}
**Finished adding the code widgets?**

- Please review our [Frontend Integration Checkout](docId\:QWXsYM9X5_pvIOGUteKcP)
- You can also explore all the configurations and customisations we have available that you may want to activate on your Shopify store! [Learn more](docId\:SBEaOaCq_A7FfbTatX8bD)
:::



***

## ✅ Testing & launching

The final step is to run some tests and checks to ensure SparkLayer is fully configured. Within the SparkLayer Dashboard, you'll see a number of [Launch checks](https://app.sparklayer.io/?expand=launch) to perform, from logging in as a B2B customer, through to placing an order.

We recommend following the below steps:

:::::WorkflowBlock
:::WorkflowBlockItem
**Set up a customer record**
Within your BigCommerce admin, you'll need to ensure you have an example customer record set up (either a new one or an existing). Most importantly, a customer must be associated with a Customer Group that starts with `b2b`. Any Customer Groups that start with `b2b` will automatically synchronise with SparkLayer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/agYyOvxUHkF7Fs_Z9ySKS_image.png)
:::

::::WorkflowBlockItem
**Place a test order**
We recommend placing test orders using the [payment methods](docId\:efevur-A3yCJXUHvrR7t-) you've selected to set up. Please note the following:

| Payment Method       | Notes                                                                                                                                                                    |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Payment by Invoice` | The order will be created with the `Awaiting Payment` status in BigCommerce.<br />This will send the customer an email order confirmation                                |
| `Payment on Account` | The order will be created with the `Awaiting Payment` status in BigCommerce.<br />This will send the customer an email order confirmation                                |
| `Request for Quote`  | The order will be created with the `Incomplete` status in BigCommerce.<br />This will <font color="#eb144c">**not**</font> send the customer an email order confirmation |
| `Upfront Payment`    | The order will be create with the `Awaiting Fulfiment` status in BigCommerce<br />This will send the customer an email order confirmation                                |

:::Iframe{iframeHeight="0" code="<video class=&#x22;full-screen-video__media&#x22; preload=&#x22;none&#x22; autoplay=&#x22;&#x22; loop=&#x22;&#x22; muted=&#x22;&#x22; playsinline=&#x22;&#x22; webkit-playinginline=&#x22;&#x22;>&#xA;    <source src=&#x22;https://www.sparklayer.io/assets/videos/bigcommerce-orders.mp4&#x22; type=&#x22;video/mp4&#x22;>&#xA;</video>"}

:::
::::

:::WorkflowBlockItem
**Invite your customers**
Please refer to [our guide here](docId:5_lWMNohhjBJJppg9E6Vh) on our recommended way to do this

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/cTfvnBxYnYOXxUubdq-n5_image.png)
:::
:::::



***

## Troubleshooting

To troubleshoot the most common issues (such as issues with pricing), please see [our guide here](docId\:BlCEkkx3I30nkUcglsfw7). You can also [contact our support team](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to assist.



***

## Frequently Asked Questions

### Plans and pricing

:::ExpandableHeading
**Which SparkLayer plans do you offer for BigCommerce?**

All SparkLayer plans are compatible with BigCommerce, from "Starter" right through to "Enterprise". [Learn more](https://www.sparklayer.io/pricing/) about our plans and pricing.
:::

:::ExpandableHeading
**How does billing work?**

When you sign up to SparkLayer, our team will contact you to discuss the most appropriate plan for your needs. Billing is managed via a monthly billing cycle with the option to pay annually.
:::

:::ExpandableHeading
**How do I select and change plan (upgrade or downgrade)**

You can sign up to SparkLayer on BigCommerce without initially selecting a plan. Once you've installed SparkLayer, our team will contact you to discuss the next steps. Once you've activated a plan, we are happy to work with you to upgrade or downgrade based on your changing requirements.
:::

### BigCommerce setup

:::ExpandableHeading
**Where do I find the SparkLayer BigCommerce app?**

You can find the official SparkLayer for BigCommerce app in the [BigCommerce App Store](https://www.bigcommerce.com/apps/sparklayer-b2b-wholesale/).
:::

:::ExpandableHeading
**What BigCommerce plan do I need to be on to use SparkLayer?**

SparkLayer works on all versions of BigCommerce, from BigCommerce Essentials right through to BigCommerce Enterprise. All you need is an active BigCommerce store and you're good to go.
:::

:::ExpandableHeading
**Can I use SparkLayer with my development website?**

Yes! If you're setting up SparkLayer on a development store (e.g. a test account), we can enable a special developer-mode that lets you use SparkLayer until you're ready to activate a billing plan. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) for more details.
:::

:::ExpandableHeading
**Can I have DTC and B2B on the same BigCommerce website?**

Yes, it's possible to install SparkLayer onto your existing BigCommerce DTC store (i.e. retail), meaning you can run both DTC and B2B on the same store. We call this a 'hybrid setup'; when your B2B customers sign in, they simply see the special SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) interface that allow them to see their prices and place orders.

If you want to see this in action, you can try our [B2B/B2C demo store here](https://b2b-demo-store-usd.myshopify.com/)
:::

### Theme setup

:::ExpandableHeading
**Can you help me install SparkLayer on my BigCommerce website?**

Yes! Within the [SparkLayer Dashboard](https://app.sparklayer.io/help), you'll see an option to request our team to install SparkLayer for you. Typically we can do this within 1-2 working days and you're then good to go. We then offer an onboarding session to walk you through how everything works.
:::

:::ExpandableHeading
**Does SparkLayer work on any BigCommerce theme?**

Yes! SparkLayer is compatible with all BigCommerce themes, even fully customised. If you need help in the setup, our team can add all the code snippets for you.&#x20;
:::

:::ExpandableHeading
**How does SparkLayer affect my current BigCommerce theme?**

The SparkLayer B2B widgets, including B2B pricing, cart and my account area, are only loaded once a customer who has been added to a b2b customer group successfully signs in to your store.

For all other users, your store will remain completely unaffected.

This allows you to have full control over which customers are able to see your B2B pricing and place B2B orders.
:::

:::ExpandableHeading
**What if I'm already using a wholesale B2B app on my website?**

If you already have a B2B / Wholesale app installed on your store, SparkLayer can work alongside this. It's a great way to test out SparkLayer and, once you're happy, you can simply uninstall any previous B2B apps you were using. If your previous B2B app has made code changes to your BigCommerce store, you may want to ask the app developer to remove these although this is optional.
:::

### Payments

:::ExpandableHeading
**Can I use my existing payment methods on the checkout?**

In terms of payment methods supported by SparkLayer and BigCommerce. If your customers choose "Pay Online by Card" during the SparkLayer checkout process, they will simply be taken to the BigCommerce checkout. From there, any payment methods you have set up in BigCommerce (e.g. Paypal, Affirm Pay) will show up, allowing the customers to pay by this method. We've attached a screenshot to illustrate this.

In short, if BigCommerce support this payment method, your B2B customers could select it during the checkout providing they choose "Pay Online by Card".
:::

### Products

:::ExpandableHeading
**How do I hide products or set up B2B-only products?**

BigCommerce does have the ability to hide collections from Customer Groups which could be one way to achieve this.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/1emGIe3eTQz6j2aywc7mX_area.gif)

There are a few things we recommend to make the experience better:

- You could **create a B2B-only collection** and redirect customers to this once they login. If you wanted to show special B2B-only products, you would need to create these as separate products within BigCommerce (i.e. with unique SKUs, etc)
- With SparkLayer pricing, if you don't upload a price against a SKU, the B2B custome&#x72;**&#x20;won't be able to purchase it.** So this is a way to prevent them from adding items you don't want them to purchase
- It is possible to adapt the BigCommerce themes to hide/show products using custom coding
:::

:::ExpandableHeading
**Can I use my BigCommerce prices for my B2B pricing?**

Yes! SparkLayer allows you to automatically synchronise your BigCommerce prices (e.g. your main BigCommerce retail price), making it really easy to set up B2B pricing for your customers. For example, you could set your B2B prices to be 20% off your BigCommerce prices and we can even make provisions for your tax set up in BigCommerce (e.g. exclusive or inclusive of tax).
:::

:::ExpandableHeading
**How do I set up pre-order and backorder products?**

In terms of pre-ordering, SparkLayer has full support for different stock status messages and it's possible to set up products as pre-order/back-order easily - it does rely on some configuration within BigCommerce, but it's relatively easy to do!

We've [full information here](docId\:Gj_Ao_gQ6oA-jx0D27Hys) on how it works and you can even set up "due in" dates to give your customers visibility.
:::

:::ExpandableHeading
**Do I need to use product SKUs?**

In terms of product SKUs, SparkLayer relies on these being added to your products within BigCommerce so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.

If you don't already have SKUs in BigCommerce, it's relatively quick to do. You can either edit individual products and add them manually, or you can use BigCommerce's 'Import' or 'Edit products' feature to do this in bulk.
:::

::::ExpandableHeading
**How do I restrict B2B customers from DTC inventory (and vice versa)**

If you're installing SparkLayer on a single website and you are looking to run both DTC and B2B at the same time, it will be necessary to **use the same stock pool&#x20;**&#x62;ehind the scenes. From an inventory point of view, this essentially means that both DTC and B2B customers will be ordering from the same stock source which can pose challenges.&#x20;

SparkLayer has a way to "reserve" stock for your DTC customers, essentially blocking B2B customers from ordering too much inventory for a specific product. [Learn more](docId\:Gj_Ao_gQ6oA-jx0D27Hys)

:::hint{type="info"}
**Important**
It is not possible to block DTC customers from ordering from your inventory and there is no mechanism in BigCommerce to do this. If you are wanting to implement this, you will need to consider:

- Creating B2B-specific products on your store&#x20;
- Creating a separate store just for your B2B customers, effectively separating out your inventory completely.&#x20;
:::


::::

:::ExpandableHeading
**Can I sell products on both store fronts?**

Yes, it is possible to have product purchaseable on both store fronts if you are using both for wholesale.&#x20;

When you are in the product within your admin, please ensure that you have both store fronts selected as sales channles that you want to offer the products on.&#x20;
:::

### User Experience

:::ExpandableHeading
**How do I set up a B2B registration form?**

If you're looking to enable a wholesale/B2B registration form there are a few good options for this and

In summary, these are the options we recommend:

- You could use your current login/registration page and enhance the registration page with some custom coding&#x20;
- You could use a [recommended form builder app](https://support.bigcommerce.com/s/article/Creating-a-Contact-Form?language=en_US#form-builders) to achieve this

It's also worth noting that you can manually add customers via the **BigCommerce Customers** admin and from there you could moderate your wholesale applications.
:::

:::ExpandableHeading
**How do I invite a B2B customer to my website?**

Please refer to [our guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::

:::ExpandableHeading
**Will SparkLayer slow down my BigCommerce website?**

No. For performance, the SparkLayer Frontend only loads when a valid B2B customer successfully logs into a website; for your standard (DTC) customers, no code is loaded at all. When a B2B customer logs in, all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.
:::

:::ExpandableHeading
**How do I setup B2B-specific content on my BigCommerce website?**

We recommend consulting with a BigCommerce expert developer before making changes to your website. For their reference, you may find the following Stencil code can be used as a mechanism to hide and show content based on a B2B customer being logged in.

```html
{{#contains (toLowerCase customer_group_name) "b2b"}}

  <!-- This content will only show for logged in B2B customers -->

{{/contains}}
```
:::

### Orders

:::ExpandableHeading
**Where do I find my B2B orders in BigCommerce?**

**Manual payments**
For manual (non-card) payment orders (e.g. Payment by Invoice), the order is saved as a "Draft order".

- You can view these in your BigCommerce admin within **Orders** and then click **Draft Orders**
- You can then convert these into approved orders by marking them as paid or marking them with payment terms

It's important to note that once an order has been approved, it will **only** then show in the customers My Account section and the [SparkLayer Dashboard](https://app.sparklayer.io/orders).

**Card payments**
You can view these in your BigCommerce admin within **Orders**&#x20;
:::

:::ExpandableHeading
**How do I see the 'shipped' order status when viewing an order on SparkLayer?**

SparkLayer will automatically show a B2B order as "Shipped" providing it meets the following conditions:

1. The order is marked as 'Shipped' within BigCommerce
2. The order has a shipment assigned to it within BigCommerce

Without the both being applied to an order, the B2B order will remain in a "Processing" state until actioned.
:::

:::ExpandableHeading
**How do I edit orders?**

It is possible to edit orders within BigCommerce when an order is placed via SparkLayer. If you have it configured to create orders as 'Draft orders' you can go into the order and make changes. If you subsequently then manually complete the order (i.e. Mark as paid), you can still edit the order up until the point of fulfilment.
:::

:::ExpandableHeading
**How do I send an invoice?**

In terms of invoicing, SparkLayer doesn't send invoices directly but there are some good ways to do this within BigCommerce using a recommended invoicing app or by sending invoices manually to your customers via your existing back-office financial system.
:::

:::ExpandableHeading
**How do I set a minimum order quantity?**

Within SparkLayer, we do have support for minimum (and maximum) quantities, but you're only able to set these at a product or product-variant level. It's not currently possible to set minimum order-level quantities but it's something we are considering as part of a future update!
:::

:::ExpandableHeading
**How do I send order notifications to customers and my team?**

You can manage notifications from BigCommerce by going to **Settings** and clicking **Order Notifications**
:::

:::hint{type="info"}
**Need assistance?**
We'd be happy to help guide you through this process. Please refer to [our guide here](docId\:NNUw1G9z7eaJ4M78vk7t9).
:::




[title] QuickBooks Online
[path] Integrations/Accountancy/

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qpC2u-jO_AVGKUa_69xyB-20260203-050107.jpg)

:::hint{type="info"}
**Requirements**

**QuickBooks:&#x20;**&#x41;vailable to **QuickBooks Online** users only
**Plan:** Merchants must be signed up to the Professional or Enterprise plan
**Platform:** Merchants must be using Shopify
:::

## Introduction

[QuickBooks Online](https://quickbooks.intuit.com/) provides online accounting tools for managing finances, invoices, inventory and customer records. With the SparkLayer integration, your B2B orders automatically sync to QuickBooks to create invoices and contacts - reducing manual data entry and removing the need for additional apps or systems to keep your platforms in sync.



***

## ⚠️ Pre-Requisites - important!

The following areas need to be configured prior to enabling the integration.

| Item       | Details                                                                                          |
| ---------- | ------------------------------------------------------------------------------------------------ |
| `Products` | All B2B products need to be created in QuickBooks with the applicable tax rates applied          |
| `Shipping` | In order for shipping to be applied at invoice-level, shipping needs to be enabled in QuickBooks |



***

## Getting started

To get started, login to your SparkLayer dashboard and navigate to **Integrations -> Partner Integrations -> Accountancy -> QuickBooks** and enable the integration. You will then be redirected to QuickBooks to complete authentication. You will also be notified about which data we require access to at this stage.

:::hint{type="info"}
**Please note**
If your QuickBooks account is associated to multiple companies then you will be requested to select which company you want to connect with SparkLayer. Only one company can be connected per SparkLayer team.
:::

Once you are connected, you can navigate back to the **Partner Integrations&#x20;**&#x70;age and modify the integrations configuration. You'll need to follow the steps below ("Configuration") to complete the setup.



***

## Configuration

The following configuration options exists for the QuickBooks integration;

| Setting                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Automatic Contact Creation`                    | <font color="#15803D">**This is not set on install, and must be configured before using the integration**</font> <br />Controls whether SparkLayer should create customers in QuickBooks during the invoice synchronisation process.<br /><br />When creating invoices, each invoice must be associated with a customer in QuickBooks. We first attempt to match an existing contact (as outlined in the Contact Matching section). If no match is found, this setting determines what happens next:<br />* **Enabled -&#x20;**&#x53;parkLayer will automatically create a new contact in QuickBooks using the customer data held in SparkLayer.&#xA; You can read more about contact creation [here](https://docs.sparklayer.io/xero#ZR11G).&#x20;
* **Disabled -** SparkLayer will not create new contacts in QuickBooks. This assumes that contacts are either:&#x20;
  - Being created by another system, or&#x20;
  - Being managed manually within QuickBooks.&#x20;
* In this case, if no matching contact is found, no invoice will be created. |
| `Payment on account - Invoice creation trigger` | <font color="#15803D">**Default: On order**</font><br />Controls when an invoice should be created for orders using the payment on account payment method.<br />* **On order&#x20;**&#x77;ill create an invoice for the whole order once it reaches the `processing` status.
* **On shipment&#x20;**&#x77;ill create an invoice per shipment, once any fulfilments on the order have been created.<br />You can read more about payment on account orders below.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `Enable Sales Receipts`                         | Enable this to generate sales receipts in QuickBooks for upfront payment orders                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `Shipping Tax Code`                             | Name of the tax code that should be applied to invoice lines for tax exempt users. This must be set in order for invoice synchronisation to succeed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `Tax Exemption Tax Code`                        | Name of the tax code that should be applied to tax exempt invoice lines.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `Income Account`                                | Name of the account that should be used as the income account on new products - this will be used when creating the SparkLayer custom product                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

### Custom Items

On installation, a "SparkLayer Custom Product" product is created within QuickBooks that will be used when a custom item is added to an order within SparkLayer.&#x20;

To ensure an invoice can be successfully created, the applicable tax rate on this product needs to be set before use. You can set this in the same way as other products within QuickBooks.



***

## Invoice Creation

SparkLayer automatically creates invoices in QuickBooks for eligible orders as soon as the order is received from your platform.&#x20;

:::hint{type="info"}
**Please note**
This process runs in the background to keep the checkout experience fast and uninterrupted, which means there may occasionally be a short delay before the invoice appears in QuickBooks.
:::

### Orders eligible for invoicing

Whether an invoice is created depends on several conditions, including your integration settings and the specific details of the order.&#x20;

| Item                | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Fulfilment status` | We only create invoices for orders that are in either the *processing* or *shipped* fulfilment status.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `Payment method`    | Invoices are generated only for orders using either the **Payment by Invoice** or **Payment on Account** payment methods.<br />* **Payment by Invoice**&#xA;For Payment by Invoice orders, the invoice is created as soon as the order reaches the `processing` status.
* **Payment on Account**&#xA;For Payment on Account orders, invoices are created depending on the integrations configuration. You can read more about payment on account orders below.<br />You can learn more about configuring these methods [our guide here](docId\:ibIKczvHM085BkeJIfFYv)  |

### Payment on account orders & split shipments

The integration configuration allows you to decide when invoices are created for orders that use the payment on account payment method. Invoices can be created either **on order&#x20;**&#x20;or **on shipment.**

If you have configured your integration for **on order&#x20;**&#x74;hen an invoice will be created when the SparkLayer order reaches the `processing` state.&#x20;

If the integration is configured for **on shipment&#x20;**&#x74;hen an invoice will be created at the time an fulfillment has been fulfilled on the order. This handling caters for **split fulfillments&#x20;**&#x61;s will we will create an invoice per fulfillment, containing only the line items fulfilled.

Customers will be able to download all invoices associated with an order from their my account section.

Note: If the integration is configured to create orders **on shipment&#x20;**&#x61;nd changed to **on order** and partially fulfilled orders will not have invoices created for the remaining shipments. Please ensure any partially fulfilled orders are completed before changing this configuration.

:::hint{type="info"}
**Shipping**
In the case of split shipments, the shipping method associated with the order will always be attached to the invoice created for the **first&#x20;**&#x73;hipment on the order.
:::



### How invoices are created

Invoices are generated using the QuickBooks API. Each invoice is created using a combination of:

- Data from the SparkLayer order&#x20;
- Your integration configuration&#x20;
- Relevant settings within QuickBooks&#x20;

The specific fields and logic used are outlined below.

| Item                                     | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Contact`                                | We attempt to match the invoice to an existing QuickBooks contact using the customer details from the SparkLayer order. If a match is found, the invoice is associated with that contact. You can read more about how contact matching and syncing works in detail here.                                                                                                                                                                                                                                                                                                                       |
| `Billing Address`                        | The billing address shown on the invoice is taken from the order billing address.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `Due Date`                               | The due date calculated for an invoice is dependant on three factors:<br />* The order date&#x20;
* The payment type&#x20;
* The customers payment terms                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `Due Date for Payment by Invoice orders` | For orders using the **payment by invoice&#x20;**&#x70;ayment method, the due date is set to the order date.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `Due Date for Payment on Account orders` | For orders using the **payment on account** type, the due date is calculated in the following hierarchical order:<br />1) If the customer has **net terms** configured in SparkLayer, these are applied to the order date. You can read more about configuring net terms [here](docId\:yWm70oQUosyKOoIqb4Z4G).
2) If not, any **payment terms** configured for the contact in QuickBooks are applied.&#x20;
3) If neither of the above are set, any **global payment terms** configured in QuickBooks are applied.&#x20;
4) If none of these are set, the due date defaults to the order date. |
| `Line Item`                              | <br />* **Description**&#xA;The line item’s SKU is used as its description.&#x20;
* **Quantity**&#xA;The quantity matches the value recorded on the order in SparkLayer.&#x20;
* **Unit Amount &  Line Amount**&#xA;The unit and line amount are calculated by SparkLayer and passed directly to QuickBooks.
* **Tax Amount**&#xA;Tax values are calculated by QuickBooks using the tax rates specified in QuickBooks                                                                                                                                                                          |
| `Shipping`                               | If shipping enabled in QuickBooks, the shipping amount will be set on the invoice, with the shipping method reflecting the name of the service chosen and the price visile in the totals.<br /><br />If shipping is disabled in QuickBooks it will be added as a line item to the invoice.<br /><br />The shipping line will use the Shipping Tax Code specified in the configuration                                                                                                                                                                                                          |



***

## Viewing Invoices

Once an invoice has been created in QuickBooks, customers can access it directly from the **My Account** section of your store. When the invoice is ready, a **View & Download Invoice** button will appear on the relevant order.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2F9VvbGw3V1ivMIj38UXGA%2Fimage.png?alt=media\&token=ed9a3454-07ce-41e2-84e4-f534aea1806d)

Selecting this button will take the customer to the publicly accessible invoice URL generated by QuickBooks. If this button is not visible, please review our troubleshooting steps below.



***

## Contact matching & creation

When creating an invoice, we first attempt to associate it with the correct QuickBooks customer using the customer details from the SparkLayer order.

### How contact matching works

Contacts are matched in the following order:

1. **Account number match (Recommended)&#x20;**- we check for an existing QuickBooks contact with an ID that matches the accounting ID [metafield](https://docs.sparklayer.io/account-and-addresses#advanced-account-settings) configured against the customer in SparkLayer
2. **Email match&#x20;**- If no account number match is found, we attempt to match using the customer’s email address.

If a match is found for either of these conditions, the invoice is associated with the matching contact.&#x20;

### Multiple contacts for a single email

:::hint{type="danger"}
**Please note**
If your organisation uses multiple contacts with the same email address, we recommend configuring unique account numbers for each contact to ensure reliable matching.
:::

In SparkLayer, email addresses are unique - only one customer account can exist per email address.  In QuickBooks, email addresses are not unique, meaning multiple contacts can share the same email.

If multiple active QuickBooks contacts exist for the customer’s email address, and the currency of the invoice matches the customer, the invoice will be created against the oldest found customer.

### Automatic contact creation

If no existing contact can be matched using the methods above, SparkLayer will automatically create a new contact in QuickBooks using the customer data from the order. This behaviour is controlled by the **Automatic Contact Creation** setting in your integration configuration. &#x20;

### Data synced on contact creation

When a contact is created in QuickBooks, the following information is synced once and is not automatically updated if changes occur later in SparkLayer:

- First name & last name&#x20;
- Email address&#x20;
- Billing & shipping address (based on the order being invoiced at the time of matching)&#x20;
- Currency will be set to the currency of the invoice being created



***

## Disabling the integration

To disable the integration, log in to your SparkLayer Dashboard and navigate to **Integrations → Partner Integrations → Accountancy → QuickBooks**, then toggle the integration off.

:::hint{type="warning"}
**Please note**
If the integration is disabled, all related features will stop working.

- No invoices will be created for orders placed while the integration is disabled.&#x20;
- Customers will no longer be able to access their QuickBooks invoices  previously generated via SparkLayer using the link in their **My Account** section.
:::



***

## FAQ's

:::ExpandableHeading
**How do I disconnect from QuickBooks?**

To disconnect from your QuickBooks organisation from SparkLayer you will need to login to your SparkLayer Dashboard and navigate to **Integrations -> Partner Integrations -> Accountancy -> QuickBooks&#x20;**&#x74;hen disable the integration. This will remove the connection from your QuickBooks organisation. Please read further information here on what happens when the integration is disabled [here](https://docs.sparklayer.io/xero#OjTtC).
:::

:::ExpandableHeading
**Does the integration work for D2C orders?**

No. The integration only supports B2B orders that are created through your platforms connection with SparkLayer. Direct-to-consumer (D2C) orders are not included in the sync and will not be pushed to QuickBooks as invoices.
:::

:::ExpandableHeading
**What level of access does the integration require in QuickBooks?**

When connecting SparkLayer to your QuickBooks organisation, you’ll see a list of the exact permissions requested. We follow QuickBooks best-practice and only ask for the minimum access needed for the integration to function. Currently, this includes:

- **View & manage contacts** - To match invoices to existing contacts and create new contacts for SparkLayer customers if your integration configuration allows.
- **View & manage business transactions** - To create invoices in QuickBooks for SparkLayer B2B orders and in the future, view payments made on invoices.
- **View organisation settings** - To read configuration details such as global payment terms when calculating invoice due dates.
:::



***

## Troubleshooting

Below are some common issues and steps to help resolve them. If your issue isn’t listed, or the problem persists after following these steps, please contact our support team.

:::ExpandableHeading
**Customers cannot access their invoice from the My Account section**

If links to invoices are not showing in a particular customers My Account section, it could be due to a number of reasons.

- Ensure the integration is enabled in the SparkLayer Dashboard by navigating to **Integrations -> Partner Integrations -> Accountancy -> QuickBooks**.
- Ensure the order is in a `processing` or `shipped` fulfilment status. We **do not&#x20;**&#x63;reate invoices for orders which are in the `awaiting merchant` status.
- Ensure an invoice exists in QuickBooks for the given order. In some cases it may take a little time for orders to sync across. If there appears to be a large delay, or an invoice has not been created, please contact support, providing the customer and order id.

If you are still experiencing issues after checking the above, or invoice urls are not showing for **all&#x20;**&#x6F;f your customers, please contact support.
:::



***

## Known limitations

Please note the following:

- Products must be setup in QuickBooks, with a SKU that matches Shopify and the correct tax rate applied.
- Invoice creation in QuickBooks is one-way. Any changes made to invoices in QuickBooks, such as modifications to line items or customer details will **not&#x20;**&#x62;e reflected back in SparkLayer or your platform.
- Apportioned tax rate for shipping line is not currently supported
- Multi-currency is not currently supported where a customer has an existing invoice for another currency.

[title] Accountancy
[path] Integrations/

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/SgPkgyz2M87ioKZl5xGrS-20251202-152201.jpg"}
[Xero](docId\:WGhH4d8L-ys8zjOQmEoVx)
⚙️ Integrates Directly

Create invoices and import payments
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/wBbAtWJv_p1-if-cpch7e-20260203-050948.png"}
[QuickBooks Online](docId\:fDAlz0ggia651N47ICR2z)&#x20;
⚙️ Integrates Directly

Create invoices and import payments
:::
::::


[title] BigCommerce Limitations
[path] Integrations/BigCommerce/

## Introduction

Currently, there are a small number of limitations to be aware of with the SparkLayer and BigCommerce Integration.

| Limitation                          | Notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Product SKUs`                      | Within BigCommerce, the product must have a SKU and this must be unique per product.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `Product Inventory/Stock`           | SparkLayer works on variant level stock. Product level stock support is limited and should be avoided where possible.<br /><br />If the inventory is set to be tracked on product level where a product has multiple variants, SparkLayer would display that each of the variants has the set level rather than the product in its entirety across all variants.<br /><br />In this situation, if a customer tried to add multiple variants to the cart with total quantity that exceeded the product stock level, a "Something went wrong" error would be shown to the customer and they would not be able to proceed.                                                                                                                                                                                                                                                                                                                                                                                                        |
| `Negative stock and pre-ordering`   | BigCommerce does not support stock levels going below zero. As a result, SparkLayer cannot support pre-ordering functionality when stock is not yet available.<br /><br />This limitation also applies to Quotes. A quote cannot be placed if there is currently insufficient stock available to fulfill the request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `Product Modifier Options`          | If you are using BigCommerce Modifier Options (under the Customizations section of the BigCommerce edit product page), these will not show within the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa). SparkLayer will only show the variants set up within BigCommerce variations section (e.g. options such as size, colour).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `Custom Line Items`                 | SparkLayer custom line items feature is not supported on BigCommerce.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `Multi-storefront`                  | Currently SparkLayer does not officially support BigCommerce's [multi-storefront functionality.](https://support.bigcommerce.com/s/article/Multi-Storefront?language=en_US) <br />However, in most cases multi-storefront setup will work out of the box with the following limitations:<br /><br />1. Only one customer with the same email address can exist across all storefronts/channels used with SparkLayer.<br />2. All storefront/channel products, customers, and orders will share the same SparkLayer site.<br />3. A customer will share a single SparkLayer site across all channels/store-fronts, meaning that either the customers should only be assigned to a single channel at a time, or they will need to complete their checkout on one channel before adding any products on another to not end up creating invalid BigCommerce carts.<br />4. An extra SparkLayer Core Script Options field must be set with a unique `igniteCheckoutContext.channel_id` numeric value for each channel's storefront. |
| `Price lists`                       | Currently price lists can only be managed though SparkLayer. Any price list modifications actioned via the BigCommerce admin will not apply to SparkLayer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `Promotions`                        | SparkLayer does not currently support the use of BigCommerce discounts (e.g. order-level discounts or promotional codes). This is an area that is being actively reviewed as part of a future update.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `Multi-zone tax`                    | SparkLayer does support multi-zone tax configured in BigCommerce, however *at least one* of the following must be true for multi-zone tax to work:<br />1) The Tax "Prices entered with tax" setting is set to "No, I will enter prices exclusive of tax"&#x20;
2) The Tax "When calculating the taxes on sales made outside this storefronts default tax zone" setting must be set to "Update product prices to reflect applicable tax rates".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `Sales Agents`                      | [Sales Agent Ordering](docId\:Uw8mDbMEfwWKqZrVB5CqX) lets your sales team place orders on behalf of customers. During the checkout process, sales agents won't be able to select "Pay Online by Card" for a customer, payments must be "offline" methods (e.g. net terms, pay by invoice)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `Company Users`                     | If you're using [Company Users](docId:_WwfeWVJY9xrSuNCQlFoZ) and a customer is inviting a team member, the team member will not receive a 'confirmation email' asking them to approve access. They will need to be manually informed of their login email address and to use the "Forgot password" feature on the BigCommerce store to create a password for their account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `Tax price display setting updates` | The setting called "How are prices displayed on your storefront" influences how shipping costs appear in your shopping cart. When you install the SparkLayer app or modify the overarching "Prices entered with tax" setting, this setting is automatically updated. But if you adjust this particular setting on its own, SparkLayer won't automatically update, causing the shipping cost to display incorrectly.<br /><br />If you need to change this setting, reach out to SparkLayer for proper synchronisation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `Shipping and checkout`             | ​At this time, it's not possible to use the [SparkLayer Shipping](docId\:CfZ_ZpGw2umOVAo73Lc5m) feature in parallel with B2B orders that require going through the BigCommerce checkout to pay online by card ("Upfront payment"). <br />Due to BigCommerce shipping configurations, any SparkLayer shipping methods are overwritten by BigCommerce, reverting to the default shipping rules you've set up on your store.<br />SparkLayer shipping can be only used with BigCommerce if the Upfront Payment method is **disabled**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `Shipping method cost display`      | When the tax zone price display setting is set to "Tax Inclusive", the shipping method option cost shown in the SparkLayer cart will be calculated using the overall cart tax rate rather than any shipping specific tax bands.<br /><br />Please note that this is just the cost display amount shown in the shipping method options select UI rather than the actual shipping cost shown in the cart summary which is provided by BigCommerce and is not affected by this limitation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |


[title] Magento
[path] Integrations/

## Introduction

SparkLayer is the powerful platform that transforms your existing Magento website into a fully featured B2B solution. Say goodbye to complicated and costly installation processes and hello to a hassle-free setup that gets you up and running in no time!

::embed[]{url="https://www.youtube.com/watch?v=23uqVqW59d0"}

Once you've installed SparkLayer on your Magento store SparkLayer enables a B2B-ready frontend interface that simply "overlays" sections of your Magento store. The best part is you can retain your *existing* Magento store design and layout and enable B2B alongside your retail operation (DTC).

## Supported Magento Plans

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pNssCMHxMLGqoLflg1xu7-20260113-135420.png)

SparkLayer works with Magento Open Source versions 2.4.2 or later (formerly "Community Edition") and Adobe Commerce (Cloud) versions 2.4.2 or later.



***

## Magento Demo Store

Want to see SparkLayer & Magento in action? Try it out on our Magento demo store using the details below:

| Item          | Details                                                                                                                                                                                                                                     |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Login URL     | [demo.magento.sparklayer.io/&#xA;](https://demo.magento.sparklayer.io/)This is an example DTC + B2B store. To login as a B2B customer, [go to this link](https://demo.woocommerce.sparklayer.io/my-account/) and use the credentials below. |
| Login details | **Sales Agent / Regular B2B Customer**<br />`contact@sparklayer.io`<br />`Testtest!`                                                                                                                                                        |



***

## Get started

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem
[Installing SparkLayer on Magento](docId\:tlR1CAK6UzBa7R4JItqXq)

Learn about the steps to install SparkLayer on your WooCommerce store
:::

:::LinkArrayItem
[Magento Metafields & Data Mapping](docId\:eBCDHtikvf78kB7v6axEh)

Learn how to use the powerful WooCommerce metafields feature
:::

:::LinkArrayItem
[Magento FAQs](docId\:iN3pgYKCvUVn9R76lza2h)

See some of our most commonly asked questions!
:::
::::


[title] Linnworks
[path] Integrations/ERPs & Operations/Untitled/

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MfCvG0-L-IAVdZquNoK%2F-MfCwXUIo16c9hZmOB-b%2FLinnworks.jpg?alt=media\&token=7f91500d-bd82-4b4b-9773-508661a29da0)

:::hint{type="info"}
**Requirements**

- Plan: Merchants must be signed up to the Professional or Enterprise plan
- Platform: works with all eCommerce platforms
:::

## Introduction

Linnworks is a multi-channel platform that lets you connect, manage, and automate your eCommerce operations. From inventory and stock, order management, right through to fulfilment. You can learn more about Linnworks [here](https://www.linnworks.com/).&#x20;



***

## How it works

The Linnworks integration for SparkLayer is available for all [Shopify merchants](https://docs.sparklayer.io/integrations/shopify-introduction#introduction) that already use Linnworks and allows you to bring B2B pricing and B2B ordering to your Shopify store.The integration works in two ways:

| **Item**            | **Details**                                                                                                                                                                                                                       |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Product Pricing** | Flow: Linnworks into SparkLayer<br />Product pricing is synchronised from Linnworks into SparkLayer using the 'Extended properties' feature available for all inventory items.                                                    |
| **Orders**          | Flow: SparkLayer to Shopify to Linnworks<br />Orders placed via SparkLayer are synchronised from Shopify into Linnworks using your **existing** Linnworks integration. Prices that show on orders will be the special B2B pricing |

Please note, all customer data is managed via Shopify via the normal methods.



***

## Configuring on SparkLayer

**Before you start -&#x20;**&#x74;o configure Linnworks on SparkLayer, you'll need to have an approved account with Linnworks. Please visit the [Linnworks website](https://www.linnworks.com/) to learn more.

To get started, you'll sign into your Linnworks account and install the SparkLayer app. Once signed in, [click here](https://apps.linnworks.net/Authorization/Authorize/d4d9f57c-ea0e-4ecf-8c6d-eaa5632d4581) to start the process and you'll then be given an **authorisation token.**

Within the SparkLayer Dashboard, go to the **Integrations** section and click **Partner Integrations.** Under **Multi-channel management**, click the toggle on the right to activate the Linnworks integration.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MfCwkJ8NaFjoQaaPW96%2F-MfCyl6oMXgpdngl-2bb%2Fimage.png?alt=media\&token=cf02565a-e453-4c42-bf5e-2e333b604ba7)

You'll then be prompted to enter the **authorisation token** and save your changes.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MfCwkJ8NaFjoQaaPW96%2F-MfCyO0vP2rm6Jhtnl60%2Fimage.png?alt=media\&token=921eca23-7f84-40b2-981b-894891bbcafb)



***

## Configuring pricing

**Creating price lists in SparkLayer**

Price Lists determine what prices specific customers see when they log into your website and are central to how SparkLayer works. SparkLayer retrieves pricing from a backend system and ensures the backend system, such as Linnworks, remains as the 'source of truth' for pricing data.

The Linnworks integration for SparkLayer works by first creating price lists within SparkLayer directly, and then using the '**extended properties**' feature in Linnworks to map pricing.To get started, go to **Data Feeds&#x20;**&#x77;ithin the SparkLayer Dashboard, and click **Price Lists**

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MfD0sJnASjWdj97JqVG%2F-MfD1j_fd9fQcRFxfPL5%2Fimage.png?alt=media\&token=8beed85c-cf4c-412b-ada8-c7021190c7bf)

Click **Create Price List&#x20;**&#x61;nd enter in a unique **Handle** and a **Name** for the price list. You can repeat this process for as many price lists as you need.

**Creating B2B pricing in Linnwork**

To create B2B product pricing in Linnworks to synchronise with SparkLayer (and subsequently then show on your Shopify store), you need to use the **extended properties&#x20;**&#x66;eature in Linnworks. You can learn more about how this works in Linnworks [here](https://assets.linnworks.com/support/inventory/my-inventory/edit-inventory-item/extended-properties/).To get started, navigate to a product in Linnworks and click the **Extended properties** tab

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MfD23-8uLwXWFPdwjRK%2F-MfDDBY1iBZ6ouWayMP-%2Fimage.png?alt=media\&token=cc9a3467-688f-476e-9c6d-05f510958016)

Click 'Add New' and then follow the below steps:

- **Name**: this must match the Handle used for the price list in SparkLayer and also start with b2b- For example, if the price list Handle in SparkLayer was was base-list the name in Linnworks would be b2b-base-list.
- **Value**: this is is a list of prices in comma separated format and there is also support for tiered pricing. It works as follows: the first price entered is the price for 1 item. If you want to add tiered pricing, prefix the price with the quantity and a plus symbol. For example, let's say you have a product that costs £7.00 for 1 item ordered, but £5.00 for 10+ items ordered. This would be entered as 7.00,10+5.00.&#x20;
  - **Unit of Measure:&#x20;**&#x59;ou may also configure Unit of Measure by formatting the each pricing tier with a Unit of Measure key. For example, if a quantity of 10 items equates to 1 box priced at 5.00 per unit and a quantity of 100 items equates to 1 crate priced at 4.00 per unit. This would be entered as 7.00,10+5.00+box,100+4.00+crate. You can read more about our unit of measure pricing [here](https://docs.sparklayer.io/quantity-pricing#H9IT8).
- **Type**: this must be entered as Other

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MfCNEaWKGJCVE9lomqi%2F-MfCQDJVbk3hbUg8LLu6%2Fimage.png?alt=media\&token=090e0eed-f606-4e8b-9098-8845d0fbfeef)

**Bulk updating pricing**

We recommend using bulk importing tools in Linnworks to more easily update B2B pricing. You can learn how this works [here](https://assets.linnworks.com/support/settings/import-and-export-data/).

Once you've add the B2B product pricing in Linnworks, this will then be synchronised **every hour&#x20;**&#x69;nto SparkLayer. You can check the pricing that's being received in SparkLayer at any point by using the [Product Data Look up tool](https://docs.sparklayer.io/partners/linnworks).



***

## Configuring customers

The final step is to ensure that customers who sign into your Shopify store see the correct pricing. To do this, you'll need to configure Customer Groups.&#x20;

Please read our [full guide here](https://docs.sparklayer.io/sparklayer-dashboard/the-sparklayer-dashboard/settings#customer-groups) to complete this step. Once this is completed, you can login as a customer on your Shopify store, navigate to a product, and you'll see the pricing as set up in Linnworks.

[title] Magento FAQs
[path] Integrations/Magento/

## Introduction

We've included some of our most commonly asked questions below. If you can't find the answer you're after, please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.



***

## Frequently Asked Questions

### Plans and pricing&#x20;

:::ExpandableHeading
**Which SparkLayer plans do you offer for Magento?**

Our "Enterprise" plan is required to use the SparkLayer Magento integration. [Learn more](https://www.sparklayer.io/pricing/) about our plans and pricing.
:::

:::ExpandableHeading
**How does billing work?**

When you sign up to SparkLayer, billing is managed via the SparkLayer Dashboard under Acccount > Plan
:::

### Magento setup

:::ExpandableHeading
**Where do I find the SparkLayer Magento module?**

Please get in touch with our support team to get access to the SparkLayer Magento module.
:::

:::ExpandableHeading
**What Magento plan do I need to be on to use SparkLayer?**

SparkLayer supports the following Magento Plans

- Magento Open Source (version 2.4.2+)
- Adobe Commerce (Cloud, version 2.4.2+)
:::

:::ExpandableHeading
**Can I have DTC and B2B on the same store?**

Yes, it's possible to install SparkLayer onto your existing Magento DTC store (i.e. retail), meaning you can run both DTC and B2B on the same store. We call this a 'hybrid setup'; when your B2B customers sign in, they simply see the special SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) interface that allow them to see their prices and place orders.

If you want to see this in action, you can try our [B2B/B2C demo store here](https://demo.woocommerce.sparklayer.io/)
:::

### Store setup

:::ExpandableHeading
**How does SparkLayer affect my current Magento theme?**

The SparkLayer B2B widgets, including B2B pricing, cart and my account area, are only loaded once a customer who has been added to a B2B customer group successfully signs in to your store.

For all other users, your store will remain completely unaffected.

This allows you to have full control over which customers are able to see your B2B pricing and place B2B orders.
:::

:::ExpandableHeading
**What if I'm already using a wholesale B2B app on my website?**

If you already have a B2B / Wholesale app installed on your store, SparkLayer can work alongside this. It's a great way to test out SparkLayer and, once you're happy, you can simply uninstall any previous B2B apps you were using. If your previous B2B app has made code changes to your Magento store, you may want to ask the app developer to remove these although this is optional.
:::

### Payments

:::ExpandableHeading
**Can I use my existing payment methods on the checkout?**

If your customers choose "Pay Online by Card" during the SparkLayer checkout process, they will be taken to our Magento payment methods checkout. From there, any payment methods you have set up in Magento (e.g. Paypal, Affirm Pay) will show up, allowing the customers to pay by this method.&#x20;

In short, if Magento support specific payment methods, your B2B customers could select it during the checkout providing they choose "Pay Online by Card".
:::

### Products

:::ExpandableHeading
**How do I hide products or set up B2B-only products?**

There are a few things we recommend to make the experience better:

You could **create a B2B-only collection** and redirect customers to this once they login.&#x20;

You could also configure your Magento theme to hide and show products based on tag via custom coding.


:::

:::ExpandableHeading
**Can I use my Magento prices for my B2B pricing?**

Yes! SparkLayer allows you to automatically synchronise your Magento prices (e.g. your main Magento retail price), making it really easy to set up B2B pricing for your customers. For example, you could set your B2B prices to be 20% off your Magento prices and we can even make provisions for your tax set up in Magento (e.g. exclusive or inclusive of tax).
:::

:::ExpandableHeading
**Do I need to use product SKUs?**

In terms of product SKUs, SparkLayer relies on these being added to your products within Magento so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.

If you don't already have SKUs in Magento, it's relatively quick to do. You can either edit individual products and add them manually, or you can use Magento 'Import' or 'Edit products' feature to do this in bulk.
:::

:::ExpandableHeading
**How do I show inventory (stock) levels?**

It's possible to show inventory levels and a stock status when your B2B customers log in. You can learn more about how to enable this in [our guide here.](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;
:::

::::ExpandableHeading
**How do I restrict B2B customers from DTC inventory (and vice versa)**

If you're installing SparkLayer on a single website and you are looking to run both DTC and B2B at the same time, it will be necessary to **use the same stock pool&#x20;**&#x62;ehind the scenes. From an inventory point of view, this essentially means that both DTC and B2B customers will be ordering from the same stock source which can pose challenges.&#x20;

:::hint{type="info"}
**Important**
It is not possible to block DTC customers from ordering from your inventory and there is no mechanism in Magento to do this. If you are wanting to implement this, you will need to consider:

- Creating B2B-specific products on your store&#x20;
- Creating a separate store just for your B2B customers, effectively separating out your inventory completely.&#x20;
:::


::::

### User Experience

:::ExpandableHeading
**How do I set up a B2B registration form?**

If you're looking to enable a wholesale/B2B registration form there are a few good options for this and

In summary, these are the options we recommend:

- You could use your current login/registration page and enhance the registration page with some additional fields
- You could create a brand new registration page and direct prospective B2B customers to this.&#x20;

It's also worth noting that you can manually add customers via the admin by going to **Magento > Customers** and from there you could moderate your wholesale applications.
:::

:::ExpandableHeading
**How do I invite a B2B customer to my website?**

When you're ready to invite your B2B customers to begin using your store, there are a variety of ways you can do this.&#x20;

You could  think about sending a marketing newsletter to your customers to notify them of your new B2B store and to sign in. We also have some example messaging you can use when inviting your customers and you can explore more in [our guide here](docId\:YUfghEGoxe_h7uJfcshna). &#x20;
:::

:::ExpandableHeading
**Will SparkLayer slow down my Magento website?**

No. For performance, the SparkLayer Frontend only loads when a valid B2B customer successfully logs into a website; for your standard (DTC) customers, no code is loaded at all. When a B2B customer logs in, all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.
:::

:::ExpandableHeading
**How do I setup B2B-specific content on my Magento website?**

This is possible but would require custom coding. We recommend consulting with a Magento expert developer before making changes to your website.&#x20;
:::

### Orders

:::ExpandableHeading
**How do I edit orders?**

It is possible to edit orders within Magento when an order is placed via SparkLayer providing payment hasn't already been processed. From Magento > Sales, navigate to an order. You'll then see the option to **Edit order** allowing you to make changes.
:::

:::ExpandableHeading
**How do I send an invoice?**

In terms of invoicing, SparkLayer doesn't send invoices directly.

When sending an invoice, this is managed outside of SparkLayer and it will require you to collect payment by your preferred means. Once you've received payment, you can then mark the order as paid within Wix and then fulfil it as normal.
:::

:::ExpandableHeading
**How do I set a minimum order quantity?**

Within SparkLayer, we support the ability to set minimum/maximum order level spends for your B2B customers. You can configure these by going to the [Customer Groups](https://app.sparklayer.io/customers/groups) area of the SparkLayer Dashboard.
:::


[title] Wix FAQs
[path] Integrations/Wix/

## Introduction

We've included some of our most commonly asked questions below. If you can't find the answer you're after, please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.



***

## Frequently Asked Questions

### Plans and pricing&#x20;

:::ExpandableHeading
**Which SparkLayer plans do you offer for Wix?**

All SparkLayer plans are compatible with Wix, from "Starter" right through to "Enterprise". [Learn more](https://www.sparklayer.io/pricing/) about our plans and pricing.
:::

:::ExpandableHeading
**How does billing work?**

When you sign up to SparkLayer, billing is managed via your Wix admin and processed monthly or annually if you've selected this option.
:::

### Wix setup

:::ExpandableHeading
**Where do I find the SparkLayer Wix app?**

You can find the official SparkLayer for Wix app in the [Wix App Market](https://www.wix.com/app-market/search-result?query=sparklayer).
:::

:::ExpandableHeading
**What Wix plan do I need to be on to use SparkLayer?**

SparkLayer works on all versions of Wix. All you need is an active Wix store and you're good to go.
:::

:::ExpandableHeading
**Can I have DTC and B2B on the same store?**

Yes, it's possible to install SparkLayer onto your existing Wix DTC store (i.e. retail), meaning you can run both DTC and B2B on the same store. We call this a 'hybrid setup'; when your B2B customers sign in, they simply see the special SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) interface that allow them to see their prices and place orders.

If you want to see this in action, you can try our [B2B/B2C demo store here](https://demo.wix.sparklayer.io/)
:::

### Store setup

:::ExpandableHeading
**Can you help me install SparkLayer on my Wix website?**

Yes! Within the [SparkLayer Dashboard](https://app.sparklayer.io/help), you'll see an option to request our team to install SparkLayer for you. Typically we can do this within 1-2 working days and you're then good to go. We then offer an onboarding session to walk you through how everything works.
:::

:::ExpandableHeading
**Does SparkLayer work on any Wix theme?**

Yes! SparkLayer is compatible with all Wix themes. Once you install the SparkLayer app, our special B2B widgets are automatically added to your Wix store and you're good to go.
:::

:::ExpandableHeading
**How does SparkLayer affect my current Wix theme?**

The SparkLayer B2B widgets, including B2B pricing, cart and my account area, are only loaded once a customer who has been added to a B2B customer group successfully signs in to your store.

For all other users, your store will remain completely unaffected.

This allows you to have full control over which customers are able to see your B2B pricing and place B2B orders.
:::

:::ExpandableHeading
**What if I'm already using a wholesale B2B app on my website?**

If you already have a B2B / Wholesale app installed on your store, SparkLayer can work alongside this. It's a great way to test out SparkLayer and, once you're happy, you can simply uninstall any previous B2B apps you were using. If your previous B2B app has made code changes to your Wix store, you may want to ask the app developer to remove these although this is optional.
:::

### Payments

:::ExpandableHeading
**Can I use my existing payment methods on the checkout?**

If your customers choose "Pay Online by Card" during the SparkLayer checkout process, they will simply be taken to the Wix checkout. From there, any payment methods you have set up in Wix (e.g. Paypal, Affirm Pay) will show up, allowing the customers to pay by this method.&#x20;

In short, if Wix support specific payment methods, your B2B customers could select it during the checkout providing they choose "Pay Online by Card".
:::

:::ExpandableHeading
**Can I use multiple currencies for my B2B customers?**

Currently, Wix [doesn't allow](https://support.wix.com/en/article/wix-stores-request-selling-in-multiple-currencies) a Wix store to accept multiple currencies (e.g. USD, EUR, GBP etc).&#x20;

If you do set up multiple currencies within SparkLayer in the [Price List section](https://app.sparklayer.io/pricing/lists), it's important to note the following:

- Customers will see the correct currency when browser your store as a logged in B2B customer. The price they see will be the currency exchange rate at that time
- If they proceed to place an order in a different currency to your Wix store's default currency, this will create an order however the pricing will show in your default currency. We've illustrated this below

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Q79pcwJvs2aCzOWqHSSY-_image.png)

How the order shows in Wix. Note how the totals are the same but the currency (EUR) has defaulted to the Wix store currency (£ GBP)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/VM5aX0DMb7P4BoNyi5UFv_image.png)
:::

### Products

:::ExpandableHeading
**How do I hide products or set up B2B-only products?**

There are a few things we recommend to make the experience better:

You could **create a B2B-only collection** and redirect customers to this once they login. Within Wix, you can set pages to have **Permissions** for **Site members**. You create a **Member Role** of `B2B Customers` and then assign this to specific pages on your Wix website. You can see [their full guide here](https://support.wix.com/en/article/wix-stores-creating-restricted-store-pages).

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/n2lVpF2KmEsziagFvpYok_image.png)

If you wanted to show special B2B-only products, you would need to create these as separate products within Wix (i.e. with unique SKUs, etc)

With SparkLayer pricing, if you don't upload a price against a SKU, the B2B custome&#x72;**&#x20;won't be able to purchase it.** So this is a way to prevent them from adding items you don't want them to purchase


:::

:::ExpandableHeading
**How do I hide prices on my regular (B2C) Wix store?&#x20;**

Within your Wix store, you can easily hide the regular (B2C) retail price from showing. This is a great way to make your Wix store "B2B only" and only show prices once a customer signs in.

To view more details on how to do this, please see the [official Wix guide here](https://support.wix.com/en/article/wix-stores-hiding-product-prices).


:::

:::ExpandableHeading
**Can I use my Wix prices for my B2B pricing?**

Yes! SparkLayer allows you to automatically synchronise your Wix prices (e.g. your main Wix retail price), making it really easy to set up B2B pricing for your customers. For example, you could set your B2B prices to be 20% off your Wix prices and we can even make provisions for your tax set up in Wix (e.g. exclusive or inclusive of tax).
:::

:::ExpandableHeading
**How do I set up pre-order and backorder products?**

In terms of pre-ordering, SparkLayer has full support for different stock status messages and it's possible to set up products as pre-order/back-order easily - it does rely on some configuration within Wix, but it's relatively easy to do!

We've [full information here](docId\:Gj_Ao_gQ6oA-jx0D27Hys) on how it works and you can even set up "due in" dates to give your customers visibility.
:::

:::ExpandableHeading
**Do I need to use product SKUs?**

In terms of product SKUs, SparkLayer relies on these being added to your products within Wix so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.

If you don't already have SKUs in Wix, it's relatively quick to do. You can either edit individual products and add them manually, or you can use Wix 'Import' or 'Edit products' feature to do this in bulk.
:::

:::ExpandableHeading
**How do I show inventory (stock) levels?**

It's possible to show inventory levels and a stock status when your B2B customers log in. You can learn more about how to enable this in [our guide here.](docId:5_lWMNohhjBJJppg9E6Vh)&#x20;
:::

::::ExpandableHeading
**How do I restrict B2B customers from DTC inventory (and vice versa)**

If you're installing SparkLayer on a single website and you are looking to run both DTC and B2B at the same time, it will be necessary to **use the same stock pool&#x20;**&#x62;ehind the scenes. From an inventory point of view, this essentially means that both DTC and B2B customers will be ordering from the same stock source which can pose challenges.&#x20;

:::hint{type="info"}
**Important**
It is not possible to block DTC customers from ordering from your inventory and there is no mechanism in Wix to do this. If you are wanting to implement this, you will need to consider:

- Creating B2B-specific products on your store&#x20;
- Creating a separate store just for your B2B customers, effectively separating out your inventory completely.&#x20;
:::


::::

### User Experience

:::ExpandableHeading
**How do I set up a B2B registration form?**

If you're looking to enable a wholesale/B2B registration form there are a few good options for this and

In summary, these are the options we recommend:

- You could use your current login/registration page and enhance the registration page with some additional fields
- You could create a brand new registration page and direct prospective B2B customers to this. Wix [have a guide here](https://support.wix.com/en/article/wix-forms-an-overview) on ways to do this.

It's also worth noting that you can manually add customers via the admin by going to **Customers & Leads > Contacts** and from there you could moderate your wholesale applications.
:::

:::ExpandableHeading
**How do I invite a B2B customer to my website?**

When you're ready to invite your B2B customers to begin using your store, there are a variety of ways you can do this. One of the easiest ways is to use the built-in Wix messaging system to simply notify your customer to sign in and begin placing orders.&#x20;

You can access this by going to your Wix Dashboard, clicking **Customers & Leads** and then **Contacts**. You'll see a tab called **Inbox** that allows you to send direct messages.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/5kdTEgvaPekbMdybdqosS_image.png)

You could also think about sending a marketing newsletter to your customers to notify them of your new B2B store and to sign in. You can access this by going to your Wix Dashboard, clicking **Customers & Leads** and then **Contacts**. You can then search and filter your customers and click **Send Email Campaign** to send an email.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/bQ8LaAASXrGmv2S4ESMlD_image.png)

We also have some example messaging you can use when inviting your customers and you can explore more in [our guide here](docId\:YUfghEGoxe_h7uJfcshna). &#x20;
:::

:::ExpandableHeading
**Will SparkLayer slow down my Wix website?**

No. For performance, the SparkLayer Frontend only loads when a valid B2B customer successfully logs into a website; for your standard (DTC) customers, no code is loaded at all. When a B2B customer logs in, all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.
:::

:::ExpandableHeading
**How do I setup B2B-specific content on my Wix website?**

We recommend consulting with a Wix expert developer before making changes to your website.&#x20;
:::

### Orders

:::ExpandableHeading
**Where do I find my B2B orders in Wix?**

| Payment Method                    | Notes                                                                                                                                                                                       |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Payment by Invoice`              | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means) |
| `Payment on Account`              | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means) |
| `Request for Quote`               | The order will be created within **Sales > Orders** with a payment status of "UNPAID". You can then manually mark the order as paid once you have received payment (e.g. via offline means) |
| `Upfront Payment (Card payments)` | The order will be created within **Sales > Orders** with a payment status of "PAID". You can then proceed to fulfil the order.                                                              |
:::

:::ExpandableHeading
**Why do orders show up as "Awaiting Merchant"?**

When a B2B customer first places an order, it will show as **Awaiting Merchant** when they view it in their [My Account Interface](docId\:lQXaNI7IVDqna09D9soAP). This status means that the order requires the merchant (the Wix store owner) to view the order and then confirm payment (e.g. such as sending the customer an invoice or arranging payment via other means).

Once you then mark the order as paid within Wix, this will then update the order status from **Awaiting Merchan**t to **Processing** and you can then fulfil the order as normal.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/lIfhmsNf5OVvjRkSUnqhv_image.png)

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/fgaZ0LGKXdMlO1m7DgCiy_image.png)
:::

:::ExpandableHeading
**How do I edit orders?**

It is possible to edit orders within Wix when an order is placed via SparkLayer providing payment hasn't already been processed. From your Wix Dashboard, navigate to an order and click the **More Actions** button. You'll then see the option to **Edit order** allowing you to make changes.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/EGDa7f7lc5jRcL_A1cEiq_image.png)
:::

:::ExpandableHeading
**How do I send an invoice?**

In terms of invoicing, SparkLayer doesn't send invoices directly but there are some good ways to do this within Wix. When viewing an order within your Wix Dashboard, you'll see the option to **Create Invoice** under **More Actions**.

When sending an invoice, this is managed outside of SparkLayer and it will require you to collect payment by your preferred means. Once you've received payment, you can then mark the order as paid within Wix and then fulfil it as normal.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/0rzfB2XOjJVqsPgieUX2c_image.png)
:::

:::ExpandableHeading
**How do I set a minimum order quantity?**

Within SparkLayer, we support the ability to set minimum/maximum order level spends for your B2B customers. You can configure these by going to the [Customer Groups](https://app.sparklayer.io/customers/groups) area of the SparkLayer Dashboard.
:::

:::ExpandableHeading
**How do I send order notifications to customers and my team?**

You can manage notifications and emails that are sent by going to your Wix Dashboard, clicking **Settings** and then **Outgoing Notifications**.
:::


[title] Uninstalling & Transferring accounts
[path] Integrations/Wix/

## Uninstalling SparkLayer

SparkLayer works just like any other app in Wix and you can uninstall it very easily.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GD_ASDOqFBamwppSnxstC_image.png)

Please follow the below steps:

::::WorkflowBlock
:::WorkflowBlockItem
From your Wix admin, click **Apps**, and then click **Manage Apps.**
:::

:::WorkflowBlockItem
For the SparkLayer, click the three dots on the right and then click **Delete**. This will then remove SparkLayer from your store.
:::
::::

Once you've removed the app, this will then **cancel** the SparkLayer recurring billing charges with immediate effect.

:::hint{type="info"}
**More information**
You can learn more about removing apps in this [Wix guide](https://support.wix.com/en/article/deleting-apps).
:::

:::hint{type="warning"}
**Please note**

- When you follow the uninstall process, this will disable customers, product and order updates to SparkLayer but will **not** delete the data until you [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) to remove your account.
- Please note, depending on when your billing cycle to SparkLayer began, you may see charges you're not expecting. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) if you would like us to investigate.
:::



***

## Transferring to another Wix store

At this time, it's not possible to transfer your SparkLayer account to a new Wix store. We recommend creating a brand new SparkLayer account on the new store and following our setup guide.

[title] Wix
[path] Integrations/

## Introduction

SparkLayer is the powerful platform that transforms your existing Wix website into a fully featured B2B solution. Say goodbye to complicated and costly installation processes and hello to a hassle-free setup that gets you up and running in no time!

::embed[]{url="https://www.youtube.com/watch?v=23uqVqW59d0"}

Once you've installed the [official SparkLayer for Wix app](https://www.wix.com/app-market/web-solution/sparklayer-b2b-wholesale), SparkLayer enables a B2B-ready frontend interface that simply "overlays" sections of your Wix store. The best part is you can retain your *existing* Wix store design and layout and enable B2B alongside your retail operation (DTC).

## Supported Wix Plans

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-5AqFHf7uXQxC2r273j8Ko-20240930-114442.png)

SparkLayer works with all versions of Wix including Wix Editor and Wix Studio.



***

## Wix Demo Store

::embed[]{url="https://www.youtube.com/embed/Bww33sF7sLk"}

Want to see SparkLayer & Wix in action? Try it out on our Wix demo store using the details below:

| Item      | Details                                                                                                                                                                                                                                    |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Login URL | [[[https://demo.wix.sparklayer.io/](https://demo.wix.sparklayer.io/)&#xA;](https://demo.bigcommerce.sparklayer.io/)](https://demo.bigcommerce.sparklayer.io/login.php)To login as a B2B click the "Try Demo" link in the main navigation.  |



***

## Get started

::::LinkArray
:::LinkArrayItem
[Installing SparkLayer on Wix](docId\:JcMpSOZdCrFjgWO6M49rS)

Learn about the steps to install SparkLayer on your Wix store
:::

:::LinkArrayItem
[Wix FAQs](docId\:FTSB7UVso1qIpgXNPwYcI)

See some of our most commonly asked questions!
:::
::::


[title] Shopify Limitations
[path] Integrations/Shopify/

## Introduction

Currently, there are a small number of limitations to be aware of with the SparkLayer and Shopify Integration.

| Limitation               | Notes                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Discounts`              | Currently, it's not possible to use Shopify discounts in parallel to SparkLayer. Instead, SparkLayer has its' own discount system that allows powerful discounts and promotions to be set up. [Learn more](docId\:WrejPw9URyjQwiQeKs_Cg)                                                                                                                                                                                                       |
| `Product SKUs`           | Within Shopify, the product **must** have a SKU and this must be unique per product.                                                                                                                                                                                                                                                                                                                                                           |
| `Product Customisations` | If you're using an app that adds customisations to a product (e.g. a text-entry field), these will not show within the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa). SparkLayer will only show the variants set up within Shopify's own catalogue (e.g. size, colour). It is possible to add customisations using the [JavaScript SDK](docId:315uNbM85_FWnh6FU9KkK) however please be aware that this will require custom development.  |
| `Cart Line Items`        | A set a restriction of a **350 line items**. By request to support, this can be increased to 500, please note this is not by default due to the performance of the Shopify APIs.                                                                                                                                                                                                                                                               |
| `Product Tax rates`      | If you're using line-item tax exemption rules within your product catalogue, SparkLayer will not have appropriate tax handling if a customer's order combines both tax-included and tax-exempt products.<br />For stores which "Include taxes in pricing", we'll be unable to calculate the gross pricing correctly, and we recommend setting up another store specifically for B2B with this setting off where we can provide net pricing.    |
| `Duties`                 | Due to Shopify's API not including Duties, we'll be unable to calculate duties as a 'separate' addition to the cart when completing an order. It's recommended that, if you're using duties in your store, to [disable this option](https://admin.shopify.com/settings/taxes/duties/management) in your Shopify admin settings or create a separate B2B store if required.  We will add support for this as soon as is available with Shopify. |
| `Companies`              | Currently, SparkLayer is not compatible with Shopify B2B companies. Please refer to our [Shopify FAQs](docId\:P-7titr2d20hXBeixvKBZ) for recommended options on how to migrate from Shopify Companies to Shopify (regular) Customers.                                                                                                                                                                                                          |




[title] Shopify B2B Landing Page
[path] Integrations/Shopify/Shopify Customisations/

## Introduction

![](https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-J01EDzvpy_axobiAeJTKY-20250806-093440.jpg)

When your B2B customers sign in, you may want to take them to a dedicated page that provides a more tailored experience - whether it's to highlight specific products, show important information, or act as a central hub for your B2B store.

SparkLayer gives you the ability to control *where* B2B customers land when they log in, and you can customise this to suit your needs. In this guide, we’ll cover a few ideas and approaches you can take.

:::hint{type="info"}
I**mportant to note**
Customising the landing experience for B2B customers is a Shopify-specific change and will require making updates to your theme or using a page builder app. While SparkLayer enables the redirect behaviour, we’re unable to assist with Shopify design or layout customisation. If you’re unsure how to make the changes in Shopify, we recommend working with a Shopify expert
:::



***

## Redirect to a B2B product collection

One simple approach is to create a B2B-specific **collection** in Shopify that contains the products you want your B2B customers to see first. For example:

:::BlockQuote
/collections/b2b-products
:::

You can manage collections in Shopify by going to **Products** > **Collections** in your [Shopify admin](https://admin.shopify.com/collections?selectedView=all).

Once created, you can configure SparkLayer to redirect logged-in customers to this URL instead of the standard homepage (see "*How to redirect B2B customers to a custom URL*" below)

This is ideal if you want your customers to immediately browse and order from your wholesale catalogue.



***

## Create a custom landing page in Shopify

Another option is to create a standard **page** in Shopify (e.g. named "*B2B Landing Page"*) and build it out with relevant content. For example, the URL could be:

:::BlockQuote
/pages/b2b-landing-page
:::

This page could include:

- Rich text or welcome messaging
- Featured product links or categories
- Helpful content or banners
- Links to customer account tools (e.g. invoices, quick order)

You can manage and edit pages directly from the Shopify admin, under **Online Store > Pages** and also within **Online Store** > **Customize** on your live theme.&#x20;

Once created, you can configure SparkLayer to redirect logged-in customers to this URL instead of the standard homepage (see *"How to redirect B2B customers to a custom UR*L" below)

:::hint{type="info"}
**Please note**
The level of functionality may depend on which theme you are using and you may need to consult your theme developer on how best to approach this.
:::





***

## Use a third-party page builder app

If you want more control over the design, you can use a **Shopify page builder app** and redirect your B2B customers to a specially designed page. There are many options within the Shopify app store such as:

- [PageFly](https://apps.shopify.com/pagefly?st_source=autocomplete\&surface_detail=autocomplete_apps)
- [Shogun](https://apps.shopify.com/shogun?st_source=autocomplete\&surface_detail=autocomplete_apps)
- [Instant](https://apps.shopify.com/instant-builder?st_source=autocomplete\&surface_detail=autocomplete_apps)
- [and many others](https://apps.shopify.com/categories/store-design-storefronts-page-builder/)

These apps give you drag-and-drop interfaces to create visually rich landing pages, without needing to write code. This can be a great solution if you want a highly polished, branded B2B dashboard or homepage.

As with other pages in your Shopify store, page builder apps will also generate a unique URL that you can direct your B2B customers to. For example, the URL could be:

:::BlockQuote
/pages/b2b-customer-landing-page
:::

Once created, you can configure SparkLayer to redirect logged-in customers to this URL instead of the standard homepage (see *"How to redirect B2B customers to a custom UR*L" below)



***

## Other ideas

Every B2B setup is different, and your landing page might be shaped by what matters most to your customers. You could also consider including:

- A quick links section to access quotes, past orders, or special promotions
- Displaying B2B-only content using Shopify Liquid (read our guide to showing B2B-only content)
- Embedding a video or help resources to guide new customers



***

## How to redirect B2B customers to a custom URL

When a logged in customer accesses your website's existing my account area (e.g. `/account`), it will redirect them to the SparkLayer My Account interface instead. If you'd prefer, you can change the default handling and set a custom URL to redirect B2B customers to once they log in. You can do this by updating the SparkLayer Core Script on your website.

```javascript
/* Add the below code into the SparkLayer Core Script */
/* Please refer to our help guide on how to do this */
accountRedirect: {
  urlRegex: /\/account/g,
  goTo: "/index", // page to redirect logged in users to
},
/* End of code */
```

::::Tabs
:::Tab{title="🛍️ Using Shopify"}
**Using Shopify Customer Accounts (New Accounts)**

If you're using Shopify Customer Accounts, you can configure which URL to send a customer to directly via your Shopify admin. In your Shopify admin, go to Settings, Checkout, and within [Configurations](https://admin.shopify.com/settings/checkout#checkoutprofiles), click "Customize".

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Kw5A14fjJZG3Jlv8YaObH_image.png)

From the top, navigate to the "Orders" page, click "Apps" on the left, and then enable the "B2B Account Redirect" extension.&#x20;

You can include:

- Some optional placeholder text that shows before the customer is redirected should you wish to inform them that they are being redirected.
- A specific destination URL to take the customer to once they are redirected. For example, you may want to take them to a specific collection page or a landing page.&#x20;

**Setting up redirect URLs based on a customer tag**

If you're using *Legacy* Shopify accounts (Classic Accounts), you can also add handling to vary the destination redirect URL based on a customer group. E.g. customer group ABC goes to` /collections/wholesale-page` whereas customer group XYZ goes to `/collections/wholesale-vip`

Within your SparkLayer Core Script, you can replace the above code sample with the following Liquid code logic (and adapt accordingly):

```javascript
accountRedirect: {
urlRegex: /\/account/g,

{% assign goTo = "/index" %}

{% for tag in customer.tags %}
 {% if tag == "b2b-group-1" %}
   {% assign goTo = "/collections/wholesale-page" %}
 {% elsif tag == "b2b-group-2" %}
   {% assign goTo = "/collections/another-wholesale-page" %}
 {% endif %}  
{% endfor %}
 
goTo: {{ goTo | json}},

},
```
:::

:::Tab{title="🌐 Other platforms"}
No configurations available.
:::
::::



***

## Show custom content on your B2B landing page

You can also use Shopify’s Liquid templating to tailor the content on your landing page depending on whether a customer is a B2B user.

Here’s a simple example:

```html
{% if customer.tags contains 'b2b' %}
  <p>Welcome back, valued wholesale customer!</p>
  <a href="/collections/b2b-products" class="button">Browse B2B Products</a>
{% else %}
  <p>This page is for B2B customers only.</p>
{% endif %}
```

For more advanced examples, see our full guide [Shopify B2B-only Content](docId:30hMTg4Cqqv69EhqNvpnf)&#x20;


[title] Brightpearl
[path] Integrations/ERPs & Operations/

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MhXD6ihqcOREWvV3juE%2F-MhYBjI0jZ9gFYsirHd1%2FBrightpearl.png?alt=media\&token=971a86ea-4c94-4079-a18c-c8029439ab7e)

:::hint{type="info"}
**Requirements**

- Plan: Merchants must be signed up to the Professional or Enterprise plan
- Platform: Merchants must be using Shopify
:::

## Introduction

Brightpearl is a multi-channel platform that lets you connect, manage, and automate your eCommerce operations. From inventory and stock, order management, right through to fulfilment. You can learn more about Brightpearl [here. ](http://brightpearl.com/)



***

## How it works

The Brightpearl integration for SparkLayer is available for all [Shopify merchants](https://docs.sparklayer.io/integrations/shopify-introduction#introduction) that already use Brightpearl and allows you to bring **B2B pricing and B2B ordering** to your Shopify store. The integration works in the following ways:

| **Item**            | **Details**                                                                                                                                                                                                      |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Customers**       | Brightpearl becomes the 'master' of your B2B customer data, and any changes to tagged customer records will automatically be synchronised to Shopify and SparkLayer.                                             |
| **Orders**          | Orders placed via SparkLayer are synchronised from Shopify into Brightpearl using your **existing** Brightpearl integration. Prices that show on orders will be the special B2B pricing as set up in Brightpearl |
| **Product Pricing** | Price lists and product prices are imported into SparkLayer via pricing rules you set up in Brightpearl                                                                                                          |



***

## Configuring on SparkLayer

To configure Brightpearl on SparkLayer, you'll need to have an approved account with Brightpearl. Please visit the [Brightpearl website](http://brightpearl.com/) to learn more. To get started using Brightpearl on SparkLayer, you'll first need to enable the integration.&#x20;

Within the [SparkLayer Dashboard](https://docs.sparklayer.io/sparklayer-dashboard/the-sparklayer-dashboard), go to the **Integrations** section and click **Partner Integrations**. Under **Multi-channel management**, click the toggle on the right to activate the Brightpearl integration.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MhrP58q8v57mRHdZF88%2F-MhrRvpsX-6t8-LXPEku%2Fimage.png?alt=media\&token=1eeb0b7e-5385-4dc9-8203-9551a16d9c8c)

You'll then be prompted to enter your **Brightpearl account ID** (which can be found within your Brightpearl admin) and then authorise SparkLayer to access your Brightpearl account. Once the authorisation process is completed, the final step is to configure how you want customers to be mapped between the two systems.&#x20;



***

## Configuring Customers

Broadly speaking, Brightpearl is your **central location&#x20;**&#x66;or managing B2B customer data. When customers are configured in Brightpearl as B2B customers, SparkLayer can automatically retrieve this data and then enable the B2B ordering experience on your Shopify site.Within Brightpearl, **Contact tags** are used as the primary mechanism to map data between systems. Within Brightpearl, go to **Settings**, **Contacts** and click **Tags**.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MhrP58q8v57mRHdZF88%2F-MhrUeyDbIrzz3hOMgJV%2Fimage.png?alt=media\&token=b3c124c8-08c9-434f-90d3-3072728ab9cb)

To enable the data mapping between the two systems, it's necessary to create new tags and then to map the names accordingly. For example, if you wanted just a single B2B customer group for your UK store, you could name this **SparkLayer UK.&#x20;**&#x57;ithin SparkLayer, to complete the mapping process, this tag simply needs to be matched as shown below.&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MhrP58q8v57mRHdZF88%2F-MhrSqAS_IldZBOfu7Lk%2Fimage.png?alt=media\&token=adc5932d-5f11-4fd0-9b85-ab7bc6e073ee)

You can then create specific rules for this customer group, e.g. minimum orders, price lists, via the [Customer Group](https://docs.sparklayer.io/sparklayer-dashboard/the-sparklayer-dashboard/settings#customer-groups) section within SparkLayer.

**Customer sub-groups**

It's also possible to create more sophisticated rules for your customers and create **sub-groups** as shown below.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MhrP58q8v57mRHdZF88%2F-MhrUk2rpY7qT1wCg52s%2Fimage.png?alt=media\&token=e525f518-f00a-4528-ac7c-984a3de55625)

For example, you may have a **VIP** group within your B2B customers where they get special pricing. To map sub-groups between Brightpearl and SparkLayer:

1. First create your sub-group in Brightpearl. For example **SparkLayer UK - VIP**
2. Within the Customer Group section within SparkLayer, create a new group ensuring you match the naming convention after the dash symbol in Brightpearl, e.g. VIP

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MhrP58q8v57mRHdZF88%2F-MhrVGYIpTy4UxYIe1cW%2Fimage.png?alt=media\&token=2fa20f3d-c37e-4571-bdb0-08bacca601ec)

This will then allow you to create additional B2B sub-groups within your customer base.

**Customer mapping**

Customers are mapped between the systems based on the **primary email** set within Brightpearl. Once this is mapped, SparkLayer will then synchronise the following data into Shopify.

| **Brightpearl**                   | **Shopify / Spark Layer**                                                                           |
| --------------------------------- | --------------------------------------------------------------------------------------------------- |
| Address                           | Shows against customer record in Shopify                                                            |
| Receive email newsletters         | Shows against customer record in Shopify                                                            |
| Primary Telephone                 | Shows against customer record in Shopify                                                            |
| First / Last Name                 | Shows against customer record in Shopify                                                            |
| Title                             | Shown via metafields in Shopify                                                                     |
| Company Name                      | Shown via metafields in Shopify                                                                     |
| Customer tag (see above)          | Shown via metafields in Shopify - matches to customer group                                         |
| Credit Limit / Balance on Account | Shown via metafields in Shopify                                                                     |
| Price List                        | Shown via metafields in Shopify                                                                     |
| Customer Custom Field: SL\_SAGTS  | Shown via metafields in Shopify - matches to SparkLayer Sales Agent groups, must be comma-delimited |

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MhrW46KbZ6VB1qVh4_j%2F-MhrWanH3Zf9zlx5yNH7%2Fimage.png?alt=media\&token=3a0602af-537f-408f-8b5b-bccb5bc28614 "How data is mapped to Shopify, using metafields")

Please note, all customer data is managed via Brightpearl and any amends made directly in Shopify will not synchronise back to Brightpearl.

**Adding new B2B customers**

Since Brightpearl is the central source for customer data, any new customers created in Brightpearl will **automatically** be added to Shopify. When new customer records are added to Shopify, they will by default be added as **Pending** customer accounts and receive an **automatic email** to enable their account by setting a password.&#x20;

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-Mhstl0m8FxEXBk3bD8k%2F-MhstpGWQoEhPXfldAVJ%2Fimage.png?alt=media\&token=aa1c437c-c724-412f-b692-a023a7508651 "Example email sent from ShopifyT")

This uses the **Customer account invite&#x20;**&#x6E;otification email which can be edited in the Notifications section within Shopify.



***

## Configuring Product Pricing

Once customers are mapped between Brightpearl and SparkLayer, the next step is to configure your B2B pricing. As with customers, Brightpearl is your centralised source for managing your B2B pricing.

**Setting up B2B pricing in Brightpearl**

Within Brightpearl, go to **Settings**, **Products/Inventory,** and click **Price Lists**. To add a new price list, click the Add new price list button and complete as necessary.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MhrX4YFKbCdtZfHI7FB%2F-MhrXuuOR9CqnHFYCtFR%2Fimage.png?alt=media\&token=023cbd90-7928-40e9-9533-0f76aafda992 "Click to zoom")

In the example above, we've created two price lists; B2B and UKVIP. Once you've created your price list(s) in Brightpearl, you'll then see a new tab show against all product records where pricing rules (including price breaks) can be specified. In the example below, you can see pricing for the UKVIP price list.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MhrY91qEpi2dd4S5EXJ%2F-MhrYQyDbrh1eSCLX_Os%2Fimage.png?alt=media\&token=853e1b5e-591c-4a6b-b2e2-1117f22b98ce)

In order for SparkLayer to map this data, price list records are **automatically** imported each time you add a price list in Brightpearl. The mapping works as follows:

| **Field name in SparkLayer** | **Field name in Brightpearl** |
| ---------------------------- | ----------------------------- |
| Handle / ID                  | Price list code               |
| Name                         | Price list                    |
| Currency                     | Currency                      |

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MhrY91qEpi2dd4S5EXJ%2F-MhrYekI6C2FSaQAEXjE%2Fimage.png?alt=media\&token=5764b23c-2c6e-4b2a-aa2e-0cd24f5bf358)

Please note: Only price lists set to **non-cost&#x20;**&#x61;re synchronised between Brightpearl and SparkLayer. During the prices synchronisation, they will be match based on **gross / net** setup within the Brightpearl price list.



***

## Known limitations

Please note the following:

- Default addresses in Brightpearl will be mapped to Shipping and Billing address in Shopify as Shopify doesn't support independent addresses.
- A customer that is removed from the customer group will also need their allocated 'b2b' tag removed from their customer account in Shopfiy.
- Addresses are a 1-way sync currently, from Brightpearl into Shopify. Its recommended to not allow address editing in SparkLayer otherwise new addresses added won't appear in Brightpearl.
- Issues syncing customers across are provided via email currently. A viewer will be added in the dashboard shortly.


[title] Uninstalling, Transferring accounts, & Trials
[path] Integrations/Shopify/

## Uninstalling SparkLayer

We understand SparkLayer may not be right just now, but we'd love to be able to help before you uninstall and cancel your subscription.

**What's the main reason you're considering canceling?**

💸   [It's too expensive →](https://www.sparklayer.io/feedback/?reason=pricing)
🕒   [I'm not using it enough →](https://www.sparklayer.io/feedback/?reason=usage)
🧩   [Missing features I need →](https://www.sparklayer.io/feedback/?reason=features)
🛠️   [Technical issues →](https://www.sparklayer.io/feedback/?reason=technical)
🔄   [Switching to a competitor →](https://www.sparklayer.io/feedback/?reason=competitor)
❓   [It's something else → ](https://www.sparklayer.io/feedback/?reason=other)

You can also see our guide below on how to uninstall SparkLayer from your Shopify store.

:::::ExpandableHeading
**Uninstalling SparkLayer in Shopify (click to expand)**

SparkLayer works as a **Sales channel** within Shopify and uninstalling it works in the same way as any other sales channel.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/e_EiEXxEX2q0FCyzJECIU_image.png)

Please follow the below steps:

::::WorkflowBlock
:::WorkflowBlockItem
From your Shopify admin, click **Settings**, and then click **Apps and sales channels**.
:::

:::WorkflowBlockItem
Click **Uninstall** beside the **SparkLayer B2B & Wholesale&#x20;**&#x20;sales channel that you want to remove.
:::

:::WorkflowBlockItem
If you want to give a reason for removing the channel, then enter it in the field.
:::

:::WorkflowBlockItem
Click to confirm
:::
::::

Once you've removed the sales channel, this will then **cancel** the SparkLayer recurring billing changes with immediate effect. &#x20;

:::hint{type="info"}
**More information**
You can learn more about removing Sales channel in this [Shopify help guide](https://help.shopify.com/en/manual/online-sales-channels#remove-an-online-sales-channel-from-your-shopify-admin).
:::

:::hint{type="warning"}
**Please note**

- If you've also added the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) to your Shopify store, these will need to be removed manually.
- When you follow the uninstall process, our system will automatically delete the account associated with that team after 30 days. If an account is scheduled for automatic deletion, you'll see a warning message at the top of the dashboard notifying you.
- Please note, depending on when your billing cycle to SparkLayer began, you may see charges you're not expecting. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) if you would like us to investigate.
:::


:::::



***

## Transferring to another Shopify store

When you first sign up to SparkLayer, you'll be asked to associate your account with a Shopify URL (i.e. `storename.myshopify.com`). Once that's done, SparkLayer will be locked to that URL and will begin synchronising products, customers, and enable you to install the Frontend code snippets to test it out.

There may be some scenarios where you need to "transfer" your SparkLayer account to a different Shopify store:

- You want to trial SparkLayer on a **test or development Shopify store** just to see how it works before you fully commit to using it.&#x20;
- You want to transfer SparkLayer from a "hybrid" Shopify store to a "standalone" Shopify store (or vice versa)

The good news is, it's possible to transfer accounts by following the below steps!

- First, sign into your Shopify store and uninstall SparkLayer **via the steps above**. This will disconnect SparkLayer from the Shopify store
- Next, you'll need to create a new team by following [these steps](docId\:r9NG74uJdtyWlvGbpnB5u)&#x20;
- Next, [sign into SparkLayer](https://app.sparklayer.io/Login) with the new account you created and go to Configuration and click [Integrations](https://app.sparklayer.io/configuration/integrations/platform)
- Once you've created the new team, go to Configuration > Connect your Shopify Store
- Select **Shopify** and re-enter the new Shopify URL you wish to connect (i.e. `new-storename.myshopify.com`)
- You'll then be taken to the Shopify admin and asked to reinstall SparkLayer and select a plan.
- Once that's completed, you'll then be returned to the SparkLayer Dashboard. SparkLayer will then begin synchronising your products and customers and you can then re-install the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) on the new store

:::hint{type="info" attributes="[object Object]"}
**Please note**
Shopify data: The transfer process above will **not** transfer any of your Shopify data (e.g. products, customers, orders). This must be managed externally to SparkLayer and apps such as [Matrixify](https://apps.shopify.com/excel-export-import?) can help with this process.

If you require any assistance in transferring your Shopify store, please feel free to [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.
:::



***

## Trial period&#x20;

When you first setup SparkLayer, you'll be given a free-trial to allow you to test how it works and ensure it's a good fit for your needs.&#x20;

If you'd like to extend your trial, please [contact our team](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to discuss.


[title] Customer Experience
[path] Integrations/

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/F5usKmg_-6xRtRJXj0TU__sufio.png"}
[Sufio Invoicing](docId\:qlBasATpzOCOF5eXC99O3)
⚙️ Integrates Directly

Professional invoices
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-Sv5L43Yj_sdqbBSwRWZw--20241121-141344.png"}
[Locksmith](https://docs.sparklayer.io/locksmith)
✅ Trusted Partner

Restrict content
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/JqdLbaSP2Tn4fw6WpY669-tqfB4hdlhBIZadLAKFqRu-20250214-094403.png"}
[Intuitive Shipping](docId\:ZkesmMUAWX2SQQ7j6as07)&#x20;
⚙️ Integrates Directly

Advanced shipping
:::
::::


[title] Payments
[path] Integrations/

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/XK7wbxwqgb_6TSQUcXmna_balance.png"}
[Balance ](https://www.sparklayer.io/partners-balance/)↗
✅ Trusted Partner

Buy Now, Pay Later for B2B
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/DrzxLSJwqPwu_ZvrAGrM4_billiet.png"}
[Billie ](https://www.sparklayer.io/partners-billie/)↗
✅ Trusted Partner

Buy Now, Pay Later for B2B
:::
::::


[title] Magento Metafields & Data Mapping
[path] Integrations/Magento/

## Introduction

:::hint{type="warning"}
**Please note**
The SparkLayer Help Docs refer to attributes as "Metafields" elsewhere.
:::

Attributes help you to customise the functionality and appearance of your Magento store by letting you save specialised information that isn't usually captured in the Magento admin. You can use attributes for internal tracking, or to display specialised information on your online store in a variety of ways.&#x20;

In the context of SparkLayer, attributes are used to capture additional B2B data that you can then use in a variety of ways:

| Type                  | Details                                                                                                                                                                                             |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Product attributes`  | Updating the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) by adding configurations such as [pack sizing](docId\:CmxfrPgjQxfz9vJzTVv0D), [RRP prices](docId\:S_VTlJBorGmnwjjfSMom9), and more |
| `Customer attributes` | Updating a customer's information by adding information such as [credit limits](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                       |
| `Order attributes`    | Updating an order with [invoicing information](docId\:yWm70oQUosyKOoIqb4Z4G)                                                                                                                        |



***

## How to add attributes to Magento

The easiest way to add attributes is to action this via the SparkLayer Dashboard. Simply go to **Integrations > Platform Connection** and click "Configure" under "Configure metafields". You can then select which of the SparkLayer [attributes](docId\:OTLHhi8sQ6oS4PAt23-8H) you'd like to enable.



***

## Important considerations

In order for SparkLayer to work with Magento attributes, please note the following:

:::hint{type="warning"}
**Product attributes**
Attributes are always added at the product variant level, even if the product only comes in a single variant.&#x20;

**JSON data**
Some SparkLayer settings require attributes to be set up as JSON strings. These will need to be carefully added, making sure the formatting is set correctly.
:::



***

## Advanced settings

To learn about more advanced settings, including customer-level product attributes settings, please see [Product Settings](docId\:Cm9B1I6Cz0vOlc67g-fJI)

[title] Wix Error Codes
[path] Integrations/Wix/

## Introduction

If SparkLayer detects an error on your Wix store, you may notice one of the following error codes display within the [My Cart Interface](#). We've detailed the most common errors along with the associated way to resolve them.

## Error codes

:::hint{type="danger"}
- **wix-checkout-out-of-stock**: This occurs when a product in your cart is out of stock in Wix but SparkLayer believes that it is in stock. When a product is not syncing properly from Wix to SparkLayer (for example because a different product already has the same SKU) stock information cannot be synced either. To resolve this go to your [Data Sync](docId:8XClbafeyxHtt5begKM58) page and make sure that all your products are syncing properly.
:::




[title] Uninstalling SparkLayer on WooCommerce
[path] Integrations/WooCommerce/

## Uninstalling SparkLayer

SparkLayer works just like any other plugin in WooCommerce and you can uninstall it very easily.

Please follow the below steps:

::::WorkflowBlock
:::WorkflowBlockItem
From your WooCommerce admin, click **Plugins**, and then click **Installed Plugins.**
:::

:::WorkflowBlockItem
Under plugin "SparkLayer B2B", click **Deactivate**
:::
::::

Once you've removed the sales channel, this will then **cancel** the SparkLayer recurring billing charges with immediate effect.

:::hint{type="info"}
**More information**
You can learn more about removing apps in this [WooCommerce guide](https://wordpress.com/support/plugins/deactivate-or-delete-a-plugin/).
:::

:::hint{type="warning"}
**Please note**

- If you've also added the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) to your WooCommerce store, these will need to be removed manually.
- When you follow the uninstall process, this will disable customers, product and order updates to SparkLayer but will **not** delete the data until you [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) to remove your account.
- Please note, depending on when your billing cycle to SparkLayer began, you may see charges you're not expecting. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) if you would like us to investigate.
:::



***

## Transferring to another WooCommerce store

When you first sign up to SparkLayer, you'll be asked to associate your account with your WooCommerce store. Once that's done, SparkLayer will be locked to that URL and will begin synchronising products, customers, and enable you to install the Frontend code snippets to test it out.

You may be wanting to trial SparkLayer on a **test or development WooCommerce store** just to see how it works before you fully commit to using it. The good news is, it's possible to transfer accounts by following the below steps!

- First, sign into your WooCommerce store and uninstall SparkLayer via the steps above. This will disconnect SparkLayer from the WooCommerce store
- Next, [sign into SparkLayer](https://app.sparklayer.io/Login) with the original account you created and go to Configuration and click [Integrations](https://app.sparklayer.io/configuration/integrations/platform)
- Select **WooCommerce** and re-enter the new WooCommerce URL you wish to connect
- You'll then be taken to the WooCommerce admin and asked to reinstall SparkLayer and select a plan.
- Once that's completed, you'll then be returned to the SparkLayer Dashboard. SparkLayer will then begin synchronising your products and customers and you can then re-install the [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) on the new store

:::hint{type="info" attributes="[object Object]"}
**Need assistance?**
If you require any assistance in transferring your WooCommerce store, please feel free to [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.
:::


[title] Shopify Markets & Currencies
[path] Integrations/Shopify/

## Introduction

SparkLayer lets you offer B2B pricing in multiple currencies - so each customer sees prices in the currency you assign to them, all from within a single Shopify store. This is ideal for merchants selling to wholesale buyers across different regions.

:::hint{type="info"}
**Please note:** To enable multiple currencies for your B2B customers, you must have [Shopify Markets](https://help.shopify.com/en/manual/markets) set up. Each currency you want to offer requires a corresponding market within Shopify. Multi-currency also requires [Shopify Payments](https://help.shopify.com/en/manual/payments/shopify-payments) to be active in a supported region.
:::

By default, SparkLayer shows B2B pricing in your store's default currency. For example, if your store currency is GBP, all B2B pricing will display in GBP when customers log in. With Shopify Markets enabled, you can configure additional currencies (e.g. USD, EUR) so that each customer group sees pricing in their assigned currency automatically.

:::hint{type="success"}
**Want to try it out?** Head over to [our demo store](https://demo.sparklayer.io/pages/b2b-login-register) and see multi-currency B2B pricing in action!
:::



***

## How it works

When a B2B customer logs in, SparkLayer checks which price list is assigned to their customer group. If that price list is set to a different currency (e.g. EUR instead of your default GBP), the customer automatically sees all B2B pricing, cart totals, and checkout amounts in that currency - no manual switching required.

This means you can serve customers in multiple regions from one store, each seeing accurate B2B pricing in the currency you control.



***

## Setting up Shopify Markets

Before creating multi-currency price lists in SparkLayer, you need to have the correct markets configured in Shopify. Each currency you plan to use must have a corresponding market.

1. In your Shopify admin, go to **Settings → Markets** (or **Markets** in the main navigation if you are using the new Markets experience).
2. Create a market for each region or country where you want to offer a specific currency. For example, create a "Europe" market with EUR as the currency.
3. Make sure the market is set to **Active** so that the currency is available for use.
4. Ensure [Shopify Payments](https://help.shopify.com/en/manual/payments/shopify-payments/supported-countries) is enabled - multi-currency is only supported in regions where Shopify Payments is available.

:::hint{type="info"}
**Please note:** You do not need to configure catalogs or product availability within Shopify Markets for SparkLayer to work. SparkLayer manages B2B product visibility and pricing independently. The market simply needs to exist so that Shopify recognises the currency.
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/uUwbib33oidrYTTX7_em4_image.png)



***

## Creating your price lists

Creating a price list in an additional currency follows the same process as creating any SparkLayer price list.

1. Go to the [Price Lists](https://app.sparklayer.io/price-lists) section of the SparkLayer dashboard.
2. Create a new price list (or edit an existing one).
3. Under **Price List Currency**, select the currency you want this price list to use (e.g. EUR, USD, AUD).
4. Add your product pricing as normal - all values should be entered in the selected currency.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Vw13eB3T5ooMhggXGRsuA_image.png)



***

## Assigning price lists to customers

Once your multi-currency price list is ready, assign it to the relevant customer group.

1. Go to [Customers](https://app.sparklayer.io/customers) in the SparkLayer dashboard.
2. Select the customer group you want to assign the price list to.
3. Under the pricing section, choose the price list with the correct currency.
4. Configure any additional ordering rules (e.g. minimum order value) - these will apply in the price list's currency.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/u7Md6CQz_VzlPbeZjRItY_image.png)

When those customers log in, they will automatically see B2B pricing in the assigned currency across product pages, the cart, and checkout.



***

## The customer experience

### Product pages

When a customer with a non-default currency logs in, product pages display B2B pricing in their assigned currency. For example, a customer assigned a EUR price list will see all prices in euros, while a customer on the default GBP price list sees pounds.

### Cart and checkout

The cart and review step display all line items, subtotals, and order totals in the customer's assigned currency. The payment methods available are those you have configured against their [customer group](https://docs.sparklayer.io/customers).

### Shipping

If you have multiple shipping methods set up for a customer group (e.g. standard and express), the shipping costs are converted from your store's default currency to the customer's assigned currency.



***

## How orders appear in Shopify

When a B2B customer places an order in a non-default currency, the order enters your Shopify admin with the correct currency assigned. How it arrives depends on the payment method:

| Payment method       | How the order arrives in Shopify                                   |
| -------------------- | ------------------------------------------------------------------ |
| `Payment by invoice` | Submitted as a draft order                                         |
| `Payment on account` | Submitted as a draft order                                         |
| `Upfront payment`    | Customer completes Shopify checkout - arrives as a completed order |

For draft orders, you can [ these into completed orders](https://app.sparklayer.io/integrations/platform) if required.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/6BlEWmzah0DUza6ZJEBv-_image.png)

:::hint{type="info"}
**Please note:** Due to how Shopify handles currency conversion and applies discounts internally, you may notice minor rounding differences between the B2B price you set and the price that appears on the order in Shopify. For example, a price set at €7.99 may display as €8.00 in the Shopify admin. This is a known Shopify limitation and not something controlled by SparkLayer.
:::



***

## Using Shopify Companies with Shopify Markets

If you are using Shopify's native B2B Companies feature alongside SparkLayer, multi-currency works in a similar way. For full details on how SparkLayer integrates with Shopify Companies, see our [Shopify Companies](https://docs.sparklayer.io/shopify-companies) guide.



***

## Limitations

- **"Show prices in local currency" setting** - In a multi-country market, Shopify offers a setting to show prices in each customer's local currency. SparkLayer does not support this setting. You will need to disable it for B2B customers in the relevant market to ensure orders are placed correctly.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/_6ViLPSUrCWV-2cUdoOGI_image.png)

- **Price rounding** - Minor discrepancies may occur between the B2B price you set in SparkLayer and the price that arrives in Shopify, due to Shopify's internal currency conversion and rounding logic.
- **One market per currency** - Each currency you offer to B2B customers requires a separate market set up in Shopify Markets.
- **Shopify Payments required** - Multi-currency is only supported in regions[ where Shopify Payments is available](https://help.shopify.com/en/manual/payments/shopify-payments/supported-countries).
- **Managed Markets and zero-value orders** - If you use Shopify Managed Markets, you cannot create a zero-value (e.g. £0.00 / €0.00) B2B order in any currency other than your store's default currency. Customers will see an error at checkout if they attempt this. [Learn more](https://help.shopify.com/en/manual/international/managed-markets/requirements-and-considerations#considerations).
- **Duties and import tax** - If you have duties enabled in your Shopify Markets settings, SparkLayer will not charge these in the SparkLayer cart. Duties are not currently supported.
- **Market catalogs** - If you assign a specific product collection to a market in Shopify, SparkLayer will not detect or enforce this. SparkLayer manages B2B product visibility independently through its own rules and customer group settings.



***

## FAQ

:::ExpandableHeading
**Do I need Shopify Plus to use multi-currency with SparkLayer?**&#x20;

No. Multi-currency works on any Shopify plan that supports Shopify Markets and Shopify Payments. However, some advanced Markets features (such as the new Markets experience with submarkets and catalogs) are currently available only on Shopify Plus.
:::

:::ExpandableHeading
**Can I set different B2B prices per currency, or does SparkLayer just convert from my default currency?**

SparkLayer does not convert prices automatically. You create a separate price list for each currency and enter the exact prices you want customers to see. This gives you full control over your B2B pricing in every currency.
:::

:::ExpandableHeading
**What happens if I haven't set up a Shopify Market for the currency I've used in a SparkLayer price list?**&#x20;

The currency will not be recognised by Shopify at checkout, which may cause errors when orders are placed. Always ensure a corresponding Shopify Market exists and is active for each currency you use in SparkLayer.
:::

:::ExpandableHeading
**Will my B2C customers be affected by the Shopify Markets I set up for B2B?**&#x20;

Shopify Markets apply to your entire store, so B2C customers in the relevant regions will also see the market's currency. SparkLayer's B2B pricing is separate and only visible to logged-in B2B customers - but the underlying Shopify Market currency applies to all visitors from that region.
:::

:::ExpandableHeading
**Can I offer the same customer group pricing in multiple currencies?**

Not within a single price list. Each price list has one currency. If you need the same customer group to see pricing in different currencies depending on their region, create separate price lists (one per currency) and assign the correct one to each customer or customer group.
:::

:::ExpandableHeading
**Why do I see small rounding differences on orders in Shopify?**&#x20;

This is caused by Shopify's internal currency conversion logic. When SparkLayer submits a B2B order, Shopify applies its own conversion and discount calculations, which can result in minor rounding differences (e.g. €7.99 becoming €8.00). This is a Shopify-side limitation.
:::

:::ExpandableHeading
**Does SparkLayer support Shopify's automatic exchange rates?**

No. SparkLayer uses fixed prices that you define in each price list. Shopify's automatic exchange rate conversion does not apply to SparkLayer B2B pricing. You control the exact price your customers see.
:::


[title] Wix Metafields & Data Mapping
[path] Integrations/Wix/

## Introduction

:::hint{type="danger"}
**Please note**
At this time, it is not possible to use metafields with Wix therefore all  [configurations detailed here](docId\:OTLHhi8sQ6oS4PAt23-8H) are not currently available. In the near future, Wix will be adding support for metafields and we will update this guide accordingly.
:::

[Metafields](docId\:OTLHhi8sQ6oS4PAt23-8H) help you to customise the functionality and appearance of your  store by letting you save specialised information that isn't usually captured in the Wix Dashboard admin. You can use metafields for internal tracking, or to display specialised information on your online store in a variety of ways.&#x20;

[title] Uninstalling SparkLayer on Magento
[path] Integrations/Magento/

## Uninstalling SparkLayer

SparkLayer works just like any other integration in Magento and you can uninstall it very easily.

Please follow the below steps:

::::WorkflowBlock
:::WorkflowBlockItem
From your Magento admin, click **System**, and then click **Integrations.**
:::

:::WorkflowBlockItem
Under plugin "SparkLayer B2B", click **Delete**
:::
::::

Once you've removed the sales channel, this will then **cancel** the SparkLayer recurring billing charges with immediate effect.

:::hint{type="warning"}
**Please note**

- If you've also added the SparkLayer [Frontend Interfaces](docId\:ccZ1vnH0O6D_722w35Xpa) to your Magento store, these will need to be removed manually.
- When you follow the uninstall process, this will disable customers, product and order updates to SparkLayer but will **not** delete the data until you [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) to remove your account.
- Please note, depending on when your billing cycle to SparkLayer began, you may see charges you're not expecting. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) if you would like us to investigate.
:::


[title] Unleashed
[path] Integrations/ERPs & Operations/

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-Ml-3RLSawygsWjXa77d%2F-Ml-4nc1UOgiAh_CBGcE%2FUnleashed.png?alt=media\&token=5f3933f0-8b7b-4919-a84b-0d572aa9a5e3)

:::hint{type="info"}
**Requirements**

- **Plan**: Merchants must be signed up to the Pro or Enterprise plan
- **Ecommerce Platform**: Merchants must be using Shopify
- **Unleashed**: Merhcants must have an approved Unleashed account
:::

## Introduction

Unleashed is a leading inventory management system that’s designed for manufacturers, wholesalers and distributors. From inventory and stock, order management, right through to fulfilment, Unleashed lets you automate your eCommerce operations. You can learn more about Unleashed [here](https://www.unleashedsoftware.com/).&#x20;



***

## How it works

The Unleashed integration for SparkLayer is available for all [Shopify merchants](https://docs.sparklayer.io/integrations/shopify-introduction#introduction) that already use Unleashed and allows you to bring **B2B pricing and B2B ordering** into SparkLayer and your Shopify store.&#x20;

The integration works in the following ways:

| **Item**    | **Details**                                                                                                                                                                                                                                                                                                          |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Customers` | Unleashed becomes the 'master' of your B2B customer data, and any changes to customer records that have the assigned Customer Type will automatically be synchronised to Shopify and SparkLayer.                                                                                                                     |
| `Orders`    | Orders placed via SparkLayer are synchronised from Shopify into Unleashed using your **existing** [Unleashed integration](https://support.unleashedsoftware.com/hc/en-us/articles/4402425783577-Shopify-Integration-Introduction). Prices that show on orders will be the special B2B pricing as set up in Unleashed |
| `Pricing`   | Price lists and product prices are imported into SparkLayer via pricing rules you set up in Unleashed                                                                                                                                                                                                                |
| `Sync`      | The automatic sync is carried out every 4 hours                                                                                                                                                                                                                                                                      |

:::hint{type="info"}
**Please note**
We recommend also familiarising yourself with the "Known limitations" below
:::



***

## Configuring  the integration

:::hint{type="info"}
**Before you begin**
You'll need to have an approved account with Unleashed - Please visit the [Unleashed website](https://www.unleashedsoftware.com/) to learn more.&#x20;
:::

To get started, the integration needs to be enable within the [SparkLayer Dashboard.](https://app.sparklayer.io/configuration/integrations/partners)Go to the **Integrations** section and click **Partner Integrations.** Under **Multi-channel management**, click the toggle on the right to activate the Unleashed integration.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MS7Kf4HorBiwDJv0WJl%2F-MkzzBNflkbeBYIFT-mM%2F-MkzzaklImnIuHqMM_Sx%2Fimage.png?alt=media\&token=0167e1cc-f110-45ca-a76e-1b52fb2761a2)

You'll then be prompted to enter the following details:

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/uxFwcy35yZajV_fJORFaO_image.png)

| **Item**         | **Details**                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `API ID`         | You can find this within your Unleashed admin under **Integration, Unleashed API Access**                                                                                                                                                                                                                                                                                                                                                                      |
| `API Key`        | You can find this within your Unleashed admin under **Integration, Unleashed API Access**                                                                                                                                                                                                                                                                                                                                                                      |
| `Customer Types` | The customer type should match a customer type that exists in Unleashed. This is the group of customers within Unleashed that SparkLayer will **synchronise to Shopify**. <br />**Please note:** this must match exactly what is in Unleashed and be seperated by a **comma** with **no** space (e.g. `GROUP1,GROUP2)`. For the purposes of testing, we recommend creating a new group and testing with a dummy customer first before using an existing group. |
| `Price Lists`    | This is the Unleashed price list you want to set as highest priority for all customer groups. For example if you assign a price list here this would take priority over all other price lists assigned to the customer account. <br />**Please note:&#x20;**&#x69;f you are adding multiple price lists, these must be seperated by a **comma** with **no** spaces.                                                                                            |



***

## Configuring Customers

Broadly speaking, Unleashed is your **central location&#x20;**&#x66;or managing B2B customer data. When customers are configured in Unleashed as B2B customers, SparkLayer can **automatically** retrieve this data and then enable the B2B ordering experience on your Shopify site.

::::ExpandableHeading
**Step 1 - setting up Customer Types**

When you have set up the [integration with SparkLayer](https://app.sparklayer.io/configuration/integrations/partners) within your Unleashed Dashbaord, go to **Settings** and then **System**. Within the options you will see **Customer Type**. Within this field, you'll then need to create the different customer groups that you are going to be offering different prices to.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jmX4hQELYkcjHYLZFScZs_image.png)

Next, navigate to your **SparkLayer Dashboard** and [Customer Groups](https://app.sparklayer.io/customers/groups). Here you'll need to create the customer groups with the names **matching** the title of the **Customer Types** you have created in Unleashed.&#x20;

In our example below, we have `Base` and `Gold`.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/k0669-8Ke34NdocTS9WAx_image.png)

Next, go to the [Partner Integrations](https://app.sparklayer.io/configuration/integrations/partners) section of SparkLayer and click **Modify** within the Unleashed integration. Finally, add the **Customer Types** you have created in Unleashed that you want to sync across to SparkLayer. In our example, we've added them for `Base` and `Gold`.

:::hint{type="warning"}
**Please note**
Customer Types**must** be seperated by a comma with **no** spacing to sync correctly e.g. `Base,Gold`
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/KuP9zS8zKCRBaC1pI_1Mp_image.png)
::::

::::ExpandableHeading
**Step 2 - syncing your customers**

To sync your customers, you'll need to create your customers in your Unleashed Dashboard if you haven't already. When doing this you are able to allocate them a **Customer Type.&#x20;**&#x54;his will assign them into the specific [customer group](https://app.sparklayer.io/customers/groups) within SparkLayer when they are synced across.&#x20;

**Please note:&#x20;**&#x54;he customer will be tagged with this customer group as the normal SparkLayer process.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/vDP4X4QORPwrXoh9R2tbB_image.png)

When setting up your customers in Unleashed, please ensure you set up:

- &#x20;A full address
- Assign any specific tax settings
- Assign a valid email address. This must be set up in order to sync to SparkLayer and Shopify.

**Syncing across to SparkLayer and Shopify**

First, you'll need to update the customer type to match that entered in the **Customer Type** field (as noted above). SparkLayer is then configured to synchronise **once per night**, and any new and updated records will automatically be synchronised with Shopify.&#x20;

Customers are mapped between the systems based on the **primary contact email** set within Unleashed. Once this is mapped, SparkLayer will then synchronise the following data into Shopify and you'll be able to see within the customer record within Shopify.

| **Unleashed**       | **Shopify / Spark Layer**                                          |
| ------------------- | ------------------------------------------------------------------ |
| `Address`           | Shows against customer record in Shopify                           |
| `Phone`             | Shows against customer record in Shopify                           |
| `First / Last Name` | Shows against customer record in Shopify                           |
| `Company Name`      | Shown via metafields in Shopify                                    |
| `Stop Credit`       | Shown via metafields in Shopify (used to allow payment on account) |
| `Taxable`           | Shows against customer record in Shopify                           |

:::hint{type="warning"}
**Please note**
All customer data is managed via Unleashed and any amends made directly in Shopify will **not** synchronise back to Unleashed.
:::
::::

:::ExpandableHeading
**Step 3 - giving access & notifying new customers**

Since Unleashed is the central source for customer data, any new customers created in Unleashed will **automatically** be added to Shopify.&#x20;

When new customer records are added to Shopify, they will by default be added as **Pending** customer accounts and receive an **automatic email** to enable their account by setting a password.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/GV5ZpXyW0LI0xshPzNf6Z_image.png)

This uses the **Customer account invite** notification email which can be edited in the [Notifications section within Shopify](https://admin.shopify.com/settings/notifications/customer).

If you prefer **not** to send the customer account invite automatically, you can easily check if this option has been activated. Simply go to your SparkLayer Dashboard, navigate to [Partner Integrations](https://app.sparklayer.io/sparklayerunleashedtest/live/configuration/integrations/partners). When modifying your Unleashed integration, you can enable or disable this via the setting at the bottom.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/oj14tO0WJyk8PG572hGcC_image.png)
:::



***

## Configuring Pricing

In Unleashed, you can utilise **up to 10 price lists**, allowing you to create multiple pricing tiers tailored to your various customer levels. On top of this limit, you have the flexibility to set customer-specific and product-specific discounts, providing even more granular control over your pricing strategy.

::::ExpandableHeading
**Step 1 - price list setup**

In Unleashed, navigate to **Settings&#x20;**> **System&#x20;**> **Sell Price Tiers**. Here, you can customise the names of your price tiers, which are initially labelled as "Sell Price Tier 1" through to "Sell Price Tier 10".&#x20;

:::hint{type="warning"}
**Please note**
SparkLayer **does not** support the custom names meaning they will show in SparkLayer as "Sell Price Tier X"
:::

**Promotion price list**

If you want to offer a promotion to customers you are able to do this by creating a promotional price list. You are able to do this by adjusting the product prices within a specific price list mentioned above.&#x20;

You are then able to sync this to all of your customers and make it a "priority price list". You'll need to add this to the [Partner Integration](https://app.sparklayer.io/configuration/integrations/partners) within the SparkLayer Dashboard by clicking **Modify** on the Unleashed option. Within the Price Lists section, enter the price lists you want add.

As with Customer Types, if you're adding multple price lists, they must be separated with a **comma** with **no spacing**. E.g. `PriceList1,PriceList1`

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/jgAIpZWfWkCwWgPmwhtCL_image.png)
::::

::::ExpandableHeading
**Step 2 - viewing price lists**

When you view a product within your Unleashed Dashboard, under the **Sale** tab you’ll see the available price tiers listed. For products offered to your wholesale customers, you can specify the exact price for each tier, depending on which pricing list is assigned to the customer.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/OUm77RBLhjUJufZyc6mTu_image.png)

If you are offering multiple currencies then you are able to use the Sell Price Tiers wihtin Unelashed to achieve this.&#x20;

For instance, if you offer pricing in USD, GBP and EUR then you can assign each currency to a Sell Price Tier in Unleashed (e.g "Sell Price Tier 1" is your GBP price. "Sell Price Tier 2" is EUR). You are able to set this up SparkLayer by going to Settings > Integrations > Partner Integrations, when modifying the Unleashed Integration and you will see the below&#x20;

:::hint{type="warning"}
**Please note**
If you only sell in the base currency of the store then you will not need to specify the currency as above.&#x20;
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/MKwf-g6PJKTSR21cLAh-__image.png)
::::

::::ExpandableHeading
**Step 3 - assigning a price list**

Within your Unleashed Dashboard, navigate back to the customer account that you are working on. You are then able to assign them a price list directly to the customer account within **Sell Price Tier**. This means when they login they will see the product pricing you've assigned to them.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/pzYyBH-qQR4KooRzUJsTZ_image.png)

:::hint{type="warning"}
**Please note**
These price lists will be asigned directly to the customer account through the SparkLayer price list metafield which is set up differently to standard price lists. You can learn more in [Metafields](docId\:OTLHhi8sQ6oS4PAt23-8H)&#x20;
:::
::::

::::ExpandableHeading
**Setting up product specific discounts**

Within the Unleashed Dashboard, navigate to a customer record and click Customer Pricing. Here you are able to set product specific pricing for this customer account.&#x20;

You are able to search for a product, specify a fixed price or discount on the product. When doing this, it will create a new price list within the [SparkLayer Price Lists](https://app.sparklayer.io/pricing/lists) section.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/yahtbhclht75OC2D5s6bu_image.png)

:::hint{type="warning"}
**Please note**
If you choose to offer a discount this will be from the **Default Sell Price** under **Discount From**. You can see more below under our Known Limitations.&#x20;
:::
::::

:::ExpandableHeading
**Setting up additional customer discounts**

Within the Unleashed Dashboard, navigate to a customer account and under the **Details** tab, you can provide customers with an additional discount on top of their assigned price list. You’ll see a **Discount (%)** box, where you can enter the desired discount percentage.

When doing this, it will create a new price list within the [SparkLayer Price Lists](https://app.sparklayer.io/pricing/lists) section.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/v3rOkzG-CCetRDy1e_PUF_image.png)
:::

:::ExpandableHeading
**Assiging prices to the Shopify Customer account**

Once you have finished configuring your customers pricing and a sync has taken place, you can then check the customer account in Shopify to ensure they have been assigned the correct pricing.&#x20;

The price list will be assigned directly to the customer account in a **Price List metafield** (this gets added automatically when you first set up the SparkLayer integration). It will also create the price list within your SparkLayer Dashboard > Price lists as an "Integration" Price List.

With this metafield it will **always** work in a hierarchy order, which means when a customer searches a SKU it will check the first price list and will cascade through the price lists untill it finds a price.&#x20;

In the example below you are able to see a number of price lists.&#x20;

1. An&#x79;**&#x20;customer product specific discounts** you have created within the customer in Unleashed.&#x20;
2. An&#x79;**&#x20;customer specific percentage discounts&#x20;**&#x74;hat you have given on top of the price list assigned to the customer.&#x20;
3. The **normal price list&#x20;**&#x74;hat you have assigned to the customer&#x20;
4. You will alway see a fallback of the **Default Sell Price**.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/UrFlmAQVqUs-K2phf5a6l_image.png)
:::

***

## Data mapping

We've detailed how data is mapped between SparkLayer and Unleashed.

| Item                                 | Details                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Creating Price Lists`               | SparkLayer generates several types of price lists based on the product prices available in Unleashed.                                                                                                                                                                                                                                             |
| `Default Price List`                 | All product prices set in Unleashed under the **Product/Sale** tab go into a standard Default Price List. This acts as the baseline price for all products.                                                                                                                                                                                       |
| `Sell Price Tiers`                   | If Unleashed has specific Sell Price Tiers set up (e.g., "Sell Price Tier 1", "Sell Price Tier 2", etc.), SparkLayer creates separate price lists for these tiers. Unleashed supports up to 10 Sell Price Tiers that you can assign to different groups of customers.                                                                             |
| `Customer-Specific Prices`           | If any customer has unique prices specified under the Customer/Product Pricing tab in Unleashed, SparkLayer creates a Customer-Specific Price List for that customer. This ensures that individual customer agreements or special pricing arrangements are captured.                                                                              |
| `Handling Different Currencies`      | If a customer uses a currency other than the base currency, SparkLayer will automatically create Alternative Currency Price Lists based on the existing price lists.                                                                                                                                                                              |
| `Applying Discounts`                 | If a customer has a specific discount percentage assigned (e.g., 10% off all products), SparkLayer will generate a Discounted Price List to reflect the adjusted prices.                                                                                                                                                                          |
| `Assigning Price Lists to Customers` | When assigning prices to customers, SparkLayer follows this order of priority:<br />* First, the Customer-Specific Price List (if available).
* Then, a Sell Price Tier (if assigned in Unleashed).
* Finally, the Default Price List.<br />If a customer has multiple currencies or discounts, they will get additional price lists accordingly. |
| `Why Prefixed Price Lists?`          | SparkLayer may apply generic "prefixed" price lists to every customer. This is to ensure that a basic Sell Price Tier is always in place, even if the customer’s Unleashed configuration doesn’t explicitly assign one.                                                                                                                           |



***

## Known limitations

**Setting a Discount % as a Price Type**

In Unleashed, you can assign the customer’s ‘Sell Price Tier’ from the ‘Details’ tab of the customer record.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/t18eM0PE13KCyWrszFRXJ_pika-1698944025409-1x.png)

Additionally, you can set up specific discounts from the ‘Customer Pricing’ tab. However, there is a specific configuration of this that we do not support due to a limitation with the Unleashed API.

If you choose ‘Discount %’ as the Price Type, it will only affect their ‘Sell Price Tier’ (as referred to above), and not the ‘Default Sell Price’ or the ‘Customer Price Tier’.&#x20;

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qz2PRZ0pern_uecXg_0-q_pika-1698943980252-1x.png)

The following limitations also apply:

- Internally SparkLayer will use the internal SellPriceTier naming for simplicity between mapping, not the custom naming that can be setup via the Unleashed Settings
- Customers set as obsolete will not be synced. When converting an account to obsolete in Unleashed, the customer will be needed to be disabled manually in Shopify.
- Changing the customers email address, will create an additional customer in Shopify. The old account will need to be disabled manually.
- Primary Customer Contacts will only be synced. If a new primary contact is selected, the existing Shopify customer on the store should be manually disabled.
- Order Import Options in Unleashed Order Configuration must not use import orders to a single customer. To get around this, using a second store for B2B can be the solution.
- Customer Synchronization must be disabled in the Unleashed Shopify integration.





***

## Troubleshooting

:::ExpandableHeading
**Why are some of my customers not syncing correctly from Unleashed to Shopify?**

Ensure that the Customer Type field in Unleashed matches exactly what you have set up in SparkLayer. Remember, the Customer Type names should be separated by a comma with no spaces (e.g., Base,Gold). Also, check that the email address is correctly set in Unleashed, as this is used to map the customer records.
:::

:::ExpandableHeading
**Why am I not seeing the B2B pricing updates in my Shopify store?**

This could be due to the pricing rules in Unleashed not being set up correctly. Make sure that the Price Lists in Unleashed are correctly assigned to the customers. Check that these lists match the Price Lists configured in SparkLayer and that they are separated by commas without spaces.
:::

:::ExpandableHeading
**Why do changes I make in Shopify not reflect in Unleashed?**

Shopify is not the master data source for customers in this integration. Unleashed is the single source of truth, meaning any updates made directly in Shopify will not synchronise back to Unleashed. Make changes in Unleashed, and the integration will push these updates to Shopify.
:::

:::ExpandableHeading
**What should I do if orders placed in Shopify are not appearing in Unleashed?**

Verify that the integration settings are configured correctly in the Unleashed Dashboard. Check that the correct API Key and Customer Type fields are being used. If these are set correctly, review the order logs in SparkLayer for any errors during the sync process.
:::

:::ExpandableHeading
**Why are my custom price lists not displaying properly in SparkLayer?**

SparkLayer currently supports Unleashed’s default Sell Price Tiers (e.g., "Sell Price Tier 1"). If you’ve created custom-named tiers, they will not appear in SparkLayer. You need to use the default naming convention for Sell Price Tiers to ensure they display correctly.
:::

:::ExpandableHeading
**Why am I getting duplicate customers in Shopify after updating emails in Unleashed?**

When you change a customer’s email address in Unleashed, it is treated as a new customer by Shopify. To avoid duplication, manually disable the old account in Shopify after making the change in Unleashed.
:::

:::ExpandableHeading
**Why are my customer-specific discounts not being applied correctly?**

Check that the Discount % has been set correctly in Unleashed. Keep in mind that using the "Discount %" option affects only the Sell Price Tier and not the Default Sell Price. For accurate discounts, make sure to apply them to the relevant Price Tiers or use Customer Pricing options within Unleashed.
:::


[title] BigCommerce FAQs
[path] Integrations/BigCommerce/

## Introduction

We've included some of our most commonly asked questions below. If you can't find the answer you're after, please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) and we'll be happy to help.



***

## Frequently Asked Questions

### Plans and pricing

:::ExpandableHeading
**Which SparkLayer plans do you offer for BigCommerce?**

All SparkLayer plans are compatible with BigCommerce, from "Starter" right through to "Enterprise". [Learn more](https://www.sparklayer.io/pricing/) about our plans and pricing.
:::

:::ExpandableHeading
**How does billing work?**

When you sign up to SparkLayer, our team will contact you to discuss the most appropriate plan for your needs. Billing is managed via a monthly billing cycle with the option to pay annually.
:::

:::ExpandableHeading
**How do I select and change plan (upgrade or downgrade)**

You can sign up to SparkLayer on BigCommerce without initially selecting a plan. Once you've installed SparkLayer, our team will contact you to discuss the next steps. Once you've activated a plan, we are happy to work with you to upgrade or downgrade based on your changing requirements.
:::

### BigCommerce setup

:::ExpandableHeading
**Where do I find the SparkLayer BigCommerce app?**

You can find the official SparkLayer for BigCommerce app in the [BigCommerce App Store](https://www.bigcommerce.com/apps/sparklayer-b2b-wholesale/).
:::

:::ExpandableHeading
**What BigCommerce plan do I need to be on to use SparkLayer?**

SparkLayer works on all versions of BigCommerce, from BigCommerce Essentials right through to BigCommerce Enterprise. All you need is an active BigCommerce store and you're good to go.
:::

:::ExpandableHeading
**Can I use SparkLayer with my development website?**

Yes! If you're setting up SparkLayer on a development store (e.g. a test account), we can enable a special developer-mode that lets you use SparkLayer until you're ready to activate a billing plan. Please [contact us](docId\:NNUw1G9z7eaJ4M78vk7t9) for more details.
:::

:::ExpandableHeading
**Can I have DTC and B2B on the same BigCommerce website?**

Yes, it's possible to install SparkLayer onto your existing BigCommerce DTC store (i.e. retail), meaning you can run both DTC and B2B on the same store. We call this a 'hybrid setup'; when your B2B customers sign in, they simply see the special SparkLayer [Frontend](docId\:OgKfvQX13dHW2582D57kJ) interface that allow them to see their prices and place orders.

If you want to see this in action, you can try our [B2B/B2C demo store here](https://b2b-demo-store-usd.myshopify.com/)
:::

### Theme setup

:::ExpandableHeading
**Can you help me install SparkLayer on my BigCommerce website?**

Yes! Within the [SparkLayer Dashboard](https://app.sparklayer.io/help), you'll see an option to request our team to install SparkLayer for you. Typically we can do this within 1-2 working days and you're then good to go. We then offer an onboarding session to walk you through how everything works.
:::

:::ExpandableHeading
**Does SparkLayer work on any BigCommerce theme?**

Yes! SparkLayer is compatible with all BigCommerce themes, even fully customised. If you need help in the setup, our team can add all the code snippets for you.&#x20;
:::

:::ExpandableHeading
**How does SparkLayer affect my current BigCommerce theme?**

The SparkLayer B2B widgets, including B2B pricing, cart and my account area, are only loaded once a customer who has been added to a b2b customer group successfully signs in to your store.

For all other users, your store will remain completely unaffected.

This allows you to have full control over which customers are able to see your B2B pricing and place B2B orders.
:::

:::ExpandableHeading
**What if I'm already using a wholesale B2B app on my website?**

If you already have a B2B / Wholesale app installed on your store, SparkLayer can work alongside this. It's a great way to test out SparkLayer and, once you're happy, you can simply uninstall any previous B2B apps you were using. If your previous B2B app has made code changes to your BigCommerce store, you may want to ask the app developer to remove these although this is optional.
:::

### Payments

:::ExpandableHeading
**Can I use my existing payment methods on the checkout?**

In terms of payment methods supported by SparkLayer and BigCommerce. If your customers choose "Pay Online by Card" during the SparkLayer checkout process, they will simply be taken to the BigCommerce checkout. From there, any payment methods you have set up in BigCommerce (e.g. Paypal, Affirm Pay) will show up, allowing the customers to pay by this method. We've attached a screenshot to illustrate this.

In short, if BigCommerce support this payment method, your B2B customers could select it during the checkout providing they choose "Pay Online by Card".
:::

### Products

:::ExpandableHeading
**How do I hide products or set up B2B-only products?**

BigCommerce does have the ability to hide collections from Customer Groups which could be one way to achieve this.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/1emGIe3eTQz6j2aywc7mX_area.gif)

There are a few things we recommend to make the experience better:

- You could **create a B2B-only collection** and redirect customers to this once they login. If you wanted to show special B2B-only products, you would need to create these as separate products within BigCommerce (i.e. with unique SKUs, etc)
- With SparkLayer pricing, if you don't upload a price against a SKU, the B2B custome&#x72;**&#x20;won't be able to purchase it.** So this is a way to prevent them from adding items you don't want them to purchase
- It is possible to adapt the BigCommerce themes to hide/show products using custom coding
:::

:::ExpandableHeading
**Can I use my BigCommerce prices for my B2B pricing?**

Yes! SparkLayer allows you to automatically synchronise your BigCommerce prices (e.g. your main BigCommerce retail price), making it really easy to set up B2B pricing for your customers. For example, you could set your B2B prices to be 20% off your BigCommerce prices and we can even make provisions for your tax set up in BigCommerce (e.g. exclusive or inclusive of tax).
:::

:::ExpandableHeading
**How do I set up pre-order and backorder products?**

In terms of pre-ordering, SparkLayer has full support for different stock status messages and it's possible to set up products as pre-order/back-order easily - it does rely on some configuration within BigCommerce, but it's relatively easy to do!

We've [full information here](docId\:Gj_Ao_gQ6oA-jx0D27Hys) on how it works and you can even set up "due in" dates to give your customers visibility.
:::

:::ExpandableHeading
**Do I need to use product SKUs?**

In terms of product SKUs, SparkLayer relies on these being added to your products within BigCommerce so that we can display the correct B2B pricing when your customers log in. Without a unique SKU, there's no way for SparkLayer to do this.

If you don't already have SKUs in BigCommerce, it's relatively quick to do. You can either edit individual products and add them manually, or you can use BigCommerce's 'Import' or 'Edit products' feature to do this in bulk.
:::

::::ExpandableHeading
**How do I restrict B2B customers from DTC inventory (and vice versa)**

If you're installing SparkLayer on a single website and you are looking to run both DTC and B2B at the same time, it will be necessary to **use the same stock pool&#x20;**&#x62;ehind the scenes. From an inventory point of view, this essentially means that both DTC and B2B customers will be ordering from the same stock source which can pose challenges.&#x20;

SparkLayer has a way to "reserve" stock for your DTC customers, essentially blocking B2B customers from ordering too much inventory for a specific product. [Learn more](docId\:Gj_Ao_gQ6oA-jx0D27Hys)

:::hint{type="info"}
**Important**
It is not possible to block DTC customers from ordering from your inventory and there is no mechanism in BigCommerce to do this. If you are wanting to implement this, you will need to consider:

- Creating B2B-specific products on your store&#x20;
- Creating a separate store just for your B2B customers, effectively separating out your inventory completely.&#x20;
:::


::::

:::ExpandableHeading
**Can I sell products on both store fronts?**

Yes, it is possible to have product purchaseable on both store fronts if you are using both for wholesale.&#x20;

When you are in the product within your admin, please ensure that you have both store fronts selected as sales channles that you want to offer the products on.&#x20;
:::

### User Experience

:::ExpandableHeading
**How do I set up a B2B registration form?**

If you're looking to enable a wholesale/B2B registration form there are a few good options for this and

In summary, these are the options we recommend:

- You could use your current login/registration page and enhance the registration page with some custom coding&#x20;
- You could use a [recommended form builder app](https://support.bigcommerce.com/s/article/Creating-a-Contact-Form?language=en_US#form-builders) to achieve this

It's also worth noting that you can manually add customers via the **BigCommerce Customers** admin and from there you could moderate your wholesale applications.
:::

:::ExpandableHeading
**How do I invite a B2B customer to my website?**

Please refer to [our guide here](docId:5_lWMNohhjBJJppg9E6Vh).
:::

:::ExpandableHeading
**Will SparkLayer slow down my BigCommerce website?**

No. For performance, the SparkLayer Frontend only loads when a valid B2B customer successfully logs into a website; for your standard (DTC) customers, no code is loaded at all. When a B2B customer logs in, all loading of the interfaces is asynchronous which means a negligible impact on page load times and performance even though SparkLayer is a hosted third-party solution. The result is the end customer will have a rapid experience browsing products and placing orders.
:::

:::ExpandableHeading
**How do I setup B2B-specific content on my BigCommerce website?**

We recommend consulting with a BigCommerce expert developer before making changes to your website. For their reference, you may find the following Stencil code can be used as a mechanism to hide and show content based on a B2B customer being logged in.

```html
{{#contains (toLowerCase customer_group_name) "b2b"}}

  <!-- This content will only show for logged in B2B customers -->

{{/contains}}
```
:::

### Orders

:::ExpandableHeading
**Where do I find my B2B orders in BigCommerce?**

**Manual payments**
For manual (non-card) payment orders (e.g. Payment by Invoice), the order is saved as a "Draft order".

- You can view these in your BigCommerce admin within **Orders** and then click **Draft Orders**
- You can then convert these into approved orders by marking them as paid or marking them with payment terms

It's important to note that once an order has been approved, it will **only** then show in the customers My Account section and the [SparkLayer Dashboard](https://app.sparklayer.io/orders).

**Card payments**
You can view these in your BigCommerce admin within **Orders**&#x20;
:::

:::ExpandableHeading
**How do I see the 'shipped' order status when viewing an order on SparkLayer?**

SparkLayer will automatically show a B2B order as "Shipped" providing it meets the following conditions:

1. The order is marked as 'Shipped' within BigCommerce
2. The order has a shipment assigned to it within BigCommerce

Without the both being applied to an order, the B2B order will remain in a "Processing" state until actioned.
:::

:::ExpandableHeading
**How do I edit orders?**

It is possible to edit orders within BigCommerce when an order is placed via SparkLayer. If you have it configured to create orders as 'Draft orders' you can go into the order and make changes. If you subsequently then manually complete the order (i.e. Mark as paid), you can still edit the order up until the point of fulfilment.
:::

:::ExpandableHeading
**How do I send an invoice?**

In terms of invoicing, SparkLayer doesn't send invoices directly but there are some good ways to do this within BigCommerce using a recommended invoicing app or by sending invoices manually to your customers via your existing back-office financial system.
:::

:::ExpandableHeading
**How do I set a minimum order quantity?**

Within SparkLayer, we do have support for minimum (and maximum) quantities, but you're only able to set these at a product or product-variant level. It's not currently possible to set minimum order-level quantities but it's something we are considering as part of a future update!
:::

:::ExpandableHeading
**How do I send order notifications to customers and my team?**

You can manage notifications from BigCommerce by going to **Settings** and clicking **Order Notifications**
:::


[space] SparkLayer B2B Catalogs (/b2b-catalogs)

[title] Configuring Access Denied View
[path] Setup/

When a product has been hidden for a customer, if the customer attempts to access the the product's PDP page - they will be shown an "access denied" view. If you would like to customize the content of this page, you can do so by modify the liquid `snippets/sparklayer-b2b-catalogs-access-denied.liquid` file that is automatically added when you installed the B2B Catalogs app.

:::hint{type="warning"}
**Please note**

If you disable B2B Catalogs on a theme where you have modified this file, your modifications will be removed.
:::


[title] Enabling Catalogs
[path] Setup/

:::hint{type="success"}
Enabling B2B catalogs is as simple as selecting a theme you would like to display your catalogs, and clicking the `enable` button.
:::

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/0je3kLpFbcjc6glGbLL6g_image.png)

Once you've enabled B2B Catalogs on a theme, you will see a list of all other themes which you can / have already enabled B2B Catalogs on. There is no limit to the amount of themes you can have Catalogs enabled on.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/W7ITqf7n3sZTm-b_BTU4-_image.png)


[title] Limitations
[path] /

### Advanced Catalogs Variant Count&#x20;

Due to the way Shopify provides access to product variants within a theme - we can only guarantee the desired hide/show behaviour on products with `<= 250` variants.

### Hidden product Add to cart caveats&#x20;

If a customer already has a product in their cart before said product is configured such that it should be hidden - the product will remain in the customers cart and they will be able to check out.&#x20;

Similarly customers will still be able to add a product to their cart via add to cart permalinks even if the product is hidden from them.

### Third party app compatibility

The Shopify app eco-system is vast, as such we cannot guarantee compatibility with all other third party apps

### Invalid liquid syntax

We're unable to modify theme files that contain invalid liquid syntax.

If you encounter an error stating `invalid liquid syntax in file <file>` while attempting to enable/disable catalogs on a theme, please fix the&#x20;


[title] Introduction
[path] /

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/M5xa-1yz19lg3eiXhSi8e-20260415-044949.jpg)

[B2B Catalogs](https://apps.shopify.com/sparklayer-b2b-catalogs) is a free SparkLayer app that gives you control over which products are visible to different types of customers on your Shopify store. Whether you want to hide specific products from B2C customers, restrict certain items to B2B customers only, or show different product ranges to different customer groups - B2B Catalogs makes it easy to manage from your Shopify admin

The app works by making modifications to your theme files, and you can enable or disable it across your store themes via the app interface.

B2B Catalogs is a [standalone Shopify app](https://apps.shopify.com/sparklayer-b2b-catalogs) available for free.



***

## Getting started

To get started, install the [B2B Catalogs app for Shopify](https://apps.shopify.com/sparklayer-b2b-catalogs) and you'll then be guided through the setup process.

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="COLOR" headerColor="#2166AE"}
&#x20;[Setup](docId\:aKcu9vZHZ16uDGPc_kkWX)&#x20;
:::

:::LinkArrayItem{headerType="COLOR" headerColor="#14B8A6"}
[Support](docId\:d28pJzUn0Qp2b3XgxFQxP)&#x20;
:::

:::LinkArrayItem{headerType="COLOR" headerColor="#A855F7"}
[Removing B2B Catalogs](docId\:M87qgqzLKYfKtimRI13AW)&#x20;
:::
::::


[title] Removing B2B Catalogs
[path] /

:::hint{type="warning"}
If you have enabled B2B Catalogs on any of your themes and want to uninstall the App from your store, you **must** first **disable&#x20;**&#x42;2B Catalogs from any themes it is currently enabled on.
:::

To **disable** B2B Catalogs for a theme, open the App within the Shopify admin and click the "disable" button on any currently enabled themes.

Once all themes have been disabled, you can uninstall the B2B catalogs app.

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/W7ITqf7n3sZTm-b_BTU4-_image.png)

:::hint{type="warning"}
**Already uninstalled the app?**

You will need to re-install the app temporarily and follow the instructions above.
:::


[title] Support
[path] /

## Ways to contact us

We're here to help! If you need technical support, such as assistance in configuring the B2B Catalogs app on your store, you can either:&#x20;

- Email [support@sparklayer.io](mailto\:support@sparklayer.io) or&#x20;
- Click the message icon within the B2B Catalogs app or on the bottom right of this page.

![](https://2607219315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS7Kf4HorBiwDJv0WJl%2Fuploads%2FGdHfvRZedRevesrWVQ9j%2Fimage.png?alt=media\&token=bc7e2240-e09f-4cfd-ba81-f24207395bfa "You'll see this icon in your SparkLayer Dashboard")

So that we can best help, please ensure you provide key details including:

- What your query is about
- Any screenshots that may help us resolve your query as quickly as possible.&#x20;

We aim to respond to all queries **within 24 hours**, but please allow up to two working days for a response.&#x20;

:::hint{type="warning"}
**Messaging via our chat system**
Please note, we operate with a small team and as such, our support is not always available on an immediate 'live chat' basis so we can't always provide a real-time response to your queries. Our support team is normally very responsive and we do tend to reply to queries with a resolution very quickly.
:::


[title] Setup
[path] /





***

## Summary

| What you want to do                                  | How to do it                                                               |
| ---------------------------------------------------- | -------------------------------------------------------------------------- |
| Show a product only to B2B customers                 | Add the `b2b-only` tag to the product                                      |
| Show a product only to B2C customers                 | Add the `b2c-only` tag to the product                                      |
| Hide a product from a specific B2B customer group    | Add a `sparklayer.settings` metafield with the group set to display: false |
| Show a product only to a specific B2B customer group | Set base to `display: false` and the target group to `display: true`       |


[title] FAQs
[path] /

## Introduction

Below you'll find answers to the most common questions about SparkLayer B2B Catalogs. If you can't find what you're looking for, get in touch with our support team and we'll be happy to help.

### Where exactly are hidden products hidden?

When you hide a product using B2B Catalogs, it is hidden across your entire store - including product pages, collection pages, and store search results. If a customer tries to access a hidden product's URL directly, they will see a customisable "access denied" page.

### Is B2B Catalogs free?

Yes. B2B Catalogs is a free standalone Shopify app included with every SparkLayer plan - including the free plan. You can install it from the [Shopify App Store](https://apps.shopify.com/sparklayer-b2b-catalogs).

### Do I need a developer to set it up?

No. B2B Catalogs is designed so your merchandising team can manage everything end-to-end. Tag a product, toggle a group, save - and changes go live instantly. No manual theme edits, no custom coding, and no waiting on a release cycle. You can follow our setup guide to get started in minutes.

### Will hidden products still appear in my sitemap or affect SEO?

Products tagged as b2b-only will still appear in the sitemap that Shopify generates automatically. However, the product pages themselves will not be visible to search engines, so they won't show up in external search results. If you need to fully remove these products from your sitemap, you'll need to follow[ Shopify's guidance on hiding products from search engines](https://help.shopify.com/en/manual/promoting-marketing/seo/hide-a-page-from-search-engines#custom-metafield) . Keep in mind that doing so may also prevent those products from appearing in your store's own search results.

### Can I show different products to different B2B customer groups?

In combination with the [SparkLayer B2B & Wholesale Shopify App ](https://docs.sparklayer.io/) it's possible to gain more granular control via the `sparklayer.settings`variant metafield, showing or hiding products between customer groups. For example, you could hide a product from all B2B customers except your 'VIP' group, or hide a specific range from one group while keeping it visible to everyone else. See our setup guide for full details on how customer group rules work.

For more detailed instructions, see[Configuring Advanced Catalogs](docId\:y8pm3bILZW6g6wryevinZ)&#x20;

### Can I control visibility at the variant level?

In combination with the [SparkLayer B2B & Wholesale Shopify App,](https://docs.sparklayer.io/) B2B Catalogs supports variant-level visibility rules. You can show a 750ml bottle to your B2C shoppers while restricting the 12-pack case to wholesale customers. Same product, different visibility, no duplicate listings needed.

For more detailed instructions, see [Configuring Advanced Catalogs](docId\:y8pm3bILZW6g6wryevinZ)&#x20;

### What happens if I disable B2B Catalogs on a theme?

Disabling B2B Catalogs on a theme will remove the visibility rules from that theme. If you've customised the `snippets/sparklayer-b2b-catalogs-access-denied.liquid` file, your modifications will also be removed. We recommend keeping a backup of any customisations before disabling.

### How do I uninstall B2B Catalogs?

Before uninstalling the app, you must first disable it on all themes where it is currently enabled. Open the app in your Shopify admin and click "Disable" on each active theme. Once all themes are disabled, you can safely uninstall the app. If you've already uninstalled without disabling first, you'll need to reinstall the app temporarily, disable it on your themes, and then uninstall again.&#x20;

For full instructions, see [Removing B2B Catalogs](docId\:M87qgqzLKYfKtimRI13AW).


[title] Configuring Your Catalogs
[path] Setup/

B2B Catalogs uses a combination of customer tags, product tags, and variant metafields to control product visibility across your store.

### Configuring your Customers

To identify a customer as a B2B customer, add the `b2b` tag to their customer record in Shopify Admin.

| **Tag** | **Description**                        |
| ------- | -------------------------------------- |
| `b2b`   | Marks the customer as a B2B customer.  |

### Configuring your Products

You can control basic product visibility using the following product tags in Shopify Admin:

| **Tag**    | **Description**                                                                               |
| ---------- | --------------------------------------------------------------------------------------------- |
| `b2b-only` | Hides the product from standard B2C customers. Only customers with the `b2b` tag will see it. |
| `b2c-only` | Hides the product from B2B customers. Only standard B2C customers will see it.                |

### Configuring Advanced Catalogs

:::hint{type="warning"}
The Advanced Catalogs feature is only available to merchants with the [SparkLayer B2B & Wholesale Shopify App ](https://docs.sparklayer.io/)
:::

| **Metafield**         | **Description**                                                                                                                                                                                                                                                                |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `sparklayer.settings` | While using[ Sparklayer's variant level selling rules](https://docs.sparklayer.io/product-settings#available-product-settings), if *all&#x20;*&#x76;ariants have the `display` rule set to `false` for the active customer's customer group, the product will also be hidden.  |

For more information see [Configuring Advanced Catalogs](docId\:y8pm3bILZW6g6wryevinZ)&#x20;


[title] Configuring Advanced Catalogs
[path] Setup/

:::hint{type="warning"}
The Advanced Catalogs feature is only available to merchants with the [SparkLayer B2B & Wholesale Shopify App ](https://docs.sparklayer.io/)
:::

Advanced catalogs allow you to show or hide products at a variant level to your different B2B customer groups.

***

## Configuring Variant Visibility

[Setup Variant level metafields](docId\:OTLHhi8sQ6oS4PAt23-8H)

After following the guide linked above, use the created `sparklayer.settings` variant metafield to show or hide products for specific customer groups.&#x20;

This is useful if you want certain products to only be visible to particular segments of your B2B customers.

### How the rules work

The `sparklayer.settings` metafield accepts a list of rules, where each rule specifies a [customer group](docId\:y8pm3bILZW6g6wryevinZ) and whether the product should be displayed for that group:

:::BlockQuote
\[
&#x20; \{&#x20;
&#x20;   "customer\_group": "group-name",&#x20;
&#x20;   "display": true / false&#x20;
&#x20; }
]
:::

By default, all customer groups can see each variant. Setting display to `false` will hide it for that group.

See more about the [sparklayer.settings metafield](https://docs.sparklayer.io/product-settings#available-product-settings)

If all variants are hidden for a given customer, the product will also be hidden.

:::hint{type="warning"}
Products using customer group metafield rules must still be tagged `b2b-only` for  visibility behaviour to apply.
:::

### Understanding customer groups

In Shopify, customers are assigned to Sparklayer customer groups via tags using the format `b2b-[group]` where `[group]` is the group name.

The group name you use in the metafield corresponds to these SparkLayer customer groups.&#x20;

*For Example:*

| **Customer tag in Shopify** | **Group name in metafield** |
| --------------------------- | --------------------------- |
| `b2b-vip`                   | vip                         |
| `b2b-wholesale`             | wholesale                   |
| `b2b-trade`                 | trade                       |

The `b2b-` prefix is used on the Shopify customer tag, but when referencing the group in the metafield, you only use the group name (e.g. `vip`, not `b2b-vip`).

You can learn more about how customer groups work in our [Customer Groups](docId:5_lWMNohhjBJJppg9E6Vh) guide.

### Using the "base" group

The special customer group `base` controls the default visibility for all B2B customers. This is useful when you want to hide a product from everyone and then selectively show it to specific groups.

For example, setting the base group to `false` will hide the product for all B2B customer groups, even if the product is tagged `b2b-only`.

***

## Examples

**Hide a product from all B2B customers except a specific group**

In this example, the variant is hidden for all B2B customers except those in the `vip` customer group (i.e. customers with the `b2b-vip` tag):



```json
[
  {
    "customer_group": "base",
    "display": false
  },
  {
    "customer_group": "vip",
    "display": true
  }
]
```

**Hide a product from a specific customer group**

In this example, the variant remains visible to all B2B customers except those in the `vip` customer group:

```json
[
  {
    "customer_group": "vip",
    "display": false
  }
]
```

﻿

[space] SparkLayer Ignite API (/ignite)

[title] Platform Connection
[path] /

## Introduction

*Platform connection* is the term used for when a platform is connected to SparkLayer. There are **two endpoints** that are used to inform of a new connection or once it's removed. It is also important to understand and support the two different flows for a new platform connection, depending on how the platform is connected to SparkLayer.

## Platform Connection Flows

There are two different flows for a new platform connection, depending on how the platform is connected to SparkLayer:

### Initialized through the eCommerce platform

This is when the platform connection is initialised though the relevant app store (or similar) on the eCommerce platform. For example, this is when a merchant installs the SparkLayer app on BigCommerce or Shopify.

**Please note:** this flow is only applicable if the Ignite integration is being built for a platform that supports 3rd party apps.

**Dashboard API:** The SparkLayer Dashboard API is used to register the user with SparkLayer, create a platform connection between a 3rd party platform and a SparkLayer site, and to obtain the site onboarding progress data. The documentation for this API is not available publicly, but can be provided on request.

The flow is as follows:

1. The eCommerce platform SparkLayer app is installed on the store
2. Store credentials and other relevant data required by the integration should be stored in the integration for later use. This usually includes the store identifier and eCommerce platform API access token or credentials.
3. The user is shown a SparkLayer registration page within the now installed platform SparkLayer app. To regsiter the user with SparkLayer, the internal SparkLayer Dashboard API user registration endpoint should be called.
4. Once the registration is successful, SparkLayer will return the relevant site environment and ID values which should then be used to call the SparkLayer site platform connection endpoint telling SparkLayer that we want to link the eCommerce platform to the newly registered SparkLayer site.
5. SparkLayer will then call the Ignite integration New Platform Connection endpoint with the SparkLayer site id and credentials data, and the Ignite integration should store this and perform the complete platform connection actions such as full data sync.
6. At this stage, the platform connection is complete and the user on the eCommerce platform store app (if applicable) should be shown the SparkLayer onboarding steps as well as links to the SparkLayer Dashboard and end-user documentation (the onboarding progress data can be obtained though the SparkLayer Dashboard API's GET onboarding steps endpoint).

### Initialised though the SparkLayer dashboard

This is when the platform connection is initialised though the SparkLayer Dashboard `Configuration -> Integrations -> eCommerce Platform` page of an existing SparkLayer site. In this scenario the flow is as follows:

1. SparkLayer will call the Ignite integration's new platform connection endpoint with the SparkLayer site and credentials data.
2. The integration should store this data and return a redirect url to which the merchant user should be redirected to install the SparkLayer app on the eCommerce platform.
3. Once the app is installed, the eCommerce store credentials and other relevant data should be stored in the integration.
4. As at this point both the SparkLayer and the eCommerce platform data is known by the integration, the platform connection is complete, and actions such as a full data sync can be initialised.
5. The user can be shown the SparkLayer onboarding steps and progress (the onboarding progress data can be obtained though the SparkLayer Dashboard API's GET onboarding steps endpoint).

**Dashboard API:** The SparkLayer Dashboard API is used to register the user with SparkLayer, create a platform connection between a 3rd party platform and a SparkLayer site, and to obtain the site onboarding progress data. The documentation for this API is not available publicly, but can be provided on request.

## Platform Connection Endpoints

These endpoints are used by SparkLayer to inform the integration of a new platform connection or when it's removed.

### New Platform Connection

The integration should record the new platform connection and perform the inital actions if connection is complete.

If the endpoint is called by the SparkLayer Dashboard platform connect flow, this endpoint should return a `redirect_url` parameter which will be used by the SparkLayer dashboard to redirect the user to the platform SparkLayer app installation page.

Finally, once the platform connection is complete (both SparkLayer and platform config and credentials are known and the integration is able to start syncing data), the following actions should be performed:

- Register any data change webhooks with the platform if available.
- Sync the store settings from the platform to the Spark API.
- Start a full synchronisation of customers and product data.

**Important considerations:**

- Please note that the completion of the platform connection may not coincide with the call to the Add Platform Connection endpoint. This is true when the connection is initiated through the SparkLayer Dashboard and is pending completion on the external platform. In such cases, the endpoint should return a `redirect_url` for redirecting the user to the platform's SparkLayer installation page where the merchant can complete the process linking their store to the pending platform connection.
- The endpoint should be idempotent - if the platform connection is already established the endpoint should re-triger the connection completion actions in a safe idempotent way.

### Remove Platform Connection

This endpoint performs the following actions:

- Stop any processing of any syncing
- Delete store sync logs
- Delete any connection data locally

:::hint{type="info"}
Our API uses OAuth access tokens and therefore shortlived access tokens are required to be created. These should be stored locally alongside the connection data and refreshed when required.
:::

[title] Authentication
[path] /

When a customer signs into their account on the eCommerce platform it's necessary for SparkLayer to authenticate the customer. To avoid making customers sign in twice (to the platform and to SparkLayer), some platforms provide a mechanism to allow third parties (such as SparkLayer) to authenticate the customer. These mechanisms differ between platforms so Ignite specifies a generic endpoint which can be provided authentication data to be verified.

This diagram shows the how the authentication data moves from the front end to the Ignite API.

::Image[]{src="https://archbee-doc-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/8xQXNkIXBJbpnf7pmZhGm_authentication.png" signedSrc="https://archbee-doc-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/8xQXNkIXBJbpnf7pmZhGm_authentication.png" size="50" isUploading="false"}

## BigCommerce example

A real example will help illustrate how this works in practice.

When a B2B customer has signed in to a BigCommerce store, SparkLayer's Javascript code running in the customer's browser makes a request to BigCommerce's [current customer endpoint](https://developer.bigcommerce.com/docs/storefront-auth/current-customer#get-current-customer). This endpoint returns a JSON Web Token which is passed to SparkLayer's API.

::::hint{type="info"}
The SparkLayer API delegates the responsibility of verifying this JWT to the Ignite service for BigCommerce so that platform-specific code is kept separate from SparkLayer's core API.

:::hint
SparkLayer passes the JWT to the `/v1/{env}/{siteId}/authentication/verify` Ignite endpoint. The Ignite implementation must verify the token and return the platform's unique identifier for the customer.

The SparkLayer API then uses the customer ID returned by Ignite to generate an access token for that customer and return it to the customer's browser. This access token is used for all subsequent requests to the SparkLayer API.
:::
::::

[title] Ignite openapi.yaml
[path] /


[title] Calculate tax and shipping
[path] Endpoints Reference/Checkout/

### Code examples

```curl
curl --location --globoff '/v1/{siteEnv}/{siteId}/checkout/calculate' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"body":{"customer":{},"billing_address":{},"shipping_address":{},"shipping_line":{},"shop":{},"ignite_state":{}}}'
```

[title] Data Sync
[path] Endpoints Reference/


[title] Customer
[path] Endpoints Reference/


[title] Checkout
[path] Endpoints Reference/


[title] Authentication
[path] Endpoints Reference/


[title] /v1/{siteEnv}/{siteId}/metafield-configuration
[path] Endpoints Reference/Metafield Configuration/

### Code examples

```curl
curl --location --globoff '/v1/{siteEnv}/{siteId}/metafield-configuration' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
```

[title] Metafield Configuration
[path] Endpoints Reference/


[title] Customer Sub-Accounts
[path] Endpoints Reference/


[title] Trigger a Data Sync
[path] Endpoints Reference/Data Sync/

### Code examples

```curl
curl --location --globoff --request POST '/v1/{siteEnv}/{siteId}/status/{syncDataType}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
```

[title] Update a customer address
[path] Endpoints Reference/Customer Address/

### Code examples

```curl
curl --location --globoff --request PUT '/v1/{siteEnv}/{siteId}/customers/{customer_external_id}/addresses/{customer_address_external_id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
```

[title] Remove a Customer Address
[path] Endpoints Reference/Customer Address/

### Code examples

```curl
curl --location --globoff --request DELETE '/v1/{siteEnv}/{siteId}/customers/{customer_external_id}/addresses/{customer_address_external_id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
```

[title] Data Sync
[path] /

A key part of an Ignite integration is the data syncronization tooling. It brings data from the chosen platform (e.g. eCommerce platform) to SparkLayer. This data can then be viewed by the merchant users within the [SparkLayer Dashboard](https://docs.sparklayer.io/sparklayer-dashboard/the-sparklayer-dashboard). Also, the data will be used in the [SparkLayer Frontend](https://docs.sparklayer.io/sparklayer-frontend/overview-of-features) to power the wholesale ordering experience, including which customers should SparkLayer be enabled to, what pricing should be shown, as well as the customer's order history.

## When data sync happens

A full data sync is to be triggered in these scenarios:

- On install of the application
- If any inconsistencies exist and data needs to be refreshed. This will be actioned via the integration's `Trigger a Data Sync` endpoint which is called by the SparkLayer Dashboard ( when the merchant clicks the manual syncronization buttons for products and customers).

Beyond this, data will be synced via partial data updates (based on webhooks or other event mechanisms from the eCommece platform).

### Important considerations

| Area               | Notes                                                                                                                                                                                                                                                                             |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Queueing and retry | To ensure the stability and reliability of the platform, partial sync events should be retried in case of issues.                                                                                                                                                                 |
| Performance        | This service should not be affected by heavy users of our API and should be designed to make as little updates as possible i.e. for a product update, fetch the product and stock levels and only run updates where required.                                                     |
| Reporting          | To ensure visibility of the last updated date and the last full sync. This should be logged via the sync-log API detailed further down this page.                                                                                                                                 |
| Issue logging      | Any issues encountered during the process should be handled and logged via the sync-log API to be displayed to our merchants in the Spark Dashboard. An example of this could be a SKU not set on a product variant or a customer address missing data such as "line 1 is empty". |

## Types of data

The data to be synced includes products, customers, orders and store settings.

### Products

Below are the key elements of data to be synced from the platform (see the API [here](https://docs.sparklayer.io/tech-docs/create-a-product)):

- `title`
- `slug`
- `external_id` -> Platform Product ID
- `variants`
  - `external_id` -> Platform Variant ID
  - `sku`
  - `weight_in_grams`
  - `position`
  - `cart_image_url`
  - `options`
  - `status` Status should be set to live when the product is live and set to discontinued when the product is deleted.

Stock levels must be set synced from inventory\_level to our stock API (see the API [here)](https://docs.sparklayer.io/tech-docs/update-product-stock)

:::hint{type="info"}
**Extending the product object with \*\*\***&#x42;2B attributes\*\*\*

The below data would be useful if this is synced across from fields on the platform where the data could be stored, such as attributes (If possible, against the variant record)

- `rrp`
- `settings`
- `restock_date` Against the stock record but can be taken from variant
:::

### Pricing

Product pricing can be synced into the [SparkLayer Pricing API](https://docs.sparklayer.io/tech-docs/pricing-api).

We suggest that the Ignite implementation create at least one price list containing the default price for every product in the underlying platform. The price list should be named after the platform, eg. "BigCommerce Price". The price list should be created when the platform is connected and pricing should be updated whenever a product sync happens.

### Customers

Customer data to be synced (see the API [here](https://docs.sparklayer.io/tech-docs/create-a-customer)) and associated customer addresses (see the API [here](https://docs.sparklayer.io/tech-docs/create-a-customer-address)).

- `external_id` -> Platform ID
- `email`
- `first_name`
- `last_name`
- `company_name`
- `send_invite`
- `addresses`

:::hint{type="info"}
**Extending the customer object with \*\*\***&#x42;2B attributes\*\*\*
The below data would be useful if this is synced across from fields on the platform where the data could be stored, such as attributes. Group can be fed via other means i.e. if there's another field which makes sense to sync via such as if there's a group on the underlying platform.

- `group`
- `accounting_id`
- `sales_agent_groups`
- `price_lists`
- `discount_percentage`
- `payment_on_account`
- `parent_customer_id`
:::

### Orders

Order data to be synced (see the Purchasing API [here](https://docs.sparklayer.io/tech-docs/createupdate-purchase)); this needs to include order creation, amends and shipments.

For SparkLayer orders, always use the `sparklayer` purchase identifier when upserting purchases. This is important, as other parts of the SparkLayer platform might have already created a purchase for the order in question but might not have known the other identifiers such as the platform order ID. Trying to update a purchase for the same SparkLayer purchase while using another identifier that was not added during the initial purchase creation will result in an `409 Conflict` error.

:::hint{type="info"}
**Please note:** It is also useful to support syncing of historical orders that were not placed through SparkLayer but already exist on the eCommerce platform. When doing this, it's OK to PUT the purchase using the `platform` identifier as we would not have a SparkLayer one, and there would not be a conflicting order already in the system. A historical order import can be triggered by the merchant setting a special historic order import metafield.
Please see the docs for historic orders here: [Importing Historical Orders](https://docs.sparklayer.io/shopify-metafields#6jvT_)
:::

### Store Settings

On platform connection, as well as when the relevant store settings are updated on the eCommerce platform, the following store settings should be synced across:

- Base currency (this should be syned to SparkLayer using the Settings API [here](https://docs.sparklayer.io/tech-docs/update-global-setting) and a setting key of `baseCurrency`).

## Logging Sync Issues

For optimal visibility of the data syncronization process, any customer and product sync timestamps and errors should be reported through the sync-log API. This ensures that our merchants can view this information on the Sparklayer Dashboard and take the necessary actions. Documentation pertaining to the sync-log API endpoints is accessible [here](https://docs.sparklayer.io/tech-docs/core-api).

### Full Data Synchronization (Including Initial Synchronization):

During a full data synchronization a full sync log should be recorded using the PUT endpoint.

Please be advised:

- Upon a full data sync log, errors from the preceding sync log are cleared.
- It's crucial that the external\_id associated with each error remains unique. This precaution prevents errors from being mistakenly overwritten or incorrectly resolved.
- As full data sync might take a while and is often done asyncronously, it will not usually be possible to record all the errors in the inital sync log PUT request. Instead, the initial sync log PUT request can be used to record the start of the sync and the errors (as well as their potential resolutions) can be recorded in subsequent partial sync PATCH requests. Also, the sync log API needs to be notified when the full sync is complete. This can be done by sending a partial sync PATCH request with the `last_full_sync` property once the Ignite integration has finished syncing all the data.
- In the case of a full sync where items are synced in separate application instances (i.e. though a use of a queue) it's important to ensure that the sync log `last_full_sync` property is only updated once all items have been synced. For this you might need to keep track of the items synced and remaining in the integration as the sync log API does not handle this.

### Partial Synchronization:

A partial synchronization log should be recorded any time an individual item is synced. For instance, this would happen if a product or customer is updated on the store and the update is synced to SparkLayer. This can be done using the sync log API PATCH endpoint.

Please be advised:

- The PATCH endpoint retains pre-existing errors.
- Incorporates any new errors.
- Additionally, errors can be resolved using an array of successfully synchronized platform IDs.

### Protocol for Sync Log Deletion:

The sync log API is responsible for sync log upkeep. Given that previous errors are cleared during a full data synchronization, there's typically no need to delete sync logs. However, if a store decides to uninstall SparkLayer, it's essential to delete the store's synchronization logs using the designated delete endpoint.

[title] Endpoints Overview
[path] /

## Introduction

This section covers the endpoints that must be implemented by the Ignite integration. Please consult the [Endpoints Reference](https://docs.sparklayer.io/ignite/endpoints-reference) documentation for the implementation details of each endpoint, as well as the relevant overview pages for each area.

The rest of this document provides an overview of the endpoints that must be implemented by the Ignite integration for various areas:

## Platform Connection

**Add a platform connection:** the endpoint is called when a platform is connected to SparkLayer. This is done either when a connection is initialized though the SparkLayer Dashboard or when a connection is initialized externally (e.g. though the eCommerce platform SparkLayer app) and is now complete. The data provided will contain the SparkLayer site environment, ID as well as the API credentials.

**Remove a platform connection:** the endpoint is called when a platform is disconnected from SparkLayer. The integration should ensure any data syncs are cancelled and the connection data is cleaned up from the integration.

You can view the in-depth Platform Connection requirements [here](https://docs.sparklayer.io/ignite/x-67-platform-connection).

## Data Sync

Allow the triggering of the sync process from the [SparkLayer Dashboard](https://docs.sparklayer.io/sparklayer-dashboard/the-sparklayer-dashboard). This is only available to internal staff and used when data needs manual refreshing.

You can view the detailed requirements [here](https://docs.sparklayer.io/ignite/data-sync).

## Customer sub-account

Customer sub-accounts require customer accounts on the eCommerce platform providing a layer of authentication for SparkLayer to use similar to other accounts. These endpoints allow creation and deletion of customers for sub-accounts which can be actioned via the frontend widgets.

## Customer addresses

These endpoints allow creation, updates and deletion of customers addresses which can be done via the frontend widgets.

## Checkout

These endpoints are for calculating checkout tax, collecting available shipping methods and allowing a checkout to be created and completed (an order to be created on the platform). The checkout for upfront payment can use the standard platform checkout and does not need to include discounts and giftcards.

**Important considerations:**

- If the platform may at any point require the checkout prices to be supplied with the tax included, this needs to be handled by adding this tax to the prices that come from SparkLayer in the checkout endpoints. This is because SparkLayer prices are always tax exclusive.
- Similar to the point above, if the calculated shipping prices that come back from the platform contain tax this should also be accounted for, keeping in mind SparkLayer operates on tax-exclusive pricing.
- Carts, checkouts and orders created or updated by SparkLayer Ignite integration should be tagged that they originated from SparkLayer. For example an `external_id` or `source` parameters might need to be set, or a metafield might need to be added. This should then be used by the Order Sync logic to know which orders should be syned to SparkLayer.
- All data supplied by SparkLayer to the Ignite integration's checkout endpoints should be stored on the relevant platform cart, checkout or order objects. Where possible this data should be mapped to the native fields (e.g. customer id, order additional info etc) however in many cases metafields and attributes will need to be utilised to store some of the data that does not have a native field match.

[title] Overview
[path] /

::Image[]{src="https://www.sparklayer.io/assets/images/docs/banner-ignite.png?v=2445" signedSrc="https://www.sparklayer.io/assets/images/docs/banner-ignite.png?v=2445" size="50" alt isUploading="false"}

## Introduction

*SparkLayer Ignite* is a commerce framework that enables any platform to easily integrate with the power of SparkLayer. From delivering a world-class frontend B2B self-service ordering experience, to connecting to SparkLayer's extensive B2B pricing engine.&#x20;

## Use Cases

The most common use case is to use SparkLayer Ignite alongside a complimentary eCommerce platform or content management system (CMS). For example, an eCommerce platform may have very limited B2B ecommerce functionality and it's not viable to build it natively. By connecting the eCommerce platform to SparkLayer Ignite (e.g. via a custom application), B2B functionality can be rapidly enabled.

Please note: access to SparkLayer Ignite requires [completing an application form](https://share-eu1.hsforms.com/1ZSI9nEs5SwGyrx9kvWIA2wfkn6z) that our team will review. As part of the approval process, we will evaluate applications to ensure SparkLayer is a good match for the relevant use case, both technically and strategically.

## Before starting

Our documentation covers all key principles and concepts required to build an integration via the SparkLayer Ignite framework. This includes how to connect a platform (e.g. an eCommerce platform) and synchronise data, right through to connecting to specific endpoints to allow you to customise as you need to. In order to familiarise yourself with how SparkLayer works, we recommend reviewing the following guides:

| Area                                                                                                 | Notes                                                                                                                                       |
| ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [The SparkLayer Frontend](https://docs.sparklayer.io/sparklayer-frontend/overview-of-features)       | The SparkLayer Frontend is a JavaScript overlay that replaces specific parts of an eCommerce website with wholesale ordering capabilities.  |
| [The SparkLayer Dashboard](https://docs.sparklayer.io/sparklayer-dashboard/the-sparklayer-dashboard) | The SparkLayer Dashboard is a web browser-based tool that lets users keep track of all elements of their SparkLayer integration.            |

## Key Principles

### Understanding the data flow

Understanding how data flows between SparkLayer and a platform (e.g. an eCommerce platform) is central to building an integration. At a very top level, our diagram below illustrates the key data flows:

::Image[]{src="https://archbee-doc-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/hzx1ykSmjuTS__j84gVES_igniteintegrationdiagram.png" signedSrc="https://archbee-doc-uploads.s3.us-east-1.amazonaws.com/kxppJrvFK15E9wXbMKaTP/hzx1ykSmjuTS__j84gVES_igniteintegrationdiagram.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAYQNQCIXNIQWBC56C%2F20240227%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240227T115438Z&X-Amz-Expires=86400&X-Amz-Signature=13f2b771a9f559493ed2e2f2b4eb23b93b5b426717790b1ba96d80c77f081d70&X-Amz-SignedHeaders=host&x-id=GetObject" size="50" isUploading="false"}

### Platform Connection

*Platform Connection* is the term used for when a platform is connected to SparkLayer (e.g. an eCommerce platform). There are two endpoints:

1. One to inform of **new connection**
2. Another to inform **once it's removed**

Learn more about [Platform Connection](https://docs.sparklayer.io/ignite/x-67-platform-connection).

### Data Sync Overview

SparkLayer requires data from the platform in order to operate. When an install initially happens, a full sync will be required to begin the process. For further updates, webhooks should power these incremental changes with the option to run the sync again (in case of any issues). For visibility, data sync issues should also be logged within the [SparkLayer Dashboard](https://docs.sparklayer.io/sparklayer-dashboard/the-sparklayer-dashboard/customers#customer-import) for easy review. Data should include:

| Area           | Details                                                                                                                                                                                        |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Product Data   | SparkLayer needs a basic level of product data to be synced across for the [frontend widgets](https://docs.sparklayer.io/sparklayer-frontend/overview-of-features) to operate.                 |
| Customer Data  | SparkLayer needs a basic level of customer data to be synced across for the [frontend widgets](https://docs.sparklayer.io/sparklayer-frontend/overview-of-features) to operate.                |
| Order Data     | SparkLayer needs order data to be synced across for the [frontend widgets](https://docs.sparklayer.io/sparklayer-frontend/overview-of-features) to show order data within the account section. |
| Store Settings | SparkLayer needs to know the base currency of the store                                                                                                                                        |

Learn more about the [Data Sync](https://docs.sparklayer.io/ignite/data-sync).

### Endpoints

The below are required instantly on a customer request and these endpoints will outline the request body and response body.

| Area                                                   | Details                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Create/update/delete of addresses                      | Via [the frontend](https://docs.sparklayer.io/sparklayer-frontend/overview-of-features/my-account-interface), customers can create, update and delete their addresses; we require endpoints to action these.                                                                                                                                                                                                                    |
| Fetching shipping and tax for an order                 | Via [the frontend](https://docs.sparklayer.io/sparklayer-frontend/overview-of-features/quick-order-interface), as the customer proceeds through the checkout; we need to be able to show shipping rates and tax information for an order.                                                                                                                                                                                       |
| Create/delete customers for sub-accounts               | Via the frontend, customers can create and delete the customers which are sub-accounts; we require endpoints to action these.                                                                                                                                                                                                                                                                                                   |
| Create a checkout for upfront orders                   | Via [the frontend](https://docs.sparklayer.io/sparklayer-frontend/overview-of-features/quick-order-interface#payment-methods) when a customer places an order which requires ‘upfront payment’ through the platform (e.g. via credit card), we need to be able to send the user to the checkout to complete payment. This checkout can use the standard platform checkout and does not need to include discounts and giftcards. |
| Create a order for orders with payment handled offline | Via [the frontend](https://docs.sparklayer.io/sparklayer-frontend/overview-of-features/quick-order-interface#payment-methods) when a customer places an order which does not require payment, we need to be able to create an order in the platform.                                                                                                                                                                            |

Learn more about the [Endpoints](https://docs.sparklayer.io/ignite/endpoints-overview).

### Please note the following

Currently, these areas are excluded from this documentation and will be covered in due course or elsewhere.

- Billing and any SparkLayer dashboard logic
- SparkLayer currently only supports a single storefront per SparkLayer environment.
- SparkLayer currently only supports simple option products, i.e. complex bundles are unsupported.


[title] Platform Connection
[path] Endpoints Reference/


[title] Create/update a customer
[path] Endpoints Reference/Customer/

### Code examples

```curl
curl --location --globoff --request PUT '/v1/{siteEnv}/{siteId}/customers' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"body":{"email":"string<email>","first_name":"string","last_name":"string","payment_on_account":{}}}'
```

[title] Remove a Customer sub-account
[path] Endpoints Reference/Customer Sub-Accounts/

### Code examples

```curl
curl --location --globoff --request DELETE '/v1/{siteEnv}/{siteId}/sub-accounts/{customer_external_id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
```

[title] New Platform Connection
[path] Endpoints Reference/Platform Connection/

### Code examples

```curl
curl --location --globoff '/v1/{siteEnv}/{siteId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"body":{"store_id":"string","spark_api_client_id":"string","spark_api_client_secret":"string"}}'
```

[title] Remove Platform Connection
[path] Endpoints Reference/Platform Connection/

### Code examples

```curl
curl --location --globoff --request DELETE '/v1/{siteEnv}/{siteId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
```

[title] Customer Address
[path] Endpoints Reference/


[title] Verify authentication data provided by the platform
[path] Endpoints Reference/Authentication/

### Code examples

```curl
curl --location --globoff '/v1/{siteEnv}/{siteId}/authentication/verify' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"body":{"data":"string"}}'
```

[title] Create a new Customer sub-account
[path] Endpoints Reference/Customer Sub-Accounts/

### Code examples

```curl
curl --location --globoff '/v1/{siteEnv}/{siteId}/sub-accounts' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"body":{"email":"string<email>","first_name":"string","last_name":"string","parent_customer_external_id":"string"}}'
```

[title] Create a new customer address
[path] Endpoints Reference/Customer Address/

### Code examples

```curl
curl --location --globoff --request POST '/v1/{siteEnv}/{siteId}/customers/{customer_external_id}/addresses' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
```

[title] Complete Checkout
[path] Endpoints Reference/Checkout/

### Code examples

```curl
curl --location --globoff '/v1/{siteEnv}/{siteId}/checkout/complete' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"body":{"customer":{},"billing_address":{},"shipping_address":{},"shipping_line":{},"shop":{},"ignite_state":{}}}'
```

[title] Update an existing Customer sub-account
[path] Endpoints Reference/Customer Sub-Accounts/

### Code examples

```curl
curl --location --globoff --request PATCH '/v1/{siteEnv}/{siteId}/sub-accounts/{customer_external_id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
```

[title] /v1/{siteEnv}/{siteId}/metafield-configuration/enable
[path] Endpoints Reference/Metafield Configuration/

### Code examples

```curl
curl --location --globoff '/v1/{siteEnv}/{siteId}/metafield-configuration/enable' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"body":{"key":"string","name":"string"}}'
```

[space] SparkLayer Technical Docs (/tech-docs)

[title] Calculate Cart
[path] Untitled/Core API Docs/Orders/

{
  "id": "vrBHzbgFzV7vHJqx0oPqj",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.sparklayer.io/api/v1/carts/{id}/calculate",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/carts/{id}/calculate",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/carts/{id}/calculate",
        "description": "Test"
      }
    ],
    "name": "Calculate Cart",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "shipping_rate_handle",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "Omitting this will set the carts shipping handle to the first available"
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "totals",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/CartTotals",
                "customType": "CartTotals",
                "schema": [
                  {
                    "name": "total",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/Totals",
                    "customType": "Totals",
                    "schema": [
                      {
                        "name": "pre_discount",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "discount",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "charge",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "shipping",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/Totals",
                    "customType": "Totals",
                    "schema": [
                      {
                        "name": "pre_discount",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "discount",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "charge",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "sub_total",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/Totals",
                    "customType": "Totals",
                    "schema": [
                      {
                        "name": "pre_discount",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "discount",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "charge",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                "name": "discounts",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "shipping_methods",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "title",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "description",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "price_v2",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/PriceDeprecated",
                    "customType": "PriceDeprecated",
                    "schema": [
                      {
                        "name": "net",
                        "kind": "optional",
                        "type": "number<float>",
                        "description": "",
                        "format": "float"
                      },
                      {
                        "name": "gross",
                        "kind": "optional",
                        "type": "number<float>",
                        "description": "",
                        "format": "float"
                      },
                      {
                        "name": "tax_rate",
                        "kind": "optional",
                        "type": "number<float>",
                        "nullable": true,
                        "description": "",
                        "format": "float"
                      },
                      {
                        "name": "currency_code",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "tax_inclusive_display",
                        "kind": "optional",
                        "type": "boolean",
                        "description": "<p>Whether the storefront should show the gross amount and label it tax inclusive. Not derivable from tax_rate, since a zero-rated SKU on a tax-inclusive price list has a rate of 0 but must still be labelled. Display only - it says nothing about what is charged.</p>",
                        "default": false
                      }
                    ]
                  },
                  {
                    "name": "price_v2_pre_discount",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "PriceDeprecated",
                        "description": "",
                        "modelRef": "#/components/schemas/PriceDeprecated",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "nullable": true,
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency_code",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "tax_inclusive_display",
                            "kind": "optional",
                            "type": "boolean",
                            "description": "<p>Whether the storefront should show the gross amount and label it tax inclusive. Not derivable from tax_rate, since a zero-rated SKU on a tax-inclusive price list has a rate of 0 but must still be labelled. Display only - it says nothing about what is charged.</p>",
                            "default": false
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "handle",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "cost_type",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "cost_language_string",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  }
                ]
              },
              {
                "name": "allowed_payment_methods",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "payment_by_invoice",
                    "kind": "optional",
                    "type": "string<AVAILABLE | DISABLED>",
                    "description": "",
                    "enum": [
                      "AVAILABLE",
                      "DISABLED"
                    ]
                  },
                  {
                    "name": "payment_on_account",
                    "kind": "optional",
                    "type": "string<AVAILABLE | DISABLED | UNAVAILABLE_DUE_TO_CREDIT | AVAILABLE_CREDIT_LIMIT_HIT>",
                    "description": "",
                    "enum": [
                      "AVAILABLE",
                      "DISABLED",
                      "UNAVAILABLE_DUE_TO_CREDIT",
                      "AVAILABLE_CREDIT_LIMIT_HIT"
                    ]
                  },
                  {
                    "name": "upfront_payment",
                    "kind": "optional",
                    "type": "string<AVAILABLE | DISABLED>",
                    "description": "",
                    "enum": [
                      "AVAILABLE",
                      "DISABLED"
                    ]
                  },
                  {
                    "name": "quote",
                    "kind": "optional",
                    "type": "string<AVAILABLE | DISABLED>",
                    "description": "",
                    "enum": [
                      "AVAILABLE",
                      "DISABLED"
                    ]
                  }
                ]
              },
              {
                "name": "selected_shipping_rate_handle",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": ""
              },
              {
                "name": "selected_payment_method",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": ""
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Cart not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "422",
        "description": "Unprocessable Entity",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "complexItems": [
              {
                "name": "object",
                "schema": [],
                "modelRef": "#/components/schemas/responses-CartErrorResponse",
                "customType": "responses-CartErrorResponse"
              },
              {
                "name": "object",
                "schema": [],
                "modelRef": "#/components/schemas/Default",
                "customType": "Default"
              }
            ],
            "complexType": "oneOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Update Cart
[path] Untitled/Core API Docs/Orders/

{
  "id": "aqlEdfWuWjSwl2CQRHBd_",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://app.sparklayer.io/api/v1/carts/{id}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/carts/{id}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/carts/{id}",
        "description": "Test"
      }
    ],
    "name": "Update Cart",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "line_items",
              "kind": "optional",
              "type": "array",
              "description": "<p>Replaces all existing cart line items. The provided quantities are absolute values (not deltas). Passing an empty array clears the cart.</p>",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "sku",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "quantity",
                  "kind": "optional",
                  "type": "integer",
                  "description": ""
                }
              ]
            },
            {
              "name": "shipping_address_id",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": ""
            },
            {
              "name": "temporary_shipping_address",
              "kind": "optional",
              "type": "object",
              "nullable": true,
              "description": "",
              "example": "",
              "schema": [
                {
                  "name": "first_name",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": ""
                },
                {
                  "name": "last_name",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": ""
                },
                {
                  "name": "company",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": ""
                },
                {
                  "name": "address_line1",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "address_line2",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": ""
                },
                {
                  "name": "city",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "region_code",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": ""
                },
                {
                  "name": "postal_code",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "country_code",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "phone",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": ""
                }
              ]
            },
            {
              "name": "customer_reference",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": ""
            },
            {
              "name": "po_number",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": ""
            },
            {
              "name": "shipping_requested_date",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": ""
            },
            {
              "name": "custom_fields",
              "kind": "optional",
              "type": "array",
              "description": "Replaces all existing custom fields on the cart. Any existing field not included is removed. Passing an empty array clears all custom fields.\n",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "name",
                  "kind": "required",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "value",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "<p>A null value has the same effect as omitting this field from the array: it is not included in the replaced set of custom fields.</p>"
                }
              ]
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "cart",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/Cart",
                "customType": "Cart",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "description": "",
                    "format": "uuid"
                  },
                  {
                    "name": "intent",
                    "kind": "optional",
                    "type": "string<ORDER | QUOTE>",
                    "description": "",
                    "enum": [
                      "ORDER",
                      "QUOTE"
                    ]
                  },
                  {
                    "name": "customer_id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "description": "",
                    "format": "uuid"
                  },
                  {
                    "name": "shipping_address_id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "",
                    "format": "uuid"
                  },
                  {
                    "name": "billing_address_id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "",
                    "format": "uuid"
                  },
                  {
                    "name": "items",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "sku",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "quantity",
                        "kind": "optional",
                        "type": "integer",
                        "description": ""
                      },
                      {
                        "name": "line_total",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "modelRef": "#/components/schemas/Price",
                        "customType": "Price",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "nullable": true,
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency_code",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "tax_inclusive_display",
                            "kind": "optional",
                            "type": "boolean",
                            "description": "<p>Whether the storefront should show the gross amount and label it tax inclusive. Not derivable from tax_rate, since a zero-rated SKU on a tax-inclusive price list has a rate of 0 but must still be labelled. Display only - it says nothing about what is charged.</p>",
                            "default": false
                          }
                        ]
                      },
                      {
                        "name": "unit_total",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "complexType": "allOf",
                        "complexItems": [
                          {
                            "name": "Price",
                            "description": "",
                            "modelRef": "#/components/schemas/Price",
                            "schema": [
                              {
                                "name": "net",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "gross",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "tax_rate",
                                "kind": "optional",
                                "type": "number<float>",
                                "nullable": true,
                                "description": "",
                                "format": "float"
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "tax_inclusive_display",
                                "kind": "optional",
                                "type": "boolean",
                                "description": "<p>Whether the storefront should show the gross amount and label it tax inclusive. Not derivable from tax_rate, since a zero-rated SKU on a tax-inclusive price list has a rate of 0 but must still be labelled. Display only - it says nothing about what is charged.</p>",
                                "default": false
                              }
                            ]
                          }
                        ],
                        "schema": []
                      }
                    ]
                  },
                  {
                    "name": "totals",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/CartTotals",
                    "customType": "CartTotals",
                    "schema": [
                      {
                        "name": "total",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "modelRef": "#/components/schemas/Totals",
                        "customType": "Totals",
                        "schema": [
                          {
                            "name": "pre_discount",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "net",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "gross",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "tax",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "apportioned_tax_rate",
                                "kind": "optional",
                                "type": "number<float>",
                                "description": "",
                                "format": "float"
                              },
                              {
                                "name": "currency",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "discount",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "net",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "gross",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "tax",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "apportioned_tax_rate",
                                "kind": "optional",
                                "type": "number<float>",
                                "description": "",
                                "format": "float"
                              },
                              {
                                "name": "currency",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "charge",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "net",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "gross",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "tax",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "apportioned_tax_rate",
                                "kind": "optional",
                                "type": "number<float>",
                                "description": "",
                                "format": "float"
                              },
                              {
                                "name": "currency",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "modelRef": "#/components/schemas/Totals",
                        "customType": "Totals",
                        "schema": [
                          {
                            "name": "pre_discount",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "net",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "gross",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "tax",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "apportioned_tax_rate",
                                "kind": "optional",
                                "type": "number<float>",
                                "description": "",
                                "format": "float"
                              },
                              {
                                "name": "currency",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "discount",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "net",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "gross",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "tax",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "apportioned_tax_rate",
                                "kind": "optional",
                                "type": "number<float>",
                                "description": "",
                                "format": "float"
                              },
                              {
                                "name": "currency",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "charge",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "net",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "gross",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "tax",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "apportioned_tax_rate",
                                "kind": "optional",
                                "type": "number<float>",
                                "description": "",
                                "format": "float"
                              },
                              {
                                "name": "currency",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "sub_total",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "modelRef": "#/components/schemas/Totals",
                        "customType": "Totals",
                        "schema": [
                          {
                            "name": "pre_discount",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "net",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "gross",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "tax",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "apportioned_tax_rate",
                                "kind": "optional",
                                "type": "number<float>",
                                "description": "",
                                "format": "float"
                              },
                              {
                                "name": "currency",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "discount",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "net",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "gross",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "tax",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "apportioned_tax_rate",
                                "kind": "optional",
                                "type": "number<float>",
                                "description": "",
                                "format": "float"
                              },
                              {
                                "name": "currency",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "charge",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "net",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "gross",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "tax",
                                "kind": "optional",
                                "type": "object",
                                "description": "",
                                "modelRef": "#/components/schemas/Amount",
                                "customType": "Amount",
                                "schema": [
                                  {
                                    "name": "amount",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  },
                                  {
                                    "name": "currency_code",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": ""
                                  }
                                ]
                              },
                              {
                                "name": "apportioned_tax_rate",
                                "kind": "optional",
                                "type": "number<float>",
                                "description": "",
                                "format": "float"
                              },
                              {
                                "name": "currency",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "customer_addresses",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "uuid",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "first_name",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "last_name",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "company",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "description",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "address_line_1",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "address_line_2",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "city",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "postal_code",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": ""
                      },
                      {
                        "name": "country_code",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "region_code",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": ""
                      },
                      {
                        "name": "phone",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "external_id",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": ""
                      }
                    ]
                  },
                  {
                    "name": "shipping_rate_handle",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "payment_method",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "validation_errors",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "modelRef": "#/components/schemas/CartValidationErrors",
                    "customType": "CartValidationErrors",
                    "schema": []
                  },
                  {
                    "name": "customer_reference",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "po_number",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "shipping_requested_date",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "custom_fields",
                    "kind": "optional",
                    "type": "array",
                    "description": "The cart's current custom fields.",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "value",
                        "kind": "required",
                        "type": "string",
                        "description": ""
                      }
                    ]
                  }
                ]
              },
              {
                "name": "item_update_results",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "sku",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "requested_quantity",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "resultant_quantity",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "messages",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "type",
                        "kind": "optional",
                        "type": "string<cannot-adjust-overridden-qty | excessive-lines | not-found | pack-size | product-settings-overridden | qty-excessive | qty-insufficient | qty-unavailable | qty-unavailable-no-clamp>",
                        "description": "",
                        "enum": [
                          "cannot-adjust-overridden-qty",
                          "excessive-lines",
                          "not-found",
                          "pack-size",
                          "product-settings-overridden",
                          "qty-excessive",
                          "qty-insufficient",
                          "qty-unavailable",
                          "qty-unavailable-no-clamp"
                        ]
                      }
                    ]
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Cart not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "422",
        "description": "Unprocessable Entity",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "complexItems": [
              {
                "name": "object",
                "schema": [],
                "modelRef": "#/components/schemas/responses-CartErrorResponse",
                "customType": "responses-CartErrorResponse"
              },
              {
                "name": "object",
                "schema": [],
                "modelRef": "#/components/schemas/Default",
                "customType": "Default"
              }
            ],
            "complexType": "oneOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get a Shipping Method
[path] Untitled/Core API Docs/Shipping/

{
  "id": "MfdejJNSy5Hi51h0icgTA",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.sparklayer.io/api/v1/shipping-methods/{id}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/shipping-methods/{id}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/shipping-methods/{id}",
        "description": "Test"
      }
    ],
    "name": "Get a Shipping Method",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ShippingMethod",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "<p>Shipping Method ID (always prefixed with sm_)</p>",
                "example": "sm_123",
                "maxLength": 15
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Created At",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Updated At",
                "format": "date-time"
              },
              {
                "name": "sku",
                "kind": "optional",
                "type": "string",
                "description": "Shipping SKU",
                "example": "SKU001",
                "maxLength": 50
              },
              {
                "name": "title",
                "kind": "optional",
                "type": "string",
                "description": "Shiping Method Name shown at checkout",
                "example": "Standard Shipping",
                "maxLength": 50
              },
              {
                "name": "priority",
                "kind": "optional",
                "type": "number",
                "description": "<p>Shown by order (lower first)</p>",
                "default": 0,
                "minimum": 0,
                "maximum": 127
              },
              {
                "name": "countries",
                "kind": "optional",
                "type": "array",
                "description": "<p>Countries covered by this shipping method (ISO 3166-1 alpha-2)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "GB",
                "itemDefault": ""
              },
              {
                "name": "regions",
                "kind": "optional",
                "type": "map",
                "description": "<p>Regions covered by this shipping method (per country) Keys are country codes (ISO 3166-1 alpha-2) Values are lists of region codes. If the list is empty, all regions are allowed</p>",
                "example": "",
                "customType": "map<string, string[]>",
                "schema": []
              },
              {
                "name": "groups",
                "kind": "optional",
                "type": "array",
                "description": "<p>Customer groups covered by this shipping method (use default to cover all groups)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "bands",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Internal Band Name",
                    "example": "Band 1",
                    "maxLength": 50
                  },
                  {
                    "name": "priority",
                    "kind": "optional",
                    "type": "number",
                    "description": "<p>Filtered by first found by percentage_charge order (lower first)</p>",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 127
                  },
                  {
                    "name": "sku",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>Shipping SKU (Leave null to use the Shipping Method SKU)</p>",
                    "example": "ship_123",
                    "maxLength": 15
                  },
                  {
                    "name": "requirement",
                    "kind": "optional",
                    "type": "object",
                    "discriminator": {
                      "propertyName": "type",
                      "mapping": {
                        "weight": "#/components/schemas/ShippingMethod.Requirement.Weight",
                        "none": "#/components/schemas/ShippingMethod.Requirement.None",
                        "net_total": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                        "gross_total": "#/components/schemas/ShippingMethod.Requirement.GrossTotal"
                      }
                    },
                    "description": "",
                    "complexType": "oneOf",
                    "complexItems": [
                      {
                        "name": "ShippingMethod.Requirement.Weight",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.Weight",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<weight>",
                            "description": "",
                            "enum": [
                              "weight"
                            ]
                          },
                          {
                            "name": "min",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.GrossTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.GrossTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<gross_total>",
                            "description": "",
                            "enum": [
                              "gross_total"
                            ]
                          },
                          {
                            "name": "min_total",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max_total",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.NetTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<net_total>",
                            "description": "",
                            "enum": [
                              "net_total"
                            ]
                          },
                          {
                            "name": "min",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.None",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.None",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<none>",
                            "description": "",
                            "enum": [
                              "none"
                            ]
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "cost",
                    "kind": "optional",
                    "type": "object",
                    "discriminator": {
                      "propertyName": "type",
                      "mapping": {
                        "free": "#/components/schemas/ShippingMethod.Cost.Free",
                        "fixed_price": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                        "percent_net_total": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                        "custom": "#/components/schemas/ShippingMethod.Cost.Custom"
                      }
                    },
                    "description": "",
                    "complexType": "oneOf",
                    "complexItems": [
                      {
                        "name": "ShippingMethod.Cost.Free",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.Free",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<free>",
                            "description": "",
                            "enum": [
                              "free"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.FixedCost",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<fixed_price>",
                            "description": "",
                            "enum": [
                              "fixed_price"
                            ]
                          },
                          {
                            "name": "price",
                            "kind": "optional",
                            "type": "number",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.PercentNetTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<percent_net_total>",
                            "description": "",
                            "enum": [
                              "percent_net_total"
                            ]
                          },
                          {
                            "name": "percentage_charge",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float",
                            "minimum": 0,
                            "maximum": 100
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.Custom",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.Custom",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom>",
                            "description": "",
                            "enum": [
                              "custom"
                            ]
                          },
                          {
                            "name": "cost_language_string",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      }
                    ],
                    "schema": []
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/ShippingMethod",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] List of Shipping Methods
[path] Untitled/Core API Docs/Shipping/

{
  "id": "C6Rj8JCkph76NBZG5JiGO",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.sparklayer.io/api/v1/shipping-methods",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/shipping-methods",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/shipping-methods",
        "description": "Test"
      }
    ],
    "name": "List of Shipping Methods",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "ShippingMethod[]",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "<p>Shipping Method ID (always prefixed with sm_)</p>",
                "example": "sm_123",
                "maxLength": 15
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Created At",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Updated At",
                "format": "date-time"
              },
              {
                "name": "sku",
                "kind": "optional",
                "type": "string",
                "description": "Shipping SKU",
                "example": "SKU001",
                "maxLength": 50
              },
              {
                "name": "title",
                "kind": "optional",
                "type": "string",
                "description": "Shiping Method Name shown at checkout",
                "example": "Standard Shipping",
                "maxLength": 50
              },
              {
                "name": "priority",
                "kind": "optional",
                "type": "number",
                "description": "<p>Shown by order (lower first)</p>",
                "default": 0,
                "minimum": 0,
                "maximum": 127
              },
              {
                "name": "countries",
                "kind": "optional",
                "type": "array",
                "description": "<p>Countries covered by this shipping method (ISO 3166-1 alpha-2)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "GB",
                "itemDefault": ""
              },
              {
                "name": "regions",
                "kind": "optional",
                "type": "map",
                "description": "<p>Regions covered by this shipping method (per country) Keys are country codes (ISO 3166-1 alpha-2) Values are lists of region codes. If the list is empty, all regions are allowed</p>",
                "example": "",
                "customType": "map<string, string[]>",
                "schema": []
              },
              {
                "name": "groups",
                "kind": "optional",
                "type": "array",
                "description": "<p>Customer groups covered by this shipping method (use default to cover all groups)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "bands",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Internal Band Name",
                    "example": "Band 1",
                    "maxLength": 50
                  },
                  {
                    "name": "priority",
                    "kind": "optional",
                    "type": "number",
                    "description": "<p>Filtered by first found by percentage_charge order (lower first)</p>",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 127
                  },
                  {
                    "name": "sku",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>Shipping SKU (Leave null to use the Shipping Method SKU)</p>",
                    "example": "ship_123",
                    "maxLength": 15
                  },
                  {
                    "name": "requirement",
                    "kind": "optional",
                    "type": "object",
                    "discriminator": {
                      "propertyName": "type",
                      "mapping": {
                        "weight": "#/components/schemas/ShippingMethod.Requirement.Weight",
                        "none": "#/components/schemas/ShippingMethod.Requirement.None",
                        "net_total": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                        "gross_total": "#/components/schemas/ShippingMethod.Requirement.GrossTotal"
                      }
                    },
                    "description": "",
                    "complexType": "oneOf",
                    "complexItems": [
                      {
                        "name": "ShippingMethod.Requirement.Weight",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.Weight",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<weight>",
                            "description": "",
                            "enum": [
                              "weight"
                            ]
                          },
                          {
                            "name": "min",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.GrossTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.GrossTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<gross_total>",
                            "description": "",
                            "enum": [
                              "gross_total"
                            ]
                          },
                          {
                            "name": "min_total",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max_total",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.NetTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<net_total>",
                            "description": "",
                            "enum": [
                              "net_total"
                            ]
                          },
                          {
                            "name": "min",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.None",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.None",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<none>",
                            "description": "",
                            "enum": [
                              "none"
                            ]
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "cost",
                    "kind": "optional",
                    "type": "object",
                    "discriminator": {
                      "propertyName": "type",
                      "mapping": {
                        "free": "#/components/schemas/ShippingMethod.Cost.Free",
                        "fixed_price": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                        "percent_net_total": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                        "custom": "#/components/schemas/ShippingMethod.Cost.Custom"
                      }
                    },
                    "description": "",
                    "complexType": "oneOf",
                    "complexItems": [
                      {
                        "name": "ShippingMethod.Cost.Free",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.Free",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<free>",
                            "description": "",
                            "enum": [
                              "free"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.FixedCost",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<fixed_price>",
                            "description": "",
                            "enum": [
                              "fixed_price"
                            ]
                          },
                          {
                            "name": "price",
                            "kind": "optional",
                            "type": "number",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.PercentNetTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<percent_net_total>",
                            "description": "",
                            "enum": [
                              "percent_net_total"
                            ]
                          },
                          {
                            "name": "percentage_charge",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float",
                            "minimum": 0,
                            "maximum": 100
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.Custom",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.Custom",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom>",
                            "description": "",
                            "enum": [
                              "custom"
                            ]
                          },
                          {
                            "name": "cost_language_string",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      }
                    ],
                    "schema": []
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/ShippingMethod",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Update Pricing by Price List
[path] Untitled/Pricing API Docs/Pricing/

{
  "id": "GSE89Ac-xgZs-Usp2W7av",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "/api/v1/price-lists/{slug}/pricing",
    "servers": [],
    "name": "Update Pricing by Price List",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "slug",
          "type": "string",
          "description": "Price List Slug"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "array",
          "description": "<p>List of sku, quantity and price to update. Partial  updates are supported, meaning only the SKUs present will be  affected. For the given SKUs, existing prices are deleted then  the supplied prices are inserted. If SKU is provided but quantity  and price are blank, all prices for that SKU are removed from the  price list.</p>",
          "schema": [
            {
              "name": "sku",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "SKU-1",
              "maxLength": 128
            },
            {
              "name": "display_tax_rate",
              "kind": "optional",
              "type": "number",
              "nullable": true,
              "description": "<p>Tax rate used only to display a tax-inclusive price, expressed as a whole percentage (10 means 10%). Stored prices remain net and the eCommerce platform remains authoritative for the tax actually charged at checkout.\nOn an update the field has three states: omit it to leave any stored rate unchanged (so a price-only sync never disturbs it), send null to clear it, or send a value to set it.</p>",
              "example": 10,
              "modelRef": "#/components/schemas/DisplayTaxRate",
              "customType": "DisplayTaxRate",
              "schema": []
            },
            {
              "name": "pricing",
              "kind": "required",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "quantity",
                  "kind": "required",
                  "type": "integer",
                  "description": "The quantity at which the specified price is applicable. This allows for quantity discount pricing to be set up.",
                  "example": 1,
                  "default": 1,
                  "minimum": 1
                },
                {
                  "name": "price",
                  "kind": "required",
                  "type": "number<float>",
                  "description": "",
                  "example": 10.49,
                  "format": "float"
                },
                {
                  "name": "unit_of_measure",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "<p>The unit of measure associated with this quantity. When specifying a unit of measure, it must match the pattern. To remove any value set, either omit the property or set the value as null.</p>",
                  "example": "pallet",
                  "pattern": "^[a-zA-Z0-9-]+$"
                }
              ]
            }
          ],
          "itemType": "object",
          "customType": "object[]",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "Validation errors",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "PriceUpdateError[]",
            "schema": [
              {
                "name": "line",
                "kind": "optional",
                "type": "integer",
                "description": "line of input which the error relates to"
              },
              {
                "name": "field",
                "kind": "optional",
                "type": "string",
                "description": "field which the error relates to"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "human readable description of error"
              }
            ],
            "modelRef": "#/components/schemas/PriceUpdateError",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Price list not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] API Authentication
[path] /

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/qJUGdWVJDNdrmdBMYuIB6-20260922-084854.jpg)

Authentication with SparkLayer works by creating an OAuth client credential for the environment within the SparkLayer Dashboard and authenticating with an OAuth2 flow. This ensures that every user that uses the application gets assigned an individualised token.

### Environment Domain

Depending on the environment you're accessing, the domain denotes the environment you are using:

| Area | Domain                           |
| ---- | -------------------------------- |
| Live | `https://app.sparklayer.io`      |
| Test | `https://test.app.sparklayer.io` |

### Retrieving an access token

:::hint{type="info"}
**Please note:**
You can retreive the Client ID and Secret from the [SparkLayer Dashboard](https://app.sparklayer.io/configuration/api)
:::

You can create a `POST` request to the `/api/auth/token` using the domain above. It must have a header of `Content-type=application/json` and the `Site-Id` provided from the dashboard when creating an API key.

:::hint{type="info"}
**Please note:**
It's recommended to set the `User-Agent` to help us debug any issues you may encounter.
:::

```json
{
  "grant_type": "client_credentials",
  "client_id": "c466d1fb-1af1-4437-a25c-03e8f94814bf",
  "client_secret": "7zA5ltJNkiI2WzhU90fTmYJANRcXYJPXsB8SnIEM3x37B2genuwqyv5tVdfLkUWV"
}
```

If the details are correct you will recieve the below:

```json
{
  "token_type": "Bearer",
  "expires_in": 3600,
  "access_token": "7zA5ltJNkiI2WzhU90fTmYJANRcXYJPXsB8SnIEM3x37B2genuwqyv5tVdfLkUWV"
}
```

To use the `access_token` that you retrieved, you will need to send it as a header with all of your requests. The header should look like this:

| Item          | Details                                                                 |
| ------------- | ----------------------------------------------------------------------- |
| Authorization | Bearer 7zA5ltJNkiI2WzhU90fTmYJANRcXYJPXsB8SnIEM3x37B2genuwqyv5tVdfLkUWV |

:::hint{type="info"}
**Please note:**
Make sure to replace `7zA5ltJNkiI2WzhU90fTmYJANRcXYJPXsB8SnIEM3x37B2genuwqyv5tVdfLkUWV` with your actual `access_token`. Once the token expires it is no longer valid.
:::

### Example Auth Request:

```javascript
POST /api/auth/token HTTP/1.1
Site-Id: exampleclient
Content-Type: application/json
Host: app.sparklayer.io
User-Agent: exampleclient

{
  "grant_type": "client_credentials",
  "client_id": "c466d1fb-1af1-4437-a25c-03e8f94814bf",
  "client_secret": "7zA5ltJNkiI2WzhU90fTmYJANRcXYJPXsB8SnIEM3x37B2genuwqyv5tVdfLkUWV"
}
```

### Example Auth Response:

```javascript
HTTP/1.1 200 OK
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: authorization, content-type, site-id
Access-Control-Max-Age: 7200
Access-Control-Allow-Methods: GET, POST, PUT, DELETE

{"token_type":"Bearer","expires_in":3600,"access_token":"7zA5ltJNkiI2WzhU90fTmYJANRcXYJPXsB8SnIEM3x37B2genuwqyv5tVdfLkUWV"}
```

### Example API Request:

```javascript
GET /api/v1/price-lists HTTP/1.1
Site-Id: exampleclient
Content-Type: application/json
Host: app.sparklayer.io
User-Agent: exampleclient
Authorization: Bearer 7zA5ltJNkiI2WzhU90fTmYJANRcXYJPXsB8SnIEM3x37B2genuwqyv5tVdfLkUWV
```

### Example API Response:

```javascript
HTTP/1.1 200 OK
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: authorization, content-type, site-id
Access-Control-Max-Age: 7200
Access-Control-Allow-Methods: GET, POST, PUT, DELETE

[]
```

[title] Files API
[path] /

Our files API is designed to store and retrieve any files in our system. For example, we use this for order file attachments.

You can use this API to retrieve the files attached to your orders. More details later

## Technical details

Important note: the URLs returned by the API to download/upload files have a expiry time of 15 minutes.

### Uploading a File

To create a file, use the `POST` endpoint `/api/v1/files`. This takes a file path in the body, and will return a URL, some headers and some other information. You can then upload a file to this URL, using the headers provided. You ***must*** include these headers, or the file upload will fail.

For example, to upload the file using cURL:

```bash
curl --upload-file '<file-name>' -H 'header 1' -H 'header 2' '<upload-url>'
```

This endpoint will also return an ID for the file, which can be used for the other endpoints.

You can update the file by using the `PATCH` endpoint `/api/v1/files/{id}`, using the ID returned when creating the file.

### Downloading a File

To download a file, use the `GET` endpoint `/api/v1/files/{id}`. When the file upload has successfully completed, this will return a download URL, along with some file metadata. As with the upload endpoint, it will return a list of headers you must include.

You can then download the file from the provided URL.

### Failed Uploads

If the mime type of the file you upload does not match the file extension, the file will be deleted, and the `GET` endpoint `/api/v1/files/{id}` will return a 410 GONE status code.

### Downloading Order File Attachments

If you would like to download any files attached to one of your B2B orders, you can use the `GET` endpoint `/api/v1/files/{id}`. We store the IDs of attached files in the note attributes of the order, under the name you provide in your `checkoutCustomElements` in your theme (by default this is `file-upload`). They are stored as a JSON array like the following:

```json
[
  "gid://sparklayer/File/fdc70d92-fcdf-4719-af2b-9d319a5035d2",
  "gid://sparklayer/File/a7a3ee08-c6d0-49ee-89b4-bcdaf780d553",
  "gid://sparklayer/File/15be5381-0b50-459f-9643-af236b9f29f7"
]
```

You must extract the UUIDs from these GID strings, removing the `gid://sparklayer/File` prefix. This is what the UUID should look like: `fdc70d92-fcdf-4719-af2b-9d319a5035d2`

[title] Get Price Lists
[path] Untitled/Pricing API Docs/Price Lists/

{
  "id": "-VGyk35s3QEst6zHalYD3",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v2/price-lists",
    "servers": [],
    "name": "Get Price Lists",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "page",
          "type": "integer",
          "description": "The page of results to fetch",
          "default": 1,
          "minimum": 1
        },
        {
          "kind": "optional",
          "name": "page_size",
          "type": "integer",
          "description": "Number of records per page",
          "default": 100,
          "minimum": 1,
          "maximum": 250
        },
        {
          "kind": "optional",
          "name": "order_by",
          "type": "string",
          "description": "Field to order the search results by",
          "default": "name:asc",
          "pattern": "^(name|created_at|updated_at):(asc|desc)$"
        },
        {
          "kind": "optional",
          "name": "source",
          "type": "array",
          "description": "",
          "default": [
            "custom",
            "integration",
            "platform"
          ],
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/PriceList",
                "customType": "PriceList",
                "schema": [
                  {
                    "name": "slug",
                    "kind": "optional",
                    "type": "string",
                    "description": "Slug",
                    "example": "base-list",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Name",
                    "example": "Base Price List",
                    "modelRef": "#/components/schemas/PriceListNameParam",
                    "customType": "PriceListNameParam",
                    "schema": []
                  },
                  {
                    "name": "currency_code",
                    "kind": "optional",
                    "type": "string",
                    "description": "ISO 4217 currency code",
                    "example": "GBP",
                    "modelRef": "#/components/schemas/PriceListCurrency",
                    "customType": "PriceListCurrency",
                    "schema": []
                  },
                  {
                    "name": "source",
                    "kind": "optional",
                    "type": "string<custom | platform | integration>",
                    "description": "<p>Integration should be used by external parties, custom is provided to any price lists setup in the dashboard and platform is reserved for the eCommerce platform.</p>",
                    "example": "custom",
                    "default": "custom",
                    "enum": [
                      "custom",
                      "platform",
                      "integration"
                    ]
                  },
                  {
                    "name": "tax_inclusive_display",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "<p>When true, storefronts display prices on this price list inclusive of the per-SKU display_tax_rate, labelled as tax inclusive. This changes presentation only - prices are still stored and transacted net. SKUs on the list with no rate, or a rate of 0, display their net price and are still labelled tax inclusive.</p>",
                    "example": false,
                    "default": false
                  },
                  {
                    "name": "rules",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "modelRef": "#/components/schemas/PriceListRulesParam",
                    "customType": "PriceListRulesParam",
                    "schema": [
                      {
                        "name": "source_price_list_slug",
                        "kind": "optional",
                        "type": "string",
                        "description": "Source PriceList slug",
                        "example": "base-list",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      {
                        "name": "adjustment_percentage",
                        "kind": "optional",
                        "type": "number",
                        "description": "<p>Adjustment percent expressed as a decimal fraction between 0 and 1 - E.g. 15% should be set as 0.15</p>",
                        "example": 0.103333,
                        "minimum": 0,
                        "maximum": 1
                      },
                      {
                        "name": "adjustment_direction",
                        "kind": "optional",
                        "type": "string<plus | minus>",
                        "description": "<p>Adjustment direction (plus, minus)</p>",
                        "example": "plus",
                        "enum": [
                          "plus",
                          "minus"
                        ]
                      },
                      {
                        "name": "currency_exchange_rate",
                        "kind": "optional",
                        "type": "number",
                        "nullable": true,
                        "description": "<p>Exchange rate between the currency of the source price list and the price list to which this rule belongs. If null, the rate will be  determined automatically based on current market rates.</p>",
                        "example": 1.254324,
                        "minimum": 0.000001
                      }
                    ]
                  }
                ]
              },
              {
                "name": "pagination",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/Pagination",
                "customType": "Pagination",
                "schema": [
                  {
                    "name": "total",
                    "kind": "optional",
                    "type": "integer",
                    "description": "The total number of available records"
                  },
                  {
                    "name": "per_page",
                    "kind": "optional",
                    "type": "integer",
                    "description": "The number of records returned per page"
                  },
                  {
                    "name": "current_page",
                    "kind": "optional",
                    "type": "integer",
                    "description": "The current page of results returned"
                  },
                  {
                    "name": "total_pages",
                    "kind": "optional",
                    "type": "integer",
                    "description": "the total number of available pages"
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Query files by metadata
[path] Untitled/Files API Docs/Files/

{
  "id": "IC_N75zEdu2QwtrW9w_Sa",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/v1/search-files",
    "servers": [],
    "name": "Query files by metadata",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "metadata",
              "kind": "required",
              "type": "",
              "nullable": true,
              "description": "<p>Returns all files who's metadata contains this JSON. See: <a href=\"https://www.postgresql.org/docs/current/datatype-json.html#JSON-CONTAINMENT\" target=\"_blank\">https://www.postgresql.org/docs/current/datatype-json.html#JSON-CONTAINMENT</a></p>",
              "example": "{\"sparklayer\":{\"forms\":{\"context\":\"email_template\"}}}"
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "schema": [
              {
                "name": "file_handle",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "",
                "modelRef": "#/components/schemas/FileHandle",
                "customType": "FileHandle",
                "schema": [
                  {
                    "name": "file_path",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "<p>The path to the file, including the file name</p>",
                    "example": "folder/file.png"
                  },
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "The ID of this type",
                    "example": "86027e2c-e853-11ee-b1d4-7c214a6ed8c7"
                  },
                  {
                    "name": "url",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "nullable": true,
                    "description": "<p>URL to download/upload the file. For GET, this will be a readable link. If the file is not ready, this will be <code>null</code>. For POST/PATCH this will be a writeable link</p>",
                    "example": "https://files.sparklayer.io/siteId/siteEnv/path/to/file.png."
                  },
                  {
                    "name": "required_headers",
                    "kind": "optional",
                    "type": "array",
                    "readOnly": true,
                    "description": "<p>An array of headers you must include in the file upload/download request</p>",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "optional",
                        "type": "string",
                        "readOnly": true,
                        "description": "Name of the header",
                        "example": "Content-Type"
                      },
                      {
                        "name": "value",
                        "kind": "optional",
                        "type": "string",
                        "readOnly": true,
                        "description": "Value of the header",
                        "example": "application/pdf"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "ready",
                "kind": "optional",
                "type": "boolean",
                "readOnly": true,
                "description": "Whether the file has been fully uploaded and verified",
                "example": true
              },
              {
                "name": "mime_type",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "The mime type of this file",
                "example": "image/png"
              },
              {
                "name": "file_size",
                "kind": "optional",
                "type": "integer",
                "readOnly": true,
                "description": "The size of this file in bytes",
                "example": 255
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "<p>The date at which the file was created (RFC-3339)</p>",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "<p>The date at which the file was updated (RFC-3339)</p>",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "metadata",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "",
                "example": "{\"sparklayer\":{\"forms\":{\"context\":\"email_template\",\"step_id\":\"erkjs\"},\"emails\":{\"attachments\":[\"86027e2c-e853-11ee-b1d4-7c214a6ed8c7\"]}}}",
                "schema": []
              },
              {
                "name": "rejected",
                "kind": "optional",
                "type": "boolean",
                "description": ""
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get Customer Specific Pricing
[path] Untitled/Core API Docs/Customers/

{
  "id": "pmVrKvAoOEtg1fOTjDicq",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.sparklayer.io/api/v1/fetch-customer-pricing",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/fetch-customer-pricing",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/fetch-customer-pricing",
        "description": "Test"
      }
    ],
    "name": "Get Customer Specific Pricing",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "application/problem+json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "example": "{\"customer_id\":\"123e4567-e89b-12d3-a456-426614174000\",\"customer_lookup_by\":\"sparklayer\",\"line_items\":[{\"sku\":\"WIDGET-RED-M\",\"quantity\":10},{\"sku\":\"WIDGET-BLUE-L\",\"quantity\":25}]}",
          "description": "",
          "schema": [
            {
              "name": "customer_id",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            },
            {
              "name": "customer_lookup_by",
              "kind": "required",
              "type": "string",
              "description": "",
              "modelRef": "#/components/schemas/CustomerLookupBy",
              "customType": "CustomerLookupBy",
              "schema": []
            },
            {
              "name": "line_items",
              "kind": "required",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "sku",
                  "kind": "required",
                  "type": "string",
                  "description": "SKU",
                  "example": "WIDGET-RED-M",
                  "minLength": 1,
                  "maxLength": 128
                },
                {
                  "name": "quantity",
                  "kind": "required",
                  "type": "integer",
                  "description": "",
                  "example": 10,
                  "minimum": 1
                }
              ]
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>Successful response — all line items resolved pricing</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"line_items\":[{\"sku\":\"WIDGET-RED-M\",\"quantity\":10,\"error\":null,\"currency_code\":\"USD\",\"unit_price\":{\"net\":\"8.500000\"},\"line_total\":{\"net\":\"85.000000\"},\"quantity_price_breaks\":[{\"min_quantity\":1,\"price\":{\"net\":\"10.000000\"},\"unit_of_measure\":\"box\"},{\"min_quantity\":10,\"price\":{\"net\":\"8.500000\"},\"unit_of_measure\":\"box\"}]}]}",
            "description": "",
            "schema": [
              {
                "name": "line_items",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/LineItem",
                "customType": "LineItem[]",
                "schema": [
                  {
                    "name": "sku",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "quantity",
                    "kind": "optional",
                    "type": "integer",
                    "description": ""
                  },
                  {
                    "name": "error",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>Populated when pricing could not be determined for this SKU; null on success</p>"
                  },
                  {
                    "name": "currency_code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "USD"
                  },
                  {
                    "name": "unit_price",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "net",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      }
                    ]
                  },
                  {
                    "name": "line_total",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "net",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      }
                    ]
                  },
                  {
                    "name": "quantity_price_breaks",
                    "kind": "optional",
                    "type": "array",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "min_quantity",
                        "kind": "optional",
                        "type": "integer",
                        "description": ""
                      },
                      {
                        "name": "price",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "unit_of_measure",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "box"
                      }
                    ]
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "207",
        "description": "<p>Partial success — one or more line items could not be priced</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"line_items\":[{\"sku\":\"WIDGET-RED-M\",\"quantity\":10,\"error\":null,\"currency_code\":\"USD\",\"unit_price\":{\"net\":\"8.500000\"},\"line_total\":{\"net\":\"85.000000\"},\"quantity_price_breaks\":[{\"min_quantity\":1,\"price\":{\"net\":\"10.000000\"},\"unit_of_measure\":\"box\"}]},{\"sku\":\"WIDGET-BLUE-L\",\"quantity\":25,\"error\":\"Pricing not found for SKU 'WIDGET-BLUE-L'\",\"currency_code\":null,\"unit_price\":null,\"line_total\":null,\"quantity_price_breaks\":null}]}",
            "description": "",
            "schema": [
              {
                "name": "line_items",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/LineItem",
                "customType": "LineItem[]",
                "schema": [
                  {
                    "name": "sku",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "quantity",
                    "kind": "optional",
                    "type": "integer",
                    "description": ""
                  },
                  {
                    "name": "error",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>Populated when pricing could not be determined for this SKU; null on success</p>"
                  },
                  {
                    "name": "currency_code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "USD"
                  },
                  {
                    "name": "unit_price",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "net",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      }
                    ]
                  },
                  {
                    "name": "line_total",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "net",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      }
                    ]
                  },
                  {
                    "name": "quantity_price_breaks",
                    "kind": "optional",
                    "type": "array",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "min_quantity",
                        "kind": "optional",
                        "type": "integer",
                        "description": ""
                      },
                      {
                        "name": "price",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "unit_of_measure",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "box"
                      }
                    ]
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Validation error",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Core-api-stock.yaml
[path] Untitled/


[title] Get Pricing by Price List
[path] Untitled/Pricing API Docs/Pricing/

{
  "id": "DR-2Wt-zTJqx2RLixPKC7",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/price-lists/{slug}/pricing",
    "servers": [],
    "name": "Get Pricing by Price List",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "slug",
          "type": "string",
          "description": "Price List Slug"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "text/csv"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "Content-Disposition",
            "type": "string",
            "example": "attachment; filename=\"pricelist.csv\"",
            "description": "<p>Used only with <code>text/csv</code> responses</p>"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "schema": [
              {
                "name": "quantity",
                "kind": "optional",
                "type": "integer",
                "description": "The quantity at which the specified price is applicable. This allows for quantity discount pricing to be set up.",
                "example": 1,
                "default": 1,
                "minimum": 1
              },
              {
                "name": "price",
                "kind": "optional",
                "type": "number<float>",
                "description": "",
                "example": 10.49,
                "format": "float"
              },
              {
                "name": "unit_of_measure",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p>The unit of measure associated with this quantity. When specifying a unit of measure, it must match the pattern. To remove any value set, either omit the property or set the value as null.</p>",
                "example": "pallet",
                "pattern": "^[a-zA-Z0-9-]+$"
              },
              {
                "name": "display_tax_rate",
                "kind": "optional",
                "type": "number",
                "nullable": true,
                "description": "<p>Tax rate used only to display a tax-inclusive price, expressed as a whole percentage (10 means 10%). Stored prices remain net and the eCommerce platform remains authoritative for the tax actually charged at checkout.\nOn an update the field has three states: omit it to leave any stored rate unchanged (so a price-only sync never disturbs it), send null to clear it, or send a value to set it.</p>",
                "example": 10,
                "modelRef": "#/components/schemas/DisplayTaxRate",
                "customType": "DisplayTaxRate",
                "schema": []
              },
              {
                "name": "sku",
                "kind": "optional",
                "type": "string",
                "description": "",
                "example": "SKU-1",
                "maxLength": 128
              }
            ],
            "itemType": "object",
            "customType": "object[]",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "204",
        "description": "Empty Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Update a Shipping Method
[path] Untitled/Core API Docs/Shipping/

{
  "id": "xB3dOS72ir3_uFxla91jH",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://app.sparklayer.io/api/v1/shipping-methods/{id}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/shipping-methods/{id}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/shipping-methods/{id}",
        "description": "Test"
      }
    ],
    "name": "Update a Shipping Method",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "ShippingMethod",
          "schema": [
            {
              "name": "sku",
              "kind": "optional",
              "type": "string",
              "description": "Shipping SKU",
              "example": "SKU001",
              "maxLength": 50
            },
            {
              "name": "title",
              "kind": "optional",
              "type": "string",
              "description": "Shiping Method Name shown at checkout",
              "example": "Standard Shipping",
              "maxLength": 50
            },
            {
              "name": "priority",
              "kind": "optional",
              "type": "number",
              "description": "<p>Shown by order (lower first)</p>",
              "default": 0,
              "minimum": 0,
              "maximum": 127
            },
            {
              "name": "countries",
              "kind": "optional",
              "type": "array",
              "description": "<p>Countries covered by this shipping method (ISO 3166-1 alpha-2)</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "GB",
              "itemDefault": ""
            },
            {
              "name": "regions",
              "kind": "optional",
              "type": "map",
              "description": "<p>Regions covered by this shipping method (per country) Keys are country codes (ISO 3166-1 alpha-2) Values are lists of region codes. If the list is empty, all regions are allowed</p>",
              "example": "",
              "customType": "map<string, string[]>",
              "schema": []
            },
            {
              "name": "groups",
              "kind": "optional",
              "type": "array",
              "description": "<p>Customer groups covered by this shipping method (use default to cover all groups)</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "default",
              "itemDefault": ""
            },
            {
              "name": "bands",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "description": "Internal Band Name",
                  "example": "Band 1",
                  "maxLength": 50
                },
                {
                  "name": "priority",
                  "kind": "optional",
                  "type": "number",
                  "description": "<p>Filtered by first found by percentage_charge order (lower first)</p>",
                  "default": 0,
                  "minimum": 0,
                  "maximum": 127
                },
                {
                  "name": "sku",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "<p>Shipping SKU (Leave null to use the Shipping Method SKU)</p>",
                  "example": "ship_123",
                  "maxLength": 15
                },
                {
                  "name": "requirement",
                  "kind": "optional",
                  "type": "object",
                  "discriminator": {
                    "propertyName": "type",
                    "mapping": {
                      "weight": "#/components/schemas/ShippingMethod.Requirement.Weight",
                      "none": "#/components/schemas/ShippingMethod.Requirement.None",
                      "net_total": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                      "gross_total": "#/components/schemas/ShippingMethod.Requirement.GrossTotal"
                    }
                  },
                  "description": "",
                  "complexType": "oneOf",
                  "complexItems": [
                    {
                      "name": "ShippingMethod.Requirement.Weight",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Requirement.Weight",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<weight>",
                          "description": "",
                          "enum": [
                            "weight"
                          ]
                        },
                        {
                          "name": "min",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        },
                        {
                          "name": "max",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Requirement.GrossTotal",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Requirement.GrossTotal",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<gross_total>",
                          "description": "",
                          "enum": [
                            "gross_total"
                          ]
                        },
                        {
                          "name": "min_total",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        },
                        {
                          "name": "max_total",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Requirement.NetTotal",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<net_total>",
                          "description": "",
                          "enum": [
                            "net_total"
                          ]
                        },
                        {
                          "name": "min",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        },
                        {
                          "name": "max",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Requirement.None",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Requirement.None",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<none>",
                          "description": "",
                          "enum": [
                            "none"
                          ]
                        }
                      ]
                    }
                  ],
                  "schema": []
                },
                {
                  "name": "cost",
                  "kind": "optional",
                  "type": "object",
                  "discriminator": {
                    "propertyName": "type",
                    "mapping": {
                      "free": "#/components/schemas/ShippingMethod.Cost.Free",
                      "fixed_price": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                      "percent_net_total": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                      "custom": "#/components/schemas/ShippingMethod.Cost.Custom"
                    }
                  },
                  "description": "",
                  "complexType": "oneOf",
                  "complexItems": [
                    {
                      "name": "ShippingMethod.Cost.Free",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Cost.Free",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<free>",
                          "description": "",
                          "enum": [
                            "free"
                          ]
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Cost.FixedCost",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<fixed_price>",
                          "description": "",
                          "enum": [
                            "fixed_price"
                          ]
                        },
                        {
                          "name": "price",
                          "kind": "optional",
                          "type": "number",
                          "description": ""
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Cost.PercentNetTotal",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<percent_net_total>",
                          "description": "",
                          "enum": [
                            "percent_net_total"
                          ]
                        },
                        {
                          "name": "percentage_charge",
                          "kind": "optional",
                          "type": "number<float>",
                          "description": "",
                          "format": "float",
                          "minimum": 0,
                          "maximum": 100
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Cost.Custom",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Cost.Custom",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<custom>",
                          "description": "",
                          "enum": [
                            "custom"
                          ]
                        },
                        {
                          "name": "cost_language_string",
                          "kind": "optional",
                          "type": "string",
                          "description": ""
                        }
                      ]
                    }
                  ],
                  "schema": []
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/ShippingMethod",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ShippingMethod",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "<p>Shipping Method ID (always prefixed with sm_)</p>",
                "example": "sm_123",
                "maxLength": 15
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Created At",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Updated At",
                "format": "date-time"
              },
              {
                "name": "sku",
                "kind": "optional",
                "type": "string",
                "description": "Shipping SKU",
                "example": "SKU001",
                "maxLength": 50
              },
              {
                "name": "title",
                "kind": "optional",
                "type": "string",
                "description": "Shiping Method Name shown at checkout",
                "example": "Standard Shipping",
                "maxLength": 50
              },
              {
                "name": "priority",
                "kind": "optional",
                "type": "number",
                "description": "<p>Shown by order (lower first)</p>",
                "default": 0,
                "minimum": 0,
                "maximum": 127
              },
              {
                "name": "countries",
                "kind": "optional",
                "type": "array",
                "description": "<p>Countries covered by this shipping method (ISO 3166-1 alpha-2)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "GB",
                "itemDefault": ""
              },
              {
                "name": "regions",
                "kind": "optional",
                "type": "map",
                "description": "<p>Regions covered by this shipping method (per country) Keys are country codes (ISO 3166-1 alpha-2) Values are lists of region codes. If the list is empty, all regions are allowed</p>",
                "example": "",
                "customType": "map<string, string[]>",
                "schema": []
              },
              {
                "name": "groups",
                "kind": "optional",
                "type": "array",
                "description": "<p>Customer groups covered by this shipping method (use default to cover all groups)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "bands",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Internal Band Name",
                    "example": "Band 1",
                    "maxLength": 50
                  },
                  {
                    "name": "priority",
                    "kind": "optional",
                    "type": "number",
                    "description": "<p>Filtered by first found by percentage_charge order (lower first)</p>",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 127
                  },
                  {
                    "name": "sku",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>Shipping SKU (Leave null to use the Shipping Method SKU)</p>",
                    "example": "ship_123",
                    "maxLength": 15
                  },
                  {
                    "name": "requirement",
                    "kind": "optional",
                    "type": "object",
                    "discriminator": {
                      "propertyName": "type",
                      "mapping": {
                        "weight": "#/components/schemas/ShippingMethod.Requirement.Weight",
                        "none": "#/components/schemas/ShippingMethod.Requirement.None",
                        "net_total": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                        "gross_total": "#/components/schemas/ShippingMethod.Requirement.GrossTotal"
                      }
                    },
                    "description": "",
                    "complexType": "oneOf",
                    "complexItems": [
                      {
                        "name": "ShippingMethod.Requirement.Weight",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.Weight",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<weight>",
                            "description": "",
                            "enum": [
                              "weight"
                            ]
                          },
                          {
                            "name": "min",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.GrossTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.GrossTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<gross_total>",
                            "description": "",
                            "enum": [
                              "gross_total"
                            ]
                          },
                          {
                            "name": "min_total",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max_total",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.NetTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<net_total>",
                            "description": "",
                            "enum": [
                              "net_total"
                            ]
                          },
                          {
                            "name": "min",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.None",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.None",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<none>",
                            "description": "",
                            "enum": [
                              "none"
                            ]
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "cost",
                    "kind": "optional",
                    "type": "object",
                    "discriminator": {
                      "propertyName": "type",
                      "mapping": {
                        "free": "#/components/schemas/ShippingMethod.Cost.Free",
                        "fixed_price": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                        "percent_net_total": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                        "custom": "#/components/schemas/ShippingMethod.Cost.Custom"
                      }
                    },
                    "description": "",
                    "complexType": "oneOf",
                    "complexItems": [
                      {
                        "name": "ShippingMethod.Cost.Free",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.Free",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<free>",
                            "description": "",
                            "enum": [
                              "free"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.FixedCost",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<fixed_price>",
                            "description": "",
                            "enum": [
                              "fixed_price"
                            ]
                          },
                          {
                            "name": "price",
                            "kind": "optional",
                            "type": "number",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.PercentNetTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<percent_net_total>",
                            "description": "",
                            "enum": [
                              "percent_net_total"
                            ]
                          },
                          {
                            "name": "percentage_charge",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float",
                            "minimum": 0,
                            "maximum": 100
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.Custom",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.Custom",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom>",
                            "description": "",
                            "enum": [
                              "custom"
                            ]
                          },
                          {
                            "name": "cost_language_string",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      }
                    ],
                    "schema": []
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/ShippingMethod",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] List of Discounts
[path] Untitled/Core API Docs/Discounts/

{
  "id": "teYUYxeln-UtjqjtjY82K",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.sparklayer.io/api/v1/discounts",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/discounts",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/discounts",
        "description": "Test"
      }
    ],
    "name": "List of Discounts",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "Discount[]",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "description": "<p>Discount ID (uuid)</p>",
                "example": "942651af-f950-4716-9916-16170fe0645f",
                "format": "uuid"
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "deleted_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "nullable": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "A user friendly name for the discount",
                "maxLength": 256
              },
              {
                "name": "internal_name",
                "kind": "required",
                "type": "string",
                "description": "",
                "maxLength": 45
              },
              {
                "name": "internal_slug",
                "kind": "required",
                "type": "string",
                "description": "",
                "maxLength": 45
              },
              {
                "name": "template",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p>Discount template type. If not null allowed values are - 'order_level_get_amount_off', 'order_level_get_free_product', 'product_level_get_amount_off', 'order_level_get_shipping_reward', 'advanced_order_level_get_amount_off', 'order_level_requirement_amount_off', 'advanced_discount', 'advanced_free_products'</p>"
              },
              {
                "name": "calculation_group",
                "kind": "required",
                "type": "number",
                "description": "<p>Dependency level = Calculation Group. All discounts with the same dependency level will share the same base, pre-discount totals. E.g. discount A (50% off) and discount B (50% off) will reward 100% off - not 75% off.</p>",
                "minimum": 0,
                "maximum": 127
              },
              {
                "name": "priority",
                "kind": "required",
                "type": "number",
                "description": "<p>The sequence to apply the discounts (within each discount 'dependency level')</p>",
                "minimum": 0,
                "maximum": 10000
              },
              {
                "name": "times_applicable_per_order",
                "kind": "required",
                "type": "number",
                "description": "<p>Per order application limits. If -1 allow unlimited applications, otherwise limited</p>",
                "minimum": -1,
                "maximum": 127
              },
              {
                "name": "max_rewards",
                "kind": "optional",
                "type": "number",
                "nullable": true,
                "description": "Used when rewardSelectionType is cheapest or expensive to determine the number of rewards available",
                "default": 1,
                "minimum": 1,
                "maximum": 127
              },
              {
                "name": "groups",
                "kind": "required",
                "type": "array",
                "description": "<p>Customer groups covered by this discount (use default to cover all groups)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "excluded_customers",
                "kind": "optional",
                "type": "array",
                "description": "Array of email address or accounting ids of customers to exclude from the discount",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "customer@b2b.com",
                "itemDefault": ""
              },
              {
                "name": "simultaneity",
                "kind": "optional",
                "type": "array",
                "nullable": true,
                "description": "<p>Other discounts which can be applied simultaneous, if null no limitation</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "requirement_selection_type",
                "kind": "required",
                "type": "string<any | all>",
                "description": "Products which must be in the cart must match all or any one of the combo groups",
                "enum": [
                  "any",
                  "all"
                ]
              },
              {
                "name": "reward_selection_type",
                "kind": "required",
                "type": "string<all | cheapest | expensive>",
                "description": "",
                "enum": [
                  "all",
                  "cheapest",
                  "expensive"
                ]
              },
              {
                "name": "currency_code",
                "kind": "required",
                "type": "string",
                "nullable": true,
                "description": "",
                "example": "gbp",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "start_date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "Start Date",
                "format": "date-time"
              },
              {
                "name": "end_date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "End Date",
                "format": "date-time"
              },
              {
                "name": "active",
                "kind": "required",
                "type": "boolean",
                "description": ""
              },
              {
                "name": "requirements",
                "kind": "required",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.Requirement",
                "customType": "Discount.Requirement[]",
                "schema": [
                  {
                    "name": "items",
                    "kind": "required",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "restrictions",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<productSKU | excludeProductSKU | productSKUContains | excludeProductSKUContains | productMetadata | excludeProductMetadata>",
                            "description": "",
                            "enum": [
                              "productSKU",
                              "excludeProductSKU",
                              "productSKUContains",
                              "excludeProductSKUContains",
                              "productMetadata",
                              "excludeProductMetadata"
                            ]
                          },
                          {
                            "name": "ref",
                            "kind": "required",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "metadata_namespace",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "erp",
                            "maxLength": 256
                          },
                          {
                            "name": "metadata_key",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "vendor",
                            "maxLength": 128
                          }
                        ]
                      },
                      {
                        "name": "points_type",
                        "kind": "required",
                        "type": "string<line | item>",
                        "description": "<p>Add X point(s) for each matching product OR Add X point(s) for once only</p>",
                        "enum": [
                          "line",
                          "item"
                        ]
                      },
                      {
                        "name": "points",
                        "kind": "required",
                        "type": "integer",
                        "description": "",
                        "default": 1
                      },
                      {
                        "name": "quantity",
                        "kind": "required",
                        "type": "integer",
                        "description": ""
                      },
                      {
                        "name": "selection_type",
                        "kind": "required",
                        "type": "string<minimum | exact>",
                        "description": "<p>At least X quantity of product(s) must match OR Exactly X quantity of product(s)</p>",
                        "enum": [
                          "minimum",
                          "exact"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "max_rewards",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "Limit the number of rewards when this requirement applies"
                  },
                  {
                    "name": "min_spend",
                    "kind": "required",
                    "type": "number",
                    "nullable": true,
                    "description": "<p>The cart must contain between min_spend and max_spend based on spend_tax_type of the requirement.</p>"
                  },
                  {
                    "name": "max_spend",
                    "kind": "required",
                    "type": "number",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "spend_tax_type",
                    "kind": "required",
                    "type": "string<net>",
                    "description": "",
                    "enum": [
                      "net"
                    ]
                  },
                  {
                    "name": "selection_type",
                    "kind": "required",
                    "type": "string<minimum | all>",
                    "description": "<p>Apply only if 'all' items matched in the cart OR if cart worth minimum of min_points requirement items(s) using requirements</p>",
                    "enum": [
                      "minimum",
                      "all"
                    ]
                  },
                  {
                    "name": "min_points",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "<p>Only applies when selection_type is minimum</p>"
                  }
                ]
              },
              {
                "name": "rewards",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.Reward",
                "customType": "Discount.Reward[]",
                "schema": [
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string<requirements|all | requirements|cheapest | cart|productSKU | cart|cheapestProductSKU | cart|productMetadata | cart|cheapestProductMetadata | product | shipping | order>",
                    "description": "",
                    "enum": [
                      "requirements|all",
                      "requirements|cheapest",
                      "cart|productSKU",
                      "cart|cheapestProductSKU",
                      "cart|productMetadata",
                      "cart|cheapestProductMetadata",
                      "product",
                      "shipping",
                      "order"
                    ]
                  },
                  {
                    "name": "amount_type",
                    "kind": "required",
                    "type": "string<percent | percentPreDiscount | priceAllGross | priceAllNet | priceLineGross | priceLineNet | fixedAllGross | fixedAllNet | fixedLineGross | fixedLineNet | none>",
                    "description": "",
                    "enum": [
                      "percent",
                      "percentPreDiscount",
                      "priceAllGross",
                      "priceAllNet",
                      "priceLineGross",
                      "priceLineNet",
                      "fixedAllGross",
                      "fixedAllNet",
                      "fixedLineGross",
                      "fixedLineNet",
                      "none"
                    ]
                  },
                  {
                    "name": "restriction_type",
                    "kind": "optional",
                    "type": "string<equals | notEquals | contains | notContains>",
                    "description": "",
                    "enum": [
                      "equals",
                      "notEquals",
                      "contains",
                      "notContains"
                    ]
                  },
                  {
                    "name": "item_id",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "maxLength": 100
                  },
                  {
                    "name": "metadata_namespace",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "erp",
                    "maxLength": 256
                  },
                  {
                    "name": "metadata_key",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "vendor",
                    "maxLength": 128
                  },
                  {
                    "name": "amount",
                    "kind": "required",
                    "type": "number",
                    "description": "",
                    "maximum": 1000000000
                  }
                ]
              },
              {
                "name": "other_requirements",
                "kind": "required",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.OtherRequirements.MaxUsesPerCustomer",
                "customType": "Discount.OtherRequirements.MaxUsesPerCustomer[]",
                "schema": [
                  {
                    "name": "requirement_type",
                    "kind": "optional",
                    "type": "string<maxUsesPerCustomer>",
                    "description": "",
                    "enum": [
                      "maxUsesPerCustomer"
                    ]
                  },
                  {
                    "name": "number",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Discount",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Core-api-files.yaml
[path] Untitled/


[title] Get Purchases
[path] Untitled/Purchasing API Docs/Purchasing/

{
  "id": "cPdwDB_4eYoWcqo0gjmpS",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/purchases",
    "servers": [],
    "name": "Get Purchases",
    "description": "This endpoint is designed to list any purchase with the ability to easily filter",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID",
          "minLength": 1
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "limit",
          "type": "integer",
          "description": "Limit the number of results returned",
          "minimum": 1,
          "maximum": 500
        },
        {
          "kind": "optional",
          "name": "order_by",
          "type": "string",
          "description": "Order by",
          "enum": [
            "created_at",
            "updated_at",
            "placed_at",
            "calculated_submitted_at",
            "shipping_requested_date"
          ]
        },
        {
          "kind": "optional",
          "name": "customer_identifiers[sparklayer]",
          "type": "string",
          "description": "<p>Filter by customer_identifiers[sparklayer]. Accepts comma-separated values. Maximum total length of all values is 2000 characters.</p>",
          "minLength": 1,
          "maxLength": 2000
        },
        {
          "kind": "optional",
          "name": "customer_identifiers[sparklayer_impersonator]",
          "type": "string",
          "description": "<p>Filter by customer_identifiers[sparklayer_impersonator]. Accepts comma-separated values. Maximum total length of all values is 2000 characters.</p>",
          "minLength": 1,
          "maxLength": 2000
        },
        {
          "kind": "optional",
          "name": "customer_identifiers[sparklayer_sales_rep]",
          "type": "string",
          "description": "<p>Filter by customer_identifiers[sparklayer_sales_rep]. Accepts comma-separated values. Maximum total length of all values is 2000 characters.</p>",
          "minLength": 1,
          "maxLength": 2000
        },
        {
          "kind": "optional",
          "name": "customer_identifiers[sparklayer_impersonator_assignee]",
          "type": "string",
          "description": "<p>Filter by customer_identifiers[sparklayer_impersonator_assignee]. Accepts comma-separated values. Maximum total length of all values is 2000 characters. To get purchases that have no assignee, include a string value of 'NULL'.</p>",
          "minLength": 1,
          "maxLength": 2000
        },
        {
          "kind": "optional",
          "name": "company[id]",
          "type": "string",
          "description": "<p>Filter by company[id]. Accepts comma-separated values. Maximum total length of all values is 2000 characters. Use this rather than listing every section id to report on a whole company.</p>",
          "minLength": 1,
          "maxLength": 2000
        },
        {
          "kind": "optional",
          "name": "company[section_id]",
          "type": "string",
          "description": "<p>Filter by company[section_id]. Accepts comma-separated values. Maximum total length of all values is 2000 characters.</p>",
          "minLength": 1,
          "maxLength": 2000
        },
        {
          "kind": "optional",
          "name": "status",
          "type": "string",
          "example": "shipped",
          "description": "Filter by status",
          "enum": [
            "incoming",
            "processing",
            "shipped",
            "part_shipped",
            "cancelled",
            "returned",
            "part_returned",
            "varied"
          ]
        },
        {
          "kind": "optional",
          "name": "type",
          "type": "string",
          "example": "order",
          "description": "Filter by type",
          "enum": [
            "order",
            "quote",
            "cart",
            "awaiting_approval",
            "awaiting_merchant",
            "archived",
            "platform_archived",
            "pending_recurring_order"
          ]
        },
        {
          "kind": "optional",
          "name": "search",
          "type": "string",
          "example": "PO-12345",
          "description": "Search Term"
        },
        {
          "kind": "optional",
          "name": "dates[last_updated][lte]",
          "type": "string",
          "description": "<p>Filter by dates[last_updated][lte]</p>",
          "minLength": 1
        },
        {
          "kind": "optional",
          "name": "dates[last_updated][gte]",
          "type": "string",
          "description": "<p>Filter by dates[last_updated][gte]</p>",
          "minLength": 1
        },
        {
          "kind": "optional",
          "name": "dates[placed][lte]",
          "type": "string",
          "description": "<p>Filter by dates[placed][lte]</p>",
          "minLength": 1
        },
        {
          "kind": "optional",
          "name": "dates[placed][gte]",
          "type": "string",
          "description": "<p>Filter by dates[placed][gte]</p>",
          "minLength": 1
        },
        {
          "kind": "optional",
          "name": "dates[submitted][lte]",
          "type": "string",
          "description": "<p>Filter by dates[submitted][lte]</p>",
          "minLength": 1
        },
        {
          "kind": "optional",
          "name": "dates[submitted][gte]",
          "type": "string",
          "description": "<p>Filter by dates[submitted][gte]</p>",
          "minLength": 1
        },
        {
          "kind": "optional",
          "name": "dates[shipping_requested][lte]",
          "type": "string",
          "description": "<p>Filter by dates[shipping_requested][lte]</p>",
          "minLength": 1
        },
        {
          "kind": "optional",
          "name": "dates[shipping_requested][gte]",
          "type": "string",
          "description": "<p>Filter by dates[shipping_requested][gte]</p>",
          "minLength": 1
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "PurchaseBase[]",
            "schema": [
              {
                "name": "type",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "order",
                "modelRef": "#/components/schemas/PurchaseType",
                "customType": "PurchaseType",
                "schema": []
              },
              {
                "name": "purchase_identifiers",
                "kind": "required",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "sparklayer",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The identifier SparkLayer uses for the purchase. You will need to generate this if the purchase does not exist",
                    "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                    "format": "uuid",
                    "minLength": 1
                  },
                  {
                    "name": "platform",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>The identifier for the purchase on the e-commerce platform</p>",
                    "example": "123456789",
                    "minLength": 1
                  },
                  {
                    "name": "internal",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The identifier for the purchase on your system",
                    "minLength": 1
                  },
                  {
                    "name": "visible",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The identifier that will be shown to the customer in their recent orders",
                    "example": "B2B01123"
                  }
                ]
              },
              {
                "name": "customer_identifiers",
                "kind": "required",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "sparklayer",
                    "kind": "required",
                    "type": "string",
                    "nullable": false,
                    "description": "The ID of the customer that that order is for.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  },
                  {
                    "name": "sparklayer_impersonator",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the sales agent placing the order.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  },
                  {
                    "name": "sparklayer_impersonator_assignee",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the sales agent assigned to be responsible for the order.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  },
                  {
                    "name": "sparklayer_child",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the company user that placed the order.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  }
                ]
              },
              {
                "name": "company",
                "kind": "optional",
                "type": "object",
                "nullable": true,
                "description": "<p>Company sections are opt-in; omit this entirely for merchants that do not use them.</p>",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The ID of the company the purchase was placed for.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                    "format": "uuid"
                  },
                  {
                    "name": "section_id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The ID of the company section the purchase was placed for.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                    "format": "uuid"
                  },
                  {
                    "name": "section_name",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>The section name at the time of purchase, kept so historical purchases stay readable after a section is renamed or deleted. Not filterable.</p>",
                    "example": "Bristol",
                    "maxLength": 128
                  }
                ]
              },
              {
                "name": "payment_method",
                "kind": "optional",
                "type": "string<quote | upfrontPayment | paymentOnAccount | paymentByInvoice>",
                "nullable": true,
                "description": "<p>How the purchase was/will be paid for</p>",
                "enum": [
                  "quote",
                  "upfrontPayment",
                  "paymentOnAccount",
                  "paymentByInvoice"
                ]
              },
              {
                "name": "dates",
                "kind": "required",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "created_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>The date the purchase was created in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "updated_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>The date the purchase was last updated in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "placed_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date at which the purchase was placed - include user timezone or Z for UTC (RFC-3339)</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "to_be_placed_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date at which the purchase is due to be placed, for a purchase that is scheduled rather than placed immediately (RFC-3339). It can be changed while the purchase is still pending</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "calculated_submitted_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>The date the purchase was submitted (RFC-3339). This is when the cart is converted into another purchase type. This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "expires_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>the date at which the purchase will expire and become archived (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "payment_due_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "The date at which payment for the purchase is expected",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  }
                ]
              },
              {
                "name": "customer_reference",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Additional information that a customer adds to the order",
                "example": "Please deliver to the back of the store"
              },
              {
                "name": "po_number",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "PO number for the purchase",
                "example": "PO-001"
              },
              {
                "name": "shipping_requested_date",
                "kind": "optional",
                "type": "string<date-time>",
                "nullable": true,
                "description": "The date requested for the delivery to arrive",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "recurring_purchase",
                "kind": "optional",
                "type": "object",
                "nullable": true,
                "description": "Present only for a purchase created from a recurring purchase template. Both properties are stored when the purchase is created and ignored on any later update",
                "example": "",
                "schema": [
                  {
                    "name": "template_id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The recurring purchase template this purchase was created from. Set on creation and ignored on update",
                    "example": "0f8fad5b-d9cb-469f-a165-70867728950e",
                    "format": "uuid"
                  },
                  {
                    "name": "cancelled_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date the customer cancelled the purchase, after which it will not be placed (RFC-3339). Cancelling does not free the date - the template has already had its turn for it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "to_be_placed_at_initial",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date to_be_placed_at was first set to (RFC-3339). Set on creation and ignored on update, so that rescheduling cannot let the same template produce a second purchase for the same date</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  }
                ]
              },
              {
                "name": "currency_code",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "The 3 letter currency code used for the prices in the purchase",
                "example": "GBP",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "calculated_shipping_address",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "nullable": true,
                "description": "<p>A single string containing all the details of the shipping address. This is read only - it should not be sent to the API, but will be returned form it</p>",
                "example": "John Spark, SparkLayer, SparkLayer HQ, Example City, 12345"
              },
              {
                "name": "calculated_total",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "calculated_total_usd",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "calculated_total_base",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "calculated_fulfilment_status",
                "kind": "optional",
                "type": "string<incoming | processing | shipped | part_shipped | cancelled | returned | part_returned | varied>",
                "readOnly": true,
                "nullable": true,
                "description": "<p>The status of the order, calculated from the statuses of the individual packages. This is read only - it should not be sent to the API, but will be returned form it</p>",
                "example": "processing",
                "enum": [
                  "incoming",
                  "processing",
                  "shipped",
                  "part_shipped",
                  "cancelled",
                  "returned",
                  "part_returned",
                  "varied"
                ]
              },
              {
                "name": "quote",
                "kind": "optional",
                "type": "object",
                "nullable": true,
                "description": "Quote data",
                "example": "",
                "schema": [
                  {
                    "name": "status_slug",
                    "kind": "optional",
                    "type": "string",
                    "description": "The slug of the quote status applied to this quote"
                  },
                  {
                    "name": "status",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "QuoteStatus",
                        "description": "",
                        "modelRef": "#/components/schemas/QuoteStatus",
                        "schema": [
                          {
                            "name": "id",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "description": "",
                            "maxLength": 45
                          },
                          {
                            "name": "slug",
                            "kind": "optional",
                            "type": "string",
                            "description": "",
                            "maxLength": 45,
                            "pattern": "^[a-z0-9-]+$"
                          },
                          {
                            "name": "default",
                            "kind": "optional",
                            "type": "boolean",
                            "description": ""
                          },
                          {
                            "name": "next",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "maxLength": 45,
                            "pattern": "^[a-z0-9-]+$"
                          },
                          {
                            "name": "actions",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "string",
                            "customType": "string[]",
                            "itemExample": "",
                            "itemDefault": ""
                          },
                          {
                            "name": "created_at",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "description": "",
                            "format": "date-time"
                          },
                          {
                            "name": "updated_at",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "description": "",
                            "format": "date-time"
                          },
                          {
                            "name": "deleted_at",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "nullable": true,
                            "description": "",
                            "format": "date-time"
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "expiry",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date at which the quote is considered expired and no longer valid (RFC-3339)</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  }
                ]
              },
              {
                "name": "payment_status",
                "kind": "optional",
                "type": "string<unpaid | part_paid | paid>",
                "description": "That payment status of the order",
                "enum": [
                  "unpaid",
                  "part_paid",
                  "paid"
                ]
              },
              {
                "name": "total_paid",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/PurchaseBase",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get bulk files
[path] Untitled/Files API Docs/Files/

{
  "id": "D-cXPUwNrGvwcdLiDfCM2",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/files",
    "servers": [],
    "name": "Get bulk files",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "required",
          "name": "ids",
          "type": "array",
          "description": "IDs of the files to get",
          "format": "uuid",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "File",
            "schema": [
              {
                "name": "file_handle",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "",
                "modelRef": "#/components/schemas/FileHandle",
                "customType": "FileHandle",
                "schema": [
                  {
                    "name": "file_path",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "<p>The path to the file, including the file name</p>",
                    "example": "folder/file.png"
                  },
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "The ID of this type",
                    "example": "86027e2c-e853-11ee-b1d4-7c214a6ed8c7"
                  },
                  {
                    "name": "url",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "nullable": true,
                    "description": "<p>URL to download/upload the file. For GET, this will be a readable link. If the file is not ready, this will be <code>null</code>. For POST/PATCH this will be a writeable link</p>",
                    "example": "https://files.sparklayer.io/siteId/siteEnv/path/to/file.png."
                  },
                  {
                    "name": "required_headers",
                    "kind": "optional",
                    "type": "array",
                    "readOnly": true,
                    "description": "<p>An array of headers you must include in the file upload/download request</p>",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "optional",
                        "type": "string",
                        "readOnly": true,
                        "description": "Name of the header",
                        "example": "Content-Type"
                      },
                      {
                        "name": "value",
                        "kind": "optional",
                        "type": "string",
                        "readOnly": true,
                        "description": "Value of the header",
                        "example": "application/pdf"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "ready",
                "kind": "optional",
                "type": "boolean",
                "readOnly": true,
                "description": "Whether the file has been fully uploaded and verified",
                "example": true
              },
              {
                "name": "mime_type",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "The mime type of this file",
                "example": "image/png"
              },
              {
                "name": "file_size",
                "kind": "optional",
                "type": "integer",
                "readOnly": true,
                "description": "The size of this file in bytes",
                "example": 255
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "<p>The date at which the file was created (RFC-3339)</p>",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "<p>The date at which the file was updated (RFC-3339)</p>",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "metadata",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "",
                "example": "{\"sparklayer\":{\"forms\":{\"context\":\"email_template\",\"step_id\":\"erkjs\"},\"emails\":{\"attachments\":[\"86027e2c-e853-11ee-b1d4-7c214a6ed8c7\"]}}}",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/File",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get Pricing by SKU
[path] Untitled/Pricing API Docs/Pricing/

{
  "id": "ultT552Vr-wzHJyhV4ICc",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/pricing/{sku}",
    "servers": [],
    "name": "Get Pricing by SKU",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "sku",
          "type": "string",
          "description": "<p>Variant SKU (URL encoding to be used)</p>"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "VariantPricing[]",
            "schema": [
              {
                "name": "price_list_slug",
                "kind": "required",
                "type": "string",
                "description": "Price List Slug",
                "example": "base-list"
              },
              {
                "name": "display_tax_rate",
                "kind": "optional",
                "type": "number",
                "nullable": true,
                "description": "<p>Tax rate used only to display a tax-inclusive price, expressed as a whole percentage (10 means 10%). Stored prices remain net and the eCommerce platform remains authoritative for the tax actually charged at checkout.\nOn an update the field has three states: omit it to leave any stored rate unchanged (so a price-only sync never disturbs it), send null to clear it, or send a value to set it.</p>",
                "example": 10,
                "modelRef": "#/components/schemas/DisplayTaxRate",
                "customType": "DisplayTaxRate",
                "schema": []
              },
              {
                "name": "pricing",
                "kind": "required",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "quantity",
                    "kind": "optional",
                    "type": "integer",
                    "description": "The quantity at which the specified price is applicable. This allows for quantity discount pricing to be set up.",
                    "example": 1,
                    "default": 1,
                    "minimum": 1
                  },
                  {
                    "name": "price",
                    "kind": "required",
                    "type": "number<float>",
                    "description": "",
                    "example": 10.49,
                    "format": "float"
                  },
                  {
                    "name": "tax_type",
                    "kind": "optional",
                    "type": "string<net>",
                    "deprecated": true,
                    "description": "Warning: Deprecated\nNet is the only supported value here",
                    "default": "net",
                    "enum": [
                      "net"
                    ]
                  },
                  {
                    "name": "unit_of_measure",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>The unit of measure associated with this quantity. When specifying a unit of measure, it must match the pattern. To remove any value set, either omit the property or set the value as null.</p>",
                    "example": "pallet",
                    "pattern": "^[a-zA-Z0-9-]+$"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/VariantPricing",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get stock levels at all connected locations for the provided SKUs
[path] Untitled/Stock API Docs/Stock Levels - Bulk operations/

{
  "id": "lNBJM2EI7-IAYt4Wyjj2-",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/v1/batch-fetch-stock",
    "servers": [],
    "name": "Get stock levels at all connected locations for the provided SKUs",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "BatchFetchStock",
          "schema": [
            {
              "name": "skus",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "SKU-1",
              "itemDefault": ""
            },
            {
              "name": "filter",
              "kind": "optional",
              "type": "object",
              "description": "",
              "example": "",
              "schema": [
                {
                  "name": "stock_location_ids",
                  "kind": "optional",
                  "type": "array",
                  "description": "",
                  "example": "",
                  "itemType": "string",
                  "customType": "string[]",
                  "itemExample": "123e4567-e89b-12d3-a456-426614174000",
                  "itemDefault": ""
                },
                {
                  "name": "all_stock_locations",
                  "kind": "optional",
                  "type": "boolean",
                  "description": ""
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/BatchFetchStock",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "schema": [
              {
                "name": "sku",
                "kind": "optional",
                "type": "string",
                "description": "Product Variant SKU",
                "example": "SKU-1"
              },
              {
                "name": "stock_levels",
                "kind": "optional",
                "type": "object",
                "description": "Stock levels for the SKU at each location",
                "modelRef": "#/components/schemas/StockLevel",
                "customType": "StockLevel[]",
                "schema": [],
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "BaseStockLevel",
                    "description": "",
                    "modelRef": "#/components/schemas/BaseStockLevel",
                    "schema": [
                      {
                        "name": "stock_level",
                        "kind": "optional",
                        "type": "integer<int32>",
                        "description": "Quantity of stock held at the location",
                        "example": 9,
                        "default": 0,
                        "format": "int32"
                      },
                      {
                        "name": "restock_date",
                        "kind": "optional",
                        "type": "string<date>",
                        "nullable": true,
                        "description": "Restock Date",
                        "example": "2020-01-01",
                        "format": "date"
                      },
                      {
                        "name": "min_stock_level",
                        "kind": "optional",
                        "type": "integer<int32>",
                        "description": "<p>Allow pre-ordering / overselling up to this qty. For example, if set to -9 and stock level was 0, 9 units could be sold.</p>",
                        "example": -9,
                        "default": 0,
                        "format": "int32"
                      },
                      {
                        "name": "created_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "readOnly": true,
                        "description": "",
                        "format": "date-time"
                      },
                      {
                        "name": "updated_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "readOnly": true,
                        "description": "",
                        "format": "date-time"
                      }
                    ]
                  },
                  {
                    "name": "StockLocationId",
                    "description": "",
                    "modelRef": "#/components/schemas/StockLocationId",
                    "schema": [
                      {
                        "name": "stock_location_id",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "description": "<p>Stock Location ID (internal UUID)</p>",
                        "example": "123e4567-e89b-12d3-a456-426614174000",
                        "format": "uuid"
                      }
                    ]
                  },
                  {
                    "name": "StockLocationName",
                    "description": "",
                    "modelRef": "#/components/schemas/StockLocationName",
                    "schema": [
                      {
                        "name": "stock_location_name",
                        "kind": "optional",
                        "type": "string",
                        "description": "Stock Location Name",
                        "example": "Main Warehouse"
                      }
                    ]
                  }
                ]
              }
            ],
            "itemType": "object",
            "customType": "object[]",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Core-api-purchasing.yaml
[path] Untitled/


[title] Update a Price List
[path] Untitled/Pricing API Docs/Price Lists/

{
  "id": "_vH66_i9YCyA9VLo9sP3f",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "/api/v1/price-lists/{slug}",
    "servers": [],
    "name": "Update a Price List",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "slug",
          "type": "string",
          "description": "Price List Slug"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "rules",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/PriceListRulesParam",
              "customType": "PriceListRulesParam",
              "schema": [
                {
                  "name": "source_price_list_slug",
                  "kind": "optional",
                  "type": "string",
                  "description": "Source PriceList slug",
                  "example": "base-list",
                  "minLength": 1,
                  "maxLength": 64
                },
                {
                  "name": "adjustment_percentage",
                  "kind": "optional",
                  "type": "number",
                  "description": "<p>Adjustment percent expressed as a decimal fraction between 0 and 1 - E.g. 15% should be set as 0.15</p>",
                  "example": 0.103333,
                  "minimum": 0,
                  "maximum": 1
                },
                {
                  "name": "adjustment_direction",
                  "kind": "optional",
                  "type": "string<plus | minus>",
                  "description": "<p>Adjustment direction (plus, minus)</p>",
                  "example": "plus",
                  "enum": [
                    "plus",
                    "minus"
                  ]
                },
                {
                  "name": "currency_exchange_rate",
                  "kind": "optional",
                  "type": "number",
                  "nullable": true,
                  "description": "<p>Exchange rate between the currency of the source price list and the price list to which this rule belongs. If null, the rate will be  determined automatically based on current market rates.</p>",
                  "example": 1.254324,
                  "minimum": 0.000001
                }
              ]
            },
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "description": "Name",
              "example": "Base Price List",
              "modelRef": "#/components/schemas/PriceListNameParam",
              "customType": "PriceListNameParam",
              "schema": []
            },
            {
              "name": "currency_code",
              "kind": "optional",
              "type": "string",
              "description": "ISO 4217 currency code",
              "example": "GBP",
              "modelRef": "#/components/schemas/PriceListCurrency",
              "customType": "PriceListCurrency",
              "schema": []
            },
            {
              "name": "tax_inclusive_display",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>Toggle tax-inclusive display for this price list.</p>",
              "example": true
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "PriceList",
            "schema": [
              {
                "name": "slug",
                "kind": "optional",
                "type": "string",
                "description": "Slug",
                "example": "base-list",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "Name",
                "example": "Base Price List",
                "modelRef": "#/components/schemas/PriceListNameParam",
                "customType": "PriceListNameParam",
                "schema": []
              },
              {
                "name": "currency_code",
                "kind": "optional",
                "type": "string",
                "description": "ISO 4217 currency code",
                "example": "GBP",
                "modelRef": "#/components/schemas/PriceListCurrency",
                "customType": "PriceListCurrency",
                "schema": []
              },
              {
                "name": "source",
                "kind": "optional",
                "type": "string<custom | platform | integration>",
                "description": "<p>Integration should be used by external parties, custom is provided to any price lists setup in the dashboard and platform is reserved for the eCommerce platform.</p>",
                "example": "custom",
                "default": "custom",
                "enum": [
                  "custom",
                  "platform",
                  "integration"
                ]
              },
              {
                "name": "tax_inclusive_display",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>When true, storefronts display prices on this price list inclusive of the per-SKU display_tax_rate, labelled as tax inclusive. This changes presentation only - prices are still stored and transacted net. SKUs on the list with no rate, or a rate of 0, display their net price and are still labelled tax inclusive.</p>",
                "example": false,
                "default": false
              },
              {
                "name": "rules",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/PriceListRulesParam",
                "customType": "PriceListRulesParam",
                "schema": [
                  {
                    "name": "source_price_list_slug",
                    "kind": "optional",
                    "type": "string",
                    "description": "Source PriceList slug",
                    "example": "base-list",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  {
                    "name": "adjustment_percentage",
                    "kind": "optional",
                    "type": "number",
                    "description": "<p>Adjustment percent expressed as a decimal fraction between 0 and 1 - E.g. 15% should be set as 0.15</p>",
                    "example": 0.103333,
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "name": "adjustment_direction",
                    "kind": "optional",
                    "type": "string<plus | minus>",
                    "description": "<p>Adjustment direction (plus, minus)</p>",
                    "example": "plus",
                    "enum": [
                      "plus",
                      "minus"
                    ]
                  },
                  {
                    "name": "currency_exchange_rate",
                    "kind": "optional",
                    "type": "number",
                    "nullable": true,
                    "description": "<p>Exchange rate between the currency of the source price list and the price list to which this rule belongs. If null, the rate will be  determined automatically based on current market rates.</p>",
                    "example": 1.254324,
                    "minimum": 0.000001
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/PriceList",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Pricing-api.yaml
[path] Untitled/


[title] Create/Update Purchase
[path] Untitled/Purchasing API Docs/Purchasing/

{
  "id": "Zt66bWwy086gLn6nXE6Te",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "/api/v1/purchases/{lookupBy}/{identifier}",
    "servers": [],
    "name": "Create/Update Purchase",
    "description": "<p>Create/Update a purchase</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "lookupBy",
          "type": "string",
          "example": "platform",
          "description": "<p>Lookup by an identifier set within the purchase_identifiers object</p>",
          "enum": [
            "sparklayer",
            "platform",
            "internal",
            "visible"
          ]
        },
        {
          "kind": "required",
          "name": "identifier",
          "type": "object",
          "description": "<p>Lookup by an identifier. Note: lookupBy=sparklayer requires UUID</p>",
          "schema": [],
          "complexItems": [
            {
              "name": "object",
              "schema": []
            },
            {
              "name": "object",
              "schema": []
            }
          ],
          "complexType": "anyOf"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "application/problem+json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "SparkLayer purchase object",
          "customType": "Purchase",
          "schema": [
            {
              "name": "type",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "order",
              "modelRef": "#/components/schemas/PurchaseType",
              "customType": "PurchaseType",
              "schema": []
            },
            {
              "name": "purchase_identifiers",
              "kind": "required",
              "type": "object",
              "description": "",
              "example": "",
              "schema": [
                {
                  "name": "sparklayer",
                  "kind": "optional",
                  "type": "string<uuid>",
                  "nullable": true,
                  "description": "The identifier SparkLayer uses for the purchase. You will need to generate this if the purchase does not exist",
                  "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                  "format": "uuid",
                  "minLength": 1
                },
                {
                  "name": "platform",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "<p>The identifier for the purchase on the e-commerce platform</p>",
                  "example": "123456789",
                  "minLength": 1
                },
                {
                  "name": "internal",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "The identifier for the purchase on your system",
                  "minLength": 1
                },
                {
                  "name": "visible",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "The identifier that will be shown to the customer in their recent orders",
                  "example": "B2B01123"
                }
              ]
            },
            {
              "name": "customer_identifiers",
              "kind": "required",
              "type": "object",
              "description": "",
              "example": "",
              "schema": [
                {
                  "name": "sparklayer",
                  "kind": "required",
                  "type": "string",
                  "nullable": false,
                  "description": "The ID of the customer that that order is for.",
                  "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                },
                {
                  "name": "sparklayer_impersonator",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "The ID of the sales agent placing the order.",
                  "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                },
                {
                  "name": "sparklayer_impersonator_assignee",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "The ID of the sales agent assigned to be responsible for the order.",
                  "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                },
                {
                  "name": "sparklayer_child",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "The ID of the company user that placed the order.",
                  "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                }
              ]
            },
            {
              "name": "company",
              "kind": "optional",
              "type": "object",
              "nullable": true,
              "description": "<p>Company sections are opt-in; omit this entirely for merchants that do not use them.</p>",
              "example": "",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "string<uuid>",
                  "nullable": true,
                  "description": "The ID of the company the purchase was placed for.",
                  "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                  "format": "uuid"
                },
                {
                  "name": "section_id",
                  "kind": "optional",
                  "type": "string<uuid>",
                  "nullable": true,
                  "description": "The ID of the company section the purchase was placed for.",
                  "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                  "format": "uuid"
                },
                {
                  "name": "section_name",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "<p>The section name at the time of purchase, kept so historical purchases stay readable after a section is renamed or deleted. Not filterable.</p>",
                  "example": "Bristol",
                  "maxLength": 128
                }
              ]
            },
            {
              "name": "payment_method",
              "kind": "optional",
              "type": "string<quote | upfrontPayment | paymentOnAccount | paymentByInvoice>",
              "nullable": true,
              "description": "<p>How the purchase was/will be paid for</p>",
              "enum": [
                "quote",
                "upfrontPayment",
                "paymentOnAccount",
                "paymentByInvoice"
              ]
            },
            {
              "name": "dates",
              "kind": "required",
              "type": "object",
              "description": "",
              "example": "",
              "schema": [
                {
                  "name": "created_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "readOnly": true,
                  "description": "<p>The date the purchase was created in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                },
                {
                  "name": "updated_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "readOnly": true,
                  "description": "<p>The date the purchase was last updated in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                },
                {
                  "name": "placed_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "nullable": true,
                  "description": "<p>The date at which the purchase was placed - include user timezone or Z for UTC (RFC-3339)</p>",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                },
                {
                  "name": "to_be_placed_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "nullable": true,
                  "description": "<p>The date at which the purchase is due to be placed, for a purchase that is scheduled rather than placed immediately (RFC-3339). It can be changed while the purchase is still pending</p>",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                },
                {
                  "name": "calculated_submitted_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "readOnly": true,
                  "description": "<p>The date the purchase was submitted (RFC-3339). This is when the cart is converted into another purchase type. This is read only - it should not be sent to the API, but will be returned form it</p>",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                },
                {
                  "name": "expires_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "readOnly": true,
                  "description": "<p>the date at which the purchase will expire and become archived (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                },
                {
                  "name": "payment_due_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "description": "The date at which payment for the purchase is expected",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                }
              ]
            },
            {
              "name": "customer_reference",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "Additional information that a customer adds to the order",
              "example": "Please deliver to the back of the store"
            },
            {
              "name": "po_number",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "PO number for the purchase",
              "example": "PO-001"
            },
            {
              "name": "shipping_requested_date",
              "kind": "optional",
              "type": "string<date-time>",
              "nullable": true,
              "description": "The date requested for the delivery to arrive",
              "example": "2020-01-01T00:00:00+02:00",
              "format": "date-time"
            },
            {
              "name": "recurring_purchase",
              "kind": "optional",
              "type": "object",
              "nullable": true,
              "description": "Present only for a purchase created from a recurring purchase template. Both properties are stored when the purchase is created and ignored on any later update",
              "example": "",
              "schema": [
                {
                  "name": "template_id",
                  "kind": "optional",
                  "type": "string<uuid>",
                  "nullable": true,
                  "description": "The recurring purchase template this purchase was created from. Set on creation and ignored on update",
                  "example": "0f8fad5b-d9cb-469f-a165-70867728950e",
                  "format": "uuid"
                },
                {
                  "name": "cancelled_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "nullable": true,
                  "description": "<p>The date the customer cancelled the purchase, after which it will not be placed (RFC-3339). Cancelling does not free the date - the template has already had its turn for it</p>",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                },
                {
                  "name": "to_be_placed_at_initial",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "nullable": true,
                  "description": "<p>The date to_be_placed_at was first set to (RFC-3339). Set on creation and ignored on update, so that rescheduling cannot let the same template produce a second purchase for the same date</p>",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                }
              ]
            },
            {
              "name": "currency_code",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "The 3 letter currency code used for the prices in the purchase",
              "example": "GBP",
              "minLength": 3,
              "maxLength": 3
            },
            {
              "name": "currency_code_base",
              "kind": "optional",
              "type": "string",
              "writeOnly": true,
              "nullable": true,
              "description": "The 3 letter currency code of the store's base currency",
              "example": "GBP",
              "minLength": 3,
              "maxLength": 3
            },
            {
              "name": "calculated_shipping_address",
              "kind": "optional",
              "type": "string",
              "readOnly": true,
              "nullable": true,
              "description": "<p>A single string containing all the details of the shipping address. This is read only - it should not be sent to the API, but will be returned form it</p>",
              "example": "John Spark, SparkLayer, SparkLayer HQ, Example City, 12345"
            },
            {
              "name": "calculated_total",
              "kind": "optional",
              "type": "object",
              "description": "",
              "complexType": "allOf",
              "complexItems": [
                {
                  "name": "MonetaryObject",
                  "description": "",
                  "modelRef": "#/components/schemas/MonetaryObject",
                  "schema": [
                    {
                      "name": "number",
                      "kind": "required",
                      "type": "string",
                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                      "example": "15.99",
                      "minLength": 1
                    },
                    {
                      "name": "currency",
                      "kind": "required",
                      "type": "string",
                      "description": "The 3 letter currency code used for the prices in the purchase",
                      "example": "GBP",
                      "minLength": 3,
                      "maxLength": 3
                    }
                  ]
                }
              ],
              "schema": []
            },
            {
              "name": "calculated_total_usd",
              "kind": "optional",
              "type": "object",
              "description": "",
              "complexType": "allOf",
              "complexItems": [
                {
                  "name": "MonetaryObject",
                  "description": "",
                  "modelRef": "#/components/schemas/MonetaryObject",
                  "schema": [
                    {
                      "name": "number",
                      "kind": "required",
                      "type": "string",
                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                      "example": "15.99",
                      "minLength": 1
                    },
                    {
                      "name": "currency",
                      "kind": "required",
                      "type": "string",
                      "description": "The 3 letter currency code used for the prices in the purchase",
                      "example": "GBP",
                      "minLength": 3,
                      "maxLength": 3
                    }
                  ]
                }
              ],
              "schema": []
            },
            {
              "name": "calculated_total_base",
              "kind": "optional",
              "type": "object",
              "description": "",
              "complexType": "allOf",
              "complexItems": [
                {
                  "name": "MonetaryObject",
                  "description": "",
                  "modelRef": "#/components/schemas/MonetaryObject",
                  "schema": [
                    {
                      "name": "number",
                      "kind": "required",
                      "type": "string",
                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                      "example": "15.99",
                      "minLength": 1
                    },
                    {
                      "name": "currency",
                      "kind": "required",
                      "type": "string",
                      "description": "The 3 letter currency code used for the prices in the purchase",
                      "example": "GBP",
                      "minLength": 3,
                      "maxLength": 3
                    }
                  ]
                }
              ],
              "schema": []
            },
            {
              "name": "calculated_fulfilment_status",
              "kind": "optional",
              "type": "string<incoming | processing | shipped | part_shipped | cancelled | returned | part_returned | varied>",
              "readOnly": true,
              "nullable": true,
              "description": "<p>The status of the order, calculated from the statuses of the individual packages. This is read only - it should not be sent to the API, but will be returned form it</p>",
              "example": "processing",
              "enum": [
                "incoming",
                "processing",
                "shipped",
                "part_shipped",
                "cancelled",
                "returned",
                "part_returned",
                "varied"
              ]
            },
            {
              "name": "quote",
              "kind": "optional",
              "type": "object",
              "nullable": true,
              "description": "Quote data",
              "example": "",
              "schema": [
                {
                  "name": "status_slug",
                  "kind": "optional",
                  "type": "string",
                  "description": "The slug of the quote status applied to this quote"
                },
                {
                  "name": "status",
                  "kind": "optional",
                  "type": "object",
                  "nullable": true,
                  "description": "",
                  "complexType": "allOf",
                  "complexItems": [
                    {
                      "name": "QuoteStatus",
                      "description": "",
                      "modelRef": "#/components/schemas/QuoteStatus",
                      "schema": [
                        {
                          "name": "id",
                          "kind": "optional",
                          "type": "string",
                          "description": ""
                        },
                        {
                          "name": "name",
                          "kind": "optional",
                          "type": "string",
                          "description": "",
                          "maxLength": 45
                        },
                        {
                          "name": "slug",
                          "kind": "optional",
                          "type": "string",
                          "description": "",
                          "maxLength": 45,
                          "pattern": "^[a-z0-9-]+$"
                        },
                        {
                          "name": "default",
                          "kind": "optional",
                          "type": "boolean",
                          "description": ""
                        },
                        {
                          "name": "next",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "maxLength": 45,
                          "pattern": "^[a-z0-9-]+$"
                        },
                        {
                          "name": "actions",
                          "kind": "optional",
                          "type": "array",
                          "description": "",
                          "example": "",
                          "itemType": "string",
                          "customType": "string[]",
                          "itemExample": "",
                          "itemDefault": ""
                        },
                        {
                          "name": "created_at",
                          "kind": "optional",
                          "type": "string<date-time>",
                          "description": "",
                          "format": "date-time"
                        },
                        {
                          "name": "updated_at",
                          "kind": "optional",
                          "type": "string<date-time>",
                          "description": "",
                          "format": "date-time"
                        },
                        {
                          "name": "deleted_at",
                          "kind": "optional",
                          "type": "string<date-time>",
                          "nullable": true,
                          "description": "",
                          "format": "date-time"
                        }
                      ]
                    }
                  ],
                  "schema": []
                },
                {
                  "name": "expiry",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "nullable": true,
                  "description": "<p>The date at which the quote is considered expired and no longer valid (RFC-3339)</p>",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                }
              ]
            },
            {
              "name": "payment_status",
              "kind": "optional",
              "type": "string<unpaid | part_paid | paid>",
              "description": "That payment status of the order",
              "enum": [
                "unpaid",
                "part_paid",
                "paid"
              ]
            },
            {
              "name": "total_paid",
              "kind": "optional",
              "type": "object",
              "description": "",
              "complexType": "allOf",
              "complexItems": [
                {
                  "name": "MonetaryObject",
                  "description": "",
                  "modelRef": "#/components/schemas/MonetaryObject",
                  "schema": [
                    {
                      "name": "number",
                      "kind": "required",
                      "type": "string",
                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                      "example": "15.99",
                      "minLength": 1
                    },
                    {
                      "name": "currency",
                      "kind": "required",
                      "type": "string",
                      "description": "The 3 letter currency code used for the prices in the purchase",
                      "example": "GBP",
                      "minLength": 3,
                      "maxLength": 3
                    }
                  ]
                }
              ],
              "schema": []
            },
            {
              "name": "revision_date",
              "kind": "optional",
              "type": "string<date-time>",
              "nullable": true,
              "description": "<p>The date at which the purchase was last modified - include user timezone or Z for UTC (RFC-3339)</p>",
              "example": "2020-01-01T00:00:00+02:00",
              "format": "date-time"
            },
            {
              "name": "tax_lines",
              "kind": "optional",
              "type": "array",
              "description": "Tax lines for the purchase.",
              "modelRef": "#/components/schemas/TaxLine",
              "customType": "TaxLine[]",
              "schema": [
                {
                  "name": "title",
                  "kind": "required",
                  "type": "string",
                  "description": "The title of the tax line",
                  "example": "HST"
                },
                {
                  "name": "amount",
                  "kind": "required",
                  "type": "object",
                  "description": "The amount of tax of the tax line",
                  "modelRef": "#/components/schemas/MonetaryObject",
                  "customType": "MonetaryObject",
                  "schema": [
                    {
                      "name": "number",
                      "kind": "required",
                      "type": "string",
                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                      "example": "15.99",
                      "minLength": 1
                    },
                    {
                      "name": "currency",
                      "kind": "required",
                      "type": "string",
                      "description": "The 3 letter currency code used for the prices in the purchase",
                      "example": "GBP",
                      "minLength": 3,
                      "maxLength": 3
                    }
                  ]
                },
                {
                  "name": "amount_base",
                  "kind": "optional",
                  "type": "object",
                  "description": "The amount of tax of the tax line in the store's base currency",
                  "modelRef": "#/components/schemas/MonetaryObject",
                  "customType": "MonetaryObject",
                  "schema": [
                    {
                      "name": "number",
                      "kind": "required",
                      "type": "string",
                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                      "example": "15.99",
                      "minLength": 1
                    },
                    {
                      "name": "currency",
                      "kind": "required",
                      "type": "string",
                      "description": "The 3 letter currency code used for the prices in the purchase",
                      "example": "GBP",
                      "minLength": 3,
                      "maxLength": 3
                    }
                  ]
                },
                {
                  "name": "rate",
                  "kind": "required",
                  "type": "number<double>",
                  "nullable": true,
                  "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                  "example": 20,
                  "format": "double",
                  "minimum": 0
                }
              ]
            },
            {
              "name": "billing_address",
              "kind": "optional",
              "type": "object",
              "nullable": true,
              "description": "",
              "modelRef": "#/components/schemas/PurchaseAddress",
              "customType": "PurchaseAddress",
              "schema": [
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "Tom Jones"
                },
                {
                  "name": "company",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "Tom Jones Hardware Ltd"
                },
                {
                  "name": "address_line1",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "example": "7 Philosophy way"
                },
                {
                  "name": "address_line2",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": ""
                },
                {
                  "name": "city",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "example": "Willerby"
                },
                {
                  "name": "region_code",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "",
                  "minLength": 1
                },
                {
                  "name": "postal_code",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "BJ6 9MK"
                },
                {
                  "name": "country_code",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "example": "GB"
                },
                {
                  "name": "phone",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "0123456789"
                },
                {
                  "name": "sparklayer_id",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                },
                {
                  "name": "first_name",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "Tom"
                },
                {
                  "name": "last_name",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "Jones"
                }
              ]
            },
            {
              "name": "packages",
              "kind": "required",
              "type": "object",
              "description": "Packages contained within this purchase",
              "modelRef": "#/components/schemas/Package",
              "customType": "Package[]",
              "schema": [],
              "complexType": "oneOf",
              "complexItems": [
                {
                  "name": "Incoming",
                  "description": "",
                  "modelRef": "#/components/schemas/Incoming",
                  "schema": [
                    {
                      "name": "identifiers",
                      "kind": "required",
                      "type": "object",
                      "description": "",
                      "example": "",
                      "schema": [
                        {
                          "name": "sparklayer_package_id",
                          "kind": "required",
                          "type": "string<uuid>",
                          "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                          "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                          "format": "uuid"
                        },
                        {
                          "name": "platform",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "<p>The identifier for the package on the e-commerce platform</p>",
                          "example": "123456789",
                          "minLength": 1
                        },
                        {
                          "name": "internal",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "The identifier for the package on your system",
                          "minLength": 1
                        },
                        {
                          "name": "visible",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "The identifier that will be shown to the customer in their recent orders"
                        }
                      ]
                    },
                    {
                      "name": "accounting_files",
                      "kind": "required",
                      "type": "array",
                      "description": "",
                      "modelRef": "#/components/schemas/PurchaseFiles",
                      "customType": "PurchaseFiles[]",
                      "schema": [
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier of the purchase file that is used by your system",
                              "example": "INV011",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier of the purchase file that should be shown to the customer",
                              "default": "INV011"
                            }
                          ]
                        },
                        {
                          "name": "data",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "complexType": "anyOf",
                          "complexItems": [
                            {
                              "name": "object",
                              "description": "",
                              "schema": [
                                {
                                  "name": "uri",
                                  "kind": "optional",
                                  "type": "string<uri>",
                                  "nullable": true,
                                  "description": "",
                                  "format": "uri"
                                },
                                {
                                  "name": "type",
                                  "kind": "required",
                                  "type": "string<uri>",
                                  "description": "",
                                  "example": "uri",
                                  "default": "uri",
                                  "enum": [
                                    "uri"
                                  ]
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "file_type",
                          "kind": "required",
                          "type": "string<credit | invoice | payment>",
                          "description": "",
                          "example": "invoice",
                          "enum": [
                            "credit",
                            "invoice",
                            "payment"
                          ]
                        }
                      ]
                    },
                    {
                      "name": "line_items",
                      "kind": "required",
                      "type": "array",
                      "description": "",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<custom | product>",
                          "description": "",
                          "enum": [
                            "custom",
                            "product"
                          ]
                        },
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "sparklayer_item_key",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                              "minLength": 1
                            },
                            {
                              "name": "sparklayer_variant_id",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The ID of the variant on your e-commerce platform</p>",
                              "example": "45552423353839",
                              "minLength": 1
                            },
                            {
                              "name": "sku",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "CAT-MUG",
                              "maxLength": 128
                            },
                            {
                              "name": "platform",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The identifier for the product on the e-commerce platform</p>",
                              "example": "123456789",
                              "minLength": 1
                            },
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier for the product on your system",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>A human-readable identifier for the product</p>"
                            }
                          ]
                        },
                        {
                          "name": "name_parent",
                          "kind": "required",
                          "type": "string",
                          "description": "Name of the product",
                          "example": "T-Shirt"
                        },
                        {
                          "name": "name_child",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "<p>Name of the product variant/type</p>",
                          "example": "Red"
                        },
                        {
                          "name": "quantity",
                          "kind": "required",
                          "type": "number",
                          "description": "",
                          "example": 4
                        },
                        {
                          "name": "custom_attributes",
                          "kind": "optional",
                          "type": "array",
                          "description": "",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "key",
                              "kind": "required",
                              "type": "string",
                              "nullable": false,
                              "description": "Key or name of the attribute.",
                              "example": "mug text"
                            },
                            {
                              "name": "value",
                              "kind": "required",
                              "type": "string",
                              "nullable": false,
                              "description": "Value of the attribute.",
                              "example": "best company ever"
                            }
                          ]
                        },
                        {
                          "name": "line_total",
                          "kind": "required",
                          "type": "object",
                          "nullable": true,
                          "description": "",
                          "complexType": "allOf",
                          "complexItems": [
                            {
                              "name": "LineTotal",
                              "description": "",
                              "modelRef": "#/components/schemas/LineTotal",
                              "schema": [
                                {
                                  "name": "total_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "tax_rate",
                                  "kind": "optional",
                                  "type": "number<double>",
                                  "deprecated": true,
                                  "nullable": true,
                                  "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                  "example": 20,
                                  "default": 0,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "tax_lines",
                          "kind": "optional",
                          "type": "array",
                          "description": "Information about a tax line on a purchase",
                          "modelRef": "#/components/schemas/TaxLine",
                          "customType": "TaxLine[]",
                          "schema": [
                            {
                              "name": "title",
                              "kind": "required",
                              "type": "string",
                              "description": "The title of the tax line",
                              "example": "HST"
                            },
                            {
                              "name": "amount",
                              "kind": "required",
                              "type": "object",
                              "description": "The amount of tax of the tax line",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "amount_base",
                              "kind": "optional",
                              "type": "object",
                              "description": "The amount of tax of the tax line in the store's base currency",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "rate",
                              "kind": "required",
                              "type": "number<double>",
                              "nullable": true,
                              "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                              "example": 20,
                              "format": "double",
                              "minimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "shipping_method",
                      "kind": "optional",
                      "type": "object",
                      "nullable": true,
                      "description": "<p>Details of how the package was/will be shipped</p>",
                      "example": "",
                      "schema": [
                        {
                          "name": "sku",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "SKU that identifies the shipping method used",
                          "example": "SHIP-ECO",
                          "minLength": 1
                        },
                        {
                          "name": "name",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The friendly/human-readable name for the shipping method</p>",
                          "example": "Standard Shipping"
                        },
                        {
                          "name": "line_total",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "complexType": "allOf",
                          "complexItems": [
                            {
                              "name": "LineTotal",
                              "description": "",
                              "modelRef": "#/components/schemas/LineTotal",
                              "schema": [
                                {
                                  "name": "total_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "tax_rate",
                                  "kind": "optional",
                                  "type": "number<double>",
                                  "deprecated": true,
                                  "nullable": true,
                                  "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                  "example": 20,
                                  "default": 0,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "tax_lines",
                          "kind": "optional",
                          "type": "array",
                          "description": "Information about a tax line on a purchase",
                          "modelRef": "#/components/schemas/TaxLine",
                          "customType": "TaxLine[]",
                          "schema": [
                            {
                              "name": "title",
                              "kind": "required",
                              "type": "string",
                              "description": "The title of the tax line",
                              "example": "HST"
                            },
                            {
                              "name": "amount",
                              "kind": "required",
                              "type": "object",
                              "description": "The amount of tax of the tax line",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "amount_base",
                              "kind": "optional",
                              "type": "object",
                              "description": "The amount of tax of the tax line in the store's base currency",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "rate",
                              "kind": "required",
                              "type": "number<double>",
                              "nullable": true,
                              "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                              "example": 20,
                              "format": "double",
                              "minimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "shipping_address",
                      "kind": "optional",
                      "type": "object",
                      "nullable": true,
                      "description": "",
                      "modelRef": "#/components/schemas/PurchaseAddress",
                      "customType": "PurchaseAddress",
                      "schema": [
                        {
                          "name": "name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom Jones"
                        },
                        {
                          "name": "company",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom Jones Hardware Ltd"
                        },
                        {
                          "name": "address_line1",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "7 Philosophy way"
                        },
                        {
                          "name": "address_line2",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": ""
                        },
                        {
                          "name": "city",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "Willerby"
                        },
                        {
                          "name": "region_code",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "",
                          "minLength": 1
                        },
                        {
                          "name": "postal_code",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "BJ6 9MK"
                        },
                        {
                          "name": "country_code",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "GB"
                        },
                        {
                          "name": "phone",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "0123456789"
                        },
                        {
                          "name": "sparklayer_id",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                        },
                        {
                          "name": "first_name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom"
                        },
                        {
                          "name": "last_name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Jones"
                        }
                      ]
                    },
                    {
                      "name": "shipments",
                      "kind": "required",
                      "type": "array",
                      "description": "Carrier and tracking details for the shipment",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "carrier",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "Carrier Company Ltd"
                        },
                        {
                          "name": "carrier_id",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The tracking number/ID used by the carrier</p>"
                        },
                        {
                          "name": "tracking_url",
                          "kind": "optional",
                          "type": "string<uri>",
                          "nullable": true,
                          "description": "The URL the customer can use to track their shipment",
                          "format": "uri"
                        }
                      ]
                    },
                    {
                      "name": "type",
                      "kind": "required",
                      "type": "string<incoming>",
                      "description": "",
                      "enum": [
                        "incoming"
                      ]
                    }
                  ]
                },
                {
                  "name": "Processing",
                  "description": "",
                  "modelRef": "#/components/schemas/Processing",
                  "schema": [
                    {
                      "name": "identifiers",
                      "kind": "required",
                      "type": "object",
                      "description": "",
                      "example": "",
                      "schema": [
                        {
                          "name": "sparklayer_package_id",
                          "kind": "required",
                          "type": "string<uuid>",
                          "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                          "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                          "format": "uuid"
                        },
                        {
                          "name": "platform",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "<p>The identifier for the package on the e-commerce platform</p>",
                          "example": "123456789",
                          "minLength": 1
                        },
                        {
                          "name": "internal",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "The identifier for the package on your system",
                          "minLength": 1
                        },
                        {
                          "name": "visible",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "The identifier that will be shown to the customer in their recent orders"
                        }
                      ]
                    },
                    {
                      "name": "accounting_files",
                      "kind": "required",
                      "type": "array",
                      "description": "",
                      "modelRef": "#/components/schemas/PurchaseFiles",
                      "customType": "PurchaseFiles[]",
                      "schema": [
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier of the purchase file that is used by your system",
                              "example": "INV011",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier of the purchase file that should be shown to the customer",
                              "default": "INV011"
                            }
                          ]
                        },
                        {
                          "name": "data",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "complexType": "anyOf",
                          "complexItems": [
                            {
                              "name": "object",
                              "description": "",
                              "schema": [
                                {
                                  "name": "uri",
                                  "kind": "optional",
                                  "type": "string<uri>",
                                  "nullable": true,
                                  "description": "",
                                  "format": "uri"
                                },
                                {
                                  "name": "type",
                                  "kind": "required",
                                  "type": "string<uri>",
                                  "description": "",
                                  "example": "uri",
                                  "default": "uri",
                                  "enum": [
                                    "uri"
                                  ]
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "file_type",
                          "kind": "required",
                          "type": "string<credit | invoice | payment>",
                          "description": "",
                          "example": "invoice",
                          "enum": [
                            "credit",
                            "invoice",
                            "payment"
                          ]
                        }
                      ]
                    },
                    {
                      "name": "line_items",
                      "kind": "required",
                      "type": "array",
                      "description": "",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<custom | product>",
                          "description": "",
                          "enum": [
                            "custom",
                            "product"
                          ]
                        },
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "sparklayer_item_key",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                              "minLength": 1
                            },
                            {
                              "name": "sparklayer_variant_id",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The ID of the variant on your e-commerce platform</p>",
                              "example": "45552423353839",
                              "minLength": 1
                            },
                            {
                              "name": "sku",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "CAT-MUG",
                              "maxLength": 128
                            },
                            {
                              "name": "platform",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The identifier for the product on the e-commerce platform</p>",
                              "example": "123456789",
                              "minLength": 1
                            },
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier for the product on your system",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>A human-readable identifier for the product</p>"
                            }
                          ]
                        },
                        {
                          "name": "name_parent",
                          "kind": "required",
                          "type": "string",
                          "description": "Name of the product",
                          "example": "T-Shirt"
                        },
                        {
                          "name": "name_child",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "<p>Name of the product variant/type</p>",
                          "example": "Red"
                        },
                        {
                          "name": "quantity",
                          "kind": "required",
                          "type": "number",
                          "description": "",
                          "example": 4
                        },
                        {
                          "name": "custom_attributes",
                          "kind": "optional",
                          "type": "array",
                          "description": "",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "key",
                              "kind": "required",
                              "type": "string",
                              "nullable": false,
                              "description": "Key or name of the attribute.",
                              "example": "mug text"
                            },
                            {
                              "name": "value",
                              "kind": "required",
                              "type": "string",
                              "nullable": false,
                              "description": "Value of the attribute.",
                              "example": "best company ever"
                            }
                          ]
                        },
                        {
                          "name": "line_total",
                          "kind": "required",
                          "type": "object",
                          "nullable": true,
                          "description": "",
                          "complexType": "allOf",
                          "complexItems": [
                            {
                              "name": "LineTotal",
                              "description": "",
                              "modelRef": "#/components/schemas/LineTotal",
                              "schema": [
                                {
                                  "name": "total_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "tax_rate",
                                  "kind": "optional",
                                  "type": "number<double>",
                                  "deprecated": true,
                                  "nullable": true,
                                  "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                  "example": 20,
                                  "default": 0,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "tax_lines",
                          "kind": "optional",
                          "type": "array",
                          "description": "Information about a tax line on a purchase",
                          "modelRef": "#/components/schemas/TaxLine",
                          "customType": "TaxLine[]",
                          "schema": [
                            {
                              "name": "title",
                              "kind": "required",
                              "type": "string",
                              "description": "The title of the tax line",
                              "example": "HST"
                            },
                            {
                              "name": "amount",
                              "kind": "required",
                              "type": "object",
                              "description": "The amount of tax of the tax line",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "amount_base",
                              "kind": "optional",
                              "type": "object",
                              "description": "The amount of tax of the tax line in the store's base currency",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "rate",
                              "kind": "required",
                              "type": "number<double>",
                              "nullable": true,
                              "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                              "example": 20,
                              "format": "double",
                              "minimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "shipping_method",
                      "kind": "optional",
                      "type": "object",
                      "nullable": true,
                      "description": "<p>Details of how the package was/will be shipped</p>",
                      "example": "",
                      "schema": [
                        {
                          "name": "sku",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "SKU that identifies the shipping method used",
                          "example": "SHIP-ECO",
                          "minLength": 1
                        },
                        {
                          "name": "name",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The friendly/human-readable name for the shipping method</p>",
                          "example": "Standard Shipping"
                        },
                        {
                          "name": "line_total",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "complexType": "allOf",
                          "complexItems": [
                            {
                              "name": "LineTotal",
                              "description": "",
                              "modelRef": "#/components/schemas/LineTotal",
                              "schema": [
                                {
                                  "name": "total_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "tax_rate",
                                  "kind": "optional",
                                  "type": "number<double>",
                                  "deprecated": true,
                                  "nullable": true,
                                  "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                  "example": 20,
                                  "default": 0,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "tax_lines",
                          "kind": "optional",
                          "type": "array",
                          "description": "Information about a tax line on a purchase",
                          "modelRef": "#/components/schemas/TaxLine",
                          "customType": "TaxLine[]",
                          "schema": [
                            {
                              "name": "title",
                              "kind": "required",
                              "type": "string",
                              "description": "The title of the tax line",
                              "example": "HST"
                            },
                            {
                              "name": "amount",
                              "kind": "required",
                              "type": "object",
                              "description": "The amount of tax of the tax line",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "amount_base",
                              "kind": "optional",
                              "type": "object",
                              "description": "The amount of tax of the tax line in the store's base currency",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "rate",
                              "kind": "required",
                              "type": "number<double>",
                              "nullable": true,
                              "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                              "example": 20,
                              "format": "double",
                              "minimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "shipping_address",
                      "kind": "optional",
                      "type": "object",
                      "nullable": true,
                      "description": "",
                      "modelRef": "#/components/schemas/PurchaseAddress",
                      "customType": "PurchaseAddress",
                      "schema": [
                        {
                          "name": "name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom Jones"
                        },
                        {
                          "name": "company",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom Jones Hardware Ltd"
                        },
                        {
                          "name": "address_line1",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "7 Philosophy way"
                        },
                        {
                          "name": "address_line2",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": ""
                        },
                        {
                          "name": "city",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "Willerby"
                        },
                        {
                          "name": "region_code",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "",
                          "minLength": 1
                        },
                        {
                          "name": "postal_code",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "BJ6 9MK"
                        },
                        {
                          "name": "country_code",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "GB"
                        },
                        {
                          "name": "phone",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "0123456789"
                        },
                        {
                          "name": "sparklayer_id",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                        },
                        {
                          "name": "first_name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom"
                        },
                        {
                          "name": "last_name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Jones"
                        }
                      ]
                    },
                    {
                      "name": "shipments",
                      "kind": "required",
                      "type": "array",
                      "description": "Carrier and tracking details for the shipment",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "carrier",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "Carrier Company Ltd"
                        },
                        {
                          "name": "carrier_id",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The tracking number/ID used by the carrier</p>"
                        },
                        {
                          "name": "tracking_url",
                          "kind": "optional",
                          "type": "string<uri>",
                          "nullable": true,
                          "description": "The URL the customer can use to track their shipment",
                          "format": "uri"
                        }
                      ]
                    },
                    {
                      "name": "type",
                      "kind": "required",
                      "type": "string<processing>",
                      "description": "",
                      "enum": [
                        "processing"
                      ]
                    }
                  ]
                },
                {
                  "name": "Shipment",
                  "description": "",
                  "modelRef": "#/components/schemas/Shipment",
                  "schema": [
                    {
                      "name": "identifiers",
                      "kind": "required",
                      "type": "object",
                      "description": "",
                      "example": "",
                      "schema": [
                        {
                          "name": "sparklayer_package_id",
                          "kind": "required",
                          "type": "string<uuid>",
                          "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                          "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                          "format": "uuid"
                        },
                        {
                          "name": "platform",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "<p>The identifier for the package on the e-commerce platform</p>",
                          "example": "123456789",
                          "minLength": 1
                        },
                        {
                          "name": "internal",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "The identifier for the package on your system",
                          "minLength": 1
                        },
                        {
                          "name": "visible",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "The identifier that will be shown to the customer in their recent orders"
                        }
                      ]
                    },
                    {
                      "name": "accounting_files",
                      "kind": "required",
                      "type": "array",
                      "description": "",
                      "modelRef": "#/components/schemas/PurchaseFiles",
                      "customType": "PurchaseFiles[]",
                      "schema": [
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier of the purchase file that is used by your system",
                              "example": "INV011",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier of the purchase file that should be shown to the customer",
                              "default": "INV011"
                            }
                          ]
                        },
                        {
                          "name": "data",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "complexType": "anyOf",
                          "complexItems": [
                            {
                              "name": "object",
                              "description": "",
                              "schema": [
                                {
                                  "name": "uri",
                                  "kind": "optional",
                                  "type": "string<uri>",
                                  "nullable": true,
                                  "description": "",
                                  "format": "uri"
                                },
                                {
                                  "name": "type",
                                  "kind": "required",
                                  "type": "string<uri>",
                                  "description": "",
                                  "example": "uri",
                                  "default": "uri",
                                  "enum": [
                                    "uri"
                                  ]
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "file_type",
                          "kind": "required",
                          "type": "string<credit | invoice | payment>",
                          "description": "",
                          "example": "invoice",
                          "enum": [
                            "credit",
                            "invoice",
                            "payment"
                          ]
                        }
                      ]
                    },
                    {
                      "name": "line_items",
                      "kind": "required",
                      "type": "array",
                      "description": "",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<custom | product>",
                          "description": "",
                          "enum": [
                            "custom",
                            "product"
                          ]
                        },
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "sparklayer_item_key",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                              "minLength": 1
                            },
                            {
                              "name": "sparklayer_variant_id",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The ID of the variant on your e-commerce platform</p>",
                              "example": "45552423353839",
                              "minLength": 1
                            },
                            {
                              "name": "sku",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "CAT-MUG",
                              "maxLength": 128
                            },
                            {
                              "name": "platform",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The identifier for the product on the e-commerce platform</p>",
                              "example": "123456789",
                              "minLength": 1
                            },
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier for the product on your system",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>A human-readable identifier for the product</p>"
                            }
                          ]
                        },
                        {
                          "name": "name_parent",
                          "kind": "required",
                          "type": "string",
                          "description": "Name of the product",
                          "example": "T-Shirt"
                        },
                        {
                          "name": "name_child",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "<p>Name of the product variant/type</p>",
                          "example": "Red"
                        },
                        {
                          "name": "quantity",
                          "kind": "required",
                          "type": "number",
                          "description": "",
                          "example": 4
                        },
                        {
                          "name": "custom_attributes",
                          "kind": "optional",
                          "type": "array",
                          "description": "",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "key",
                              "kind": "required",
                              "type": "string",
                              "nullable": false,
                              "description": "Key or name of the attribute.",
                              "example": "mug text"
                            },
                            {
                              "name": "value",
                              "kind": "required",
                              "type": "string",
                              "nullable": false,
                              "description": "Value of the attribute.",
                              "example": "best company ever"
                            }
                          ]
                        },
                        {
                          "name": "line_total",
                          "kind": "required",
                          "type": "object",
                          "nullable": true,
                          "description": "",
                          "complexType": "allOf",
                          "complexItems": [
                            {
                              "name": "LineTotal",
                              "description": "",
                              "modelRef": "#/components/schemas/LineTotal",
                              "schema": [
                                {
                                  "name": "total_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "tax_rate",
                                  "kind": "optional",
                                  "type": "number<double>",
                                  "deprecated": true,
                                  "nullable": true,
                                  "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                  "example": 20,
                                  "default": 0,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "tax_lines",
                          "kind": "optional",
                          "type": "array",
                          "description": "Information about a tax line on a purchase",
                          "modelRef": "#/components/schemas/TaxLine",
                          "customType": "TaxLine[]",
                          "schema": [
                            {
                              "name": "title",
                              "kind": "required",
                              "type": "string",
                              "description": "The title of the tax line",
                              "example": "HST"
                            },
                            {
                              "name": "amount",
                              "kind": "required",
                              "type": "object",
                              "description": "The amount of tax of the tax line",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "amount_base",
                              "kind": "optional",
                              "type": "object",
                              "description": "The amount of tax of the tax line in the store's base currency",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "rate",
                              "kind": "required",
                              "type": "number<double>",
                              "nullable": true,
                              "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                              "example": 20,
                              "format": "double",
                              "minimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "shipping_method",
                      "kind": "optional",
                      "type": "object",
                      "nullable": true,
                      "description": "<p>Details of how the package was/will be shipped</p>",
                      "example": "",
                      "schema": [
                        {
                          "name": "sku",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "SKU that identifies the shipping method used",
                          "example": "SHIP-ECO",
                          "minLength": 1
                        },
                        {
                          "name": "name",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The friendly/human-readable name for the shipping method</p>",
                          "example": "Standard Shipping"
                        },
                        {
                          "name": "line_total",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "complexType": "allOf",
                          "complexItems": [
                            {
                              "name": "LineTotal",
                              "description": "",
                              "modelRef": "#/components/schemas/LineTotal",
                              "schema": [
                                {
                                  "name": "total_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "tax_rate",
                                  "kind": "optional",
                                  "type": "number<double>",
                                  "deprecated": true,
                                  "nullable": true,
                                  "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                  "example": 20,
                                  "default": 0,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "tax_lines",
                          "kind": "optional",
                          "type": "array",
                          "description": "Information about a tax line on a purchase",
                          "modelRef": "#/components/schemas/TaxLine",
                          "customType": "TaxLine[]",
                          "schema": [
                            {
                              "name": "title",
                              "kind": "required",
                              "type": "string",
                              "description": "The title of the tax line",
                              "example": "HST"
                            },
                            {
                              "name": "amount",
                              "kind": "required",
                              "type": "object",
                              "description": "The amount of tax of the tax line",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "amount_base",
                              "kind": "optional",
                              "type": "object",
                              "description": "The amount of tax of the tax line in the store's base currency",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "rate",
                              "kind": "required",
                              "type": "number<double>",
                              "nullable": true,
                              "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                              "example": 20,
                              "format": "double",
                              "minimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "shipping_address",
                      "kind": "optional",
                      "type": "object",
                      "nullable": true,
                      "description": "",
                      "modelRef": "#/components/schemas/PurchaseAddress",
                      "customType": "PurchaseAddress",
                      "schema": [
                        {
                          "name": "name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom Jones"
                        },
                        {
                          "name": "company",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom Jones Hardware Ltd"
                        },
                        {
                          "name": "address_line1",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "7 Philosophy way"
                        },
                        {
                          "name": "address_line2",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": ""
                        },
                        {
                          "name": "city",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "Willerby"
                        },
                        {
                          "name": "region_code",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "",
                          "minLength": 1
                        },
                        {
                          "name": "postal_code",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "BJ6 9MK"
                        },
                        {
                          "name": "country_code",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "GB"
                        },
                        {
                          "name": "phone",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "0123456789"
                        },
                        {
                          "name": "sparklayer_id",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                        },
                        {
                          "name": "first_name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom"
                        },
                        {
                          "name": "last_name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Jones"
                        }
                      ]
                    },
                    {
                      "name": "shipments",
                      "kind": "required",
                      "type": "array",
                      "description": "Carrier and tracking details for the shipment",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "carrier",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "Carrier Company Ltd"
                        },
                        {
                          "name": "carrier_id",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The tracking number/ID used by the carrier</p>"
                        },
                        {
                          "name": "tracking_url",
                          "kind": "optional",
                          "type": "string<uri>",
                          "nullable": true,
                          "description": "The URL the customer can use to track their shipment",
                          "format": "uri"
                        }
                      ]
                    },
                    {
                      "name": "type",
                      "kind": "required",
                      "type": "string<shipment>",
                      "description": "",
                      "enum": [
                        "shipment"
                      ]
                    },
                    {
                      "name": "dates",
                      "kind": "required",
                      "type": "object",
                      "description": "",
                      "example": "",
                      "schema": [
                        {
                          "name": "shipped_at",
                          "kind": "required",
                          "type": "string<date-time>",
                          "description": "<p>The date at which the package was shipped - include user timezone or Z for UTC (RFC-3339)</p>",
                          "example": "2020-01-01T00:00:00+02:00",
                          "format": "date-time"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name": "Cancelled",
                  "description": "",
                  "modelRef": "#/components/schemas/Cancelled",
                  "schema": [
                    {
                      "name": "identifiers",
                      "kind": "required",
                      "type": "object",
                      "description": "",
                      "example": "",
                      "schema": [
                        {
                          "name": "sparklayer_package_id",
                          "kind": "required",
                          "type": "string<uuid>",
                          "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                          "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                          "format": "uuid"
                        },
                        {
                          "name": "platform",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "<p>The identifier for the package on the e-commerce platform</p>",
                          "example": "123456789",
                          "minLength": 1
                        },
                        {
                          "name": "internal",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "The identifier for the package on your system",
                          "minLength": 1
                        },
                        {
                          "name": "visible",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "The identifier that will be shown to the customer in their recent orders"
                        }
                      ]
                    },
                    {
                      "name": "accounting_files",
                      "kind": "required",
                      "type": "array",
                      "description": "",
                      "modelRef": "#/components/schemas/PurchaseFiles",
                      "customType": "PurchaseFiles[]",
                      "schema": [
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier of the purchase file that is used by your system",
                              "example": "INV011",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier of the purchase file that should be shown to the customer",
                              "default": "INV011"
                            }
                          ]
                        },
                        {
                          "name": "data",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "complexType": "anyOf",
                          "complexItems": [
                            {
                              "name": "object",
                              "description": "",
                              "schema": [
                                {
                                  "name": "uri",
                                  "kind": "optional",
                                  "type": "string<uri>",
                                  "nullable": true,
                                  "description": "",
                                  "format": "uri"
                                },
                                {
                                  "name": "type",
                                  "kind": "required",
                                  "type": "string<uri>",
                                  "description": "",
                                  "example": "uri",
                                  "default": "uri",
                                  "enum": [
                                    "uri"
                                  ]
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "file_type",
                          "kind": "required",
                          "type": "string<credit | invoice | payment>",
                          "description": "",
                          "example": "invoice",
                          "enum": [
                            "credit",
                            "invoice",
                            "payment"
                          ]
                        }
                      ]
                    },
                    {
                      "name": "line_items",
                      "kind": "required",
                      "type": "array",
                      "description": "",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<custom | product>",
                          "description": "",
                          "enum": [
                            "custom",
                            "product"
                          ]
                        },
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "sparklayer_item_key",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                              "minLength": 1
                            },
                            {
                              "name": "sparklayer_variant_id",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The ID of the variant on your e-commerce platform</p>",
                              "example": "45552423353839",
                              "minLength": 1
                            },
                            {
                              "name": "sku",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "CAT-MUG",
                              "maxLength": 128
                            },
                            {
                              "name": "platform",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The identifier for the product on the e-commerce platform</p>",
                              "example": "123456789",
                              "minLength": 1
                            },
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier for the product on your system",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>A human-readable identifier for the product</p>"
                            }
                          ]
                        },
                        {
                          "name": "name_parent",
                          "kind": "required",
                          "type": "string",
                          "description": "Name of the product",
                          "example": "T-Shirt"
                        },
                        {
                          "name": "name_child",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "<p>Name of the product variant/type</p>",
                          "example": "Red"
                        },
                        {
                          "name": "quantity",
                          "kind": "required",
                          "type": "number",
                          "description": "",
                          "example": 4
                        },
                        {
                          "name": "custom_attributes",
                          "kind": "optional",
                          "type": "array",
                          "description": "",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "key",
                              "kind": "required",
                              "type": "string",
                              "nullable": false,
                              "description": "Key or name of the attribute.",
                              "example": "mug text"
                            },
                            {
                              "name": "value",
                              "kind": "required",
                              "type": "string",
                              "nullable": false,
                              "description": "Value of the attribute.",
                              "example": "best company ever"
                            }
                          ]
                        },
                        {
                          "name": "line_total",
                          "kind": "required",
                          "type": "object",
                          "nullable": true,
                          "description": "",
                          "complexType": "allOf",
                          "complexItems": [
                            {
                              "name": "LineTotal",
                              "description": "",
                              "modelRef": "#/components/schemas/LineTotal",
                              "schema": [
                                {
                                  "name": "total_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "tax_rate",
                                  "kind": "optional",
                                  "type": "number<double>",
                                  "deprecated": true,
                                  "nullable": true,
                                  "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                  "example": 20,
                                  "default": 0,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "tax_lines",
                          "kind": "optional",
                          "type": "array",
                          "description": "Information about a tax line on a purchase",
                          "modelRef": "#/components/schemas/TaxLine",
                          "customType": "TaxLine[]",
                          "schema": [
                            {
                              "name": "title",
                              "kind": "required",
                              "type": "string",
                              "description": "The title of the tax line",
                              "example": "HST"
                            },
                            {
                              "name": "amount",
                              "kind": "required",
                              "type": "object",
                              "description": "The amount of tax of the tax line",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "amount_base",
                              "kind": "optional",
                              "type": "object",
                              "description": "The amount of tax of the tax line in the store's base currency",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "rate",
                              "kind": "required",
                              "type": "number<double>",
                              "nullable": true,
                              "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                              "example": 20,
                              "format": "double",
                              "minimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "shipping_method",
                      "kind": "optional",
                      "type": "object",
                      "nullable": true,
                      "description": "<p>Details of how the package was/will be shipped</p>",
                      "example": "",
                      "schema": [
                        {
                          "name": "sku",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "SKU that identifies the shipping method used",
                          "example": "SHIP-ECO",
                          "minLength": 1
                        },
                        {
                          "name": "name",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The friendly/human-readable name for the shipping method</p>",
                          "example": "Standard Shipping"
                        },
                        {
                          "name": "line_total",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "complexType": "allOf",
                          "complexItems": [
                            {
                              "name": "LineTotal",
                              "description": "",
                              "modelRef": "#/components/schemas/LineTotal",
                              "schema": [
                                {
                                  "name": "total_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_tax_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "total_gross_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "discount_net_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "allOf",
                                  "complexItems": [
                                    {
                                      "name": "MonetaryObject",
                                      "description": "",
                                      "modelRef": "#/components/schemas/MonetaryObject",
                                      "schema": [
                                        {
                                          "name": "number",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                          "example": "15.99",
                                          "minLength": 1
                                        },
                                        {
                                          "name": "currency",
                                          "kind": "required",
                                          "type": "string",
                                          "description": "The 3 letter currency code used for the prices in the purchase",
                                          "example": "GBP",
                                          "minLength": 3,
                                          "maxLength": 3
                                        }
                                      ]
                                    }
                                  ],
                                  "schema": []
                                },
                                {
                                  "name": "tax_rate",
                                  "kind": "optional",
                                  "type": "number<double>",
                                  "deprecated": true,
                                  "nullable": true,
                                  "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                  "example": 20,
                                  "default": 0,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ],
                          "schema": []
                        },
                        {
                          "name": "tax_lines",
                          "kind": "optional",
                          "type": "array",
                          "description": "Information about a tax line on a purchase",
                          "modelRef": "#/components/schemas/TaxLine",
                          "customType": "TaxLine[]",
                          "schema": [
                            {
                              "name": "title",
                              "kind": "required",
                              "type": "string",
                              "description": "The title of the tax line",
                              "example": "HST"
                            },
                            {
                              "name": "amount",
                              "kind": "required",
                              "type": "object",
                              "description": "The amount of tax of the tax line",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "amount_base",
                              "kind": "optional",
                              "type": "object",
                              "description": "The amount of tax of the tax line in the store's base currency",
                              "modelRef": "#/components/schemas/MonetaryObject",
                              "customType": "MonetaryObject",
                              "schema": [
                                {
                                  "name": "number",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                  "example": "15.99",
                                  "minLength": 1
                                },
                                {
                                  "name": "currency",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The 3 letter currency code used for the prices in the purchase",
                                  "example": "GBP",
                                  "minLength": 3,
                                  "maxLength": 3
                                }
                              ]
                            },
                            {
                              "name": "rate",
                              "kind": "required",
                              "type": "number<double>",
                              "nullable": true,
                              "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                              "example": 20,
                              "format": "double",
                              "minimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "shipping_address",
                      "kind": "optional",
                      "type": "object",
                      "nullable": true,
                      "description": "",
                      "modelRef": "#/components/schemas/PurchaseAddress",
                      "customType": "PurchaseAddress",
                      "schema": [
                        {
                          "name": "name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom Jones"
                        },
                        {
                          "name": "company",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom Jones Hardware Ltd"
                        },
                        {
                          "name": "address_line1",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "7 Philosophy way"
                        },
                        {
                          "name": "address_line2",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": ""
                        },
                        {
                          "name": "city",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "Willerby"
                        },
                        {
                          "name": "region_code",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "",
                          "minLength": 1
                        },
                        {
                          "name": "postal_code",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "BJ6 9MK"
                        },
                        {
                          "name": "country_code",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "GB"
                        },
                        {
                          "name": "phone",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "0123456789"
                        },
                        {
                          "name": "sparklayer_id",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                        },
                        {
                          "name": "first_name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Tom"
                        },
                        {
                          "name": "last_name",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "Jones"
                        }
                      ]
                    },
                    {
                      "name": "shipments",
                      "kind": "required",
                      "type": "array",
                      "description": "Carrier and tracking details for the shipment",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "carrier",
                          "kind": "required",
                          "type": "string",
                          "description": "",
                          "example": "Carrier Company Ltd"
                        },
                        {
                          "name": "carrier_id",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The tracking number/ID used by the carrier</p>"
                        },
                        {
                          "name": "tracking_url",
                          "kind": "optional",
                          "type": "string<uri>",
                          "nullable": true,
                          "description": "The URL the customer can use to track their shipment",
                          "format": "uri"
                        }
                      ]
                    },
                    {
                      "name": "type",
                      "kind": "required",
                      "type": "string<cancelled>",
                      "description": "",
                      "enum": [
                        "cancelled"
                      ]
                    },
                    {
                      "name": "dates",
                      "kind": "required",
                      "type": "object",
                      "description": "",
                      "example": "",
                      "schema": [
                        {
                          "name": "cancelled_at",
                          "kind": "optional",
                          "type": "string<date-time>",
                          "nullable": true,
                          "description": "<p>The date at which the package was cancelled - include user timezone or Z for UTC (RFC-3339)</p>",
                          "example": "2020-01-01T00:00:00+02:00",
                          "format": "date-time"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name": "Return",
                  "description": "",
                  "modelRef": "#/components/schemas/Return",
                  "schema": [
                    {
                      "name": "",
                      "description": "",
                      "customType": "Max depth limit reached"
                    }
                  ]
                }
              ]
            },
            {
              "name": "accounting_files",
              "kind": "required",
              "type": "array",
              "description": "Any accounting files associated with this package e.g. invoices",
              "modelRef": "#/components/schemas/PurchaseFiles",
              "customType": "PurchaseFiles[]",
              "schema": [
                {
                  "name": "identifiers",
                  "kind": "required",
                  "type": "object",
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "internal",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "The identifier of the purchase file that is used by your system",
                      "example": "INV011",
                      "minLength": 1
                    },
                    {
                      "name": "visible",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "The identifier of the purchase file that should be shown to the customer",
                      "default": "INV011"
                    }
                  ]
                },
                {
                  "name": "data",
                  "kind": "required",
                  "type": "object",
                  "description": "",
                  "complexType": "anyOf",
                  "complexItems": [
                    {
                      "name": "object",
                      "description": "",
                      "schema": [
                        {
                          "name": "uri",
                          "kind": "optional",
                          "type": "string<uri>",
                          "nullable": true,
                          "description": "",
                          "format": "uri"
                        },
                        {
                          "name": "type",
                          "kind": "required",
                          "type": "string<uri>",
                          "description": "",
                          "example": "uri",
                          "default": "uri",
                          "enum": [
                            "uri"
                          ]
                        }
                      ]
                    }
                  ],
                  "schema": []
                },
                {
                  "name": "file_type",
                  "kind": "required",
                  "type": "string<credit | invoice | payment>",
                  "description": "",
                  "example": "invoice",
                  "enum": [
                    "credit",
                    "invoice",
                    "payment"
                  ]
                }
              ]
            },
            {
              "name": "custom_fields",
              "kind": "required",
              "type": "array",
              "description": "Extra information for the purchase. This will be shown to the customer in their recent orders",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "name",
                  "kind": "required",
                  "type": "string",
                  "description": "<p>Name/identifier for the custom field</p>",
                  "example": "delivery-date",
                  "minLength": 1
                },
                {
                  "name": "value",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "Data for the custom field",
                  "example": "2023-10-28"
                }
              ]
            },
            {
              "name": "metadata",
              "kind": "optional",
              "type": "array",
              "description": "Extra information for the purchase. This not will be shown to the customer",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "name",
                  "kind": "required",
                  "type": "string",
                  "description": "<p>Name/identifier for the metadata</p>",
                  "example": "example-key",
                  "minLength": 1
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "string",
                  "description": "Data for the metadata",
                  "example": "1234"
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/Purchase",
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "example": "order",
                  "modelRef": "#/components/schemas/PurchaseType",
                  "customType": "PurchaseType",
                  "schema": []
                },
                {
                  "name": "purchase_identifiers",
                  "kind": "required",
                  "type": "object",
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "sparklayer",
                      "kind": "optional",
                      "type": "string<uuid>",
                      "nullable": true,
                      "description": "The identifier SparkLayer uses for the purchase. You will need to generate this if the purchase does not exist",
                      "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                      "format": "uuid",
                      "minLength": 1
                    },
                    {
                      "name": "platform",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "<p>The identifier for the purchase on the e-commerce platform</p>",
                      "example": "123456789",
                      "minLength": 1
                    },
                    {
                      "name": "internal",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "The identifier for the purchase on your system",
                      "minLength": 1
                    },
                    {
                      "name": "visible",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "The identifier that will be shown to the customer in their recent orders",
                      "example": "B2B01123"
                    }
                  ]
                },
                {
                  "name": "customer_identifiers",
                  "kind": "required",
                  "type": "object",
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "sparklayer",
                      "kind": "required",
                      "type": "string",
                      "nullable": false,
                      "description": "The ID of the customer that that order is for.",
                      "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                    },
                    {
                      "name": "sparklayer_impersonator",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "The ID of the sales agent placing the order.",
                      "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                    },
                    {
                      "name": "sparklayer_impersonator_assignee",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "The ID of the sales agent assigned to be responsible for the order.",
                      "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                    },
                    {
                      "name": "sparklayer_child",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "The ID of the company user that placed the order.",
                      "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                    }
                  ]
                },
                {
                  "name": "company",
                  "kind": "optional",
                  "type": "object",
                  "nullable": true,
                  "description": "<p>Company sections are opt-in; omit this entirely for merchants that do not use them.</p>",
                  "example": "",
                  "schema": [
                    {
                      "name": "id",
                      "kind": "optional",
                      "type": "string<uuid>",
                      "nullable": true,
                      "description": "The ID of the company the purchase was placed for.",
                      "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                      "format": "uuid"
                    },
                    {
                      "name": "section_id",
                      "kind": "optional",
                      "type": "string<uuid>",
                      "nullable": true,
                      "description": "The ID of the company section the purchase was placed for.",
                      "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                      "format": "uuid"
                    },
                    {
                      "name": "section_name",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "<p>The section name at the time of purchase, kept so historical purchases stay readable after a section is renamed or deleted. Not filterable.</p>",
                      "example": "Bristol",
                      "maxLength": 128
                    }
                  ]
                },
                {
                  "name": "payment_method",
                  "kind": "optional",
                  "type": "string<quote | upfrontPayment | paymentOnAccount | paymentByInvoice>",
                  "nullable": true,
                  "description": "<p>How the purchase was/will be paid for</p>",
                  "enum": [
                    "quote",
                    "upfrontPayment",
                    "paymentOnAccount",
                    "paymentByInvoice"
                  ]
                },
                {
                  "name": "dates",
                  "kind": "required",
                  "type": "object",
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "created_at",
                      "kind": "optional",
                      "type": "string<date-time>",
                      "readOnly": true,
                      "description": "<p>The date the purchase was created in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                      "example": "2020-01-01T00:00:00+02:00",
                      "format": "date-time"
                    },
                    {
                      "name": "updated_at",
                      "kind": "optional",
                      "type": "string<date-time>",
                      "readOnly": true,
                      "description": "<p>The date the purchase was last updated in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                      "example": "2020-01-01T00:00:00+02:00",
                      "format": "date-time"
                    },
                    {
                      "name": "placed_at",
                      "kind": "optional",
                      "type": "string<date-time>",
                      "nullable": true,
                      "description": "<p>The date at which the purchase was placed - include user timezone or Z for UTC (RFC-3339)</p>",
                      "example": "2020-01-01T00:00:00+02:00",
                      "format": "date-time"
                    },
                    {
                      "name": "to_be_placed_at",
                      "kind": "optional",
                      "type": "string<date-time>",
                      "nullable": true,
                      "description": "<p>The date at which the purchase is due to be placed, for a purchase that is scheduled rather than placed immediately (RFC-3339). It can be changed while the purchase is still pending</p>",
                      "example": "2020-01-01T00:00:00+02:00",
                      "format": "date-time"
                    },
                    {
                      "name": "calculated_submitted_at",
                      "kind": "optional",
                      "type": "string<date-time>",
                      "readOnly": true,
                      "description": "<p>The date the purchase was submitted (RFC-3339). This is when the cart is converted into another purchase type. This is read only - it should not be sent to the API, but will be returned form it</p>",
                      "example": "2020-01-01T00:00:00+02:00",
                      "format": "date-time"
                    },
                    {
                      "name": "expires_at",
                      "kind": "optional",
                      "type": "string<date-time>",
                      "readOnly": true,
                      "description": "<p>the date at which the purchase will expire and become archived (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                      "example": "2020-01-01T00:00:00+02:00",
                      "format": "date-time"
                    },
                    {
                      "name": "payment_due_at",
                      "kind": "optional",
                      "type": "string<date-time>",
                      "description": "The date at which payment for the purchase is expected",
                      "example": "2020-01-01T00:00:00+02:00",
                      "format": "date-time"
                    }
                  ]
                },
                {
                  "name": "customer_reference",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "Additional information that a customer adds to the order",
                  "example": "Please deliver to the back of the store"
                },
                {
                  "name": "po_number",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "PO number for the purchase",
                  "example": "PO-001"
                },
                {
                  "name": "shipping_requested_date",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "nullable": true,
                  "description": "The date requested for the delivery to arrive",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                },
                {
                  "name": "recurring_purchase",
                  "kind": "optional",
                  "type": "object",
                  "nullable": true,
                  "description": "Present only for a purchase created from a recurring purchase template. Both properties are stored when the purchase is created and ignored on any later update",
                  "example": "",
                  "schema": [
                    {
                      "name": "template_id",
                      "kind": "optional",
                      "type": "string<uuid>",
                      "nullable": true,
                      "description": "The recurring purchase template this purchase was created from. Set on creation and ignored on update",
                      "example": "0f8fad5b-d9cb-469f-a165-70867728950e",
                      "format": "uuid"
                    },
                    {
                      "name": "cancelled_at",
                      "kind": "optional",
                      "type": "string<date-time>",
                      "nullable": true,
                      "description": "<p>The date the customer cancelled the purchase, after which it will not be placed (RFC-3339). Cancelling does not free the date - the template has already had its turn for it</p>",
                      "example": "2020-01-01T00:00:00+02:00",
                      "format": "date-time"
                    },
                    {
                      "name": "to_be_placed_at_initial",
                      "kind": "optional",
                      "type": "string<date-time>",
                      "nullable": true,
                      "description": "<p>The date to_be_placed_at was first set to (RFC-3339). Set on creation and ignored on update, so that rescheduling cannot let the same template produce a second purchase for the same date</p>",
                      "example": "2020-01-01T00:00:00+02:00",
                      "format": "date-time"
                    }
                  ]
                },
                {
                  "name": "currency_code",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "The 3 letter currency code used for the prices in the purchase",
                  "example": "GBP",
                  "minLength": 3,
                  "maxLength": 3
                },
                {
                  "name": "currency_code_base",
                  "kind": "optional",
                  "type": "string",
                  "writeOnly": true,
                  "nullable": true,
                  "description": "The 3 letter currency code of the store's base currency",
                  "example": "GBP",
                  "minLength": 3,
                  "maxLength": 3
                },
                {
                  "name": "calculated_shipping_address",
                  "kind": "optional",
                  "type": "string",
                  "readOnly": true,
                  "nullable": true,
                  "description": "<p>A single string containing all the details of the shipping address. This is read only - it should not be sent to the API, but will be returned form it</p>",
                  "example": "John Spark, SparkLayer, SparkLayer HQ, Example City, 12345"
                },
                {
                  "name": "calculated_total",
                  "kind": "optional",
                  "type": "object",
                  "description": "",
                  "complexType": "allOf",
                  "complexItems": [
                    {
                      "name": "MonetaryObject",
                      "description": "",
                      "modelRef": "#/components/schemas/MonetaryObject",
                      "schema": [
                        {
                          "name": "number",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                          "example": "15.99",
                          "minLength": 1
                        },
                        {
                          "name": "currency",
                          "kind": "required",
                          "type": "string",
                          "description": "The 3 letter currency code used for the prices in the purchase",
                          "example": "GBP",
                          "minLength": 3,
                          "maxLength": 3
                        }
                      ]
                    }
                  ],
                  "schema": []
                },
                {
                  "name": "calculated_total_usd",
                  "kind": "optional",
                  "type": "object",
                  "description": "",
                  "complexType": "allOf",
                  "complexItems": [
                    {
                      "name": "MonetaryObject",
                      "description": "",
                      "modelRef": "#/components/schemas/MonetaryObject",
                      "schema": [
                        {
                          "name": "number",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                          "example": "15.99",
                          "minLength": 1
                        },
                        {
                          "name": "currency",
                          "kind": "required",
                          "type": "string",
                          "description": "The 3 letter currency code used for the prices in the purchase",
                          "example": "GBP",
                          "minLength": 3,
                          "maxLength": 3
                        }
                      ]
                    }
                  ],
                  "schema": []
                },
                {
                  "name": "calculated_total_base",
                  "kind": "optional",
                  "type": "object",
                  "description": "",
                  "complexType": "allOf",
                  "complexItems": [
                    {
                      "name": "MonetaryObject",
                      "description": "",
                      "modelRef": "#/components/schemas/MonetaryObject",
                      "schema": [
                        {
                          "name": "number",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                          "example": "15.99",
                          "minLength": 1
                        },
                        {
                          "name": "currency",
                          "kind": "required",
                          "type": "string",
                          "description": "The 3 letter currency code used for the prices in the purchase",
                          "example": "GBP",
                          "minLength": 3,
                          "maxLength": 3
                        }
                      ]
                    }
                  ],
                  "schema": []
                },
                {
                  "name": "calculated_fulfilment_status",
                  "kind": "optional",
                  "type": "string<incoming | processing | shipped | part_shipped | cancelled | returned | part_returned | varied>",
                  "readOnly": true,
                  "nullable": true,
                  "description": "<p>The status of the order, calculated from the statuses of the individual packages. This is read only - it should not be sent to the API, but will be returned form it</p>",
                  "example": "processing",
                  "enum": [
                    "incoming",
                    "processing",
                    "shipped",
                    "part_shipped",
                    "cancelled",
                    "returned",
                    "part_returned",
                    "varied"
                  ]
                },
                {
                  "name": "quote",
                  "kind": "optional",
                  "type": "object",
                  "nullable": true,
                  "description": "Quote data",
                  "example": "",
                  "schema": [
                    {
                      "name": "status_slug",
                      "kind": "optional",
                      "type": "string",
                      "description": "The slug of the quote status applied to this quote"
                    },
                    {
                      "name": "status",
                      "kind": "optional",
                      "type": "object",
                      "nullable": true,
                      "description": "",
                      "complexType": "allOf",
                      "complexItems": [
                        {
                          "name": "QuoteStatus",
                          "description": "",
                          "modelRef": "#/components/schemas/QuoteStatus",
                          "schema": [
                            {
                              "name": "id",
                              "kind": "optional",
                              "type": "string",
                              "description": ""
                            },
                            {
                              "name": "name",
                              "kind": "optional",
                              "type": "string",
                              "description": "",
                              "maxLength": 45
                            },
                            {
                              "name": "slug",
                              "kind": "optional",
                              "type": "string",
                              "description": "",
                              "maxLength": 45,
                              "pattern": "^[a-z0-9-]+$"
                            },
                            {
                              "name": "default",
                              "kind": "optional",
                              "type": "boolean",
                              "description": ""
                            },
                            {
                              "name": "next",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "maxLength": 45,
                              "pattern": "^[a-z0-9-]+$"
                            },
                            {
                              "name": "actions",
                              "kind": "optional",
                              "type": "array",
                              "description": "",
                              "example": "",
                              "itemType": "string",
                              "customType": "string[]",
                              "itemExample": "",
                              "itemDefault": ""
                            },
                            {
                              "name": "created_at",
                              "kind": "optional",
                              "type": "string<date-time>",
                              "description": "",
                              "format": "date-time"
                            },
                            {
                              "name": "updated_at",
                              "kind": "optional",
                              "type": "string<date-time>",
                              "description": "",
                              "format": "date-time"
                            },
                            {
                              "name": "deleted_at",
                              "kind": "optional",
                              "type": "string<date-time>",
                              "nullable": true,
                              "description": "",
                              "format": "date-time"
                            }
                          ]
                        }
                      ],
                      "schema": []
                    },
                    {
                      "name": "expiry",
                      "kind": "optional",
                      "type": "string<date-time>",
                      "nullable": true,
                      "description": "<p>The date at which the quote is considered expired and no longer valid (RFC-3339)</p>",
                      "example": "2020-01-01T00:00:00+02:00",
                      "format": "date-time"
                    }
                  ]
                },
                {
                  "name": "payment_status",
                  "kind": "optional",
                  "type": "string<unpaid | part_paid | paid>",
                  "description": "That payment status of the order",
                  "enum": [
                    "unpaid",
                    "part_paid",
                    "paid"
                  ]
                },
                {
                  "name": "total_paid",
                  "kind": "optional",
                  "type": "object",
                  "description": "",
                  "complexType": "allOf",
                  "complexItems": [
                    {
                      "name": "MonetaryObject",
                      "description": "",
                      "modelRef": "#/components/schemas/MonetaryObject",
                      "schema": [
                        {
                          "name": "number",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                          "example": "15.99",
                          "minLength": 1
                        },
                        {
                          "name": "currency",
                          "kind": "required",
                          "type": "string",
                          "description": "The 3 letter currency code used for the prices in the purchase",
                          "example": "GBP",
                          "minLength": 3,
                          "maxLength": 3
                        }
                      ]
                    }
                  ],
                  "schema": []
                }
              ],
              "modelRef": "#/components/schemas/PurchaseBase",
              "customType": "PurchaseBase"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "revision_date",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "nullable": true,
                  "description": "<p>The date at which the purchase was last modified - include user timezone or Z for UTC (RFC-3339)</p>",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                },
                {
                  "name": "tax_lines",
                  "kind": "optional",
                  "type": "array",
                  "description": "Tax lines for the purchase.",
                  "modelRef": "#/components/schemas/TaxLine",
                  "customType": "TaxLine[]",
                  "schema": [
                    {
                      "name": "title",
                      "kind": "required",
                      "type": "string",
                      "description": "The title of the tax line",
                      "example": "HST"
                    },
                    {
                      "name": "amount",
                      "kind": "required",
                      "type": "object",
                      "description": "The amount of tax of the tax line",
                      "modelRef": "#/components/schemas/MonetaryObject",
                      "customType": "MonetaryObject",
                      "schema": [
                        {
                          "name": "number",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                          "example": "15.99",
                          "minLength": 1
                        },
                        {
                          "name": "currency",
                          "kind": "required",
                          "type": "string",
                          "description": "The 3 letter currency code used for the prices in the purchase",
                          "example": "GBP",
                          "minLength": 3,
                          "maxLength": 3
                        }
                      ]
                    },
                    {
                      "name": "amount_base",
                      "kind": "optional",
                      "type": "object",
                      "description": "The amount of tax of the tax line in the store's base currency",
                      "modelRef": "#/components/schemas/MonetaryObject",
                      "customType": "MonetaryObject",
                      "schema": [
                        {
                          "name": "number",
                          "kind": "required",
                          "type": "string",
                          "description": "<p>The amount of currency in this currency, represented as a string</p>",
                          "example": "15.99",
                          "minLength": 1
                        },
                        {
                          "name": "currency",
                          "kind": "required",
                          "type": "string",
                          "description": "The 3 letter currency code used for the prices in the purchase",
                          "example": "GBP",
                          "minLength": 3,
                          "maxLength": 3
                        }
                      ]
                    },
                    {
                      "name": "rate",
                      "kind": "required",
                      "type": "number<double>",
                      "nullable": true,
                      "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                      "example": 20,
                      "format": "double",
                      "minimum": 0
                    }
                  ]
                },
                {
                  "name": "billing_address",
                  "kind": "optional",
                  "type": "object",
                  "nullable": true,
                  "description": "",
                  "modelRef": "#/components/schemas/PurchaseAddress",
                  "customType": "PurchaseAddress",
                  "schema": [
                    {
                      "name": "name",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "",
                      "example": "Tom Jones"
                    },
                    {
                      "name": "company",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "",
                      "example": "Tom Jones Hardware Ltd"
                    },
                    {
                      "name": "address_line1",
                      "kind": "required",
                      "type": "string",
                      "description": "",
                      "example": "7 Philosophy way"
                    },
                    {
                      "name": "address_line2",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "",
                      "example": ""
                    },
                    {
                      "name": "city",
                      "kind": "required",
                      "type": "string",
                      "description": "",
                      "example": "Willerby"
                    },
                    {
                      "name": "region_code",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "",
                      "example": "",
                      "minLength": 1
                    },
                    {
                      "name": "postal_code",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "",
                      "example": "BJ6 9MK"
                    },
                    {
                      "name": "country_code",
                      "kind": "required",
                      "type": "string",
                      "description": "",
                      "example": "GB"
                    },
                    {
                      "name": "phone",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "",
                      "example": "0123456789"
                    },
                    {
                      "name": "sparklayer_id",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "",
                      "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                    },
                    {
                      "name": "first_name",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "",
                      "example": "Tom"
                    },
                    {
                      "name": "last_name",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "",
                      "example": "Jones"
                    }
                  ]
                },
                {
                  "name": "packages",
                  "kind": "required",
                  "type": "object",
                  "description": "Packages contained within this purchase",
                  "modelRef": "#/components/schemas/Package",
                  "customType": "Package[]",
                  "schema": [],
                  "complexType": "oneOf",
                  "complexItems": [
                    {
                      "name": "Incoming",
                      "description": "",
                      "modelRef": "#/components/schemas/Incoming",
                      "schema": [
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "sparklayer_package_id",
                              "kind": "required",
                              "type": "string<uuid>",
                              "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                              "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                              "format": "uuid"
                            },
                            {
                              "name": "platform",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The identifier for the package on the e-commerce platform</p>",
                              "example": "123456789",
                              "minLength": 1
                            },
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier for the package on your system",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier that will be shown to the customer in their recent orders"
                            }
                          ]
                        },
                        {
                          "name": "accounting_files",
                          "kind": "required",
                          "type": "array",
                          "description": "",
                          "modelRef": "#/components/schemas/PurchaseFiles",
                          "customType": "PurchaseFiles[]",
                          "schema": [
                            {
                              "name": "identifiers",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "example": "",
                              "schema": [
                                {
                                  "name": "internal",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier of the purchase file that is used by your system",
                                  "example": "INV011",
                                  "minLength": 1
                                },
                                {
                                  "name": "visible",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier of the purchase file that should be shown to the customer",
                                  "default": "INV011"
                                }
                              ]
                            },
                            {
                              "name": "data",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "complexType": "anyOf",
                              "complexItems": [
                                {
                                  "name": "object",
                                  "description": "",
                                  "schema": [
                                    {
                                      "name": "uri",
                                      "kind": "optional",
                                      "type": "string<uri>",
                                      "nullable": true,
                                      "description": "",
                                      "format": "uri"
                                    },
                                    {
                                      "name": "type",
                                      "kind": "required",
                                      "type": "string<uri>",
                                      "description": "",
                                      "example": "uri",
                                      "default": "uri",
                                      "enum": [
                                        "uri"
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "file_type",
                              "kind": "required",
                              "type": "string<credit | invoice | payment>",
                              "description": "",
                              "example": "invoice",
                              "enum": [
                                "credit",
                                "invoice",
                                "payment"
                              ]
                            }
                          ]
                        },
                        {
                          "name": "line_items",
                          "kind": "required",
                          "type": "array",
                          "description": "",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<custom | product>",
                              "description": "",
                              "enum": [
                                "custom",
                                "product"
                              ]
                            },
                            {
                              "name": "identifiers",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "example": "",
                              "schema": [
                                {
                                  "name": "sparklayer_item_key",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                  "minLength": 1
                                },
                                {
                                  "name": "sparklayer_variant_id",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                  "example": "45552423353839",
                                  "minLength": 1
                                },
                                {
                                  "name": "sku",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "",
                                  "example": "CAT-MUG",
                                  "maxLength": 128
                                },
                                {
                                  "name": "platform",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                  "example": "123456789",
                                  "minLength": 1
                                },
                                {
                                  "name": "internal",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier for the product on your system",
                                  "minLength": 1
                                },
                                {
                                  "name": "visible",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>A human-readable identifier for the product</p>"
                                }
                              ]
                            },
                            {
                              "name": "name_parent",
                              "kind": "required",
                              "type": "string",
                              "description": "Name of the product",
                              "example": "T-Shirt"
                            },
                            {
                              "name": "name_child",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>Name of the product variant/type</p>",
                              "example": "Red"
                            },
                            {
                              "name": "quantity",
                              "kind": "required",
                              "type": "number",
                              "description": "",
                              "example": 4
                            },
                            {
                              "name": "custom_attributes",
                              "kind": "optional",
                              "type": "array",
                              "description": "",
                              "example": "",
                              "itemType": "object",
                              "customType": "object[]",
                              "schema": [
                                {
                                  "name": "key",
                                  "kind": "required",
                                  "type": "string",
                                  "nullable": false,
                                  "description": "Key or name of the attribute.",
                                  "example": "mug text"
                                },
                                {
                                  "name": "value",
                                  "kind": "required",
                                  "type": "string",
                                  "nullable": false,
                                  "description": "Value of the attribute.",
                                  "example": "best company ever"
                                }
                              ]
                            },
                            {
                              "name": "line_total",
                              "kind": "required",
                              "type": "object",
                              "nullable": true,
                              "description": "",
                              "complexType": "allOf",
                              "complexItems": [
                                {
                                  "name": "LineTotal",
                                  "description": "",
                                  "modelRef": "#/components/schemas/LineTotal",
                                  "schema": [
                                    {
                                      "name": "total_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "tax_rate",
                                      "kind": "optional",
                                      "type": "number<double>",
                                      "deprecated": true,
                                      "nullable": true,
                                      "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                      "example": 20,
                                      "default": 0,
                                      "format": "double",
                                      "minimum": 0
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "tax_lines",
                              "kind": "optional",
                              "type": "array",
                              "description": "Information about a tax line on a purchase",
                              "modelRef": "#/components/schemas/TaxLine",
                              "customType": "TaxLine[]",
                              "schema": [
                                {
                                  "name": "title",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The title of the tax line",
                                  "example": "HST"
                                },
                                {
                                  "name": "amount",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "amount_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line in the store's base currency",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "rate",
                                  "kind": "required",
                                  "type": "number<double>",
                                  "nullable": true,
                                  "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                  "example": 20,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name": "shipping_method",
                          "kind": "optional",
                          "type": "object",
                          "nullable": true,
                          "description": "<p>Details of how the package was/will be shipped</p>",
                          "example": "",
                          "schema": [
                            {
                              "name": "sku",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "SKU that identifies the shipping method used",
                              "example": "SHIP-ECO",
                              "minLength": 1
                            },
                            {
                              "name": "name",
                              "kind": "required",
                              "type": "string",
                              "description": "<p>The friendly/human-readable name for the shipping method</p>",
                              "example": "Standard Shipping"
                            },
                            {
                              "name": "line_total",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "complexType": "allOf",
                              "complexItems": [
                                {
                                  "name": "LineTotal",
                                  "description": "",
                                  "modelRef": "#/components/schemas/LineTotal",
                                  "schema": [
                                    {
                                      "name": "total_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "tax_rate",
                                      "kind": "optional",
                                      "type": "number<double>",
                                      "deprecated": true,
                                      "nullable": true,
                                      "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                      "example": 20,
                                      "default": 0,
                                      "format": "double",
                                      "minimum": 0
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "tax_lines",
                              "kind": "optional",
                              "type": "array",
                              "description": "Information about a tax line on a purchase",
                              "modelRef": "#/components/schemas/TaxLine",
                              "customType": "TaxLine[]",
                              "schema": [
                                {
                                  "name": "title",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The title of the tax line",
                                  "example": "HST"
                                },
                                {
                                  "name": "amount",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "amount_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line in the store's base currency",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "rate",
                                  "kind": "required",
                                  "type": "number<double>",
                                  "nullable": true,
                                  "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                  "example": 20,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name": "shipping_address",
                          "kind": "optional",
                          "type": "object",
                          "nullable": true,
                          "description": "",
                          "modelRef": "#/components/schemas/PurchaseAddress",
                          "customType": "PurchaseAddress",
                          "schema": [
                            {
                              "name": "name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom Jones"
                            },
                            {
                              "name": "company",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom Jones Hardware Ltd"
                            },
                            {
                              "name": "address_line1",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "7 Philosophy way"
                            },
                            {
                              "name": "address_line2",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": ""
                            },
                            {
                              "name": "city",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "Willerby"
                            },
                            {
                              "name": "region_code",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "",
                              "minLength": 1
                            },
                            {
                              "name": "postal_code",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "BJ6 9MK"
                            },
                            {
                              "name": "country_code",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "GB"
                            },
                            {
                              "name": "phone",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "0123456789"
                            },
                            {
                              "name": "sparklayer_id",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                            },
                            {
                              "name": "first_name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom"
                            },
                            {
                              "name": "last_name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Jones"
                            }
                          ]
                        },
                        {
                          "name": "shipments",
                          "kind": "required",
                          "type": "array",
                          "description": "Carrier and tracking details for the shipment",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "carrier",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "Carrier Company Ltd"
                            },
                            {
                              "name": "carrier_id",
                              "kind": "required",
                              "type": "string",
                              "description": "<p>The tracking number/ID used by the carrier</p>"
                            },
                            {
                              "name": "tracking_url",
                              "kind": "optional",
                              "type": "string<uri>",
                              "nullable": true,
                              "description": "The URL the customer can use to track their shipment",
                              "format": "uri"
                            }
                          ]
                        },
                        {
                          "name": "type",
                          "kind": "required",
                          "type": "string<incoming>",
                          "description": "",
                          "enum": [
                            "incoming"
                          ]
                        }
                      ]
                    },
                    {
                      "name": "Processing",
                      "description": "",
                      "modelRef": "#/components/schemas/Processing",
                      "schema": [
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "sparklayer_package_id",
                              "kind": "required",
                              "type": "string<uuid>",
                              "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                              "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                              "format": "uuid"
                            },
                            {
                              "name": "platform",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The identifier for the package on the e-commerce platform</p>",
                              "example": "123456789",
                              "minLength": 1
                            },
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier for the package on your system",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier that will be shown to the customer in their recent orders"
                            }
                          ]
                        },
                        {
                          "name": "accounting_files",
                          "kind": "required",
                          "type": "array",
                          "description": "",
                          "modelRef": "#/components/schemas/PurchaseFiles",
                          "customType": "PurchaseFiles[]",
                          "schema": [
                            {
                              "name": "identifiers",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "example": "",
                              "schema": [
                                {
                                  "name": "internal",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier of the purchase file that is used by your system",
                                  "example": "INV011",
                                  "minLength": 1
                                },
                                {
                                  "name": "visible",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier of the purchase file that should be shown to the customer",
                                  "default": "INV011"
                                }
                              ]
                            },
                            {
                              "name": "data",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "complexType": "anyOf",
                              "complexItems": [
                                {
                                  "name": "object",
                                  "description": "",
                                  "schema": [
                                    {
                                      "name": "uri",
                                      "kind": "optional",
                                      "type": "string<uri>",
                                      "nullable": true,
                                      "description": "",
                                      "format": "uri"
                                    },
                                    {
                                      "name": "type",
                                      "kind": "required",
                                      "type": "string<uri>",
                                      "description": "",
                                      "example": "uri",
                                      "default": "uri",
                                      "enum": [
                                        "uri"
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "file_type",
                              "kind": "required",
                              "type": "string<credit | invoice | payment>",
                              "description": "",
                              "example": "invoice",
                              "enum": [
                                "credit",
                                "invoice",
                                "payment"
                              ]
                            }
                          ]
                        },
                        {
                          "name": "line_items",
                          "kind": "required",
                          "type": "array",
                          "description": "",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<custom | product>",
                              "description": "",
                              "enum": [
                                "custom",
                                "product"
                              ]
                            },
                            {
                              "name": "identifiers",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "example": "",
                              "schema": [
                                {
                                  "name": "sparklayer_item_key",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                  "minLength": 1
                                },
                                {
                                  "name": "sparklayer_variant_id",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                  "example": "45552423353839",
                                  "minLength": 1
                                },
                                {
                                  "name": "sku",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "",
                                  "example": "CAT-MUG",
                                  "maxLength": 128
                                },
                                {
                                  "name": "platform",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                  "example": "123456789",
                                  "minLength": 1
                                },
                                {
                                  "name": "internal",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier for the product on your system",
                                  "minLength": 1
                                },
                                {
                                  "name": "visible",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>A human-readable identifier for the product</p>"
                                }
                              ]
                            },
                            {
                              "name": "name_parent",
                              "kind": "required",
                              "type": "string",
                              "description": "Name of the product",
                              "example": "T-Shirt"
                            },
                            {
                              "name": "name_child",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>Name of the product variant/type</p>",
                              "example": "Red"
                            },
                            {
                              "name": "quantity",
                              "kind": "required",
                              "type": "number",
                              "description": "",
                              "example": 4
                            },
                            {
                              "name": "custom_attributes",
                              "kind": "optional",
                              "type": "array",
                              "description": "",
                              "example": "",
                              "itemType": "object",
                              "customType": "object[]",
                              "schema": [
                                {
                                  "name": "key",
                                  "kind": "required",
                                  "type": "string",
                                  "nullable": false,
                                  "description": "Key or name of the attribute.",
                                  "example": "mug text"
                                },
                                {
                                  "name": "value",
                                  "kind": "required",
                                  "type": "string",
                                  "nullable": false,
                                  "description": "Value of the attribute.",
                                  "example": "best company ever"
                                }
                              ]
                            },
                            {
                              "name": "line_total",
                              "kind": "required",
                              "type": "object",
                              "nullable": true,
                              "description": "",
                              "complexType": "allOf",
                              "complexItems": [
                                {
                                  "name": "LineTotal",
                                  "description": "",
                                  "modelRef": "#/components/schemas/LineTotal",
                                  "schema": [
                                    {
                                      "name": "total_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "tax_rate",
                                      "kind": "optional",
                                      "type": "number<double>",
                                      "deprecated": true,
                                      "nullable": true,
                                      "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                      "example": 20,
                                      "default": 0,
                                      "format": "double",
                                      "minimum": 0
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "tax_lines",
                              "kind": "optional",
                              "type": "array",
                              "description": "Information about a tax line on a purchase",
                              "modelRef": "#/components/schemas/TaxLine",
                              "customType": "TaxLine[]",
                              "schema": [
                                {
                                  "name": "title",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The title of the tax line",
                                  "example": "HST"
                                },
                                {
                                  "name": "amount",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "amount_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line in the store's base currency",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "rate",
                                  "kind": "required",
                                  "type": "number<double>",
                                  "nullable": true,
                                  "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                  "example": 20,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name": "shipping_method",
                          "kind": "optional",
                          "type": "object",
                          "nullable": true,
                          "description": "<p>Details of how the package was/will be shipped</p>",
                          "example": "",
                          "schema": [
                            {
                              "name": "sku",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "SKU that identifies the shipping method used",
                              "example": "SHIP-ECO",
                              "minLength": 1
                            },
                            {
                              "name": "name",
                              "kind": "required",
                              "type": "string",
                              "description": "<p>The friendly/human-readable name for the shipping method</p>",
                              "example": "Standard Shipping"
                            },
                            {
                              "name": "line_total",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "complexType": "allOf",
                              "complexItems": [
                                {
                                  "name": "LineTotal",
                                  "description": "",
                                  "modelRef": "#/components/schemas/LineTotal",
                                  "schema": [
                                    {
                                      "name": "total_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "tax_rate",
                                      "kind": "optional",
                                      "type": "number<double>",
                                      "deprecated": true,
                                      "nullable": true,
                                      "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                      "example": 20,
                                      "default": 0,
                                      "format": "double",
                                      "minimum": 0
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "tax_lines",
                              "kind": "optional",
                              "type": "array",
                              "description": "Information about a tax line on a purchase",
                              "modelRef": "#/components/schemas/TaxLine",
                              "customType": "TaxLine[]",
                              "schema": [
                                {
                                  "name": "title",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The title of the tax line",
                                  "example": "HST"
                                },
                                {
                                  "name": "amount",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "amount_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line in the store's base currency",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "rate",
                                  "kind": "required",
                                  "type": "number<double>",
                                  "nullable": true,
                                  "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                  "example": 20,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name": "shipping_address",
                          "kind": "optional",
                          "type": "object",
                          "nullable": true,
                          "description": "",
                          "modelRef": "#/components/schemas/PurchaseAddress",
                          "customType": "PurchaseAddress",
                          "schema": [
                            {
                              "name": "name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom Jones"
                            },
                            {
                              "name": "company",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom Jones Hardware Ltd"
                            },
                            {
                              "name": "address_line1",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "7 Philosophy way"
                            },
                            {
                              "name": "address_line2",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": ""
                            },
                            {
                              "name": "city",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "Willerby"
                            },
                            {
                              "name": "region_code",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "",
                              "minLength": 1
                            },
                            {
                              "name": "postal_code",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "BJ6 9MK"
                            },
                            {
                              "name": "country_code",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "GB"
                            },
                            {
                              "name": "phone",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "0123456789"
                            },
                            {
                              "name": "sparklayer_id",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                            },
                            {
                              "name": "first_name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom"
                            },
                            {
                              "name": "last_name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Jones"
                            }
                          ]
                        },
                        {
                          "name": "shipments",
                          "kind": "required",
                          "type": "array",
                          "description": "Carrier and tracking details for the shipment",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "carrier",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "Carrier Company Ltd"
                            },
                            {
                              "name": "carrier_id",
                              "kind": "required",
                              "type": "string",
                              "description": "<p>The tracking number/ID used by the carrier</p>"
                            },
                            {
                              "name": "tracking_url",
                              "kind": "optional",
                              "type": "string<uri>",
                              "nullable": true,
                              "description": "The URL the customer can use to track their shipment",
                              "format": "uri"
                            }
                          ]
                        },
                        {
                          "name": "type",
                          "kind": "required",
                          "type": "string<processing>",
                          "description": "",
                          "enum": [
                            "processing"
                          ]
                        }
                      ]
                    },
                    {
                      "name": "Shipment",
                      "description": "",
                      "modelRef": "#/components/schemas/Shipment",
                      "schema": [
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "sparklayer_package_id",
                              "kind": "required",
                              "type": "string<uuid>",
                              "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                              "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                              "format": "uuid"
                            },
                            {
                              "name": "platform",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The identifier for the package on the e-commerce platform</p>",
                              "example": "123456789",
                              "minLength": 1
                            },
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier for the package on your system",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier that will be shown to the customer in their recent orders"
                            }
                          ]
                        },
                        {
                          "name": "accounting_files",
                          "kind": "required",
                          "type": "array",
                          "description": "",
                          "modelRef": "#/components/schemas/PurchaseFiles",
                          "customType": "PurchaseFiles[]",
                          "schema": [
                            {
                              "name": "identifiers",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "example": "",
                              "schema": [
                                {
                                  "name": "internal",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier of the purchase file that is used by your system",
                                  "example": "INV011",
                                  "minLength": 1
                                },
                                {
                                  "name": "visible",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier of the purchase file that should be shown to the customer",
                                  "default": "INV011"
                                }
                              ]
                            },
                            {
                              "name": "data",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "complexType": "anyOf",
                              "complexItems": [
                                {
                                  "name": "object",
                                  "description": "",
                                  "schema": [
                                    {
                                      "name": "uri",
                                      "kind": "optional",
                                      "type": "string<uri>",
                                      "nullable": true,
                                      "description": "",
                                      "format": "uri"
                                    },
                                    {
                                      "name": "type",
                                      "kind": "required",
                                      "type": "string<uri>",
                                      "description": "",
                                      "example": "uri",
                                      "default": "uri",
                                      "enum": [
                                        "uri"
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "file_type",
                              "kind": "required",
                              "type": "string<credit | invoice | payment>",
                              "description": "",
                              "example": "invoice",
                              "enum": [
                                "credit",
                                "invoice",
                                "payment"
                              ]
                            }
                          ]
                        },
                        {
                          "name": "line_items",
                          "kind": "required",
                          "type": "array",
                          "description": "",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<custom | product>",
                              "description": "",
                              "enum": [
                                "custom",
                                "product"
                              ]
                            },
                            {
                              "name": "identifiers",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "example": "",
                              "schema": [
                                {
                                  "name": "sparklayer_item_key",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                  "minLength": 1
                                },
                                {
                                  "name": "sparklayer_variant_id",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                  "example": "45552423353839",
                                  "minLength": 1
                                },
                                {
                                  "name": "sku",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "",
                                  "example": "CAT-MUG",
                                  "maxLength": 128
                                },
                                {
                                  "name": "platform",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                  "example": "123456789",
                                  "minLength": 1
                                },
                                {
                                  "name": "internal",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier for the product on your system",
                                  "minLength": 1
                                },
                                {
                                  "name": "visible",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>A human-readable identifier for the product</p>"
                                }
                              ]
                            },
                            {
                              "name": "name_parent",
                              "kind": "required",
                              "type": "string",
                              "description": "Name of the product",
                              "example": "T-Shirt"
                            },
                            {
                              "name": "name_child",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>Name of the product variant/type</p>",
                              "example": "Red"
                            },
                            {
                              "name": "quantity",
                              "kind": "required",
                              "type": "number",
                              "description": "",
                              "example": 4
                            },
                            {
                              "name": "custom_attributes",
                              "kind": "optional",
                              "type": "array",
                              "description": "",
                              "example": "",
                              "itemType": "object",
                              "customType": "object[]",
                              "schema": [
                                {
                                  "name": "key",
                                  "kind": "required",
                                  "type": "string",
                                  "nullable": false,
                                  "description": "Key or name of the attribute.",
                                  "example": "mug text"
                                },
                                {
                                  "name": "value",
                                  "kind": "required",
                                  "type": "string",
                                  "nullable": false,
                                  "description": "Value of the attribute.",
                                  "example": "best company ever"
                                }
                              ]
                            },
                            {
                              "name": "line_total",
                              "kind": "required",
                              "type": "object",
                              "nullable": true,
                              "description": "",
                              "complexType": "allOf",
                              "complexItems": [
                                {
                                  "name": "LineTotal",
                                  "description": "",
                                  "modelRef": "#/components/schemas/LineTotal",
                                  "schema": [
                                    {
                                      "name": "total_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "tax_rate",
                                      "kind": "optional",
                                      "type": "number<double>",
                                      "deprecated": true,
                                      "nullable": true,
                                      "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                      "example": 20,
                                      "default": 0,
                                      "format": "double",
                                      "minimum": 0
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "tax_lines",
                              "kind": "optional",
                              "type": "array",
                              "description": "Information about a tax line on a purchase",
                              "modelRef": "#/components/schemas/TaxLine",
                              "customType": "TaxLine[]",
                              "schema": [
                                {
                                  "name": "title",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The title of the tax line",
                                  "example": "HST"
                                },
                                {
                                  "name": "amount",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "amount_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line in the store's base currency",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "rate",
                                  "kind": "required",
                                  "type": "number<double>",
                                  "nullable": true,
                                  "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                  "example": 20,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name": "shipping_method",
                          "kind": "optional",
                          "type": "object",
                          "nullable": true,
                          "description": "<p>Details of how the package was/will be shipped</p>",
                          "example": "",
                          "schema": [
                            {
                              "name": "sku",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "SKU that identifies the shipping method used",
                              "example": "SHIP-ECO",
                              "minLength": 1
                            },
                            {
                              "name": "name",
                              "kind": "required",
                              "type": "string",
                              "description": "<p>The friendly/human-readable name for the shipping method</p>",
                              "example": "Standard Shipping"
                            },
                            {
                              "name": "line_total",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "complexType": "allOf",
                              "complexItems": [
                                {
                                  "name": "LineTotal",
                                  "description": "",
                                  "modelRef": "#/components/schemas/LineTotal",
                                  "schema": [
                                    {
                                      "name": "total_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "tax_rate",
                                      "kind": "optional",
                                      "type": "number<double>",
                                      "deprecated": true,
                                      "nullable": true,
                                      "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                      "example": 20,
                                      "default": 0,
                                      "format": "double",
                                      "minimum": 0
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "tax_lines",
                              "kind": "optional",
                              "type": "array",
                              "description": "Information about a tax line on a purchase",
                              "modelRef": "#/components/schemas/TaxLine",
                              "customType": "TaxLine[]",
                              "schema": [
                                {
                                  "name": "title",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The title of the tax line",
                                  "example": "HST"
                                },
                                {
                                  "name": "amount",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "amount_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line in the store's base currency",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "rate",
                                  "kind": "required",
                                  "type": "number<double>",
                                  "nullable": true,
                                  "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                  "example": 20,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name": "shipping_address",
                          "kind": "optional",
                          "type": "object",
                          "nullable": true,
                          "description": "",
                          "modelRef": "#/components/schemas/PurchaseAddress",
                          "customType": "PurchaseAddress",
                          "schema": [
                            {
                              "name": "name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom Jones"
                            },
                            {
                              "name": "company",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom Jones Hardware Ltd"
                            },
                            {
                              "name": "address_line1",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "7 Philosophy way"
                            },
                            {
                              "name": "address_line2",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": ""
                            },
                            {
                              "name": "city",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "Willerby"
                            },
                            {
                              "name": "region_code",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "",
                              "minLength": 1
                            },
                            {
                              "name": "postal_code",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "BJ6 9MK"
                            },
                            {
                              "name": "country_code",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "GB"
                            },
                            {
                              "name": "phone",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "0123456789"
                            },
                            {
                              "name": "sparklayer_id",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                            },
                            {
                              "name": "first_name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom"
                            },
                            {
                              "name": "last_name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Jones"
                            }
                          ]
                        },
                        {
                          "name": "shipments",
                          "kind": "required",
                          "type": "array",
                          "description": "Carrier and tracking details for the shipment",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "carrier",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "Carrier Company Ltd"
                            },
                            {
                              "name": "carrier_id",
                              "kind": "required",
                              "type": "string",
                              "description": "<p>The tracking number/ID used by the carrier</p>"
                            },
                            {
                              "name": "tracking_url",
                              "kind": "optional",
                              "type": "string<uri>",
                              "nullable": true,
                              "description": "The URL the customer can use to track their shipment",
                              "format": "uri"
                            }
                          ]
                        },
                        {
                          "name": "type",
                          "kind": "required",
                          "type": "string<shipment>",
                          "description": "",
                          "enum": [
                            "shipment"
                          ]
                        },
                        {
                          "name": "dates",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "shipped_at",
                              "kind": "required",
                              "type": "string<date-time>",
                              "description": "<p>The date at which the package was shipped - include user timezone or Z for UTC (RFC-3339)</p>",
                              "example": "2020-01-01T00:00:00+02:00",
                              "format": "date-time"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "Cancelled",
                      "description": "",
                      "modelRef": "#/components/schemas/Cancelled",
                      "schema": [
                        {
                          "name": "identifiers",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "sparklayer_package_id",
                              "kind": "required",
                              "type": "string<uuid>",
                              "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                              "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                              "format": "uuid"
                            },
                            {
                              "name": "platform",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>The identifier for the package on the e-commerce platform</p>",
                              "example": "123456789",
                              "minLength": 1
                            },
                            {
                              "name": "internal",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier for the package on your system",
                              "minLength": 1
                            },
                            {
                              "name": "visible",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "The identifier that will be shown to the customer in their recent orders"
                            }
                          ]
                        },
                        {
                          "name": "accounting_files",
                          "kind": "required",
                          "type": "array",
                          "description": "",
                          "modelRef": "#/components/schemas/PurchaseFiles",
                          "customType": "PurchaseFiles[]",
                          "schema": [
                            {
                              "name": "identifiers",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "example": "",
                              "schema": [
                                {
                                  "name": "internal",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier of the purchase file that is used by your system",
                                  "example": "INV011",
                                  "minLength": 1
                                },
                                {
                                  "name": "visible",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier of the purchase file that should be shown to the customer",
                                  "default": "INV011"
                                }
                              ]
                            },
                            {
                              "name": "data",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "complexType": "anyOf",
                              "complexItems": [
                                {
                                  "name": "object",
                                  "description": "",
                                  "schema": [
                                    {
                                      "name": "uri",
                                      "kind": "optional",
                                      "type": "string<uri>",
                                      "nullable": true,
                                      "description": "",
                                      "format": "uri"
                                    },
                                    {
                                      "name": "type",
                                      "kind": "required",
                                      "type": "string<uri>",
                                      "description": "",
                                      "example": "uri",
                                      "default": "uri",
                                      "enum": [
                                        "uri"
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "file_type",
                              "kind": "required",
                              "type": "string<credit | invoice | payment>",
                              "description": "",
                              "example": "invoice",
                              "enum": [
                                "credit",
                                "invoice",
                                "payment"
                              ]
                            }
                          ]
                        },
                        {
                          "name": "line_items",
                          "kind": "required",
                          "type": "array",
                          "description": "",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<custom | product>",
                              "description": "",
                              "enum": [
                                "custom",
                                "product"
                              ]
                            },
                            {
                              "name": "identifiers",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "example": "",
                              "schema": [
                                {
                                  "name": "sparklayer_item_key",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                  "minLength": 1
                                },
                                {
                                  "name": "sparklayer_variant_id",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                  "example": "45552423353839",
                                  "minLength": 1
                                },
                                {
                                  "name": "sku",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "",
                                  "example": "CAT-MUG",
                                  "maxLength": 128
                                },
                                {
                                  "name": "platform",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                  "example": "123456789",
                                  "minLength": 1
                                },
                                {
                                  "name": "internal",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "The identifier for the product on your system",
                                  "minLength": 1
                                },
                                {
                                  "name": "visible",
                                  "kind": "optional",
                                  "type": "string",
                                  "nullable": true,
                                  "description": "<p>A human-readable identifier for the product</p>"
                                }
                              ]
                            },
                            {
                              "name": "name_parent",
                              "kind": "required",
                              "type": "string",
                              "description": "Name of the product",
                              "example": "T-Shirt"
                            },
                            {
                              "name": "name_child",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "<p>Name of the product variant/type</p>",
                              "example": "Red"
                            },
                            {
                              "name": "quantity",
                              "kind": "required",
                              "type": "number",
                              "description": "",
                              "example": 4
                            },
                            {
                              "name": "custom_attributes",
                              "kind": "optional",
                              "type": "array",
                              "description": "",
                              "example": "",
                              "itemType": "object",
                              "customType": "object[]",
                              "schema": [
                                {
                                  "name": "key",
                                  "kind": "required",
                                  "type": "string",
                                  "nullable": false,
                                  "description": "Key or name of the attribute.",
                                  "example": "mug text"
                                },
                                {
                                  "name": "value",
                                  "kind": "required",
                                  "type": "string",
                                  "nullable": false,
                                  "description": "Value of the attribute.",
                                  "example": "best company ever"
                                }
                              ]
                            },
                            {
                              "name": "line_total",
                              "kind": "required",
                              "type": "object",
                              "nullable": true,
                              "description": "",
                              "complexType": "allOf",
                              "complexItems": [
                                {
                                  "name": "LineTotal",
                                  "description": "",
                                  "modelRef": "#/components/schemas/LineTotal",
                                  "schema": [
                                    {
                                      "name": "total_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "tax_rate",
                                      "kind": "optional",
                                      "type": "number<double>",
                                      "deprecated": true,
                                      "nullable": true,
                                      "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                      "example": 20,
                                      "default": 0,
                                      "format": "double",
                                      "minimum": 0
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "tax_lines",
                              "kind": "optional",
                              "type": "array",
                              "description": "Information about a tax line on a purchase",
                              "modelRef": "#/components/schemas/TaxLine",
                              "customType": "TaxLine[]",
                              "schema": [
                                {
                                  "name": "title",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The title of the tax line",
                                  "example": "HST"
                                },
                                {
                                  "name": "amount",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "amount_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line in the store's base currency",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "rate",
                                  "kind": "required",
                                  "type": "number<double>",
                                  "nullable": true,
                                  "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                  "example": 20,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name": "shipping_method",
                          "kind": "optional",
                          "type": "object",
                          "nullable": true,
                          "description": "<p>Details of how the package was/will be shipped</p>",
                          "example": "",
                          "schema": [
                            {
                              "name": "sku",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "SKU that identifies the shipping method used",
                              "example": "SHIP-ECO",
                              "minLength": 1
                            },
                            {
                              "name": "name",
                              "kind": "required",
                              "type": "string",
                              "description": "<p>The friendly/human-readable name for the shipping method</p>",
                              "example": "Standard Shipping"
                            },
                            {
                              "name": "line_total",
                              "kind": "required",
                              "type": "object",
                              "description": "",
                              "complexType": "allOf",
                              "complexItems": [
                                {
                                  "name": "LineTotal",
                                  "description": "",
                                  "modelRef": "#/components/schemas/LineTotal",
                                  "schema": [
                                    {
                                      "name": "total_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_tax_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "total_gross_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net",
                                      "kind": "required",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "discount_net_base",
                                      "kind": "optional",
                                      "type": "object",
                                      "description": "",
                                      "complexType": "allOf",
                                      "complexItems": [
                                        {
                                          "name": "MonetaryObject",
                                          "description": "",
                                          "modelRef": "#/components/schemas/MonetaryObject",
                                          "schema": [
                                            {
                                              "name": "number",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                              "example": "15.99",
                                              "minLength": 1
                                            },
                                            {
                                              "name": "currency",
                                              "kind": "required",
                                              "type": "string",
                                              "description": "The 3 letter currency code used for the prices in the purchase",
                                              "example": "GBP",
                                              "minLength": 3,
                                              "maxLength": 3
                                            }
                                          ]
                                        }
                                      ],
                                      "schema": []
                                    },
                                    {
                                      "name": "tax_rate",
                                      "kind": "optional",
                                      "type": "number<double>",
                                      "deprecated": true,
                                      "nullable": true,
                                      "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                      "example": 20,
                                      "default": 0,
                                      "format": "double",
                                      "minimum": 0
                                    }
                                  ]
                                }
                              ],
                              "schema": []
                            },
                            {
                              "name": "tax_lines",
                              "kind": "optional",
                              "type": "array",
                              "description": "Information about a tax line on a purchase",
                              "modelRef": "#/components/schemas/TaxLine",
                              "customType": "TaxLine[]",
                              "schema": [
                                {
                                  "name": "title",
                                  "kind": "required",
                                  "type": "string",
                                  "description": "The title of the tax line",
                                  "example": "HST"
                                },
                                {
                                  "name": "amount",
                                  "kind": "required",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "amount_base",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "The amount of tax of the tax line in the store's base currency",
                                  "modelRef": "#/components/schemas/MonetaryObject",
                                  "customType": "MonetaryObject",
                                  "schema": [
                                    {
                                      "name": "number",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                      "example": "15.99",
                                      "minLength": 1
                                    },
                                    {
                                      "name": "currency",
                                      "kind": "required",
                                      "type": "string",
                                      "description": "The 3 letter currency code used for the prices in the purchase",
                                      "example": "GBP",
                                      "minLength": 3,
                                      "maxLength": 3
                                    }
                                  ]
                                },
                                {
                                  "name": "rate",
                                  "kind": "required",
                                  "type": "number<double>",
                                  "nullable": true,
                                  "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                  "example": 20,
                                  "format": "double",
                                  "minimum": 0
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name": "shipping_address",
                          "kind": "optional",
                          "type": "object",
                          "nullable": true,
                          "description": "",
                          "modelRef": "#/components/schemas/PurchaseAddress",
                          "customType": "PurchaseAddress",
                          "schema": [
                            {
                              "name": "name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom Jones"
                            },
                            {
                              "name": "company",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom Jones Hardware Ltd"
                            },
                            {
                              "name": "address_line1",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "7 Philosophy way"
                            },
                            {
                              "name": "address_line2",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": ""
                            },
                            {
                              "name": "city",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "Willerby"
                            },
                            {
                              "name": "region_code",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "",
                              "minLength": 1
                            },
                            {
                              "name": "postal_code",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "BJ6 9MK"
                            },
                            {
                              "name": "country_code",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "GB"
                            },
                            {
                              "name": "phone",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "0123456789"
                            },
                            {
                              "name": "sparklayer_id",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                            },
                            {
                              "name": "first_name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Tom"
                            },
                            {
                              "name": "last_name",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "Jones"
                            }
                          ]
                        },
                        {
                          "name": "shipments",
                          "kind": "required",
                          "type": "array",
                          "description": "Carrier and tracking details for the shipment",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "carrier",
                              "kind": "required",
                              "type": "string",
                              "description": "",
                              "example": "Carrier Company Ltd"
                            },
                            {
                              "name": "carrier_id",
                              "kind": "required",
                              "type": "string",
                              "description": "<p>The tracking number/ID used by the carrier</p>"
                            },
                            {
                              "name": "tracking_url",
                              "kind": "optional",
                              "type": "string<uri>",
                              "nullable": true,
                              "description": "The URL the customer can use to track their shipment",
                              "format": "uri"
                            }
                          ]
                        },
                        {
                          "name": "type",
                          "kind": "required",
                          "type": "string<cancelled>",
                          "description": "",
                          "enum": [
                            "cancelled"
                          ]
                        },
                        {
                          "name": "dates",
                          "kind": "required",
                          "type": "object",
                          "description": "",
                          "example": "",
                          "schema": [
                            {
                              "name": "cancelled_at",
                              "kind": "optional",
                              "type": "string<date-time>",
                              "nullable": true,
                              "description": "<p>The date at which the package was cancelled - include user timezone or Z for UTC (RFC-3339)</p>",
                              "example": "2020-01-01T00:00:00+02:00",
                              "format": "date-time"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "Return",
                      "description": "",
                      "modelRef": "#/components/schemas/Return",
                      "schema": [
                        {
                          "name": "",
                          "description": "",
                          "customType": "Max depth limit reached"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name": "accounting_files",
                  "kind": "required",
                  "type": "array",
                  "description": "Any accounting files associated with this package e.g. invoices",
                  "modelRef": "#/components/schemas/PurchaseFiles",
                  "customType": "PurchaseFiles[]",
                  "schema": [
                    {
                      "name": "identifiers",
                      "kind": "required",
                      "type": "object",
                      "description": "",
                      "example": "",
                      "schema": [
                        {
                          "name": "internal",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "The identifier of the purchase file that is used by your system",
                          "example": "INV011",
                          "minLength": 1
                        },
                        {
                          "name": "visible",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "The identifier of the purchase file that should be shown to the customer",
                          "default": "INV011"
                        }
                      ]
                    },
                    {
                      "name": "data",
                      "kind": "required",
                      "type": "object",
                      "description": "",
                      "complexType": "anyOf",
                      "complexItems": [
                        {
                          "name": "object",
                          "description": "",
                          "schema": [
                            {
                              "name": "uri",
                              "kind": "optional",
                              "type": "string<uri>",
                              "nullable": true,
                              "description": "",
                              "format": "uri"
                            },
                            {
                              "name": "type",
                              "kind": "required",
                              "type": "string<uri>",
                              "description": "",
                              "example": "uri",
                              "default": "uri",
                              "enum": [
                                "uri"
                              ]
                            }
                          ]
                        }
                      ],
                      "schema": []
                    },
                    {
                      "name": "file_type",
                      "kind": "required",
                      "type": "string<credit | invoice | payment>",
                      "description": "",
                      "example": "invoice",
                      "enum": [
                        "credit",
                        "invoice",
                        "payment"
                      ]
                    }
                  ]
                },
                {
                  "name": "custom_fields",
                  "kind": "required",
                  "type": "array",
                  "description": "Extra information for the purchase. This will be shown to the customer in their recent orders",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "name",
                      "kind": "required",
                      "type": "string",
                      "description": "<p>Name/identifier for the custom field</p>",
                      "example": "delivery-date",
                      "minLength": 1
                    },
                    {
                      "name": "value",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "Data for the custom field",
                      "example": "2023-10-28"
                    }
                  ]
                },
                {
                  "name": "metadata",
                  "kind": "optional",
                  "type": "array",
                  "description": "Extra information for the purchase. This not will be shown to the customer",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "name",
                      "kind": "required",
                      "type": "string",
                      "description": "<p>Name/identifier for the metadata</p>",
                      "example": "example-key",
                      "minLength": 1
                    },
                    {
                      "name": "value",
                      "kind": "required",
                      "type": "string",
                      "description": "Data for the metadata",
                      "example": "1234"
                    }
                  ]
                }
              ]
            }
          ],
          "complexType": "allOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "SparkLayer purchase object",
            "customType": "Purchase",
            "schema": [
              {
                "name": "type",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "order",
                "modelRef": "#/components/schemas/PurchaseType",
                "customType": "PurchaseType",
                "schema": []
              },
              {
                "name": "purchase_identifiers",
                "kind": "required",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "sparklayer",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The identifier SparkLayer uses for the purchase. You will need to generate this if the purchase does not exist",
                    "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                    "format": "uuid",
                    "minLength": 1
                  },
                  {
                    "name": "platform",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>The identifier for the purchase on the e-commerce platform</p>",
                    "example": "123456789",
                    "minLength": 1
                  },
                  {
                    "name": "internal",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The identifier for the purchase on your system",
                    "minLength": 1
                  },
                  {
                    "name": "visible",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The identifier that will be shown to the customer in their recent orders",
                    "example": "B2B01123"
                  }
                ]
              },
              {
                "name": "customer_identifiers",
                "kind": "required",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "sparklayer",
                    "kind": "required",
                    "type": "string",
                    "nullable": false,
                    "description": "The ID of the customer that that order is for.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  },
                  {
                    "name": "sparklayer_impersonator",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the sales agent placing the order.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  },
                  {
                    "name": "sparklayer_impersonator_assignee",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the sales agent assigned to be responsible for the order.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  },
                  {
                    "name": "sparklayer_child",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the company user that placed the order.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  }
                ]
              },
              {
                "name": "company",
                "kind": "optional",
                "type": "object",
                "nullable": true,
                "description": "<p>Company sections are opt-in; omit this entirely for merchants that do not use them.</p>",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The ID of the company the purchase was placed for.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                    "format": "uuid"
                  },
                  {
                    "name": "section_id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The ID of the company section the purchase was placed for.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                    "format": "uuid"
                  },
                  {
                    "name": "section_name",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>The section name at the time of purchase, kept so historical purchases stay readable after a section is renamed or deleted. Not filterable.</p>",
                    "example": "Bristol",
                    "maxLength": 128
                  }
                ]
              },
              {
                "name": "payment_method",
                "kind": "optional",
                "type": "string<quote | upfrontPayment | paymentOnAccount | paymentByInvoice>",
                "nullable": true,
                "description": "<p>How the purchase was/will be paid for</p>",
                "enum": [
                  "quote",
                  "upfrontPayment",
                  "paymentOnAccount",
                  "paymentByInvoice"
                ]
              },
              {
                "name": "dates",
                "kind": "required",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "created_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>The date the purchase was created in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "updated_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>The date the purchase was last updated in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "placed_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date at which the purchase was placed - include user timezone or Z for UTC (RFC-3339)</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "to_be_placed_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date at which the purchase is due to be placed, for a purchase that is scheduled rather than placed immediately (RFC-3339). It can be changed while the purchase is still pending</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "calculated_submitted_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>The date the purchase was submitted (RFC-3339). This is when the cart is converted into another purchase type. This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "expires_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>the date at which the purchase will expire and become archived (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "payment_due_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "The date at which payment for the purchase is expected",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  }
                ]
              },
              {
                "name": "customer_reference",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Additional information that a customer adds to the order",
                "example": "Please deliver to the back of the store"
              },
              {
                "name": "po_number",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "PO number for the purchase",
                "example": "PO-001"
              },
              {
                "name": "shipping_requested_date",
                "kind": "optional",
                "type": "string<date-time>",
                "nullable": true,
                "description": "The date requested for the delivery to arrive",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "recurring_purchase",
                "kind": "optional",
                "type": "object",
                "nullable": true,
                "description": "Present only for a purchase created from a recurring purchase template. Both properties are stored when the purchase is created and ignored on any later update",
                "example": "",
                "schema": [
                  {
                    "name": "template_id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The recurring purchase template this purchase was created from. Set on creation and ignored on update",
                    "example": "0f8fad5b-d9cb-469f-a165-70867728950e",
                    "format": "uuid"
                  },
                  {
                    "name": "cancelled_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date the customer cancelled the purchase, after which it will not be placed (RFC-3339). Cancelling does not free the date - the template has already had its turn for it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "to_be_placed_at_initial",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date to_be_placed_at was first set to (RFC-3339). Set on creation and ignored on update, so that rescheduling cannot let the same template produce a second purchase for the same date</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  }
                ]
              },
              {
                "name": "currency_code",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "The 3 letter currency code used for the prices in the purchase",
                "example": "GBP",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "currency_code_base",
                "kind": "optional",
                "type": "string",
                "writeOnly": true,
                "nullable": true,
                "description": "The 3 letter currency code of the store's base currency",
                "example": "GBP",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "calculated_shipping_address",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "nullable": true,
                "description": "<p>A single string containing all the details of the shipping address. This is read only - it should not be sent to the API, but will be returned form it</p>",
                "example": "John Spark, SparkLayer, SparkLayer HQ, Example City, 12345"
              },
              {
                "name": "calculated_total",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "calculated_total_usd",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "calculated_total_base",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "calculated_fulfilment_status",
                "kind": "optional",
                "type": "string<incoming | processing | shipped | part_shipped | cancelled | returned | part_returned | varied>",
                "readOnly": true,
                "nullable": true,
                "description": "<p>The status of the order, calculated from the statuses of the individual packages. This is read only - it should not be sent to the API, but will be returned form it</p>",
                "example": "processing",
                "enum": [
                  "incoming",
                  "processing",
                  "shipped",
                  "part_shipped",
                  "cancelled",
                  "returned",
                  "part_returned",
                  "varied"
                ]
              },
              {
                "name": "quote",
                "kind": "optional",
                "type": "object",
                "nullable": true,
                "description": "Quote data",
                "example": "",
                "schema": [
                  {
                    "name": "status_slug",
                    "kind": "optional",
                    "type": "string",
                    "description": "The slug of the quote status applied to this quote"
                  },
                  {
                    "name": "status",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "QuoteStatus",
                        "description": "",
                        "modelRef": "#/components/schemas/QuoteStatus",
                        "schema": [
                          {
                            "name": "id",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "description": "",
                            "maxLength": 45
                          },
                          {
                            "name": "slug",
                            "kind": "optional",
                            "type": "string",
                            "description": "",
                            "maxLength": 45,
                            "pattern": "^[a-z0-9-]+$"
                          },
                          {
                            "name": "default",
                            "kind": "optional",
                            "type": "boolean",
                            "description": ""
                          },
                          {
                            "name": "next",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "maxLength": 45,
                            "pattern": "^[a-z0-9-]+$"
                          },
                          {
                            "name": "actions",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "string",
                            "customType": "string[]",
                            "itemExample": "",
                            "itemDefault": ""
                          },
                          {
                            "name": "created_at",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "description": "",
                            "format": "date-time"
                          },
                          {
                            "name": "updated_at",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "description": "",
                            "format": "date-time"
                          },
                          {
                            "name": "deleted_at",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "nullable": true,
                            "description": "",
                            "format": "date-time"
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "expiry",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date at which the quote is considered expired and no longer valid (RFC-3339)</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  }
                ]
              },
              {
                "name": "payment_status",
                "kind": "optional",
                "type": "string<unpaid | part_paid | paid>",
                "description": "That payment status of the order",
                "enum": [
                  "unpaid",
                  "part_paid",
                  "paid"
                ]
              },
              {
                "name": "total_paid",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "revision_date",
                "kind": "optional",
                "type": "string<date-time>",
                "nullable": true,
                "description": "<p>The date at which the purchase was last modified - include user timezone or Z for UTC (RFC-3339)</p>",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "tax_lines",
                "kind": "optional",
                "type": "array",
                "description": "Tax lines for the purchase.",
                "modelRef": "#/components/schemas/TaxLine",
                "customType": "TaxLine[]",
                "schema": [
                  {
                    "name": "title",
                    "kind": "required",
                    "type": "string",
                    "description": "The title of the tax line",
                    "example": "HST"
                  },
                  {
                    "name": "amount",
                    "kind": "required",
                    "type": "object",
                    "description": "The amount of tax of the tax line",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "customType": "MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  },
                  {
                    "name": "amount_base",
                    "kind": "optional",
                    "type": "object",
                    "description": "The amount of tax of the tax line in the store's base currency",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "customType": "MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  },
                  {
                    "name": "rate",
                    "kind": "required",
                    "type": "number<double>",
                    "nullable": true,
                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                    "example": 20,
                    "format": "double",
                    "minimum": 0
                  }
                ]
              },
              {
                "name": "billing_address",
                "kind": "optional",
                "type": "object",
                "nullable": true,
                "description": "",
                "modelRef": "#/components/schemas/PurchaseAddress",
                "customType": "PurchaseAddress",
                "schema": [
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Tom Jones"
                  },
                  {
                    "name": "company",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Tom Jones Hardware Ltd"
                  },
                  {
                    "name": "address_line1",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "example": "7 Philosophy way"
                  },
                  {
                    "name": "address_line2",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": ""
                  },
                  {
                    "name": "city",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "example": "Willerby"
                  },
                  {
                    "name": "region_code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "minLength": 1
                  },
                  {
                    "name": "postal_code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "BJ6 9MK"
                  },
                  {
                    "name": "country_code",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "example": "GB"
                  },
                  {
                    "name": "phone",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "0123456789"
                  },
                  {
                    "name": "sparklayer_id",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                  },
                  {
                    "name": "first_name",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Tom"
                  },
                  {
                    "name": "last_name",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Jones"
                  }
                ]
              },
              {
                "name": "packages",
                "kind": "required",
                "type": "object",
                "description": "Packages contained within this purchase",
                "modelRef": "#/components/schemas/Package",
                "customType": "Package[]",
                "schema": [],
                "complexType": "oneOf",
                "complexItems": [
                  {
                    "name": "Incoming",
                    "description": "",
                    "modelRef": "#/components/schemas/Incoming",
                    "schema": [
                      {
                        "name": "identifiers",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "sparklayer_package_id",
                            "kind": "required",
                            "type": "string<uuid>",
                            "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                            "format": "uuid"
                          },
                          {
                            "name": "platform",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>The identifier for the package on the e-commerce platform</p>",
                            "example": "123456789",
                            "minLength": 1
                          },
                          {
                            "name": "internal",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier for the package on your system",
                            "minLength": 1
                          },
                          {
                            "name": "visible",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier that will be shown to the customer in their recent orders"
                          }
                        ]
                      },
                      {
                        "name": "accounting_files",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseFiles",
                        "customType": "PurchaseFiles[]",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that is used by your system",
                                "example": "INV011",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that should be shown to the customer",
                                "default": "INV011"
                              }
                            ]
                          },
                          {
                            "name": "data",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "anyOf",
                            "complexItems": [
                              {
                                "name": "object",
                                "description": "",
                                "schema": [
                                  {
                                    "name": "uri",
                                    "kind": "optional",
                                    "type": "string<uri>",
                                    "nullable": true,
                                    "description": "",
                                    "format": "uri"
                                  },
                                  {
                                    "name": "type",
                                    "kind": "required",
                                    "type": "string<uri>",
                                    "description": "",
                                    "example": "uri",
                                    "default": "uri",
                                    "enum": [
                                      "uri"
                                    ]
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "file_type",
                            "kind": "required",
                            "type": "string<credit | invoice | payment>",
                            "description": "",
                            "example": "invoice",
                            "enum": [
                              "credit",
                              "invoice",
                              "payment"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "line_items",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom | product>",
                            "description": "",
                            "enum": [
                              "custom",
                              "product"
                            ]
                          },
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_item_key",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                "minLength": 1
                              },
                              {
                                "name": "sparklayer_variant_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                "example": "45552423353839",
                                "minLength": 1
                              },
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "CAT-MUG",
                                "maxLength": 128
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the product on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>A human-readable identifier for the product</p>"
                              }
                            ]
                          },
                          {
                            "name": "name_parent",
                            "kind": "required",
                            "type": "string",
                            "description": "Name of the product",
                            "example": "T-Shirt"
                          },
                          {
                            "name": "name_child",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>Name of the product variant/type</p>",
                            "example": "Red"
                          },
                          {
                            "name": "quantity",
                            "kind": "required",
                            "type": "number",
                            "description": "",
                            "example": 4
                          },
                          {
                            "name": "custom_attributes",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "key",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Key or name of the attribute.",
                                "example": "mug text"
                              },
                              {
                                "name": "value",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Value of the attribute.",
                                "example": "best company ever"
                              }
                            ]
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_method",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "<p>Details of how the package was/will be shipped</p>",
                        "example": "",
                        "schema": [
                          {
                            "name": "sku",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "SKU that identifies the shipping method used",
                            "example": "SHIP-ECO",
                            "minLength": 1
                          },
                          {
                            "name": "name",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The friendly/human-readable name for the shipping method</p>",
                            "example": "Standard Shipping"
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_address",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseAddress",
                        "customType": "PurchaseAddress",
                        "schema": [
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones"
                          },
                          {
                            "name": "company",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones Hardware Ltd"
                          },
                          {
                            "name": "address_line1",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "7 Philosophy way"
                          },
                          {
                            "name": "address_line2",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": ""
                          },
                          {
                            "name": "city",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Willerby"
                          },
                          {
                            "name": "region_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "",
                            "minLength": 1
                          },
                          {
                            "name": "postal_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "BJ6 9MK"
                          },
                          {
                            "name": "country_code",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "GB"
                          },
                          {
                            "name": "phone",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "0123456789"
                          },
                          {
                            "name": "sparklayer_id",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                          },
                          {
                            "name": "first_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom"
                          },
                          {
                            "name": "last_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Jones"
                          }
                        ]
                      },
                      {
                        "name": "shipments",
                        "kind": "required",
                        "type": "array",
                        "description": "Carrier and tracking details for the shipment",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "carrier",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Carrier Company Ltd"
                          },
                          {
                            "name": "carrier_id",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The tracking number/ID used by the carrier</p>"
                          },
                          {
                            "name": "tracking_url",
                            "kind": "optional",
                            "type": "string<uri>",
                            "nullable": true,
                            "description": "The URL the customer can use to track their shipment",
                            "format": "uri"
                          }
                        ]
                      },
                      {
                        "name": "type",
                        "kind": "required",
                        "type": "string<incoming>",
                        "description": "",
                        "enum": [
                          "incoming"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "Processing",
                    "description": "",
                    "modelRef": "#/components/schemas/Processing",
                    "schema": [
                      {
                        "name": "identifiers",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "sparklayer_package_id",
                            "kind": "required",
                            "type": "string<uuid>",
                            "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                            "format": "uuid"
                          },
                          {
                            "name": "platform",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>The identifier for the package on the e-commerce platform</p>",
                            "example": "123456789",
                            "minLength": 1
                          },
                          {
                            "name": "internal",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier for the package on your system",
                            "minLength": 1
                          },
                          {
                            "name": "visible",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier that will be shown to the customer in their recent orders"
                          }
                        ]
                      },
                      {
                        "name": "accounting_files",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseFiles",
                        "customType": "PurchaseFiles[]",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that is used by your system",
                                "example": "INV011",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that should be shown to the customer",
                                "default": "INV011"
                              }
                            ]
                          },
                          {
                            "name": "data",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "anyOf",
                            "complexItems": [
                              {
                                "name": "object",
                                "description": "",
                                "schema": [
                                  {
                                    "name": "uri",
                                    "kind": "optional",
                                    "type": "string<uri>",
                                    "nullable": true,
                                    "description": "",
                                    "format": "uri"
                                  },
                                  {
                                    "name": "type",
                                    "kind": "required",
                                    "type": "string<uri>",
                                    "description": "",
                                    "example": "uri",
                                    "default": "uri",
                                    "enum": [
                                      "uri"
                                    ]
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "file_type",
                            "kind": "required",
                            "type": "string<credit | invoice | payment>",
                            "description": "",
                            "example": "invoice",
                            "enum": [
                              "credit",
                              "invoice",
                              "payment"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "line_items",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom | product>",
                            "description": "",
                            "enum": [
                              "custom",
                              "product"
                            ]
                          },
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_item_key",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                "minLength": 1
                              },
                              {
                                "name": "sparklayer_variant_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                "example": "45552423353839",
                                "minLength": 1
                              },
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "CAT-MUG",
                                "maxLength": 128
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the product on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>A human-readable identifier for the product</p>"
                              }
                            ]
                          },
                          {
                            "name": "name_parent",
                            "kind": "required",
                            "type": "string",
                            "description": "Name of the product",
                            "example": "T-Shirt"
                          },
                          {
                            "name": "name_child",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>Name of the product variant/type</p>",
                            "example": "Red"
                          },
                          {
                            "name": "quantity",
                            "kind": "required",
                            "type": "number",
                            "description": "",
                            "example": 4
                          },
                          {
                            "name": "custom_attributes",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "key",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Key or name of the attribute.",
                                "example": "mug text"
                              },
                              {
                                "name": "value",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Value of the attribute.",
                                "example": "best company ever"
                              }
                            ]
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_method",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "<p>Details of how the package was/will be shipped</p>",
                        "example": "",
                        "schema": [
                          {
                            "name": "sku",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "SKU that identifies the shipping method used",
                            "example": "SHIP-ECO",
                            "minLength": 1
                          },
                          {
                            "name": "name",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The friendly/human-readable name for the shipping method</p>",
                            "example": "Standard Shipping"
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_address",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseAddress",
                        "customType": "PurchaseAddress",
                        "schema": [
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones"
                          },
                          {
                            "name": "company",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones Hardware Ltd"
                          },
                          {
                            "name": "address_line1",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "7 Philosophy way"
                          },
                          {
                            "name": "address_line2",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": ""
                          },
                          {
                            "name": "city",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Willerby"
                          },
                          {
                            "name": "region_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "",
                            "minLength": 1
                          },
                          {
                            "name": "postal_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "BJ6 9MK"
                          },
                          {
                            "name": "country_code",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "GB"
                          },
                          {
                            "name": "phone",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "0123456789"
                          },
                          {
                            "name": "sparklayer_id",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                          },
                          {
                            "name": "first_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom"
                          },
                          {
                            "name": "last_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Jones"
                          }
                        ]
                      },
                      {
                        "name": "shipments",
                        "kind": "required",
                        "type": "array",
                        "description": "Carrier and tracking details for the shipment",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "carrier",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Carrier Company Ltd"
                          },
                          {
                            "name": "carrier_id",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The tracking number/ID used by the carrier</p>"
                          },
                          {
                            "name": "tracking_url",
                            "kind": "optional",
                            "type": "string<uri>",
                            "nullable": true,
                            "description": "The URL the customer can use to track their shipment",
                            "format": "uri"
                          }
                        ]
                      },
                      {
                        "name": "type",
                        "kind": "required",
                        "type": "string<processing>",
                        "description": "",
                        "enum": [
                          "processing"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "Shipment",
                    "description": "",
                    "modelRef": "#/components/schemas/Shipment",
                    "schema": [
                      {
                        "name": "identifiers",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "sparklayer_package_id",
                            "kind": "required",
                            "type": "string<uuid>",
                            "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                            "format": "uuid"
                          },
                          {
                            "name": "platform",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>The identifier for the package on the e-commerce platform</p>",
                            "example": "123456789",
                            "minLength": 1
                          },
                          {
                            "name": "internal",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier for the package on your system",
                            "minLength": 1
                          },
                          {
                            "name": "visible",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier that will be shown to the customer in their recent orders"
                          }
                        ]
                      },
                      {
                        "name": "accounting_files",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseFiles",
                        "customType": "PurchaseFiles[]",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that is used by your system",
                                "example": "INV011",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that should be shown to the customer",
                                "default": "INV011"
                              }
                            ]
                          },
                          {
                            "name": "data",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "anyOf",
                            "complexItems": [
                              {
                                "name": "object",
                                "description": "",
                                "schema": [
                                  {
                                    "name": "uri",
                                    "kind": "optional",
                                    "type": "string<uri>",
                                    "nullable": true,
                                    "description": "",
                                    "format": "uri"
                                  },
                                  {
                                    "name": "type",
                                    "kind": "required",
                                    "type": "string<uri>",
                                    "description": "",
                                    "example": "uri",
                                    "default": "uri",
                                    "enum": [
                                      "uri"
                                    ]
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "file_type",
                            "kind": "required",
                            "type": "string<credit | invoice | payment>",
                            "description": "",
                            "example": "invoice",
                            "enum": [
                              "credit",
                              "invoice",
                              "payment"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "line_items",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom | product>",
                            "description": "",
                            "enum": [
                              "custom",
                              "product"
                            ]
                          },
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_item_key",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                "minLength": 1
                              },
                              {
                                "name": "sparklayer_variant_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                "example": "45552423353839",
                                "minLength": 1
                              },
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "CAT-MUG",
                                "maxLength": 128
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the product on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>A human-readable identifier for the product</p>"
                              }
                            ]
                          },
                          {
                            "name": "name_parent",
                            "kind": "required",
                            "type": "string",
                            "description": "Name of the product",
                            "example": "T-Shirt"
                          },
                          {
                            "name": "name_child",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>Name of the product variant/type</p>",
                            "example": "Red"
                          },
                          {
                            "name": "quantity",
                            "kind": "required",
                            "type": "number",
                            "description": "",
                            "example": 4
                          },
                          {
                            "name": "custom_attributes",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "key",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Key or name of the attribute.",
                                "example": "mug text"
                              },
                              {
                                "name": "value",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Value of the attribute.",
                                "example": "best company ever"
                              }
                            ]
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_method",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "<p>Details of how the package was/will be shipped</p>",
                        "example": "",
                        "schema": [
                          {
                            "name": "sku",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "SKU that identifies the shipping method used",
                            "example": "SHIP-ECO",
                            "minLength": 1
                          },
                          {
                            "name": "name",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The friendly/human-readable name for the shipping method</p>",
                            "example": "Standard Shipping"
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_address",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseAddress",
                        "customType": "PurchaseAddress",
                        "schema": [
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones"
                          },
                          {
                            "name": "company",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones Hardware Ltd"
                          },
                          {
                            "name": "address_line1",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "7 Philosophy way"
                          },
                          {
                            "name": "address_line2",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": ""
                          },
                          {
                            "name": "city",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Willerby"
                          },
                          {
                            "name": "region_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "",
                            "minLength": 1
                          },
                          {
                            "name": "postal_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "BJ6 9MK"
                          },
                          {
                            "name": "country_code",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "GB"
                          },
                          {
                            "name": "phone",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "0123456789"
                          },
                          {
                            "name": "sparklayer_id",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                          },
                          {
                            "name": "first_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom"
                          },
                          {
                            "name": "last_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Jones"
                          }
                        ]
                      },
                      {
                        "name": "shipments",
                        "kind": "required",
                        "type": "array",
                        "description": "Carrier and tracking details for the shipment",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "carrier",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Carrier Company Ltd"
                          },
                          {
                            "name": "carrier_id",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The tracking number/ID used by the carrier</p>"
                          },
                          {
                            "name": "tracking_url",
                            "kind": "optional",
                            "type": "string<uri>",
                            "nullable": true,
                            "description": "The URL the customer can use to track their shipment",
                            "format": "uri"
                          }
                        ]
                      },
                      {
                        "name": "type",
                        "kind": "required",
                        "type": "string<shipment>",
                        "description": "",
                        "enum": [
                          "shipment"
                        ]
                      },
                      {
                        "name": "dates",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "shipped_at",
                            "kind": "required",
                            "type": "string<date-time>",
                            "description": "<p>The date at which the package was shipped - include user timezone or Z for UTC (RFC-3339)</p>",
                            "example": "2020-01-01T00:00:00+02:00",
                            "format": "date-time"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "Cancelled",
                    "description": "",
                    "modelRef": "#/components/schemas/Cancelled",
                    "schema": [
                      {
                        "name": "identifiers",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "sparklayer_package_id",
                            "kind": "required",
                            "type": "string<uuid>",
                            "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                            "format": "uuid"
                          },
                          {
                            "name": "platform",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>The identifier for the package on the e-commerce platform</p>",
                            "example": "123456789",
                            "minLength": 1
                          },
                          {
                            "name": "internal",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier for the package on your system",
                            "minLength": 1
                          },
                          {
                            "name": "visible",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier that will be shown to the customer in their recent orders"
                          }
                        ]
                      },
                      {
                        "name": "accounting_files",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseFiles",
                        "customType": "PurchaseFiles[]",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that is used by your system",
                                "example": "INV011",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that should be shown to the customer",
                                "default": "INV011"
                              }
                            ]
                          },
                          {
                            "name": "data",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "anyOf",
                            "complexItems": [
                              {
                                "name": "object",
                                "description": "",
                                "schema": [
                                  {
                                    "name": "uri",
                                    "kind": "optional",
                                    "type": "string<uri>",
                                    "nullable": true,
                                    "description": "",
                                    "format": "uri"
                                  },
                                  {
                                    "name": "type",
                                    "kind": "required",
                                    "type": "string<uri>",
                                    "description": "",
                                    "example": "uri",
                                    "default": "uri",
                                    "enum": [
                                      "uri"
                                    ]
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "file_type",
                            "kind": "required",
                            "type": "string<credit | invoice | payment>",
                            "description": "",
                            "example": "invoice",
                            "enum": [
                              "credit",
                              "invoice",
                              "payment"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "line_items",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom | product>",
                            "description": "",
                            "enum": [
                              "custom",
                              "product"
                            ]
                          },
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_item_key",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                "minLength": 1
                              },
                              {
                                "name": "sparklayer_variant_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                "example": "45552423353839",
                                "minLength": 1
                              },
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "CAT-MUG",
                                "maxLength": 128
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the product on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>A human-readable identifier for the product</p>"
                              }
                            ]
                          },
                          {
                            "name": "name_parent",
                            "kind": "required",
                            "type": "string",
                            "description": "Name of the product",
                            "example": "T-Shirt"
                          },
                          {
                            "name": "name_child",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>Name of the product variant/type</p>",
                            "example": "Red"
                          },
                          {
                            "name": "quantity",
                            "kind": "required",
                            "type": "number",
                            "description": "",
                            "example": 4
                          },
                          {
                            "name": "custom_attributes",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "key",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Key or name of the attribute.",
                                "example": "mug text"
                              },
                              {
                                "name": "value",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Value of the attribute.",
                                "example": "best company ever"
                              }
                            ]
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_method",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "<p>Details of how the package was/will be shipped</p>",
                        "example": "",
                        "schema": [
                          {
                            "name": "sku",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "SKU that identifies the shipping method used",
                            "example": "SHIP-ECO",
                            "minLength": 1
                          },
                          {
                            "name": "name",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The friendly/human-readable name for the shipping method</p>",
                            "example": "Standard Shipping"
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_address",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseAddress",
                        "customType": "PurchaseAddress",
                        "schema": [
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones"
                          },
                          {
                            "name": "company",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones Hardware Ltd"
                          },
                          {
                            "name": "address_line1",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "7 Philosophy way"
                          },
                          {
                            "name": "address_line2",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": ""
                          },
                          {
                            "name": "city",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Willerby"
                          },
                          {
                            "name": "region_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "",
                            "minLength": 1
                          },
                          {
                            "name": "postal_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "BJ6 9MK"
                          },
                          {
                            "name": "country_code",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "GB"
                          },
                          {
                            "name": "phone",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "0123456789"
                          },
                          {
                            "name": "sparklayer_id",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                          },
                          {
                            "name": "first_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom"
                          },
                          {
                            "name": "last_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Jones"
                          }
                        ]
                      },
                      {
                        "name": "shipments",
                        "kind": "required",
                        "type": "array",
                        "description": "Carrier and tracking details for the shipment",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "carrier",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Carrier Company Ltd"
                          },
                          {
                            "name": "carrier_id",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The tracking number/ID used by the carrier</p>"
                          },
                          {
                            "name": "tracking_url",
                            "kind": "optional",
                            "type": "string<uri>",
                            "nullable": true,
                            "description": "The URL the customer can use to track their shipment",
                            "format": "uri"
                          }
                        ]
                      },
                      {
                        "name": "type",
                        "kind": "required",
                        "type": "string<cancelled>",
                        "description": "",
                        "enum": [
                          "cancelled"
                        ]
                      },
                      {
                        "name": "dates",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "cancelled_at",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "nullable": true,
                            "description": "<p>The date at which the package was cancelled - include user timezone or Z for UTC (RFC-3339)</p>",
                            "example": "2020-01-01T00:00:00+02:00",
                            "format": "date-time"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "Return",
                    "description": "",
                    "modelRef": "#/components/schemas/Return",
                    "schema": [
                      {
                        "name": "",
                        "description": "",
                        "customType": "Max depth limit reached"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "accounting_files",
                "kind": "required",
                "type": "array",
                "description": "Any accounting files associated with this package e.g. invoices",
                "modelRef": "#/components/schemas/PurchaseFiles",
                "customType": "PurchaseFiles[]",
                "schema": [
                  {
                    "name": "identifiers",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "internal",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The identifier of the purchase file that is used by your system",
                        "example": "INV011",
                        "minLength": 1
                      },
                      {
                        "name": "visible",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The identifier of the purchase file that should be shown to the customer",
                        "default": "INV011"
                      }
                    ]
                  },
                  {
                    "name": "data",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "complexType": "anyOf",
                    "complexItems": [
                      {
                        "name": "object",
                        "description": "",
                        "schema": [
                          {
                            "name": "uri",
                            "kind": "optional",
                            "type": "string<uri>",
                            "nullable": true,
                            "description": "",
                            "format": "uri"
                          },
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<uri>",
                            "description": "",
                            "example": "uri",
                            "default": "uri",
                            "enum": [
                              "uri"
                            ]
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "file_type",
                    "kind": "required",
                    "type": "string<credit | invoice | payment>",
                    "description": "",
                    "example": "invoice",
                    "enum": [
                      "credit",
                      "invoice",
                      "payment"
                    ]
                  }
                ]
              },
              {
                "name": "custom_fields",
                "kind": "required",
                "type": "array",
                "description": "Extra information for the purchase. This will be shown to the customer in their recent orders",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>Name/identifier for the custom field</p>",
                    "example": "delivery-date",
                    "minLength": 1
                  },
                  {
                    "name": "value",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "Data for the custom field",
                    "example": "2023-10-28"
                  }
                ]
              },
              {
                "name": "metadata",
                "kind": "optional",
                "type": "array",
                "description": "Extra information for the purchase. This not will be shown to the customer",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>Name/identifier for the metadata</p>",
                    "example": "example-key",
                    "minLength": 1
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "string",
                    "description": "Data for the metadata",
                    "example": "1234"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Purchase",
            "complexItems": [
              {
                "name": "object",
                "schema": [
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "example": "order",
                    "modelRef": "#/components/schemas/PurchaseType",
                    "customType": "PurchaseType",
                    "schema": []
                  },
                  {
                    "name": "purchase_identifiers",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "sparklayer",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "nullable": true,
                        "description": "The identifier SparkLayer uses for the purchase. You will need to generate this if the purchase does not exist",
                        "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                        "format": "uuid",
                        "minLength": 1
                      },
                      {
                        "name": "platform",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "<p>The identifier for the purchase on the e-commerce platform</p>",
                        "example": "123456789",
                        "minLength": 1
                      },
                      {
                        "name": "internal",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The identifier for the purchase on your system",
                        "minLength": 1
                      },
                      {
                        "name": "visible",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The identifier that will be shown to the customer in their recent orders",
                        "example": "B2B01123"
                      }
                    ]
                  },
                  {
                    "name": "customer_identifiers",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "sparklayer",
                        "kind": "required",
                        "type": "string",
                        "nullable": false,
                        "description": "The ID of the customer that that order is for.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                      },
                      {
                        "name": "sparklayer_impersonator",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of the sales agent placing the order.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                      },
                      {
                        "name": "sparklayer_impersonator_assignee",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of the sales agent assigned to be responsible for the order.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                      },
                      {
                        "name": "sparklayer_child",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of the company user that placed the order.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                      }
                    ]
                  },
                  {
                    "name": "company",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "<p>Company sections are opt-in; omit this entirely for merchants that do not use them.</p>",
                    "example": "",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "nullable": true,
                        "description": "The ID of the company the purchase was placed for.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                        "format": "uuid"
                      },
                      {
                        "name": "section_id",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "nullable": true,
                        "description": "The ID of the company section the purchase was placed for.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                        "format": "uuid"
                      },
                      {
                        "name": "section_name",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "<p>The section name at the time of purchase, kept so historical purchases stay readable after a section is renamed or deleted. Not filterable.</p>",
                        "example": "Bristol",
                        "maxLength": 128
                      }
                    ]
                  },
                  {
                    "name": "payment_method",
                    "kind": "optional",
                    "type": "string<quote | upfrontPayment | paymentOnAccount | paymentByInvoice>",
                    "nullable": true,
                    "description": "<p>How the purchase was/will be paid for</p>",
                    "enum": [
                      "quote",
                      "upfrontPayment",
                      "paymentOnAccount",
                      "paymentByInvoice"
                    ]
                  },
                  {
                    "name": "dates",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "created_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "readOnly": true,
                        "description": "<p>The date the purchase was created in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "updated_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "readOnly": true,
                        "description": "<p>The date the purchase was last updated in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "placed_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "nullable": true,
                        "description": "<p>The date at which the purchase was placed - include user timezone or Z for UTC (RFC-3339)</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "to_be_placed_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "nullable": true,
                        "description": "<p>The date at which the purchase is due to be placed, for a purchase that is scheduled rather than placed immediately (RFC-3339). It can be changed while the purchase is still pending</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "calculated_submitted_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "readOnly": true,
                        "description": "<p>The date the purchase was submitted (RFC-3339). This is when the cart is converted into another purchase type. This is read only - it should not be sent to the API, but will be returned form it</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "expires_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "readOnly": true,
                        "description": "<p>the date at which the purchase will expire and become archived (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "payment_due_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "description": "The date at which payment for the purchase is expected",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      }
                    ]
                  },
                  {
                    "name": "customer_reference",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "Additional information that a customer adds to the order",
                    "example": "Please deliver to the back of the store"
                  },
                  {
                    "name": "po_number",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "PO number for the purchase",
                    "example": "PO-001"
                  },
                  {
                    "name": "shipping_requested_date",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "The date requested for the delivery to arrive",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "recurring_purchase",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "Present only for a purchase created from a recurring purchase template. Both properties are stored when the purchase is created and ignored on any later update",
                    "example": "",
                    "schema": [
                      {
                        "name": "template_id",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "nullable": true,
                        "description": "The recurring purchase template this purchase was created from. Set on creation and ignored on update",
                        "example": "0f8fad5b-d9cb-469f-a165-70867728950e",
                        "format": "uuid"
                      },
                      {
                        "name": "cancelled_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "nullable": true,
                        "description": "<p>The date the customer cancelled the purchase, after which it will not be placed (RFC-3339). Cancelling does not free the date - the template has already had its turn for it</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "to_be_placed_at_initial",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "nullable": true,
                        "description": "<p>The date to_be_placed_at was first set to (RFC-3339). Set on creation and ignored on update, so that rescheduling cannot let the same template produce a second purchase for the same date</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      }
                    ]
                  },
                  {
                    "name": "currency_code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The 3 letter currency code used for the prices in the purchase",
                    "example": "GBP",
                    "minLength": 3,
                    "maxLength": 3
                  },
                  {
                    "name": "currency_code_base",
                    "kind": "optional",
                    "type": "string",
                    "writeOnly": true,
                    "nullable": true,
                    "description": "The 3 letter currency code of the store's base currency",
                    "example": "GBP",
                    "minLength": 3,
                    "maxLength": 3
                  },
                  {
                    "name": "calculated_shipping_address",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "nullable": true,
                    "description": "<p>A single string containing all the details of the shipping address. This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "John Spark, SparkLayer, SparkLayer HQ, Example City, 12345"
                  },
                  {
                    "name": "calculated_total",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "MonetaryObject",
                        "description": "",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "calculated_total_usd",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "MonetaryObject",
                        "description": "",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "calculated_total_base",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "MonetaryObject",
                        "description": "",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "calculated_fulfilment_status",
                    "kind": "optional",
                    "type": "string<incoming | processing | shipped | part_shipped | cancelled | returned | part_returned | varied>",
                    "readOnly": true,
                    "nullable": true,
                    "description": "<p>The status of the order, calculated from the statuses of the individual packages. This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "processing",
                    "enum": [
                      "incoming",
                      "processing",
                      "shipped",
                      "part_shipped",
                      "cancelled",
                      "returned",
                      "part_returned",
                      "varied"
                    ]
                  },
                  {
                    "name": "quote",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "Quote data",
                    "example": "",
                    "schema": [
                      {
                        "name": "status_slug",
                        "kind": "optional",
                        "type": "string",
                        "description": "The slug of the quote status applied to this quote"
                      },
                      {
                        "name": "status",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "complexType": "allOf",
                        "complexItems": [
                          {
                            "name": "QuoteStatus",
                            "description": "",
                            "modelRef": "#/components/schemas/QuoteStatus",
                            "schema": [
                              {
                                "name": "id",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "description": "",
                                "maxLength": 45
                              },
                              {
                                "name": "slug",
                                "kind": "optional",
                                "type": "string",
                                "description": "",
                                "maxLength": 45,
                                "pattern": "^[a-z0-9-]+$"
                              },
                              {
                                "name": "default",
                                "kind": "optional",
                                "type": "boolean",
                                "description": ""
                              },
                              {
                                "name": "next",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "maxLength": 45,
                                "pattern": "^[a-z0-9-]+$"
                              },
                              {
                                "name": "actions",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "example": "",
                                "itemType": "string",
                                "customType": "string[]",
                                "itemExample": "",
                                "itemDefault": ""
                              },
                              {
                                "name": "created_at",
                                "kind": "optional",
                                "type": "string<date-time>",
                                "description": "",
                                "format": "date-time"
                              },
                              {
                                "name": "updated_at",
                                "kind": "optional",
                                "type": "string<date-time>",
                                "description": "",
                                "format": "date-time"
                              },
                              {
                                "name": "deleted_at",
                                "kind": "optional",
                                "type": "string<date-time>",
                                "nullable": true,
                                "description": "",
                                "format": "date-time"
                              }
                            ]
                          }
                        ],
                        "schema": []
                      },
                      {
                        "name": "expiry",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "nullable": true,
                        "description": "<p>The date at which the quote is considered expired and no longer valid (RFC-3339)</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      }
                    ]
                  },
                  {
                    "name": "payment_status",
                    "kind": "optional",
                    "type": "string<unpaid | part_paid | paid>",
                    "description": "That payment status of the order",
                    "enum": [
                      "unpaid",
                      "part_paid",
                      "paid"
                    ]
                  },
                  {
                    "name": "total_paid",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "MonetaryObject",
                        "description": "",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      }
                    ],
                    "schema": []
                  }
                ],
                "modelRef": "#/components/schemas/PurchaseBase",
                "customType": "PurchaseBase"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "revision_date",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date at which the purchase was last modified - include user timezone or Z for UTC (RFC-3339)</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "tax_lines",
                    "kind": "optional",
                    "type": "array",
                    "description": "Tax lines for the purchase.",
                    "modelRef": "#/components/schemas/TaxLine",
                    "customType": "TaxLine[]",
                    "schema": [
                      {
                        "name": "title",
                        "kind": "required",
                        "type": "string",
                        "description": "The title of the tax line",
                        "example": "HST"
                      },
                      {
                        "name": "amount",
                        "kind": "required",
                        "type": "object",
                        "description": "The amount of tax of the tax line",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "customType": "MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      },
                      {
                        "name": "amount_base",
                        "kind": "optional",
                        "type": "object",
                        "description": "The amount of tax of the tax line in the store's base currency",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "customType": "MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      },
                      {
                        "name": "rate",
                        "kind": "required",
                        "type": "number<double>",
                        "nullable": true,
                        "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                        "example": 20,
                        "format": "double",
                        "minimum": 0
                      }
                    ]
                  },
                  {
                    "name": "billing_address",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "modelRef": "#/components/schemas/PurchaseAddress",
                    "customType": "PurchaseAddress",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "Tom Jones"
                      },
                      {
                        "name": "company",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "Tom Jones Hardware Ltd"
                      },
                      {
                        "name": "address_line1",
                        "kind": "required",
                        "type": "string",
                        "description": "",
                        "example": "7 Philosophy way"
                      },
                      {
                        "name": "address_line2",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": ""
                      },
                      {
                        "name": "city",
                        "kind": "required",
                        "type": "string",
                        "description": "",
                        "example": "Willerby"
                      },
                      {
                        "name": "region_code",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "",
                        "minLength": 1
                      },
                      {
                        "name": "postal_code",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "BJ6 9MK"
                      },
                      {
                        "name": "country_code",
                        "kind": "required",
                        "type": "string",
                        "description": "",
                        "example": "GB"
                      },
                      {
                        "name": "phone",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "0123456789"
                      },
                      {
                        "name": "sparklayer_id",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                      },
                      {
                        "name": "first_name",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "Tom"
                      },
                      {
                        "name": "last_name",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "Jones"
                      }
                    ]
                  },
                  {
                    "name": "packages",
                    "kind": "required",
                    "type": "object",
                    "description": "Packages contained within this purchase",
                    "modelRef": "#/components/schemas/Package",
                    "customType": "Package[]",
                    "schema": [],
                    "complexType": "oneOf",
                    "complexItems": [
                      {
                        "name": "Incoming",
                        "description": "",
                        "modelRef": "#/components/schemas/Incoming",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_package_id",
                                "kind": "required",
                                "type": "string<uuid>",
                                "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                                "format": "uuid"
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the package on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the package on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier that will be shown to the customer in their recent orders"
                              }
                            ]
                          },
                          {
                            "name": "accounting_files",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseFiles",
                            "customType": "PurchaseFiles[]",
                            "schema": [
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that is used by your system",
                                    "example": "INV011",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that should be shown to the customer",
                                    "default": "INV011"
                                  }
                                ]
                              },
                              {
                                "name": "data",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "anyOf",
                                "complexItems": [
                                  {
                                    "name": "object",
                                    "description": "",
                                    "schema": [
                                      {
                                        "name": "uri",
                                        "kind": "optional",
                                        "type": "string<uri>",
                                        "nullable": true,
                                        "description": "",
                                        "format": "uri"
                                      },
                                      {
                                        "name": "type",
                                        "kind": "required",
                                        "type": "string<uri>",
                                        "description": "",
                                        "example": "uri",
                                        "default": "uri",
                                        "enum": [
                                          "uri"
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "file_type",
                                "kind": "required",
                                "type": "string<credit | invoice | payment>",
                                "description": "",
                                "example": "invoice",
                                "enum": [
                                  "credit",
                                  "invoice",
                                  "payment"
                                ]
                              }
                            ]
                          },
                          {
                            "name": "line_items",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string<custom | product>",
                                "description": "",
                                "enum": [
                                  "custom",
                                  "product"
                                ]
                              },
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "sparklayer_item_key",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sparklayer_variant_id",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                    "example": "45552423353839",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sku",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "",
                                    "example": "CAT-MUG",
                                    "maxLength": 128
                                  },
                                  {
                                    "name": "platform",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                    "example": "123456789",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier for the product on your system",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>A human-readable identifier for the product</p>"
                                  }
                                ]
                              },
                              {
                                "name": "name_parent",
                                "kind": "required",
                                "type": "string",
                                "description": "Name of the product",
                                "example": "T-Shirt"
                              },
                              {
                                "name": "name_child",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Name of the product variant/type</p>",
                                "example": "Red"
                              },
                              {
                                "name": "quantity",
                                "kind": "required",
                                "type": "number",
                                "description": "",
                                "example": 4
                              },
                              {
                                "name": "custom_attributes",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "example": "",
                                "itemType": "object",
                                "customType": "object[]",
                                "schema": [
                                  {
                                    "name": "key",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Key or name of the attribute.",
                                    "example": "mug text"
                                  },
                                  {
                                    "name": "value",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Value of the attribute.",
                                    "example": "best company ever"
                                  }
                                ]
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "nullable": true,
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_method",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "<p>Details of how the package was/will be shipped</p>",
                            "example": "",
                            "schema": [
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "SKU that identifies the shipping method used",
                                "example": "SHIP-ECO",
                                "minLength": 1
                              },
                              {
                                "name": "name",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The friendly/human-readable name for the shipping method</p>",
                                "example": "Standard Shipping"
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_address",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseAddress",
                            "customType": "PurchaseAddress",
                            "schema": [
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones"
                              },
                              {
                                "name": "company",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones Hardware Ltd"
                              },
                              {
                                "name": "address_line1",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "7 Philosophy way"
                              },
                              {
                                "name": "address_line2",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": ""
                              },
                              {
                                "name": "city",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Willerby"
                              },
                              {
                                "name": "region_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "",
                                "minLength": 1
                              },
                              {
                                "name": "postal_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "BJ6 9MK"
                              },
                              {
                                "name": "country_code",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "GB"
                              },
                              {
                                "name": "phone",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "0123456789"
                              },
                              {
                                "name": "sparklayer_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                              },
                              {
                                "name": "first_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom"
                              },
                              {
                                "name": "last_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Jones"
                              }
                            ]
                          },
                          {
                            "name": "shipments",
                            "kind": "required",
                            "type": "array",
                            "description": "Carrier and tracking details for the shipment",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "carrier",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Carrier Company Ltd"
                              },
                              {
                                "name": "carrier_id",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The tracking number/ID used by the carrier</p>"
                              },
                              {
                                "name": "tracking_url",
                                "kind": "optional",
                                "type": "string<uri>",
                                "nullable": true,
                                "description": "The URL the customer can use to track their shipment",
                                "format": "uri"
                              }
                            ]
                          },
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<incoming>",
                            "description": "",
                            "enum": [
                              "incoming"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "Processing",
                        "description": "",
                        "modelRef": "#/components/schemas/Processing",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_package_id",
                                "kind": "required",
                                "type": "string<uuid>",
                                "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                                "format": "uuid"
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the package on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the package on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier that will be shown to the customer in their recent orders"
                              }
                            ]
                          },
                          {
                            "name": "accounting_files",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseFiles",
                            "customType": "PurchaseFiles[]",
                            "schema": [
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that is used by your system",
                                    "example": "INV011",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that should be shown to the customer",
                                    "default": "INV011"
                                  }
                                ]
                              },
                              {
                                "name": "data",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "anyOf",
                                "complexItems": [
                                  {
                                    "name": "object",
                                    "description": "",
                                    "schema": [
                                      {
                                        "name": "uri",
                                        "kind": "optional",
                                        "type": "string<uri>",
                                        "nullable": true,
                                        "description": "",
                                        "format": "uri"
                                      },
                                      {
                                        "name": "type",
                                        "kind": "required",
                                        "type": "string<uri>",
                                        "description": "",
                                        "example": "uri",
                                        "default": "uri",
                                        "enum": [
                                          "uri"
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "file_type",
                                "kind": "required",
                                "type": "string<credit | invoice | payment>",
                                "description": "",
                                "example": "invoice",
                                "enum": [
                                  "credit",
                                  "invoice",
                                  "payment"
                                ]
                              }
                            ]
                          },
                          {
                            "name": "line_items",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string<custom | product>",
                                "description": "",
                                "enum": [
                                  "custom",
                                  "product"
                                ]
                              },
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "sparklayer_item_key",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sparklayer_variant_id",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                    "example": "45552423353839",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sku",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "",
                                    "example": "CAT-MUG",
                                    "maxLength": 128
                                  },
                                  {
                                    "name": "platform",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                    "example": "123456789",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier for the product on your system",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>A human-readable identifier for the product</p>"
                                  }
                                ]
                              },
                              {
                                "name": "name_parent",
                                "kind": "required",
                                "type": "string",
                                "description": "Name of the product",
                                "example": "T-Shirt"
                              },
                              {
                                "name": "name_child",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Name of the product variant/type</p>",
                                "example": "Red"
                              },
                              {
                                "name": "quantity",
                                "kind": "required",
                                "type": "number",
                                "description": "",
                                "example": 4
                              },
                              {
                                "name": "custom_attributes",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "example": "",
                                "itemType": "object",
                                "customType": "object[]",
                                "schema": [
                                  {
                                    "name": "key",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Key or name of the attribute.",
                                    "example": "mug text"
                                  },
                                  {
                                    "name": "value",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Value of the attribute.",
                                    "example": "best company ever"
                                  }
                                ]
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "nullable": true,
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_method",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "<p>Details of how the package was/will be shipped</p>",
                            "example": "",
                            "schema": [
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "SKU that identifies the shipping method used",
                                "example": "SHIP-ECO",
                                "minLength": 1
                              },
                              {
                                "name": "name",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The friendly/human-readable name for the shipping method</p>",
                                "example": "Standard Shipping"
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_address",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseAddress",
                            "customType": "PurchaseAddress",
                            "schema": [
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones"
                              },
                              {
                                "name": "company",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones Hardware Ltd"
                              },
                              {
                                "name": "address_line1",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "7 Philosophy way"
                              },
                              {
                                "name": "address_line2",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": ""
                              },
                              {
                                "name": "city",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Willerby"
                              },
                              {
                                "name": "region_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "",
                                "minLength": 1
                              },
                              {
                                "name": "postal_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "BJ6 9MK"
                              },
                              {
                                "name": "country_code",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "GB"
                              },
                              {
                                "name": "phone",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "0123456789"
                              },
                              {
                                "name": "sparklayer_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                              },
                              {
                                "name": "first_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom"
                              },
                              {
                                "name": "last_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Jones"
                              }
                            ]
                          },
                          {
                            "name": "shipments",
                            "kind": "required",
                            "type": "array",
                            "description": "Carrier and tracking details for the shipment",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "carrier",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Carrier Company Ltd"
                              },
                              {
                                "name": "carrier_id",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The tracking number/ID used by the carrier</p>"
                              },
                              {
                                "name": "tracking_url",
                                "kind": "optional",
                                "type": "string<uri>",
                                "nullable": true,
                                "description": "The URL the customer can use to track their shipment",
                                "format": "uri"
                              }
                            ]
                          },
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<processing>",
                            "description": "",
                            "enum": [
                              "processing"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "Shipment",
                        "description": "",
                        "modelRef": "#/components/schemas/Shipment",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_package_id",
                                "kind": "required",
                                "type": "string<uuid>",
                                "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                                "format": "uuid"
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the package on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the package on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier that will be shown to the customer in their recent orders"
                              }
                            ]
                          },
                          {
                            "name": "accounting_files",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseFiles",
                            "customType": "PurchaseFiles[]",
                            "schema": [
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that is used by your system",
                                    "example": "INV011",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that should be shown to the customer",
                                    "default": "INV011"
                                  }
                                ]
                              },
                              {
                                "name": "data",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "anyOf",
                                "complexItems": [
                                  {
                                    "name": "object",
                                    "description": "",
                                    "schema": [
                                      {
                                        "name": "uri",
                                        "kind": "optional",
                                        "type": "string<uri>",
                                        "nullable": true,
                                        "description": "",
                                        "format": "uri"
                                      },
                                      {
                                        "name": "type",
                                        "kind": "required",
                                        "type": "string<uri>",
                                        "description": "",
                                        "example": "uri",
                                        "default": "uri",
                                        "enum": [
                                          "uri"
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "file_type",
                                "kind": "required",
                                "type": "string<credit | invoice | payment>",
                                "description": "",
                                "example": "invoice",
                                "enum": [
                                  "credit",
                                  "invoice",
                                  "payment"
                                ]
                              }
                            ]
                          },
                          {
                            "name": "line_items",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string<custom | product>",
                                "description": "",
                                "enum": [
                                  "custom",
                                  "product"
                                ]
                              },
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "sparklayer_item_key",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sparklayer_variant_id",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                    "example": "45552423353839",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sku",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "",
                                    "example": "CAT-MUG",
                                    "maxLength": 128
                                  },
                                  {
                                    "name": "platform",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                    "example": "123456789",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier for the product on your system",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>A human-readable identifier for the product</p>"
                                  }
                                ]
                              },
                              {
                                "name": "name_parent",
                                "kind": "required",
                                "type": "string",
                                "description": "Name of the product",
                                "example": "T-Shirt"
                              },
                              {
                                "name": "name_child",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Name of the product variant/type</p>",
                                "example": "Red"
                              },
                              {
                                "name": "quantity",
                                "kind": "required",
                                "type": "number",
                                "description": "",
                                "example": 4
                              },
                              {
                                "name": "custom_attributes",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "example": "",
                                "itemType": "object",
                                "customType": "object[]",
                                "schema": [
                                  {
                                    "name": "key",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Key or name of the attribute.",
                                    "example": "mug text"
                                  },
                                  {
                                    "name": "value",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Value of the attribute.",
                                    "example": "best company ever"
                                  }
                                ]
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "nullable": true,
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_method",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "<p>Details of how the package was/will be shipped</p>",
                            "example": "",
                            "schema": [
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "SKU that identifies the shipping method used",
                                "example": "SHIP-ECO",
                                "minLength": 1
                              },
                              {
                                "name": "name",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The friendly/human-readable name for the shipping method</p>",
                                "example": "Standard Shipping"
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_address",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseAddress",
                            "customType": "PurchaseAddress",
                            "schema": [
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones"
                              },
                              {
                                "name": "company",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones Hardware Ltd"
                              },
                              {
                                "name": "address_line1",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "7 Philosophy way"
                              },
                              {
                                "name": "address_line2",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": ""
                              },
                              {
                                "name": "city",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Willerby"
                              },
                              {
                                "name": "region_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "",
                                "minLength": 1
                              },
                              {
                                "name": "postal_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "BJ6 9MK"
                              },
                              {
                                "name": "country_code",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "GB"
                              },
                              {
                                "name": "phone",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "0123456789"
                              },
                              {
                                "name": "sparklayer_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                              },
                              {
                                "name": "first_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom"
                              },
                              {
                                "name": "last_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Jones"
                              }
                            ]
                          },
                          {
                            "name": "shipments",
                            "kind": "required",
                            "type": "array",
                            "description": "Carrier and tracking details for the shipment",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "carrier",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Carrier Company Ltd"
                              },
                              {
                                "name": "carrier_id",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The tracking number/ID used by the carrier</p>"
                              },
                              {
                                "name": "tracking_url",
                                "kind": "optional",
                                "type": "string<uri>",
                                "nullable": true,
                                "description": "The URL the customer can use to track their shipment",
                                "format": "uri"
                              }
                            ]
                          },
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<shipment>",
                            "description": "",
                            "enum": [
                              "shipment"
                            ]
                          },
                          {
                            "name": "dates",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "shipped_at",
                                "kind": "required",
                                "type": "string<date-time>",
                                "description": "<p>The date at which the package was shipped - include user timezone or Z for UTC (RFC-3339)</p>",
                                "example": "2020-01-01T00:00:00+02:00",
                                "format": "date-time"
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "Cancelled",
                        "description": "",
                        "modelRef": "#/components/schemas/Cancelled",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_package_id",
                                "kind": "required",
                                "type": "string<uuid>",
                                "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                                "format": "uuid"
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the package on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the package on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier that will be shown to the customer in their recent orders"
                              }
                            ]
                          },
                          {
                            "name": "accounting_files",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseFiles",
                            "customType": "PurchaseFiles[]",
                            "schema": [
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that is used by your system",
                                    "example": "INV011",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that should be shown to the customer",
                                    "default": "INV011"
                                  }
                                ]
                              },
                              {
                                "name": "data",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "anyOf",
                                "complexItems": [
                                  {
                                    "name": "object",
                                    "description": "",
                                    "schema": [
                                      {
                                        "name": "uri",
                                        "kind": "optional",
                                        "type": "string<uri>",
                                        "nullable": true,
                                        "description": "",
                                        "format": "uri"
                                      },
                                      {
                                        "name": "type",
                                        "kind": "required",
                                        "type": "string<uri>",
                                        "description": "",
                                        "example": "uri",
                                        "default": "uri",
                                        "enum": [
                                          "uri"
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "file_type",
                                "kind": "required",
                                "type": "string<credit | invoice | payment>",
                                "description": "",
                                "example": "invoice",
                                "enum": [
                                  "credit",
                                  "invoice",
                                  "payment"
                                ]
                              }
                            ]
                          },
                          {
                            "name": "line_items",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string<custom | product>",
                                "description": "",
                                "enum": [
                                  "custom",
                                  "product"
                                ]
                              },
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "sparklayer_item_key",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sparklayer_variant_id",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                    "example": "45552423353839",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sku",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "",
                                    "example": "CAT-MUG",
                                    "maxLength": 128
                                  },
                                  {
                                    "name": "platform",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                    "example": "123456789",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier for the product on your system",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>A human-readable identifier for the product</p>"
                                  }
                                ]
                              },
                              {
                                "name": "name_parent",
                                "kind": "required",
                                "type": "string",
                                "description": "Name of the product",
                                "example": "T-Shirt"
                              },
                              {
                                "name": "name_child",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Name of the product variant/type</p>",
                                "example": "Red"
                              },
                              {
                                "name": "quantity",
                                "kind": "required",
                                "type": "number",
                                "description": "",
                                "example": 4
                              },
                              {
                                "name": "custom_attributes",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "example": "",
                                "itemType": "object",
                                "customType": "object[]",
                                "schema": [
                                  {
                                    "name": "key",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Key or name of the attribute.",
                                    "example": "mug text"
                                  },
                                  {
                                    "name": "value",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Value of the attribute.",
                                    "example": "best company ever"
                                  }
                                ]
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "nullable": true,
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_method",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "<p>Details of how the package was/will be shipped</p>",
                            "example": "",
                            "schema": [
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "SKU that identifies the shipping method used",
                                "example": "SHIP-ECO",
                                "minLength": 1
                              },
                              {
                                "name": "name",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The friendly/human-readable name for the shipping method</p>",
                                "example": "Standard Shipping"
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_address",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseAddress",
                            "customType": "PurchaseAddress",
                            "schema": [
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones"
                              },
                              {
                                "name": "company",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones Hardware Ltd"
                              },
                              {
                                "name": "address_line1",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "7 Philosophy way"
                              },
                              {
                                "name": "address_line2",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": ""
                              },
                              {
                                "name": "city",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Willerby"
                              },
                              {
                                "name": "region_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "",
                                "minLength": 1
                              },
                              {
                                "name": "postal_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "BJ6 9MK"
                              },
                              {
                                "name": "country_code",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "GB"
                              },
                              {
                                "name": "phone",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "0123456789"
                              },
                              {
                                "name": "sparklayer_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                              },
                              {
                                "name": "first_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom"
                              },
                              {
                                "name": "last_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Jones"
                              }
                            ]
                          },
                          {
                            "name": "shipments",
                            "kind": "required",
                            "type": "array",
                            "description": "Carrier and tracking details for the shipment",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "carrier",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Carrier Company Ltd"
                              },
                              {
                                "name": "carrier_id",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The tracking number/ID used by the carrier</p>"
                              },
                              {
                                "name": "tracking_url",
                                "kind": "optional",
                                "type": "string<uri>",
                                "nullable": true,
                                "description": "The URL the customer can use to track their shipment",
                                "format": "uri"
                              }
                            ]
                          },
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<cancelled>",
                            "description": "",
                            "enum": [
                              "cancelled"
                            ]
                          },
                          {
                            "name": "dates",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "cancelled_at",
                                "kind": "optional",
                                "type": "string<date-time>",
                                "nullable": true,
                                "description": "<p>The date at which the package was cancelled - include user timezone or Z for UTC (RFC-3339)</p>",
                                "example": "2020-01-01T00:00:00+02:00",
                                "format": "date-time"
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "Return",
                        "description": "",
                        "modelRef": "#/components/schemas/Return",
                        "schema": [
                          {
                            "name": "",
                            "description": "",
                            "customType": "Max depth limit reached"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "accounting_files",
                    "kind": "required",
                    "type": "array",
                    "description": "Any accounting files associated with this package e.g. invoices",
                    "modelRef": "#/components/schemas/PurchaseFiles",
                    "customType": "PurchaseFiles[]",
                    "schema": [
                      {
                        "name": "identifiers",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "internal",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier of the purchase file that is used by your system",
                            "example": "INV011",
                            "minLength": 1
                          },
                          {
                            "name": "visible",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier of the purchase file that should be shown to the customer",
                            "default": "INV011"
                          }
                        ]
                      },
                      {
                        "name": "data",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "complexType": "anyOf",
                        "complexItems": [
                          {
                            "name": "object",
                            "description": "",
                            "schema": [
                              {
                                "name": "uri",
                                "kind": "optional",
                                "type": "string<uri>",
                                "nullable": true,
                                "description": "",
                                "format": "uri"
                              },
                              {
                                "name": "type",
                                "kind": "required",
                                "type": "string<uri>",
                                "description": "",
                                "example": "uri",
                                "default": "uri",
                                "enum": [
                                  "uri"
                                ]
                              }
                            ]
                          }
                        ],
                        "schema": []
                      },
                      {
                        "name": "file_type",
                        "kind": "required",
                        "type": "string<credit | invoice | payment>",
                        "description": "",
                        "example": "invoice",
                        "enum": [
                          "credit",
                          "invoice",
                          "payment"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "custom_fields",
                    "kind": "required",
                    "type": "array",
                    "description": "Extra information for the purchase. This will be shown to the customer in their recent orders",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>Name/identifier for the custom field</p>",
                        "example": "delivery-date",
                        "minLength": 1
                      },
                      {
                        "name": "value",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Data for the custom field",
                        "example": "2023-10-28"
                      }
                    ]
                  },
                  {
                    "name": "metadata",
                    "kind": "optional",
                    "type": "array",
                    "description": "Extra information for the purchase. This not will be shown to the customer",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>Name/identifier for the metadata</p>",
                        "example": "example-key",
                        "minLength": 1
                      },
                      {
                        "name": "value",
                        "kind": "required",
                        "type": "string",
                        "description": "Data for the metadata",
                        "example": "1234"
                      }
                    ]
                  }
                ]
              }
            ],
            "complexType": "allOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "<p>Trying to update purchase SparkLayer ID, which is immutable</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "A conflict has occurred",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Intro
[path] /

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/HGO17BtuizKqqrCrjWvZr-20260922-084853.jpg)

The SparkLayer API lets you connect your backend systems (e.g. ERP, CRM, PIM, or iPaas) and send through B2B data such as pricing information! Once you've completed the API integration, you can then install the [SparkLayer Frontend](https://docs.sparklayer.io/sparklayer-frontend/overview-of-features), converting your eCommerce website into a powerful B2B ordering system.

The SparkLayer API follows REST principles with *OAuth2* authentication, allowing you to tightly integrate with your backend systems. Our API Docs give a complete overview of how to integrate with SparkLayer and we've also included some key information below.

:::hint{type="info"}
**Please note:**
Access to the SparkLayer API is only available on our [Pro and Enterprise plans.](https://www.sparklayer.io/pricing/)
:::

## API elements

The SparkLayer API can be used to connect to a wide range of data and the extent will depend on your integration and the systems you intend to use.

For example, if you're using one of the supported platform integrations (e.g. [Shopify](https://docs.sparklayer.io/integrations/shopify-introduction)), SparkLayer will *automatically* be able to retrieve product and customer data from the platform itself. In this scenario, the SparkLayer API will only be used to send through Product price list data primarily. If you're building a bespoke integration with a custom platform, the integration will be more extensive and require some elements of the Purchasing API and the Core API to be used.

If you are looking to use another API outside of the Pricing API, it's recommended to us on the technical approach, please contact us to arrange a call.

The SparkLayer API is structured as follows:

| Area                                          | Details                                                                                                                                                                       |
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Pricing API](docId:0DHXyupLiqXhF3E4HQ2D5)    | The SparkLayer Pricing API is typically used to automate your pricing data into SparkLayer. You can learn more about how it works in the [here](docId:0DHXyupLiqXhF3E4HQ2D5). |
| [Purchasing API](docId:1HrRHA9Z_PocqnxPSouYY) | The SparkLayer Purchasing API is typically used to update orders visible to the customer. You can learn more in the [here](docId:1HrRHA9Z_PocqnxPSouYY)                       |
| [Core API](docId:3SKgXfUw3GKMr9XRvsst-)       | The SparkLayer Core API provides support for a wider range of data elements (e.g., products, customers ). You can learn more in the [here](docId:3SKgXfUw3GKMr9XRvsst-).      |

## Getting started with the API

Integrating with the SparkLayer API will require technical expertise and our recommendation is to review our SparkLayer API Docs in detail before beginning the process.

:::hint{type="info"}
**Please note:**
Before starting, you'll need your unique `Site ID` which can be found in the SparkLayer Dashboard [My Account section](https://app.sparklayer.io/settings/account) and you'll also need to generate your unique API keys [here](https://app.sparklayer.io/configuration/api). If you have any technical questions about how best to integrate with the SparkLayer API, please [contact us here](https://docs.sparklayer.io/useful-links/contact-and-support) and we'll be happy to assist
:::

[title] Create a Price List
[path] Untitled/Pricing API Docs/Price Lists/

{
  "id": "sF_rvpr6xpPx9HyFP07er",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/v1/price-lists",
    "servers": [],
    "name": "Create a Price List",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "slug",
              "kind": "optional",
              "type": "string",
              "description": "Slug",
              "example": "base-list",
              "minLength": 1,
              "maxLength": 64
            },
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "description": "Name",
              "example": "Base Price List",
              "modelRef": "#/components/schemas/PriceListNameParam",
              "customType": "PriceListNameParam",
              "schema": []
            },
            {
              "name": "currency_code",
              "kind": "optional",
              "type": "string",
              "description": "ISO 4217 currency code",
              "example": "GBP",
              "modelRef": "#/components/schemas/PriceListCurrency",
              "customType": "PriceListCurrency",
              "schema": []
            },
            {
              "name": "source",
              "kind": "optional",
              "type": "string<custom | platform | integration>",
              "description": "<p>Integration should be used by external parties, custom is provided to any price lists setup in the dashboard and platform is reserved for the eCommerce platform.</p>",
              "example": "custom",
              "default": "custom",
              "enum": [
                "custom",
                "platform",
                "integration"
              ]
            },
            {
              "name": "tax_inclusive_display",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>When true, storefronts display prices on this price list inclusive of the per-SKU display_tax_rate, labelled as tax inclusive. This changes presentation only - prices are still stored and transacted net. SKUs on the list with no rate, or a rate of 0, display their net price and are still labelled tax inclusive.</p>",
              "example": false,
              "default": false
            },
            {
              "name": "rules",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/PriceListRulesParam",
              "customType": "PriceListRulesParam",
              "schema": [
                {
                  "name": "source_price_list_slug",
                  "kind": "optional",
                  "type": "string",
                  "description": "Source PriceList slug",
                  "example": "base-list",
                  "minLength": 1,
                  "maxLength": 64
                },
                {
                  "name": "adjustment_percentage",
                  "kind": "optional",
                  "type": "number",
                  "description": "<p>Adjustment percent expressed as a decimal fraction between 0 and 1 - E.g. 15% should be set as 0.15</p>",
                  "example": 0.103333,
                  "minimum": 0,
                  "maximum": 1
                },
                {
                  "name": "adjustment_direction",
                  "kind": "optional",
                  "type": "string<plus | minus>",
                  "description": "<p>Adjustment direction (plus, minus)</p>",
                  "example": "plus",
                  "enum": [
                    "plus",
                    "minus"
                  ]
                },
                {
                  "name": "currency_exchange_rate",
                  "kind": "optional",
                  "type": "number",
                  "nullable": true,
                  "description": "<p>Exchange rate between the currency of the source price list and the price list to which this rule belongs. If null, the rate will be  determined automatically based on current market rates.</p>",
                  "example": 1.254324,
                  "minimum": 0.000001
                }
              ]
            }
          ],
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "slug",
                  "kind": "optional",
                  "type": "string",
                  "description": "Slug",
                  "example": "base-list",
                  "minLength": 1,
                  "maxLength": 64
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "description": "Name",
                  "example": "Base Price List",
                  "modelRef": "#/components/schemas/PriceListNameParam",
                  "customType": "PriceListNameParam",
                  "schema": []
                },
                {
                  "name": "currency_code",
                  "kind": "optional",
                  "type": "string",
                  "description": "ISO 4217 currency code",
                  "example": "GBP",
                  "modelRef": "#/components/schemas/PriceListCurrency",
                  "customType": "PriceListCurrency",
                  "schema": []
                },
                {
                  "name": "source",
                  "kind": "optional",
                  "type": "string<custom | platform | integration>",
                  "description": "<p>Integration should be used by external parties, custom is provided to any price lists setup in the dashboard and platform is reserved for the eCommerce platform.</p>",
                  "example": "custom",
                  "default": "custom",
                  "enum": [
                    "custom",
                    "platform",
                    "integration"
                  ]
                },
                {
                  "name": "tax_inclusive_display",
                  "kind": "optional",
                  "type": "boolean",
                  "description": "<p>When true, storefronts display prices on this price list inclusive of the per-SKU display_tax_rate, labelled as tax inclusive. This changes presentation only - prices are still stored and transacted net. SKUs on the list with no rate, or a rate of 0, display their net price and are still labelled tax inclusive.</p>",
                  "example": false,
                  "default": false
                },
                {
                  "name": "rules",
                  "kind": "optional",
                  "type": "array",
                  "description": "",
                  "modelRef": "#/components/schemas/PriceListRulesParam",
                  "customType": "PriceListRulesParam",
                  "schema": [
                    {
                      "name": "source_price_list_slug",
                      "kind": "optional",
                      "type": "string",
                      "description": "Source PriceList slug",
                      "example": "base-list",
                      "minLength": 1,
                      "maxLength": 64
                    },
                    {
                      "name": "adjustment_percentage",
                      "kind": "optional",
                      "type": "number",
                      "description": "<p>Adjustment percent expressed as a decimal fraction between 0 and 1 - E.g. 15% should be set as 0.15</p>",
                      "example": 0.103333,
                      "minimum": 0,
                      "maximum": 1
                    },
                    {
                      "name": "adjustment_direction",
                      "kind": "optional",
                      "type": "string<plus | minus>",
                      "description": "<p>Adjustment direction (plus, minus)</p>",
                      "example": "plus",
                      "enum": [
                        "plus",
                        "minus"
                      ]
                    },
                    {
                      "name": "currency_exchange_rate",
                      "kind": "optional",
                      "type": "number",
                      "nullable": true,
                      "description": "<p>Exchange rate between the currency of the source price list and the price list to which this rule belongs. If null, the rate will be  determined automatically based on current market rates.</p>",
                      "example": 1.254324,
                      "minimum": 0.000001
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/PriceList",
              "customType": "PriceList"
            },
            {
              "name": "object",
              "schema": []
            }
          ],
          "complexType": "allOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "PriceList",
            "schema": [
              {
                "name": "slug",
                "kind": "optional",
                "type": "string",
                "description": "Slug",
                "example": "base-list",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "Name",
                "example": "Base Price List",
                "modelRef": "#/components/schemas/PriceListNameParam",
                "customType": "PriceListNameParam",
                "schema": []
              },
              {
                "name": "currency_code",
                "kind": "optional",
                "type": "string",
                "description": "ISO 4217 currency code",
                "example": "GBP",
                "modelRef": "#/components/schemas/PriceListCurrency",
                "customType": "PriceListCurrency",
                "schema": []
              },
              {
                "name": "source",
                "kind": "optional",
                "type": "string<custom | platform | integration>",
                "description": "<p>Integration should be used by external parties, custom is provided to any price lists setup in the dashboard and platform is reserved for the eCommerce platform.</p>",
                "example": "custom",
                "default": "custom",
                "enum": [
                  "custom",
                  "platform",
                  "integration"
                ]
              },
              {
                "name": "tax_inclusive_display",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>When true, storefronts display prices on this price list inclusive of the per-SKU display_tax_rate, labelled as tax inclusive. This changes presentation only - prices are still stored and transacted net. SKUs on the list with no rate, or a rate of 0, display their net price and are still labelled tax inclusive.</p>",
                "example": false,
                "default": false
              },
              {
                "name": "rules",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/PriceListRulesParam",
                "customType": "PriceListRulesParam",
                "schema": [
                  {
                    "name": "source_price_list_slug",
                    "kind": "optional",
                    "type": "string",
                    "description": "Source PriceList slug",
                    "example": "base-list",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  {
                    "name": "adjustment_percentage",
                    "kind": "optional",
                    "type": "number",
                    "description": "<p>Adjustment percent expressed as a decimal fraction between 0 and 1 - E.g. 15% should be set as 0.15</p>",
                    "example": 0.103333,
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "name": "adjustment_direction",
                    "kind": "optional",
                    "type": "string<plus | minus>",
                    "description": "<p>Adjustment direction (plus, minus)</p>",
                    "example": "plus",
                    "enum": [
                      "plus",
                      "minus"
                    ]
                  },
                  {
                    "name": "currency_exchange_rate",
                    "kind": "optional",
                    "type": "number",
                    "nullable": true,
                    "description": "<p>Exchange rate between the currency of the source price list and the price list to which this rule belongs. If null, the rate will be  determined automatically based on current market rates.</p>",
                    "example": 1.254324,
                    "minimum": 0.000001
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/PriceList",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Update Pricing by SKU
[path] Untitled/Pricing API Docs/Pricing/

{
  "id": "OF_2flr3U0xkKHl1Nh8XI",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "/api/v1/pricing/{sku}",
    "servers": [],
    "name": "Update Pricing by SKU",
    "description": "<p>This patch endpoint will remove all pricing for the <strong>price list slugs</strong> provided and apply provided pricing against the provided price lists. It is also important to note you can upload multiple price lists in one call.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "sku",
          "type": "string",
          "description": "<p>Variant SKU (URL encoding to be used)</p>"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "array",
          "description": "",
          "customType": "VariantPricing[]",
          "schema": [
            {
              "name": "price_list_slug",
              "kind": "required",
              "type": "string",
              "description": "Price List Slug",
              "example": "base-list"
            },
            {
              "name": "display_tax_rate",
              "kind": "optional",
              "type": "number",
              "nullable": true,
              "description": "<p>Tax rate used only to display a tax-inclusive price, expressed as a whole percentage (10 means 10%). Stored prices remain net and the eCommerce platform remains authoritative for the tax actually charged at checkout.\nOn an update the field has three states: omit it to leave any stored rate unchanged (so a price-only sync never disturbs it), send null to clear it, or send a value to set it.</p>",
              "example": 10,
              "modelRef": "#/components/schemas/DisplayTaxRate",
              "customType": "DisplayTaxRate",
              "schema": []
            },
            {
              "name": "pricing",
              "kind": "required",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "quantity",
                  "kind": "optional",
                  "type": "integer",
                  "description": "The quantity at which the specified price is applicable. This allows for quantity discount pricing to be set up.",
                  "example": 1,
                  "default": 1,
                  "minimum": 1
                },
                {
                  "name": "price",
                  "kind": "required",
                  "type": "number<float>",
                  "description": "",
                  "example": 10.49,
                  "format": "float"
                },
                {
                  "name": "tax_type",
                  "kind": "optional",
                  "type": "string<net>",
                  "deprecated": true,
                  "description": "Warning: Deprecated\nNet is the only supported value here",
                  "default": "net",
                  "enum": [
                    "net"
                  ]
                },
                {
                  "name": "unit_of_measure",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "<p>The unit of measure associated with this quantity. When specifying a unit of measure, it must match the pattern. To remove any value set, either omit the property or set the value as null.</p>",
                  "example": "pallet",
                  "pattern": "^[a-zA-Z0-9-]+$"
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/VariantPricing",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "VariantPricing[]",
            "schema": [
              {
                "name": "price_list_slug",
                "kind": "required",
                "type": "string",
                "description": "Price List Slug",
                "example": "base-list"
              },
              {
                "name": "display_tax_rate",
                "kind": "optional",
                "type": "number",
                "nullable": true,
                "description": "<p>Tax rate used only to display a tax-inclusive price, expressed as a whole percentage (10 means 10%). Stored prices remain net and the eCommerce platform remains authoritative for the tax actually charged at checkout.\nOn an update the field has three states: omit it to leave any stored rate unchanged (so a price-only sync never disturbs it), send null to clear it, or send a value to set it.</p>",
                "example": 10,
                "modelRef": "#/components/schemas/DisplayTaxRate",
                "customType": "DisplayTaxRate",
                "schema": []
              },
              {
                "name": "pricing",
                "kind": "required",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "quantity",
                    "kind": "optional",
                    "type": "integer",
                    "description": "The quantity at which the specified price is applicable. This allows for quantity discount pricing to be set up.",
                    "example": 1,
                    "default": 1,
                    "minimum": 1
                  },
                  {
                    "name": "price",
                    "kind": "required",
                    "type": "number<float>",
                    "description": "",
                    "example": 10.49,
                    "format": "float"
                  },
                  {
                    "name": "tax_type",
                    "kind": "optional",
                    "type": "string<net>",
                    "deprecated": true,
                    "description": "Warning: Deprecated\nNet is the only supported value here",
                    "default": "net",
                    "enum": [
                      "net"
                    ]
                  },
                  {
                    "name": "unit_of_measure",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>The unit of measure associated with this quantity. When specifying a unit of measure, it must match the pattern. To remove any value set, either omit the property or set the value as null.</p>",
                    "example": "pallet",
                    "pattern": "^[a-zA-Z0-9-]+$"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/VariantPricing",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Price list not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get Price Lists tagged with the number of prices set manually
[path] Untitled/Pricing API Docs/Price Lists with Number of Manual Prices/

{
  "id": "HuC8go5AfABeZXkH6MxJp",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v2/price-lists-num-manual-prices",
    "servers": [],
    "name": "Get Price Lists tagged with the number of prices set manually",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "page",
          "type": "integer",
          "description": "The page of results to fetch",
          "default": 1,
          "minimum": 1
        },
        {
          "kind": "optional",
          "name": "page_size",
          "type": "integer",
          "description": "Number of records per page",
          "default": 100,
          "minimum": 1,
          "maximum": 250
        },
        {
          "kind": "optional",
          "name": "order_by",
          "type": "string",
          "description": "Field to order the search results by",
          "default": "name:asc",
          "pattern": "^(name|created_at|updated_at):(asc|desc)$"
        },
        {
          "kind": "optional",
          "name": "source",
          "type": "array",
          "description": "",
          "default": [
            "custom",
            "integration",
            "platform"
          ],
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "pagination",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/Pagination",
                "customType": "Pagination",
                "schema": [
                  {
                    "name": "total",
                    "kind": "optional",
                    "type": "integer",
                    "description": "The total number of available records"
                  },
                  {
                    "name": "per_page",
                    "kind": "optional",
                    "type": "integer",
                    "description": "The number of records returned per page"
                  },
                  {
                    "name": "current_page",
                    "kind": "optional",
                    "type": "integer",
                    "description": "The current page of results returned"
                  },
                  {
                    "name": "total_pages",
                    "kind": "optional",
                    "type": "integer",
                    "description": "the total number of available pages"
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get Price List
[path] Untitled/Pricing API Docs/Price Lists/

{
  "id": "wtKGSoRiBR5vD5jUwwdCu",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/price-lists/{slug}",
    "servers": [],
    "name": "Get Price List",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "slug",
          "type": "string",
          "description": "Price List Slug"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "PriceList",
            "schema": [
              {
                "name": "slug",
                "kind": "optional",
                "type": "string",
                "description": "Slug",
                "example": "base-list",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "Name",
                "example": "Base Price List",
                "modelRef": "#/components/schemas/PriceListNameParam",
                "customType": "PriceListNameParam",
                "schema": []
              },
              {
                "name": "currency_code",
                "kind": "optional",
                "type": "string",
                "description": "ISO 4217 currency code",
                "example": "GBP",
                "modelRef": "#/components/schemas/PriceListCurrency",
                "customType": "PriceListCurrency",
                "schema": []
              },
              {
                "name": "source",
                "kind": "optional",
                "type": "string<custom | platform | integration>",
                "description": "<p>Integration should be used by external parties, custom is provided to any price lists setup in the dashboard and platform is reserved for the eCommerce platform.</p>",
                "example": "custom",
                "default": "custom",
                "enum": [
                  "custom",
                  "platform",
                  "integration"
                ]
              },
              {
                "name": "tax_inclusive_display",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>When true, storefronts display prices on this price list inclusive of the per-SKU display_tax_rate, labelled as tax inclusive. This changes presentation only - prices are still stored and transacted net. SKUs on the list with no rate, or a rate of 0, display their net price and are still labelled tax inclusive.</p>",
                "example": false,
                "default": false
              },
              {
                "name": "rules",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/PriceListRulesParam",
                "customType": "PriceListRulesParam",
                "schema": [
                  {
                    "name": "source_price_list_slug",
                    "kind": "optional",
                    "type": "string",
                    "description": "Source PriceList slug",
                    "example": "base-list",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  {
                    "name": "adjustment_percentage",
                    "kind": "optional",
                    "type": "number",
                    "description": "<p>Adjustment percent expressed as a decimal fraction between 0 and 1 - E.g. 15% should be set as 0.15</p>",
                    "example": 0.103333,
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "name": "adjustment_direction",
                    "kind": "optional",
                    "type": "string<plus | minus>",
                    "description": "<p>Adjustment direction (plus, minus)</p>",
                    "example": "plus",
                    "enum": [
                      "plus",
                      "minus"
                    ]
                  },
                  {
                    "name": "currency_exchange_rate",
                    "kind": "optional",
                    "type": "number",
                    "nullable": true,
                    "description": "<p>Exchange rate between the currency of the source price list and the price list to which this rule belongs. If null, the rate will be  determined automatically based on current market rates.</p>",
                    "example": 1.254324,
                    "minimum": 0.000001
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/PriceList",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get Price Lists
[path] Untitled/Pricing API Docs/Price Lists/

{
  "id": "c5we19I78B1qtuZu08-UX",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/price-lists",
    "servers": [],
    "name": "Get Price Lists",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "PriceList[]",
            "schema": [
              {
                "name": "slug",
                "kind": "optional",
                "type": "string",
                "description": "Slug",
                "example": "base-list",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "Name",
                "example": "Base Price List",
                "modelRef": "#/components/schemas/PriceListNameParam",
                "customType": "PriceListNameParam",
                "schema": []
              },
              {
                "name": "currency_code",
                "kind": "optional",
                "type": "string",
                "description": "ISO 4217 currency code",
                "example": "GBP",
                "modelRef": "#/components/schemas/PriceListCurrency",
                "customType": "PriceListCurrency",
                "schema": []
              },
              {
                "name": "source",
                "kind": "optional",
                "type": "string<custom | platform | integration>",
                "description": "<p>Integration should be used by external parties, custom is provided to any price lists setup in the dashboard and platform is reserved for the eCommerce platform.</p>",
                "example": "custom",
                "default": "custom",
                "enum": [
                  "custom",
                  "platform",
                  "integration"
                ]
              },
              {
                "name": "tax_inclusive_display",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>When true, storefronts display prices on this price list inclusive of the per-SKU display_tax_rate, labelled as tax inclusive. This changes presentation only - prices are still stored and transacted net. SKUs on the list with no rate, or a rate of 0, display their net price and are still labelled tax inclusive.</p>",
                "example": false,
                "default": false
              },
              {
                "name": "rules",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/PriceListRulesParam",
                "customType": "PriceListRulesParam",
                "schema": [
                  {
                    "name": "source_price_list_slug",
                    "kind": "optional",
                    "type": "string",
                    "description": "Source PriceList slug",
                    "example": "base-list",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  {
                    "name": "adjustment_percentage",
                    "kind": "optional",
                    "type": "number",
                    "description": "<p>Adjustment percent expressed as a decimal fraction between 0 and 1 - E.g. 15% should be set as 0.15</p>",
                    "example": 0.103333,
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "name": "adjustment_direction",
                    "kind": "optional",
                    "type": "string<plus | minus>",
                    "description": "<p>Adjustment direction (plus, minus)</p>",
                    "example": "plus",
                    "enum": [
                      "plus",
                      "minus"
                    ]
                  },
                  {
                    "name": "currency_exchange_rate",
                    "kind": "optional",
                    "type": "number",
                    "nullable": true,
                    "description": "<p>Exchange rate between the currency of the source price list and the price list to which this rule belongs. If null, the rate will be  determined automatically based on current market rates.</p>",
                    "example": 1.254324,
                    "minimum": 0.000001
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/PriceList",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Pricing
[path] Untitled/Pricing API Docs/


[title] Pricing API
[path] /

If you're using the SparkLayer API to connect to your backend system, the price list data comes **directly** from your backend system (e.g. ERP, PIM, CRM, iPaaS) and each product SKU will subsequently then be assigned a price list within SparkLayer. [Our diagram here](docId\:usYik0SwC3mbkuN80GdGP) runs through how this flow works.

## Typical Integration Flow

The source system is typically the external system that sends the pricing data and you can follow these guidelines:

| Step | Action                                                                                                                                       |
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| 1    | Fetch the source system price lists                                                                                                          |
| 2    | Fetch the SparkLayer price lists using [this API endpoint](get-price-lists)                                                                  |
| 3    | Create any price lists missing in SparkLayer using [this API endpoint](create-a-price-list)                                                  |
| 4    | Collect all pricing against the price lists from the source system and push to our API via [this API endpoint](update-pricing-by-price-list) |

The same process applies to customer-specific pricing. In this scenario, a unique price list is created that contains a reference to link to the customer, and pricing is pushed against it.

To map price lists to a customer, you can use either the SparkLayer Customer Groups or directly map them (refer to the documentation of the chosen eCommerce platform for more information).

## Data Mapping

When it comes to data mapping, keep in mind the following:

- Price lists are linked to price list rules
- Prices are connected to product data by a SKU, which is in turn linked to a price list

Here's a diagram to help illustrate the data mapping process:

![price-lists-diagram](https://archbee-doc-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/CQGC_cnLqDqIaEmYMscvf_price-lists-diagram.png)

## Checking Price List Data

The easiest way to check if price lists have been assigned to a product is to use the [Price Editor](https://app.sparklayer.io/products/price-editor) tool within the SparkLayer Dashboard.

[title] Update pricing for multiple price lists
[path] Untitled/Pricing API Docs/Pricing/

{
  "id": "VM2m43QifBgmQzL6zi82e",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "/api/v1/batch-update-pricing",
    "servers": [],
    "name": "Update pricing for multiple price lists",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "array",
          "description": "<p>List of sku, price list, quantity and price to update. Partial updates are supported, meaning only the SKUs present will be affected. For the given SKUs, existing prices are deleted then the supplied prices are inserted. If a SKU is provided but quantity and price are blank, all prices for that SKU are removed from the price list.</p>",
          "schema": [
            {
              "name": "sku",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "SKU-1",
              "maxLength": 128
            },
            {
              "name": "price_list_slug",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "example-list"
            },
            {
              "name": "display_tax_rate",
              "kind": "optional",
              "type": "number",
              "nullable": true,
              "description": "<p>Tax rate used only to display a tax-inclusive price, expressed as a whole percentage (10 means 10%). Stored prices remain net and the eCommerce platform remains authoritative for the tax actually charged at checkout.\nOn an update the field has three states: omit it to leave any stored rate unchanged (so a price-only sync never disturbs it), send null to clear it, or send a value to set it.</p>",
              "example": 10,
              "modelRef": "#/components/schemas/DisplayTaxRate",
              "customType": "DisplayTaxRate",
              "schema": []
            },
            {
              "name": "pricing",
              "kind": "required",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "quantity",
                  "kind": "required",
                  "type": "integer",
                  "description": "The quantity at which the specified price is applicable. This allows for quantity discount pricing to be set up.",
                  "example": 1,
                  "default": 1,
                  "minimum": 1
                },
                {
                  "name": "price",
                  "kind": "required",
                  "type": "number<float>",
                  "description": "",
                  "example": 10.49,
                  "format": "float"
                },
                {
                  "name": "unit_of_measure",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "<p>The unit of measure associated with this quantity. When specifying a unit of measure, it must match the pattern. To remove any value set, either omit the property or set the value as null.</p>",
                  "example": "pallet",
                  "pattern": "^[a-zA-Z0-9-]+$"
                }
              ]
            }
          ],
          "itemType": "object",
          "customType": "object[]",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "Validation errors",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "PriceUpdateError[]",
            "schema": [
              {
                "name": "line",
                "kind": "optional",
                "type": "integer",
                "description": "line of input which the error relates to"
              },
              {
                "name": "field",
                "kind": "optional",
                "type": "string",
                "description": "field which the error relates to"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "human readable description of error"
              }
            ],
            "modelRef": "#/components/schemas/PriceUpdateError",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Price list not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Internal server error",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Price Lists
[path] Untitled/Pricing API Docs/


[title] Price Lists with Number of Manual Prices
[path] Untitled/Pricing API Docs/


[title] Calculate Pricing
[path] Untitled/Pricing API Docs/Pricing/

{
  "id": "jMr-vyguGKdFzySfIZItq",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/v1/calculate-pricing",
    "servers": [],
    "name": "Calculate Pricing",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "skus",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "TEST01",
              "itemDefault": ""
            },
            {
              "name": "price_list_slugs",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "a-price-list",
              "itemDefault": ""
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "schema": [
              {
                "name": "sku",
                "kind": "optional",
                "type": "string",
                "description": "SKU",
                "example": "TEST01"
              },
              {
                "name": "display_tax_rate",
                "kind": "optional",
                "type": "number",
                "nullable": true,
                "description": "<p>Tax rate used only to display a tax-inclusive price, expressed as a whole percentage (10 means 10%). Stored prices remain net and the eCommerce platform remains authoritative for the tax actually charged at checkout.\nOn an update the field has three states: omit it to leave any stored rate unchanged (so a price-only sync never disturbs it), send null to clear it, or send a value to set it.</p>",
                "example": 10,
                "modelRef": "#/components/schemas/DisplayTaxRate",
                "customType": "DisplayTaxRate",
                "schema": []
              },
              {
                "name": "tax_inclusive_display",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>Whether the winning price list is configured to display prices inclusive of display_tax_rate. Presentation only - the prices returned above are always net.</p>",
                "example": false
              },
              {
                "name": "pricing",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "quantity",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "price",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/Price",
                    "customType": "Price",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "currency",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      }
                    ]
                  },
                  {
                    "name": "unit_of_measure",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "pallet"
                  }
                ]
              }
            ],
            "itemType": "object",
            "customType": "object[]",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Delete a Price List
[path] Untitled/Pricing API Docs/Price Lists/

{
  "id": "1XW2fm2OG1h2kLNFm5i0y",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "/api/v1/price-lists/{slug}",
    "servers": [],
    "name": "Delete a Price List",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "slug",
          "type": "string",
          "description": "Price List Slug"
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Empty Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Purchasing API
[path] /

Our purchasing API is designed to store any purchases these can be purchases not ready yet such as a cart, quote or a purchase which has yet to be confirmed and finally allows easy updates to an order once placed.

:::hint{type="warning"}
**Please note:**
Purchases created here will not be pushed to your e-commerce platform (e.g. Shopify). These purchases will show in the "My Account" section for your B2B users.

If you wish to have the orders in your e-commerce platform, you will need to use the API provided by the platform to create the order, e.g. [Shopify orders API](https://shopify.dev/docs/api/admin-rest/2024-04/resources/order) to create the order.

In order to have the orders sync through to SparkLayer, they need a few properties applied. This may be different depending on your e-commerce platform.

For example, in Shopify you will need to ensure the order has:

- The `b2b` tag
- The `sparklayer.order_import` metafield

For more details on this (for Shopify), please refer to our documentation on importing orders [here](https://docs.sparklayer.io/shopify-metafields#6jvT_)
:::

## Technical details

Any creates/updates to an order are saved via the `PUT` endpoint `/api/v1/purchases/{lookupBy}/{identifier}`. This can be a new purchase, or update an existing purchase. If the `lookupBy` and `identifier` are not found, a new purchase is created. Typically, if an order was created from SparkLayer, it is important you use the Spark Cart ID which was used to create the order on the platform, this will ensure the cart is replaced with the order.

Below highlights the top level `purchase_identifiers`:

| Lookup Identifier | Description                                                                                                                                                                                                     |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sparklayer`      | Passed to the eCommerce platform when a customer completes the checkout. If a SparkLayer order, this MUST be brought through to move the order from `awaiting_merchant` to `order` type. Otherwise leave blank. |
| `platform`        | The internal eCommerce platform ID.                                                                                                                                                                             |
| `internal`        | The merchant ID from a ERP/OMS.                                                                                                                                                                                 |
| `visible`         | The ID which will be shown to the customer.                                                                                                                                                                     |

Note that this endpoint replaces the previous data for a purchase, so when making updates, ensure you include the full purchase and not just updated fields. This is to prevent any weird or stale states and lowers complexity of integration of orders to the platform.

Also note all calculated fields are calculated by the API and should not be set in the request body.

Purchases can be one of a few types, "quote", "awaiting\_approval", "order" and "awaiting\_merchant". Typically, you will be using "order".

| Purchase Type       | Description                                                                                                                                 |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `quote`             | A purchase in the state of quote with a quote status.                                                                                       |
| `awaiting_approval` | An purchase awaiting confirmation by another member of the customer typically used by our company user functionality.                       |
| `awaiting_merchant` | An order completed within SparkLayer but not confirmed yet, either pending on the eCommerce platform or sync tooling has not completed yet. |
| `order`             | A finalised order saved within the eCommerce platform or from the merchants order source of truth such as ERP/OMS.                          |

A purchase is mostly made up of packages, these packages store the line items, shipping methods, addresses and various IDs.

When first creating an order, the orders line items should be placed in a "processing" package. These items can then be moved to the relevant packages through a order lifecycle, such as "shipment", "refund" or "cancelled". You can use multiple of each, for say partial shipments.

The state of an order as reflected in the frontend is calculated by package dates, created at, shipped at etc.

When an order is missing required values, or they are invalid, the API will return a 400 with the appropriate error to identify the value.

## Purchase Transactions

To record transactions against a purchase such as payments, refunds etc. you can use the purchase transactions PUT endpoint. The transactions are used to calculate the payment status of the given Purchase.

NOTE: If using this API it's important to not also send the same information to your e-commerce platform as that could lead to the same transaction being recorded twice.

Every transaction requires the SparkID of the purchase in the `purchase_spark_id` property that you want to record it against. Multiple transactions can be logged against a single purchase, but each transaction must have a unique combination of `purchase_spark_id` and `platform_id` which is a reference to the ID used by the 3rd party system to identify this specific transaction.

The `total` should be positive for a payment and negative for a refund. A currency code is also required.

Purchase transactions can be created in one of two states governed by the `apply_to_balance` boolean.

When set to `false` the record is created for informational purposes only. It will not be used in the status calculation. It will be available to be returned from the GET endpoint, but no further processing of the record will take place. This is useful for recording pending or failed transactions etc. which may be useful for debugging.

Setting to `true` will make this transaction part of the status calculation for the purchase and also trigger two additional processes. Firstly a new item will be added to the PurchaseHistory for the associated Purchase which will be shown to the customer in the UI. Secondly, the value in the `total` property will be used to adjust the outstanding balance of the customer associated with the purchase.

Updating a PurchaseTransaction that was previously set `true` to `false` will delete the PurchaseHistory item it created and revert the change to the customer's balance and payment status.

The `full_transaction` property is a JSON string that can be used to store a full representation of the transaction as held by the 3rd party system. Be aware that this will be stored as given and no redaction will take place, so it's vital to ensure that sensitive data such as full credit card numbers etc. are removed or obfuscated before sending to SparkLayer.

[title] Create or update a Purchase Transaction
[path] Untitled/Purchasing API Docs/Purchasing/

{
  "id": "uwca4smocylL0NdJvQsIO",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "/api/v1/purchases/{lookupBy}/{identifier}/transactions",
    "servers": [],
    "name": "Create or update a Purchase Transaction",
    "description": "Create transaction for a given purchase",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID",
          "minLength": 1
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "string<uuid>",
              "readOnly": true,
              "nullable": true,
              "description": "The identifier SparkLayer uses for the transaction.",
              "example": "63428136-658f-48a6-beb7-7f333dfd9686",
              "format": "uuid",
              "minLength": 1
            },
            {
              "name": "purchase_spark_id",
              "kind": "optional",
              "type": "string<uuid>",
              "readOnly": true,
              "nullable": true,
              "description": "The identifier SparkLayer uses for the purchase.",
              "example": "63428136-658f-48a6-beb7-7f333dfd9686",
              "format": "uuid",
              "minLength": 1
            },
            {
              "name": "platform_id",
              "kind": "optional",
              "type": "string",
              "description": "<p>The identifier for this transaction on the e-commerce platform</p>",
              "example": "123456789",
              "minLength": 1
            },
            {
              "name": "full_transaction",
              "kind": "optional",
              "type": "string",
              "description": "A JSON string representing the full details of the transaction"
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "string",
              "description": "<p>The type of the transaction e.g. charge, refund</p>"
            },
            {
              "name": "apply_to_balance",
              "kind": "optional",
              "type": "boolean",
              "description": "Set to true to signal that the value of this transaction should contribute to customer balances"
            },
            {
              "name": "currency_code",
              "kind": "optional",
              "type": "string",
              "description": "The 3 letter currency code used in this transaction",
              "example": "GBP",
              "minLength": 3,
              "maxLength": 3
            },
            {
              "name": "total",
              "kind": "optional",
              "type": "string",
              "description": "The amount of this transaction",
              "example": "20.99"
            },
            {
              "name": "transaction_date",
              "kind": "optional",
              "type": "string<date-time>",
              "description": "The date the transaction was created",
              "example": "2020-01-01T00:00:00+02:00",
              "format": "date-time"
            },
            {
              "name": "created_at",
              "kind": "optional",
              "type": "string<date-time>",
              "readOnly": true,
              "description": "<p>The date the transaction was created in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned from it</p>",
              "example": "2020-01-01T00:00:00+02:00",
              "format": "date-time"
            }
          ],
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "string<uuid>",
                  "readOnly": true,
                  "nullable": true,
                  "description": "The identifier SparkLayer uses for the transaction.",
                  "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                  "format": "uuid",
                  "minLength": 1
                },
                {
                  "name": "purchase_spark_id",
                  "kind": "optional",
                  "type": "string<uuid>",
                  "readOnly": true,
                  "nullable": true,
                  "description": "The identifier SparkLayer uses for the purchase.",
                  "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                  "format": "uuid",
                  "minLength": 1
                },
                {
                  "name": "platform_id",
                  "kind": "optional",
                  "type": "string",
                  "description": "<p>The identifier for this transaction on the e-commerce platform</p>",
                  "example": "123456789",
                  "minLength": 1
                },
                {
                  "name": "full_transaction",
                  "kind": "optional",
                  "type": "string",
                  "description": "A JSON string representing the full details of the transaction"
                },
                {
                  "name": "type",
                  "kind": "optional",
                  "type": "string",
                  "description": "<p>The type of the transaction e.g. charge, refund</p>"
                },
                {
                  "name": "apply_to_balance",
                  "kind": "optional",
                  "type": "boolean",
                  "description": "Set to true to signal that the value of this transaction should contribute to customer balances"
                },
                {
                  "name": "currency_code",
                  "kind": "optional",
                  "type": "string",
                  "description": "The 3 letter currency code used in this transaction",
                  "example": "GBP",
                  "minLength": 3,
                  "maxLength": 3
                },
                {
                  "name": "total",
                  "kind": "optional",
                  "type": "string",
                  "description": "The amount of this transaction",
                  "example": "20.99"
                },
                {
                  "name": "transaction_date",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "description": "The date the transaction was created",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                },
                {
                  "name": "created_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "readOnly": true,
                  "description": "<p>The date the transaction was created in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned from it</p>",
                  "example": "2020-01-01T00:00:00+02:00",
                  "format": "date-time"
                }
              ],
              "modelRef": "#/components/schemas/Transaction",
              "customType": "Transaction"
            },
            {
              "name": "object",
              "schema": []
            }
          ],
          "complexType": "allOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Transaction",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "nullable": true,
                "description": "The identifier SparkLayer uses for the transaction.",
                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                "format": "uuid",
                "minLength": 1
              },
              {
                "name": "purchase_spark_id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "nullable": true,
                "description": "The identifier SparkLayer uses for the purchase.",
                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                "format": "uuid",
                "minLength": 1
              },
              {
                "name": "platform_id",
                "kind": "optional",
                "type": "string",
                "description": "<p>The identifier for this transaction on the e-commerce platform</p>",
                "example": "123456789",
                "minLength": 1
              },
              {
                "name": "full_transaction",
                "kind": "optional",
                "type": "string",
                "description": "A JSON string representing the full details of the transaction"
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string",
                "description": "<p>The type of the transaction e.g. charge, refund</p>"
              },
              {
                "name": "apply_to_balance",
                "kind": "optional",
                "type": "boolean",
                "description": "Set to true to signal that the value of this transaction should contribute to customer balances"
              },
              {
                "name": "currency_code",
                "kind": "optional",
                "type": "string",
                "description": "The 3 letter currency code used in this transaction",
                "example": "GBP",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "total",
                "kind": "optional",
                "type": "string",
                "description": "The amount of this transaction",
                "example": "20.99"
              },
              {
                "name": "transaction_date",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "The date the transaction was created",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "<p>The date the transaction was created in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned from it</p>",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              }
            ],
            "modelRef": "#/components/schemas/Transaction",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get Purchase
[path] Untitled/Purchasing API Docs/Purchasing/

{
  "id": "htZixy97zZjGPz99omUxw",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/purchases/{lookupBy}/{identifier}",
    "servers": [],
    "name": "Get Purchase",
    "description": "<p>Retrieve a cart, quote, awaiting approval order, or finalised order</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID",
          "minLength": 1
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "SparkLayer purchase object",
            "customType": "Purchase",
            "schema": [
              {
                "name": "type",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "order",
                "modelRef": "#/components/schemas/PurchaseType",
                "customType": "PurchaseType",
                "schema": []
              },
              {
                "name": "purchase_identifiers",
                "kind": "required",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "sparklayer",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The identifier SparkLayer uses for the purchase. You will need to generate this if the purchase does not exist",
                    "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                    "format": "uuid",
                    "minLength": 1
                  },
                  {
                    "name": "platform",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>The identifier for the purchase on the e-commerce platform</p>",
                    "example": "123456789",
                    "minLength": 1
                  },
                  {
                    "name": "internal",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The identifier for the purchase on your system",
                    "minLength": 1
                  },
                  {
                    "name": "visible",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The identifier that will be shown to the customer in their recent orders",
                    "example": "B2B01123"
                  }
                ]
              },
              {
                "name": "customer_identifiers",
                "kind": "required",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "sparklayer",
                    "kind": "required",
                    "type": "string",
                    "nullable": false,
                    "description": "The ID of the customer that that order is for.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  },
                  {
                    "name": "sparklayer_impersonator",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the sales agent placing the order.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  },
                  {
                    "name": "sparklayer_impersonator_assignee",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the sales agent assigned to be responsible for the order.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  },
                  {
                    "name": "sparklayer_child",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the company user that placed the order.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                  }
                ]
              },
              {
                "name": "company",
                "kind": "optional",
                "type": "object",
                "nullable": true,
                "description": "<p>Company sections are opt-in; omit this entirely for merchants that do not use them.</p>",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The ID of the company the purchase was placed for.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                    "format": "uuid"
                  },
                  {
                    "name": "section_id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The ID of the company section the purchase was placed for.",
                    "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                    "format": "uuid"
                  },
                  {
                    "name": "section_name",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>The section name at the time of purchase, kept so historical purchases stay readable after a section is renamed or deleted. Not filterable.</p>",
                    "example": "Bristol",
                    "maxLength": 128
                  }
                ]
              },
              {
                "name": "payment_method",
                "kind": "optional",
                "type": "string<quote | upfrontPayment | paymentOnAccount | paymentByInvoice>",
                "nullable": true,
                "description": "<p>How the purchase was/will be paid for</p>",
                "enum": [
                  "quote",
                  "upfrontPayment",
                  "paymentOnAccount",
                  "paymentByInvoice"
                ]
              },
              {
                "name": "dates",
                "kind": "required",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "created_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>The date the purchase was created in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "updated_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>The date the purchase was last updated in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "placed_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date at which the purchase was placed - include user timezone or Z for UTC (RFC-3339)</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "to_be_placed_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date at which the purchase is due to be placed, for a purchase that is scheduled rather than placed immediately (RFC-3339). It can be changed while the purchase is still pending</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "calculated_submitted_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>The date the purchase was submitted (RFC-3339). This is when the cart is converted into another purchase type. This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "expires_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>the date at which the purchase will expire and become archived (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "payment_due_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "The date at which payment for the purchase is expected",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  }
                ]
              },
              {
                "name": "customer_reference",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Additional information that a customer adds to the order",
                "example": "Please deliver to the back of the store"
              },
              {
                "name": "po_number",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "PO number for the purchase",
                "example": "PO-001"
              },
              {
                "name": "shipping_requested_date",
                "kind": "optional",
                "type": "string<date-time>",
                "nullable": true,
                "description": "The date requested for the delivery to arrive",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "recurring_purchase",
                "kind": "optional",
                "type": "object",
                "nullable": true,
                "description": "Present only for a purchase created from a recurring purchase template. Both properties are stored when the purchase is created and ignored on any later update",
                "example": "",
                "schema": [
                  {
                    "name": "template_id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The recurring purchase template this purchase was created from. Set on creation and ignored on update",
                    "example": "0f8fad5b-d9cb-469f-a165-70867728950e",
                    "format": "uuid"
                  },
                  {
                    "name": "cancelled_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date the customer cancelled the purchase, after which it will not be placed (RFC-3339). Cancelling does not free the date - the template has already had its turn for it</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "to_be_placed_at_initial",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date to_be_placed_at was first set to (RFC-3339). Set on creation and ignored on update, so that rescheduling cannot let the same template produce a second purchase for the same date</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  }
                ]
              },
              {
                "name": "currency_code",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "The 3 letter currency code used for the prices in the purchase",
                "example": "GBP",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "currency_code_base",
                "kind": "optional",
                "type": "string",
                "writeOnly": true,
                "nullable": true,
                "description": "The 3 letter currency code of the store's base currency",
                "example": "GBP",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "calculated_shipping_address",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "nullable": true,
                "description": "<p>A single string containing all the details of the shipping address. This is read only - it should not be sent to the API, but will be returned form it</p>",
                "example": "John Spark, SparkLayer, SparkLayer HQ, Example City, 12345"
              },
              {
                "name": "calculated_total",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "calculated_total_usd",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "calculated_total_base",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "calculated_fulfilment_status",
                "kind": "optional",
                "type": "string<incoming | processing | shipped | part_shipped | cancelled | returned | part_returned | varied>",
                "readOnly": true,
                "nullable": true,
                "description": "<p>The status of the order, calculated from the statuses of the individual packages. This is read only - it should not be sent to the API, but will be returned form it</p>",
                "example": "processing",
                "enum": [
                  "incoming",
                  "processing",
                  "shipped",
                  "part_shipped",
                  "cancelled",
                  "returned",
                  "part_returned",
                  "varied"
                ]
              },
              {
                "name": "quote",
                "kind": "optional",
                "type": "object",
                "nullable": true,
                "description": "Quote data",
                "example": "",
                "schema": [
                  {
                    "name": "status_slug",
                    "kind": "optional",
                    "type": "string",
                    "description": "The slug of the quote status applied to this quote"
                  },
                  {
                    "name": "status",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "QuoteStatus",
                        "description": "",
                        "modelRef": "#/components/schemas/QuoteStatus",
                        "schema": [
                          {
                            "name": "id",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "description": "",
                            "maxLength": 45
                          },
                          {
                            "name": "slug",
                            "kind": "optional",
                            "type": "string",
                            "description": "",
                            "maxLength": 45,
                            "pattern": "^[a-z0-9-]+$"
                          },
                          {
                            "name": "default",
                            "kind": "optional",
                            "type": "boolean",
                            "description": ""
                          },
                          {
                            "name": "next",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "maxLength": 45,
                            "pattern": "^[a-z0-9-]+$"
                          },
                          {
                            "name": "actions",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "string",
                            "customType": "string[]",
                            "itemExample": "",
                            "itemDefault": ""
                          },
                          {
                            "name": "created_at",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "description": "",
                            "format": "date-time"
                          },
                          {
                            "name": "updated_at",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "description": "",
                            "format": "date-time"
                          },
                          {
                            "name": "deleted_at",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "nullable": true,
                            "description": "",
                            "format": "date-time"
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "expiry",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date at which the quote is considered expired and no longer valid (RFC-3339)</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  }
                ]
              },
              {
                "name": "payment_status",
                "kind": "optional",
                "type": "string<unpaid | part_paid | paid>",
                "description": "That payment status of the order",
                "enum": [
                  "unpaid",
                  "part_paid",
                  "paid"
                ]
              },
              {
                "name": "total_paid",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "MonetaryObject",
                    "description": "",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "revision_date",
                "kind": "optional",
                "type": "string<date-time>",
                "nullable": true,
                "description": "<p>The date at which the purchase was last modified - include user timezone or Z for UTC (RFC-3339)</p>",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "tax_lines",
                "kind": "optional",
                "type": "array",
                "description": "Tax lines for the purchase.",
                "modelRef": "#/components/schemas/TaxLine",
                "customType": "TaxLine[]",
                "schema": [
                  {
                    "name": "title",
                    "kind": "required",
                    "type": "string",
                    "description": "The title of the tax line",
                    "example": "HST"
                  },
                  {
                    "name": "amount",
                    "kind": "required",
                    "type": "object",
                    "description": "The amount of tax of the tax line",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "customType": "MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  },
                  {
                    "name": "amount_base",
                    "kind": "optional",
                    "type": "object",
                    "description": "The amount of tax of the tax line in the store's base currency",
                    "modelRef": "#/components/schemas/MonetaryObject",
                    "customType": "MonetaryObject",
                    "schema": [
                      {
                        "name": "number",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                        "example": "15.99",
                        "minLength": 1
                      },
                      {
                        "name": "currency",
                        "kind": "required",
                        "type": "string",
                        "description": "The 3 letter currency code used for the prices in the purchase",
                        "example": "GBP",
                        "minLength": 3,
                        "maxLength": 3
                      }
                    ]
                  },
                  {
                    "name": "rate",
                    "kind": "required",
                    "type": "number<double>",
                    "nullable": true,
                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                    "example": 20,
                    "format": "double",
                    "minimum": 0
                  }
                ]
              },
              {
                "name": "billing_address",
                "kind": "optional",
                "type": "object",
                "nullable": true,
                "description": "",
                "modelRef": "#/components/schemas/PurchaseAddress",
                "customType": "PurchaseAddress",
                "schema": [
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Tom Jones"
                  },
                  {
                    "name": "company",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Tom Jones Hardware Ltd"
                  },
                  {
                    "name": "address_line1",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "example": "7 Philosophy way"
                  },
                  {
                    "name": "address_line2",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": ""
                  },
                  {
                    "name": "city",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "example": "Willerby"
                  },
                  {
                    "name": "region_code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "minLength": 1
                  },
                  {
                    "name": "postal_code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "BJ6 9MK"
                  },
                  {
                    "name": "country_code",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "example": "GB"
                  },
                  {
                    "name": "phone",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "0123456789"
                  },
                  {
                    "name": "sparklayer_id",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                  },
                  {
                    "name": "first_name",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Tom"
                  },
                  {
                    "name": "last_name",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Jones"
                  }
                ]
              },
              {
                "name": "packages",
                "kind": "required",
                "type": "object",
                "description": "Packages contained within this purchase",
                "modelRef": "#/components/schemas/Package",
                "customType": "Package[]",
                "schema": [],
                "complexType": "oneOf",
                "complexItems": [
                  {
                    "name": "Incoming",
                    "description": "",
                    "modelRef": "#/components/schemas/Incoming",
                    "schema": [
                      {
                        "name": "identifiers",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "sparklayer_package_id",
                            "kind": "required",
                            "type": "string<uuid>",
                            "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                            "format": "uuid"
                          },
                          {
                            "name": "platform",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>The identifier for the package on the e-commerce platform</p>",
                            "example": "123456789",
                            "minLength": 1
                          },
                          {
                            "name": "internal",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier for the package on your system",
                            "minLength": 1
                          },
                          {
                            "name": "visible",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier that will be shown to the customer in their recent orders"
                          }
                        ]
                      },
                      {
                        "name": "accounting_files",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseFiles",
                        "customType": "PurchaseFiles[]",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that is used by your system",
                                "example": "INV011",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that should be shown to the customer",
                                "default": "INV011"
                              }
                            ]
                          },
                          {
                            "name": "data",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "anyOf",
                            "complexItems": [
                              {
                                "name": "object",
                                "description": "",
                                "schema": [
                                  {
                                    "name": "uri",
                                    "kind": "optional",
                                    "type": "string<uri>",
                                    "nullable": true,
                                    "description": "",
                                    "format": "uri"
                                  },
                                  {
                                    "name": "type",
                                    "kind": "required",
                                    "type": "string<uri>",
                                    "description": "",
                                    "example": "uri",
                                    "default": "uri",
                                    "enum": [
                                      "uri"
                                    ]
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "file_type",
                            "kind": "required",
                            "type": "string<credit | invoice | payment>",
                            "description": "",
                            "example": "invoice",
                            "enum": [
                              "credit",
                              "invoice",
                              "payment"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "line_items",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom | product>",
                            "description": "",
                            "enum": [
                              "custom",
                              "product"
                            ]
                          },
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_item_key",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                "minLength": 1
                              },
                              {
                                "name": "sparklayer_variant_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                "example": "45552423353839",
                                "minLength": 1
                              },
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "CAT-MUG",
                                "maxLength": 128
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the product on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>A human-readable identifier for the product</p>"
                              }
                            ]
                          },
                          {
                            "name": "name_parent",
                            "kind": "required",
                            "type": "string",
                            "description": "Name of the product",
                            "example": "T-Shirt"
                          },
                          {
                            "name": "name_child",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>Name of the product variant/type</p>",
                            "example": "Red"
                          },
                          {
                            "name": "quantity",
                            "kind": "required",
                            "type": "number",
                            "description": "",
                            "example": 4
                          },
                          {
                            "name": "custom_attributes",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "key",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Key or name of the attribute.",
                                "example": "mug text"
                              },
                              {
                                "name": "value",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Value of the attribute.",
                                "example": "best company ever"
                              }
                            ]
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_method",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "<p>Details of how the package was/will be shipped</p>",
                        "example": "",
                        "schema": [
                          {
                            "name": "sku",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "SKU that identifies the shipping method used",
                            "example": "SHIP-ECO",
                            "minLength": 1
                          },
                          {
                            "name": "name",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The friendly/human-readable name for the shipping method</p>",
                            "example": "Standard Shipping"
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_address",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseAddress",
                        "customType": "PurchaseAddress",
                        "schema": [
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones"
                          },
                          {
                            "name": "company",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones Hardware Ltd"
                          },
                          {
                            "name": "address_line1",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "7 Philosophy way"
                          },
                          {
                            "name": "address_line2",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": ""
                          },
                          {
                            "name": "city",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Willerby"
                          },
                          {
                            "name": "region_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "",
                            "minLength": 1
                          },
                          {
                            "name": "postal_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "BJ6 9MK"
                          },
                          {
                            "name": "country_code",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "GB"
                          },
                          {
                            "name": "phone",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "0123456789"
                          },
                          {
                            "name": "sparklayer_id",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                          },
                          {
                            "name": "first_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom"
                          },
                          {
                            "name": "last_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Jones"
                          }
                        ]
                      },
                      {
                        "name": "shipments",
                        "kind": "required",
                        "type": "array",
                        "description": "Carrier and tracking details for the shipment",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "carrier",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Carrier Company Ltd"
                          },
                          {
                            "name": "carrier_id",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The tracking number/ID used by the carrier</p>"
                          },
                          {
                            "name": "tracking_url",
                            "kind": "optional",
                            "type": "string<uri>",
                            "nullable": true,
                            "description": "The URL the customer can use to track their shipment",
                            "format": "uri"
                          }
                        ]
                      },
                      {
                        "name": "type",
                        "kind": "required",
                        "type": "string<incoming>",
                        "description": "",
                        "enum": [
                          "incoming"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "Processing",
                    "description": "",
                    "modelRef": "#/components/schemas/Processing",
                    "schema": [
                      {
                        "name": "identifiers",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "sparklayer_package_id",
                            "kind": "required",
                            "type": "string<uuid>",
                            "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                            "format": "uuid"
                          },
                          {
                            "name": "platform",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>The identifier for the package on the e-commerce platform</p>",
                            "example": "123456789",
                            "minLength": 1
                          },
                          {
                            "name": "internal",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier for the package on your system",
                            "minLength": 1
                          },
                          {
                            "name": "visible",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier that will be shown to the customer in their recent orders"
                          }
                        ]
                      },
                      {
                        "name": "accounting_files",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseFiles",
                        "customType": "PurchaseFiles[]",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that is used by your system",
                                "example": "INV011",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that should be shown to the customer",
                                "default": "INV011"
                              }
                            ]
                          },
                          {
                            "name": "data",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "anyOf",
                            "complexItems": [
                              {
                                "name": "object",
                                "description": "",
                                "schema": [
                                  {
                                    "name": "uri",
                                    "kind": "optional",
                                    "type": "string<uri>",
                                    "nullable": true,
                                    "description": "",
                                    "format": "uri"
                                  },
                                  {
                                    "name": "type",
                                    "kind": "required",
                                    "type": "string<uri>",
                                    "description": "",
                                    "example": "uri",
                                    "default": "uri",
                                    "enum": [
                                      "uri"
                                    ]
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "file_type",
                            "kind": "required",
                            "type": "string<credit | invoice | payment>",
                            "description": "",
                            "example": "invoice",
                            "enum": [
                              "credit",
                              "invoice",
                              "payment"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "line_items",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom | product>",
                            "description": "",
                            "enum": [
                              "custom",
                              "product"
                            ]
                          },
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_item_key",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                "minLength": 1
                              },
                              {
                                "name": "sparklayer_variant_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                "example": "45552423353839",
                                "minLength": 1
                              },
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "CAT-MUG",
                                "maxLength": 128
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the product on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>A human-readable identifier for the product</p>"
                              }
                            ]
                          },
                          {
                            "name": "name_parent",
                            "kind": "required",
                            "type": "string",
                            "description": "Name of the product",
                            "example": "T-Shirt"
                          },
                          {
                            "name": "name_child",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>Name of the product variant/type</p>",
                            "example": "Red"
                          },
                          {
                            "name": "quantity",
                            "kind": "required",
                            "type": "number",
                            "description": "",
                            "example": 4
                          },
                          {
                            "name": "custom_attributes",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "key",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Key or name of the attribute.",
                                "example": "mug text"
                              },
                              {
                                "name": "value",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Value of the attribute.",
                                "example": "best company ever"
                              }
                            ]
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_method",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "<p>Details of how the package was/will be shipped</p>",
                        "example": "",
                        "schema": [
                          {
                            "name": "sku",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "SKU that identifies the shipping method used",
                            "example": "SHIP-ECO",
                            "minLength": 1
                          },
                          {
                            "name": "name",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The friendly/human-readable name for the shipping method</p>",
                            "example": "Standard Shipping"
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_address",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseAddress",
                        "customType": "PurchaseAddress",
                        "schema": [
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones"
                          },
                          {
                            "name": "company",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones Hardware Ltd"
                          },
                          {
                            "name": "address_line1",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "7 Philosophy way"
                          },
                          {
                            "name": "address_line2",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": ""
                          },
                          {
                            "name": "city",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Willerby"
                          },
                          {
                            "name": "region_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "",
                            "minLength": 1
                          },
                          {
                            "name": "postal_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "BJ6 9MK"
                          },
                          {
                            "name": "country_code",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "GB"
                          },
                          {
                            "name": "phone",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "0123456789"
                          },
                          {
                            "name": "sparklayer_id",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                          },
                          {
                            "name": "first_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom"
                          },
                          {
                            "name": "last_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Jones"
                          }
                        ]
                      },
                      {
                        "name": "shipments",
                        "kind": "required",
                        "type": "array",
                        "description": "Carrier and tracking details for the shipment",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "carrier",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Carrier Company Ltd"
                          },
                          {
                            "name": "carrier_id",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The tracking number/ID used by the carrier</p>"
                          },
                          {
                            "name": "tracking_url",
                            "kind": "optional",
                            "type": "string<uri>",
                            "nullable": true,
                            "description": "The URL the customer can use to track their shipment",
                            "format": "uri"
                          }
                        ]
                      },
                      {
                        "name": "type",
                        "kind": "required",
                        "type": "string<processing>",
                        "description": "",
                        "enum": [
                          "processing"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "Shipment",
                    "description": "",
                    "modelRef": "#/components/schemas/Shipment",
                    "schema": [
                      {
                        "name": "identifiers",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "sparklayer_package_id",
                            "kind": "required",
                            "type": "string<uuid>",
                            "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                            "format": "uuid"
                          },
                          {
                            "name": "platform",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>The identifier for the package on the e-commerce platform</p>",
                            "example": "123456789",
                            "minLength": 1
                          },
                          {
                            "name": "internal",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier for the package on your system",
                            "minLength": 1
                          },
                          {
                            "name": "visible",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier that will be shown to the customer in their recent orders"
                          }
                        ]
                      },
                      {
                        "name": "accounting_files",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseFiles",
                        "customType": "PurchaseFiles[]",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that is used by your system",
                                "example": "INV011",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that should be shown to the customer",
                                "default": "INV011"
                              }
                            ]
                          },
                          {
                            "name": "data",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "anyOf",
                            "complexItems": [
                              {
                                "name": "object",
                                "description": "",
                                "schema": [
                                  {
                                    "name": "uri",
                                    "kind": "optional",
                                    "type": "string<uri>",
                                    "nullable": true,
                                    "description": "",
                                    "format": "uri"
                                  },
                                  {
                                    "name": "type",
                                    "kind": "required",
                                    "type": "string<uri>",
                                    "description": "",
                                    "example": "uri",
                                    "default": "uri",
                                    "enum": [
                                      "uri"
                                    ]
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "file_type",
                            "kind": "required",
                            "type": "string<credit | invoice | payment>",
                            "description": "",
                            "example": "invoice",
                            "enum": [
                              "credit",
                              "invoice",
                              "payment"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "line_items",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom | product>",
                            "description": "",
                            "enum": [
                              "custom",
                              "product"
                            ]
                          },
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_item_key",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                "minLength": 1
                              },
                              {
                                "name": "sparklayer_variant_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                "example": "45552423353839",
                                "minLength": 1
                              },
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "CAT-MUG",
                                "maxLength": 128
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the product on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>A human-readable identifier for the product</p>"
                              }
                            ]
                          },
                          {
                            "name": "name_parent",
                            "kind": "required",
                            "type": "string",
                            "description": "Name of the product",
                            "example": "T-Shirt"
                          },
                          {
                            "name": "name_child",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>Name of the product variant/type</p>",
                            "example": "Red"
                          },
                          {
                            "name": "quantity",
                            "kind": "required",
                            "type": "number",
                            "description": "",
                            "example": 4
                          },
                          {
                            "name": "custom_attributes",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "key",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Key or name of the attribute.",
                                "example": "mug text"
                              },
                              {
                                "name": "value",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Value of the attribute.",
                                "example": "best company ever"
                              }
                            ]
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_method",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "<p>Details of how the package was/will be shipped</p>",
                        "example": "",
                        "schema": [
                          {
                            "name": "sku",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "SKU that identifies the shipping method used",
                            "example": "SHIP-ECO",
                            "minLength": 1
                          },
                          {
                            "name": "name",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The friendly/human-readable name for the shipping method</p>",
                            "example": "Standard Shipping"
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_address",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseAddress",
                        "customType": "PurchaseAddress",
                        "schema": [
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones"
                          },
                          {
                            "name": "company",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones Hardware Ltd"
                          },
                          {
                            "name": "address_line1",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "7 Philosophy way"
                          },
                          {
                            "name": "address_line2",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": ""
                          },
                          {
                            "name": "city",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Willerby"
                          },
                          {
                            "name": "region_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "",
                            "minLength": 1
                          },
                          {
                            "name": "postal_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "BJ6 9MK"
                          },
                          {
                            "name": "country_code",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "GB"
                          },
                          {
                            "name": "phone",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "0123456789"
                          },
                          {
                            "name": "sparklayer_id",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                          },
                          {
                            "name": "first_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom"
                          },
                          {
                            "name": "last_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Jones"
                          }
                        ]
                      },
                      {
                        "name": "shipments",
                        "kind": "required",
                        "type": "array",
                        "description": "Carrier and tracking details for the shipment",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "carrier",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Carrier Company Ltd"
                          },
                          {
                            "name": "carrier_id",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The tracking number/ID used by the carrier</p>"
                          },
                          {
                            "name": "tracking_url",
                            "kind": "optional",
                            "type": "string<uri>",
                            "nullable": true,
                            "description": "The URL the customer can use to track their shipment",
                            "format": "uri"
                          }
                        ]
                      },
                      {
                        "name": "type",
                        "kind": "required",
                        "type": "string<shipment>",
                        "description": "",
                        "enum": [
                          "shipment"
                        ]
                      },
                      {
                        "name": "dates",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "shipped_at",
                            "kind": "required",
                            "type": "string<date-time>",
                            "description": "<p>The date at which the package was shipped - include user timezone or Z for UTC (RFC-3339)</p>",
                            "example": "2020-01-01T00:00:00+02:00",
                            "format": "date-time"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "Cancelled",
                    "description": "",
                    "modelRef": "#/components/schemas/Cancelled",
                    "schema": [
                      {
                        "name": "identifiers",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "sparklayer_package_id",
                            "kind": "required",
                            "type": "string<uuid>",
                            "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                            "format": "uuid"
                          },
                          {
                            "name": "platform",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>The identifier for the package on the e-commerce platform</p>",
                            "example": "123456789",
                            "minLength": 1
                          },
                          {
                            "name": "internal",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier for the package on your system",
                            "minLength": 1
                          },
                          {
                            "name": "visible",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier that will be shown to the customer in their recent orders"
                          }
                        ]
                      },
                      {
                        "name": "accounting_files",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseFiles",
                        "customType": "PurchaseFiles[]",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that is used by your system",
                                "example": "INV011",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier of the purchase file that should be shown to the customer",
                                "default": "INV011"
                              }
                            ]
                          },
                          {
                            "name": "data",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "anyOf",
                            "complexItems": [
                              {
                                "name": "object",
                                "description": "",
                                "schema": [
                                  {
                                    "name": "uri",
                                    "kind": "optional",
                                    "type": "string<uri>",
                                    "nullable": true,
                                    "description": "",
                                    "format": "uri"
                                  },
                                  {
                                    "name": "type",
                                    "kind": "required",
                                    "type": "string<uri>",
                                    "description": "",
                                    "example": "uri",
                                    "default": "uri",
                                    "enum": [
                                      "uri"
                                    ]
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "file_type",
                            "kind": "required",
                            "type": "string<credit | invoice | payment>",
                            "description": "",
                            "example": "invoice",
                            "enum": [
                              "credit",
                              "invoice",
                              "payment"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "line_items",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom | product>",
                            "description": "",
                            "enum": [
                              "custom",
                              "product"
                            ]
                          },
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_item_key",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                "minLength": 1
                              },
                              {
                                "name": "sparklayer_variant_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                "example": "45552423353839",
                                "minLength": 1
                              },
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "CAT-MUG",
                                "maxLength": 128
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the product on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>A human-readable identifier for the product</p>"
                              }
                            ]
                          },
                          {
                            "name": "name_parent",
                            "kind": "required",
                            "type": "string",
                            "description": "Name of the product",
                            "example": "T-Shirt"
                          },
                          {
                            "name": "name_child",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>Name of the product variant/type</p>",
                            "example": "Red"
                          },
                          {
                            "name": "quantity",
                            "kind": "required",
                            "type": "number",
                            "description": "",
                            "example": 4
                          },
                          {
                            "name": "custom_attributes",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "key",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Key or name of the attribute.",
                                "example": "mug text"
                              },
                              {
                                "name": "value",
                                "kind": "required",
                                "type": "string",
                                "nullable": false,
                                "description": "Value of the attribute.",
                                "example": "best company ever"
                              }
                            ]
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_method",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "<p>Details of how the package was/will be shipped</p>",
                        "example": "",
                        "schema": [
                          {
                            "name": "sku",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "SKU that identifies the shipping method used",
                            "example": "SHIP-ECO",
                            "minLength": 1
                          },
                          {
                            "name": "name",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The friendly/human-readable name for the shipping method</p>",
                            "example": "Standard Shipping"
                          },
                          {
                            "name": "line_total",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "complexType": "allOf",
                            "complexItems": [
                              {
                                "name": "LineTotal",
                                "description": "",
                                "modelRef": "#/components/schemas/LineTotal",
                                "schema": [
                                  {
                                    "name": "total_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_tax_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "total_gross_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "discount_net_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "",
                                    "complexType": "allOf",
                                    "complexItems": [
                                      {
                                        "name": "MonetaryObject",
                                        "description": "",
                                        "modelRef": "#/components/schemas/MonetaryObject",
                                        "schema": [
                                          {
                                            "name": "number",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                            "example": "15.99",
                                            "minLength": 1
                                          },
                                          {
                                            "name": "currency",
                                            "kind": "required",
                                            "type": "string",
                                            "description": "The 3 letter currency code used for the prices in the purchase",
                                            "example": "GBP",
                                            "minLength": 3,
                                            "maxLength": 3
                                          }
                                        ]
                                      }
                                    ],
                                    "schema": []
                                  },
                                  {
                                    "name": "tax_rate",
                                    "kind": "optional",
                                    "type": "number<double>",
                                    "deprecated": true,
                                    "nullable": true,
                                    "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                    "example": 20,
                                    "default": 0,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ],
                            "schema": []
                          },
                          {
                            "name": "tax_lines",
                            "kind": "optional",
                            "type": "array",
                            "description": "Information about a tax line on a purchase",
                            "modelRef": "#/components/schemas/TaxLine",
                            "customType": "TaxLine[]",
                            "schema": [
                              {
                                "name": "title",
                                "kind": "required",
                                "type": "string",
                                "description": "The title of the tax line",
                                "example": "HST"
                              },
                              {
                                "name": "amount",
                                "kind": "required",
                                "type": "object",
                                "description": "The amount of tax of the tax line",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "amount_base",
                                "kind": "optional",
                                "type": "object",
                                "description": "The amount of tax of the tax line in the store's base currency",
                                "modelRef": "#/components/schemas/MonetaryObject",
                                "customType": "MonetaryObject",
                                "schema": [
                                  {
                                    "name": "number",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                    "example": "15.99",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "currency",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The 3 letter currency code used for the prices in the purchase",
                                    "example": "GBP",
                                    "minLength": 3,
                                    "maxLength": 3
                                  }
                                ]
                              },
                              {
                                "name": "rate",
                                "kind": "required",
                                "type": "number<double>",
                                "nullable": true,
                                "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                "example": 20,
                                "format": "double",
                                "minimum": 0
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "shipping_address",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "modelRef": "#/components/schemas/PurchaseAddress",
                        "customType": "PurchaseAddress",
                        "schema": [
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones"
                          },
                          {
                            "name": "company",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom Jones Hardware Ltd"
                          },
                          {
                            "name": "address_line1",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "7 Philosophy way"
                          },
                          {
                            "name": "address_line2",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": ""
                          },
                          {
                            "name": "city",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Willerby"
                          },
                          {
                            "name": "region_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "",
                            "minLength": 1
                          },
                          {
                            "name": "postal_code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "BJ6 9MK"
                          },
                          {
                            "name": "country_code",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "GB"
                          },
                          {
                            "name": "phone",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "0123456789"
                          },
                          {
                            "name": "sparklayer_id",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                          },
                          {
                            "name": "first_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Tom"
                          },
                          {
                            "name": "last_name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "Jones"
                          }
                        ]
                      },
                      {
                        "name": "shipments",
                        "kind": "required",
                        "type": "array",
                        "description": "Carrier and tracking details for the shipment",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "carrier",
                            "kind": "required",
                            "type": "string",
                            "description": "",
                            "example": "Carrier Company Ltd"
                          },
                          {
                            "name": "carrier_id",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The tracking number/ID used by the carrier</p>"
                          },
                          {
                            "name": "tracking_url",
                            "kind": "optional",
                            "type": "string<uri>",
                            "nullable": true,
                            "description": "The URL the customer can use to track their shipment",
                            "format": "uri"
                          }
                        ]
                      },
                      {
                        "name": "type",
                        "kind": "required",
                        "type": "string<cancelled>",
                        "description": "",
                        "enum": [
                          "cancelled"
                        ]
                      },
                      {
                        "name": "dates",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "cancelled_at",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "nullable": true,
                            "description": "<p>The date at which the package was cancelled - include user timezone or Z for UTC (RFC-3339)</p>",
                            "example": "2020-01-01T00:00:00+02:00",
                            "format": "date-time"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "Return",
                    "description": "",
                    "modelRef": "#/components/schemas/Return",
                    "schema": [
                      {
                        "name": "",
                        "description": "",
                        "customType": "Max depth limit reached"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "accounting_files",
                "kind": "required",
                "type": "array",
                "description": "Any accounting files associated with this package e.g. invoices",
                "modelRef": "#/components/schemas/PurchaseFiles",
                "customType": "PurchaseFiles[]",
                "schema": [
                  {
                    "name": "identifiers",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "internal",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The identifier of the purchase file that is used by your system",
                        "example": "INV011",
                        "minLength": 1
                      },
                      {
                        "name": "visible",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The identifier of the purchase file that should be shown to the customer",
                        "default": "INV011"
                      }
                    ]
                  },
                  {
                    "name": "data",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "complexType": "anyOf",
                    "complexItems": [
                      {
                        "name": "object",
                        "description": "",
                        "schema": [
                          {
                            "name": "uri",
                            "kind": "optional",
                            "type": "string<uri>",
                            "nullable": true,
                            "description": "",
                            "format": "uri"
                          },
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<uri>",
                            "description": "",
                            "example": "uri",
                            "default": "uri",
                            "enum": [
                              "uri"
                            ]
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "file_type",
                    "kind": "required",
                    "type": "string<credit | invoice | payment>",
                    "description": "",
                    "example": "invoice",
                    "enum": [
                      "credit",
                      "invoice",
                      "payment"
                    ]
                  }
                ]
              },
              {
                "name": "custom_fields",
                "kind": "required",
                "type": "array",
                "description": "Extra information for the purchase. This will be shown to the customer in their recent orders",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>Name/identifier for the custom field</p>",
                    "example": "delivery-date",
                    "minLength": 1
                  },
                  {
                    "name": "value",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "Data for the custom field",
                    "example": "2023-10-28"
                  }
                ]
              },
              {
                "name": "metadata",
                "kind": "optional",
                "type": "array",
                "description": "Extra information for the purchase. This not will be shown to the customer",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>Name/identifier for the metadata</p>",
                    "example": "example-key",
                    "minLength": 1
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "string",
                    "description": "Data for the metadata",
                    "example": "1234"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Purchase",
            "complexItems": [
              {
                "name": "object",
                "schema": [
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "example": "order",
                    "modelRef": "#/components/schemas/PurchaseType",
                    "customType": "PurchaseType",
                    "schema": []
                  },
                  {
                    "name": "purchase_identifiers",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "sparklayer",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "nullable": true,
                        "description": "The identifier SparkLayer uses for the purchase. You will need to generate this if the purchase does not exist",
                        "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                        "format": "uuid",
                        "minLength": 1
                      },
                      {
                        "name": "platform",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "<p>The identifier for the purchase on the e-commerce platform</p>",
                        "example": "123456789",
                        "minLength": 1
                      },
                      {
                        "name": "internal",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The identifier for the purchase on your system",
                        "minLength": 1
                      },
                      {
                        "name": "visible",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The identifier that will be shown to the customer in their recent orders",
                        "example": "B2B01123"
                      }
                    ]
                  },
                  {
                    "name": "customer_identifiers",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "sparklayer",
                        "kind": "required",
                        "type": "string",
                        "nullable": false,
                        "description": "The ID of the customer that that order is for.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                      },
                      {
                        "name": "sparklayer_impersonator",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of the sales agent placing the order.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                      },
                      {
                        "name": "sparklayer_impersonator_assignee",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of the sales agent assigned to be responsible for the order.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                      },
                      {
                        "name": "sparklayer_child",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of the company user that placed the order.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                      }
                    ]
                  },
                  {
                    "name": "company",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "<p>Company sections are opt-in; omit this entirely for merchants that do not use them.</p>",
                    "example": "",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "nullable": true,
                        "description": "The ID of the company the purchase was placed for.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                        "format": "uuid"
                      },
                      {
                        "name": "section_id",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "nullable": true,
                        "description": "The ID of the company section the purchase was placed for.",
                        "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1",
                        "format": "uuid"
                      },
                      {
                        "name": "section_name",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "<p>The section name at the time of purchase, kept so historical purchases stay readable after a section is renamed or deleted. Not filterable.</p>",
                        "example": "Bristol",
                        "maxLength": 128
                      }
                    ]
                  },
                  {
                    "name": "payment_method",
                    "kind": "optional",
                    "type": "string<quote | upfrontPayment | paymentOnAccount | paymentByInvoice>",
                    "nullable": true,
                    "description": "<p>How the purchase was/will be paid for</p>",
                    "enum": [
                      "quote",
                      "upfrontPayment",
                      "paymentOnAccount",
                      "paymentByInvoice"
                    ]
                  },
                  {
                    "name": "dates",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "created_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "readOnly": true,
                        "description": "<p>The date the purchase was created in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "updated_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "readOnly": true,
                        "description": "<p>The date the purchase was last updated in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "placed_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "nullable": true,
                        "description": "<p>The date at which the purchase was placed - include user timezone or Z for UTC (RFC-3339)</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "to_be_placed_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "nullable": true,
                        "description": "<p>The date at which the purchase is due to be placed, for a purchase that is scheduled rather than placed immediately (RFC-3339). It can be changed while the purchase is still pending</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "calculated_submitted_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "readOnly": true,
                        "description": "<p>The date the purchase was submitted (RFC-3339). This is when the cart is converted into another purchase type. This is read only - it should not be sent to the API, but will be returned form it</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "expires_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "readOnly": true,
                        "description": "<p>the date at which the purchase will expire and become archived (RFC-3339). This is read only - it should not be sent to the API, but will be returned form it</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "payment_due_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "description": "The date at which payment for the purchase is expected",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      }
                    ]
                  },
                  {
                    "name": "customer_reference",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "Additional information that a customer adds to the order",
                    "example": "Please deliver to the back of the store"
                  },
                  {
                    "name": "po_number",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "PO number for the purchase",
                    "example": "PO-001"
                  },
                  {
                    "name": "shipping_requested_date",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "The date requested for the delivery to arrive",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "recurring_purchase",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "Present only for a purchase created from a recurring purchase template. Both properties are stored when the purchase is created and ignored on any later update",
                    "example": "",
                    "schema": [
                      {
                        "name": "template_id",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "nullable": true,
                        "description": "The recurring purchase template this purchase was created from. Set on creation and ignored on update",
                        "example": "0f8fad5b-d9cb-469f-a165-70867728950e",
                        "format": "uuid"
                      },
                      {
                        "name": "cancelled_at",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "nullable": true,
                        "description": "<p>The date the customer cancelled the purchase, after which it will not be placed (RFC-3339). Cancelling does not free the date - the template has already had its turn for it</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      },
                      {
                        "name": "to_be_placed_at_initial",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "nullable": true,
                        "description": "<p>The date to_be_placed_at was first set to (RFC-3339). Set on creation and ignored on update, so that rescheduling cannot let the same template produce a second purchase for the same date</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      }
                    ]
                  },
                  {
                    "name": "currency_code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The 3 letter currency code used for the prices in the purchase",
                    "example": "GBP",
                    "minLength": 3,
                    "maxLength": 3
                  },
                  {
                    "name": "currency_code_base",
                    "kind": "optional",
                    "type": "string",
                    "writeOnly": true,
                    "nullable": true,
                    "description": "The 3 letter currency code of the store's base currency",
                    "example": "GBP",
                    "minLength": 3,
                    "maxLength": 3
                  },
                  {
                    "name": "calculated_shipping_address",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "nullable": true,
                    "description": "<p>A single string containing all the details of the shipping address. This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "John Spark, SparkLayer, SparkLayer HQ, Example City, 12345"
                  },
                  {
                    "name": "calculated_total",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "MonetaryObject",
                        "description": "",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "calculated_total_usd",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "MonetaryObject",
                        "description": "",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "calculated_total_base",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "MonetaryObject",
                        "description": "",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "calculated_fulfilment_status",
                    "kind": "optional",
                    "type": "string<incoming | processing | shipped | part_shipped | cancelled | returned | part_returned | varied>",
                    "readOnly": true,
                    "nullable": true,
                    "description": "<p>The status of the order, calculated from the statuses of the individual packages. This is read only - it should not be sent to the API, but will be returned form it</p>",
                    "example": "processing",
                    "enum": [
                      "incoming",
                      "processing",
                      "shipped",
                      "part_shipped",
                      "cancelled",
                      "returned",
                      "part_returned",
                      "varied"
                    ]
                  },
                  {
                    "name": "quote",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "Quote data",
                    "example": "",
                    "schema": [
                      {
                        "name": "status_slug",
                        "kind": "optional",
                        "type": "string",
                        "description": "The slug of the quote status applied to this quote"
                      },
                      {
                        "name": "status",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "complexType": "allOf",
                        "complexItems": [
                          {
                            "name": "QuoteStatus",
                            "description": "",
                            "modelRef": "#/components/schemas/QuoteStatus",
                            "schema": [
                              {
                                "name": "id",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "description": "",
                                "maxLength": 45
                              },
                              {
                                "name": "slug",
                                "kind": "optional",
                                "type": "string",
                                "description": "",
                                "maxLength": 45,
                                "pattern": "^[a-z0-9-]+$"
                              },
                              {
                                "name": "default",
                                "kind": "optional",
                                "type": "boolean",
                                "description": ""
                              },
                              {
                                "name": "next",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "maxLength": 45,
                                "pattern": "^[a-z0-9-]+$"
                              },
                              {
                                "name": "actions",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "example": "",
                                "itemType": "string",
                                "customType": "string[]",
                                "itemExample": "",
                                "itemDefault": ""
                              },
                              {
                                "name": "created_at",
                                "kind": "optional",
                                "type": "string<date-time>",
                                "description": "",
                                "format": "date-time"
                              },
                              {
                                "name": "updated_at",
                                "kind": "optional",
                                "type": "string<date-time>",
                                "description": "",
                                "format": "date-time"
                              },
                              {
                                "name": "deleted_at",
                                "kind": "optional",
                                "type": "string<date-time>",
                                "nullable": true,
                                "description": "",
                                "format": "date-time"
                              }
                            ]
                          }
                        ],
                        "schema": []
                      },
                      {
                        "name": "expiry",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "nullable": true,
                        "description": "<p>The date at which the quote is considered expired and no longer valid (RFC-3339)</p>",
                        "example": "2020-01-01T00:00:00+02:00",
                        "format": "date-time"
                      }
                    ]
                  },
                  {
                    "name": "payment_status",
                    "kind": "optional",
                    "type": "string<unpaid | part_paid | paid>",
                    "description": "That payment status of the order",
                    "enum": [
                      "unpaid",
                      "part_paid",
                      "paid"
                    ]
                  },
                  {
                    "name": "total_paid",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "MonetaryObject",
                        "description": "",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      }
                    ],
                    "schema": []
                  }
                ],
                "modelRef": "#/components/schemas/PurchaseBase",
                "customType": "PurchaseBase"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "revision_date",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "nullable": true,
                    "description": "<p>The date at which the purchase was last modified - include user timezone or Z for UTC (RFC-3339)</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "tax_lines",
                    "kind": "optional",
                    "type": "array",
                    "description": "Tax lines for the purchase.",
                    "modelRef": "#/components/schemas/TaxLine",
                    "customType": "TaxLine[]",
                    "schema": [
                      {
                        "name": "title",
                        "kind": "required",
                        "type": "string",
                        "description": "The title of the tax line",
                        "example": "HST"
                      },
                      {
                        "name": "amount",
                        "kind": "required",
                        "type": "object",
                        "description": "The amount of tax of the tax line",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "customType": "MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      },
                      {
                        "name": "amount_base",
                        "kind": "optional",
                        "type": "object",
                        "description": "The amount of tax of the tax line in the store's base currency",
                        "modelRef": "#/components/schemas/MonetaryObject",
                        "customType": "MonetaryObject",
                        "schema": [
                          {
                            "name": "number",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The amount of currency in this currency, represented as a string</p>",
                            "example": "15.99",
                            "minLength": 1
                          },
                          {
                            "name": "currency",
                            "kind": "required",
                            "type": "string",
                            "description": "The 3 letter currency code used for the prices in the purchase",
                            "example": "GBP",
                            "minLength": 3,
                            "maxLength": 3
                          }
                        ]
                      },
                      {
                        "name": "rate",
                        "kind": "required",
                        "type": "number<double>",
                        "nullable": true,
                        "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                        "example": 20,
                        "format": "double",
                        "minimum": 0
                      }
                    ]
                  },
                  {
                    "name": "billing_address",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "modelRef": "#/components/schemas/PurchaseAddress",
                    "customType": "PurchaseAddress",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "Tom Jones"
                      },
                      {
                        "name": "company",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "Tom Jones Hardware Ltd"
                      },
                      {
                        "name": "address_line1",
                        "kind": "required",
                        "type": "string",
                        "description": "",
                        "example": "7 Philosophy way"
                      },
                      {
                        "name": "address_line2",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": ""
                      },
                      {
                        "name": "city",
                        "kind": "required",
                        "type": "string",
                        "description": "",
                        "example": "Willerby"
                      },
                      {
                        "name": "region_code",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "",
                        "minLength": 1
                      },
                      {
                        "name": "postal_code",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "BJ6 9MK"
                      },
                      {
                        "name": "country_code",
                        "kind": "required",
                        "type": "string",
                        "description": "",
                        "example": "GB"
                      },
                      {
                        "name": "phone",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "0123456789"
                      },
                      {
                        "name": "sparklayer_id",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                      },
                      {
                        "name": "first_name",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "Tom"
                      },
                      {
                        "name": "last_name",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "",
                        "example": "Jones"
                      }
                    ]
                  },
                  {
                    "name": "packages",
                    "kind": "required",
                    "type": "object",
                    "description": "Packages contained within this purchase",
                    "modelRef": "#/components/schemas/Package",
                    "customType": "Package[]",
                    "schema": [],
                    "complexType": "oneOf",
                    "complexItems": [
                      {
                        "name": "Incoming",
                        "description": "",
                        "modelRef": "#/components/schemas/Incoming",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_package_id",
                                "kind": "required",
                                "type": "string<uuid>",
                                "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                                "format": "uuid"
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the package on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the package on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier that will be shown to the customer in their recent orders"
                              }
                            ]
                          },
                          {
                            "name": "accounting_files",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseFiles",
                            "customType": "PurchaseFiles[]",
                            "schema": [
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that is used by your system",
                                    "example": "INV011",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that should be shown to the customer",
                                    "default": "INV011"
                                  }
                                ]
                              },
                              {
                                "name": "data",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "anyOf",
                                "complexItems": [
                                  {
                                    "name": "object",
                                    "description": "",
                                    "schema": [
                                      {
                                        "name": "uri",
                                        "kind": "optional",
                                        "type": "string<uri>",
                                        "nullable": true,
                                        "description": "",
                                        "format": "uri"
                                      },
                                      {
                                        "name": "type",
                                        "kind": "required",
                                        "type": "string<uri>",
                                        "description": "",
                                        "example": "uri",
                                        "default": "uri",
                                        "enum": [
                                          "uri"
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "file_type",
                                "kind": "required",
                                "type": "string<credit | invoice | payment>",
                                "description": "",
                                "example": "invoice",
                                "enum": [
                                  "credit",
                                  "invoice",
                                  "payment"
                                ]
                              }
                            ]
                          },
                          {
                            "name": "line_items",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string<custom | product>",
                                "description": "",
                                "enum": [
                                  "custom",
                                  "product"
                                ]
                              },
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "sparklayer_item_key",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sparklayer_variant_id",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                    "example": "45552423353839",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sku",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "",
                                    "example": "CAT-MUG",
                                    "maxLength": 128
                                  },
                                  {
                                    "name": "platform",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                    "example": "123456789",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier for the product on your system",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>A human-readable identifier for the product</p>"
                                  }
                                ]
                              },
                              {
                                "name": "name_parent",
                                "kind": "required",
                                "type": "string",
                                "description": "Name of the product",
                                "example": "T-Shirt"
                              },
                              {
                                "name": "name_child",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Name of the product variant/type</p>",
                                "example": "Red"
                              },
                              {
                                "name": "quantity",
                                "kind": "required",
                                "type": "number",
                                "description": "",
                                "example": 4
                              },
                              {
                                "name": "custom_attributes",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "example": "",
                                "itemType": "object",
                                "customType": "object[]",
                                "schema": [
                                  {
                                    "name": "key",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Key or name of the attribute.",
                                    "example": "mug text"
                                  },
                                  {
                                    "name": "value",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Value of the attribute.",
                                    "example": "best company ever"
                                  }
                                ]
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "nullable": true,
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_method",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "<p>Details of how the package was/will be shipped</p>",
                            "example": "",
                            "schema": [
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "SKU that identifies the shipping method used",
                                "example": "SHIP-ECO",
                                "minLength": 1
                              },
                              {
                                "name": "name",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The friendly/human-readable name for the shipping method</p>",
                                "example": "Standard Shipping"
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_address",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseAddress",
                            "customType": "PurchaseAddress",
                            "schema": [
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones"
                              },
                              {
                                "name": "company",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones Hardware Ltd"
                              },
                              {
                                "name": "address_line1",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "7 Philosophy way"
                              },
                              {
                                "name": "address_line2",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": ""
                              },
                              {
                                "name": "city",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Willerby"
                              },
                              {
                                "name": "region_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "",
                                "minLength": 1
                              },
                              {
                                "name": "postal_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "BJ6 9MK"
                              },
                              {
                                "name": "country_code",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "GB"
                              },
                              {
                                "name": "phone",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "0123456789"
                              },
                              {
                                "name": "sparklayer_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                              },
                              {
                                "name": "first_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom"
                              },
                              {
                                "name": "last_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Jones"
                              }
                            ]
                          },
                          {
                            "name": "shipments",
                            "kind": "required",
                            "type": "array",
                            "description": "Carrier and tracking details for the shipment",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "carrier",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Carrier Company Ltd"
                              },
                              {
                                "name": "carrier_id",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The tracking number/ID used by the carrier</p>"
                              },
                              {
                                "name": "tracking_url",
                                "kind": "optional",
                                "type": "string<uri>",
                                "nullable": true,
                                "description": "The URL the customer can use to track their shipment",
                                "format": "uri"
                              }
                            ]
                          },
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<incoming>",
                            "description": "",
                            "enum": [
                              "incoming"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "Processing",
                        "description": "",
                        "modelRef": "#/components/schemas/Processing",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_package_id",
                                "kind": "required",
                                "type": "string<uuid>",
                                "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                                "format": "uuid"
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the package on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the package on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier that will be shown to the customer in their recent orders"
                              }
                            ]
                          },
                          {
                            "name": "accounting_files",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseFiles",
                            "customType": "PurchaseFiles[]",
                            "schema": [
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that is used by your system",
                                    "example": "INV011",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that should be shown to the customer",
                                    "default": "INV011"
                                  }
                                ]
                              },
                              {
                                "name": "data",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "anyOf",
                                "complexItems": [
                                  {
                                    "name": "object",
                                    "description": "",
                                    "schema": [
                                      {
                                        "name": "uri",
                                        "kind": "optional",
                                        "type": "string<uri>",
                                        "nullable": true,
                                        "description": "",
                                        "format": "uri"
                                      },
                                      {
                                        "name": "type",
                                        "kind": "required",
                                        "type": "string<uri>",
                                        "description": "",
                                        "example": "uri",
                                        "default": "uri",
                                        "enum": [
                                          "uri"
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "file_type",
                                "kind": "required",
                                "type": "string<credit | invoice | payment>",
                                "description": "",
                                "example": "invoice",
                                "enum": [
                                  "credit",
                                  "invoice",
                                  "payment"
                                ]
                              }
                            ]
                          },
                          {
                            "name": "line_items",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string<custom | product>",
                                "description": "",
                                "enum": [
                                  "custom",
                                  "product"
                                ]
                              },
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "sparklayer_item_key",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sparklayer_variant_id",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                    "example": "45552423353839",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sku",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "",
                                    "example": "CAT-MUG",
                                    "maxLength": 128
                                  },
                                  {
                                    "name": "platform",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                    "example": "123456789",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier for the product on your system",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>A human-readable identifier for the product</p>"
                                  }
                                ]
                              },
                              {
                                "name": "name_parent",
                                "kind": "required",
                                "type": "string",
                                "description": "Name of the product",
                                "example": "T-Shirt"
                              },
                              {
                                "name": "name_child",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Name of the product variant/type</p>",
                                "example": "Red"
                              },
                              {
                                "name": "quantity",
                                "kind": "required",
                                "type": "number",
                                "description": "",
                                "example": 4
                              },
                              {
                                "name": "custom_attributes",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "example": "",
                                "itemType": "object",
                                "customType": "object[]",
                                "schema": [
                                  {
                                    "name": "key",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Key or name of the attribute.",
                                    "example": "mug text"
                                  },
                                  {
                                    "name": "value",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Value of the attribute.",
                                    "example": "best company ever"
                                  }
                                ]
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "nullable": true,
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_method",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "<p>Details of how the package was/will be shipped</p>",
                            "example": "",
                            "schema": [
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "SKU that identifies the shipping method used",
                                "example": "SHIP-ECO",
                                "minLength": 1
                              },
                              {
                                "name": "name",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The friendly/human-readable name for the shipping method</p>",
                                "example": "Standard Shipping"
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_address",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseAddress",
                            "customType": "PurchaseAddress",
                            "schema": [
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones"
                              },
                              {
                                "name": "company",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones Hardware Ltd"
                              },
                              {
                                "name": "address_line1",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "7 Philosophy way"
                              },
                              {
                                "name": "address_line2",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": ""
                              },
                              {
                                "name": "city",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Willerby"
                              },
                              {
                                "name": "region_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "",
                                "minLength": 1
                              },
                              {
                                "name": "postal_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "BJ6 9MK"
                              },
                              {
                                "name": "country_code",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "GB"
                              },
                              {
                                "name": "phone",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "0123456789"
                              },
                              {
                                "name": "sparklayer_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                              },
                              {
                                "name": "first_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom"
                              },
                              {
                                "name": "last_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Jones"
                              }
                            ]
                          },
                          {
                            "name": "shipments",
                            "kind": "required",
                            "type": "array",
                            "description": "Carrier and tracking details for the shipment",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "carrier",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Carrier Company Ltd"
                              },
                              {
                                "name": "carrier_id",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The tracking number/ID used by the carrier</p>"
                              },
                              {
                                "name": "tracking_url",
                                "kind": "optional",
                                "type": "string<uri>",
                                "nullable": true,
                                "description": "The URL the customer can use to track their shipment",
                                "format": "uri"
                              }
                            ]
                          },
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<processing>",
                            "description": "",
                            "enum": [
                              "processing"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "Shipment",
                        "description": "",
                        "modelRef": "#/components/schemas/Shipment",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_package_id",
                                "kind": "required",
                                "type": "string<uuid>",
                                "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                                "format": "uuid"
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the package on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the package on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier that will be shown to the customer in their recent orders"
                              }
                            ]
                          },
                          {
                            "name": "accounting_files",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseFiles",
                            "customType": "PurchaseFiles[]",
                            "schema": [
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that is used by your system",
                                    "example": "INV011",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that should be shown to the customer",
                                    "default": "INV011"
                                  }
                                ]
                              },
                              {
                                "name": "data",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "anyOf",
                                "complexItems": [
                                  {
                                    "name": "object",
                                    "description": "",
                                    "schema": [
                                      {
                                        "name": "uri",
                                        "kind": "optional",
                                        "type": "string<uri>",
                                        "nullable": true,
                                        "description": "",
                                        "format": "uri"
                                      },
                                      {
                                        "name": "type",
                                        "kind": "required",
                                        "type": "string<uri>",
                                        "description": "",
                                        "example": "uri",
                                        "default": "uri",
                                        "enum": [
                                          "uri"
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "file_type",
                                "kind": "required",
                                "type": "string<credit | invoice | payment>",
                                "description": "",
                                "example": "invoice",
                                "enum": [
                                  "credit",
                                  "invoice",
                                  "payment"
                                ]
                              }
                            ]
                          },
                          {
                            "name": "line_items",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string<custom | product>",
                                "description": "",
                                "enum": [
                                  "custom",
                                  "product"
                                ]
                              },
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "sparklayer_item_key",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sparklayer_variant_id",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                    "example": "45552423353839",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sku",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "",
                                    "example": "CAT-MUG",
                                    "maxLength": 128
                                  },
                                  {
                                    "name": "platform",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                    "example": "123456789",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier for the product on your system",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>A human-readable identifier for the product</p>"
                                  }
                                ]
                              },
                              {
                                "name": "name_parent",
                                "kind": "required",
                                "type": "string",
                                "description": "Name of the product",
                                "example": "T-Shirt"
                              },
                              {
                                "name": "name_child",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Name of the product variant/type</p>",
                                "example": "Red"
                              },
                              {
                                "name": "quantity",
                                "kind": "required",
                                "type": "number",
                                "description": "",
                                "example": 4
                              },
                              {
                                "name": "custom_attributes",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "example": "",
                                "itemType": "object",
                                "customType": "object[]",
                                "schema": [
                                  {
                                    "name": "key",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Key or name of the attribute.",
                                    "example": "mug text"
                                  },
                                  {
                                    "name": "value",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Value of the attribute.",
                                    "example": "best company ever"
                                  }
                                ]
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "nullable": true,
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_method",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "<p>Details of how the package was/will be shipped</p>",
                            "example": "",
                            "schema": [
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "SKU that identifies the shipping method used",
                                "example": "SHIP-ECO",
                                "minLength": 1
                              },
                              {
                                "name": "name",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The friendly/human-readable name for the shipping method</p>",
                                "example": "Standard Shipping"
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_address",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseAddress",
                            "customType": "PurchaseAddress",
                            "schema": [
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones"
                              },
                              {
                                "name": "company",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones Hardware Ltd"
                              },
                              {
                                "name": "address_line1",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "7 Philosophy way"
                              },
                              {
                                "name": "address_line2",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": ""
                              },
                              {
                                "name": "city",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Willerby"
                              },
                              {
                                "name": "region_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "",
                                "minLength": 1
                              },
                              {
                                "name": "postal_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "BJ6 9MK"
                              },
                              {
                                "name": "country_code",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "GB"
                              },
                              {
                                "name": "phone",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "0123456789"
                              },
                              {
                                "name": "sparklayer_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                              },
                              {
                                "name": "first_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom"
                              },
                              {
                                "name": "last_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Jones"
                              }
                            ]
                          },
                          {
                            "name": "shipments",
                            "kind": "required",
                            "type": "array",
                            "description": "Carrier and tracking details for the shipment",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "carrier",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Carrier Company Ltd"
                              },
                              {
                                "name": "carrier_id",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The tracking number/ID used by the carrier</p>"
                              },
                              {
                                "name": "tracking_url",
                                "kind": "optional",
                                "type": "string<uri>",
                                "nullable": true,
                                "description": "The URL the customer can use to track their shipment",
                                "format": "uri"
                              }
                            ]
                          },
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<shipment>",
                            "description": "",
                            "enum": [
                              "shipment"
                            ]
                          },
                          {
                            "name": "dates",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "shipped_at",
                                "kind": "required",
                                "type": "string<date-time>",
                                "description": "<p>The date at which the package was shipped - include user timezone or Z for UTC (RFC-3339)</p>",
                                "example": "2020-01-01T00:00:00+02:00",
                                "format": "date-time"
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "Cancelled",
                        "description": "",
                        "modelRef": "#/components/schemas/Cancelled",
                        "schema": [
                          {
                            "name": "identifiers",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "sparklayer_package_id",
                                "kind": "required",
                                "type": "string<uuid>",
                                "description": "A UUID for the package that must be unique within the purchase. You must generate this yourself",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                                "format": "uuid"
                              },
                              {
                                "name": "platform",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>The identifier for the package on the e-commerce platform</p>",
                                "example": "123456789",
                                "minLength": 1
                              },
                              {
                                "name": "internal",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier for the package on your system",
                                "minLength": 1
                              },
                              {
                                "name": "visible",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "The identifier that will be shown to the customer in their recent orders"
                              }
                            ]
                          },
                          {
                            "name": "accounting_files",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseFiles",
                            "customType": "PurchaseFiles[]",
                            "schema": [
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that is used by your system",
                                    "example": "INV011",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier of the purchase file that should be shown to the customer",
                                    "default": "INV011"
                                  }
                                ]
                              },
                              {
                                "name": "data",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "anyOf",
                                "complexItems": [
                                  {
                                    "name": "object",
                                    "description": "",
                                    "schema": [
                                      {
                                        "name": "uri",
                                        "kind": "optional",
                                        "type": "string<uri>",
                                        "nullable": true,
                                        "description": "",
                                        "format": "uri"
                                      },
                                      {
                                        "name": "type",
                                        "kind": "required",
                                        "type": "string<uri>",
                                        "description": "",
                                        "example": "uri",
                                        "default": "uri",
                                        "enum": [
                                          "uri"
                                        ]
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "file_type",
                                "kind": "required",
                                "type": "string<credit | invoice | payment>",
                                "description": "",
                                "example": "invoice",
                                "enum": [
                                  "credit",
                                  "invoice",
                                  "payment"
                                ]
                              }
                            ]
                          },
                          {
                            "name": "line_items",
                            "kind": "required",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string<custom | product>",
                                "description": "",
                                "enum": [
                                  "custom",
                                  "product"
                                ]
                              },
                              {
                                "name": "identifiers",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "example": "",
                                "schema": [
                                  {
                                    "name": "sparklayer_item_key",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>Internally used for tracking line items. For orders, can be set to null</p>",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sparklayer_variant_id",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The ID of the variant on your e-commerce platform</p>",
                                    "example": "45552423353839",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "sku",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "",
                                    "example": "CAT-MUG",
                                    "maxLength": 128
                                  },
                                  {
                                    "name": "platform",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>The identifier for the product on the e-commerce platform</p>",
                                    "example": "123456789",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "internal",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The identifier for the product on your system",
                                    "minLength": 1
                                  },
                                  {
                                    "name": "visible",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": "<p>A human-readable identifier for the product</p>"
                                  }
                                ]
                              },
                              {
                                "name": "name_parent",
                                "kind": "required",
                                "type": "string",
                                "description": "Name of the product",
                                "example": "T-Shirt"
                              },
                              {
                                "name": "name_child",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "<p>Name of the product variant/type</p>",
                                "example": "Red"
                              },
                              {
                                "name": "quantity",
                                "kind": "required",
                                "type": "number",
                                "description": "",
                                "example": 4
                              },
                              {
                                "name": "custom_attributes",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "example": "",
                                "itemType": "object",
                                "customType": "object[]",
                                "schema": [
                                  {
                                    "name": "key",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Key or name of the attribute.",
                                    "example": "mug text"
                                  },
                                  {
                                    "name": "value",
                                    "kind": "required",
                                    "type": "string",
                                    "nullable": false,
                                    "description": "Value of the attribute.",
                                    "example": "best company ever"
                                  }
                                ]
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "nullable": true,
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_method",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "<p>Details of how the package was/will be shipped</p>",
                            "example": "",
                            "schema": [
                              {
                                "name": "sku",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "SKU that identifies the shipping method used",
                                "example": "SHIP-ECO",
                                "minLength": 1
                              },
                              {
                                "name": "name",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The friendly/human-readable name for the shipping method</p>",
                                "example": "Standard Shipping"
                              },
                              {
                                "name": "line_total",
                                "kind": "required",
                                "type": "object",
                                "description": "",
                                "complexType": "allOf",
                                "complexItems": [
                                  {
                                    "name": "LineTotal",
                                    "description": "",
                                    "modelRef": "#/components/schemas/LineTotal",
                                    "schema": [
                                      {
                                        "name": "total_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_tax_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "total_gross_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net",
                                        "kind": "required",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "discount_net_base",
                                        "kind": "optional",
                                        "type": "object",
                                        "description": "",
                                        "complexType": "allOf",
                                        "complexItems": [
                                          {
                                            "name": "MonetaryObject",
                                            "description": "",
                                            "modelRef": "#/components/schemas/MonetaryObject",
                                            "schema": [
                                              {
                                                "name": "number",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                                "example": "15.99",
                                                "minLength": 1
                                              },
                                              {
                                                "name": "currency",
                                                "kind": "required",
                                                "type": "string",
                                                "description": "The 3 letter currency code used for the prices in the purchase",
                                                "example": "GBP",
                                                "minLength": 3,
                                                "maxLength": 3
                                              }
                                            ]
                                          }
                                        ],
                                        "schema": []
                                      },
                                      {
                                        "name": "tax_rate",
                                        "kind": "optional",
                                        "type": "number<double>",
                                        "deprecated": true,
                                        "nullable": true,
                                        "description": "Warning: Deprecated\n<p>The tax rate to apply to the net total. The value represents a percentage e.g. 20 means 20%</p>",
                                        "example": 20,
                                        "default": 0,
                                        "format": "double",
                                        "minimum": 0
                                      }
                                    ]
                                  }
                                ],
                                "schema": []
                              },
                              {
                                "name": "tax_lines",
                                "kind": "optional",
                                "type": "array",
                                "description": "Information about a tax line on a purchase",
                                "modelRef": "#/components/schemas/TaxLine",
                                "customType": "TaxLine[]",
                                "schema": [
                                  {
                                    "name": "title",
                                    "kind": "required",
                                    "type": "string",
                                    "description": "The title of the tax line",
                                    "example": "HST"
                                  },
                                  {
                                    "name": "amount",
                                    "kind": "required",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "amount_base",
                                    "kind": "optional",
                                    "type": "object",
                                    "description": "The amount of tax of the tax line in the store's base currency",
                                    "modelRef": "#/components/schemas/MonetaryObject",
                                    "customType": "MonetaryObject",
                                    "schema": [
                                      {
                                        "name": "number",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "<p>The amount of currency in this currency, represented as a string</p>",
                                        "example": "15.99",
                                        "minLength": 1
                                      },
                                      {
                                        "name": "currency",
                                        "kind": "required",
                                        "type": "string",
                                        "description": "The 3 letter currency code used for the prices in the purchase",
                                        "example": "GBP",
                                        "minLength": 3,
                                        "maxLength": 3
                                      }
                                    ]
                                  },
                                  {
                                    "name": "rate",
                                    "kind": "required",
                                    "type": "number<double>",
                                    "nullable": true,
                                    "description": "<p>The rate of the tax. The value represents a percentage e.g. 20 means 20%.</p>",
                                    "example": 20,
                                    "format": "double",
                                    "minimum": 0
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "shipping_address",
                            "kind": "optional",
                            "type": "object",
                            "nullable": true,
                            "description": "",
                            "modelRef": "#/components/schemas/PurchaseAddress",
                            "customType": "PurchaseAddress",
                            "schema": [
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones"
                              },
                              {
                                "name": "company",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom Jones Hardware Ltd"
                              },
                              {
                                "name": "address_line1",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "7 Philosophy way"
                              },
                              {
                                "name": "address_line2",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": ""
                              },
                              {
                                "name": "city",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Willerby"
                              },
                              {
                                "name": "region_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "",
                                "minLength": 1
                              },
                              {
                                "name": "postal_code",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "BJ6 9MK"
                              },
                              {
                                "name": "country_code",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "GB"
                              },
                              {
                                "name": "phone",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "0123456789"
                              },
                              {
                                "name": "sparklayer_id",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "63428136-658f-48a6-beb7-7f333dfd9686"
                              },
                              {
                                "name": "first_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Tom"
                              },
                              {
                                "name": "last_name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": "",
                                "example": "Jones"
                              }
                            ]
                          },
                          {
                            "name": "shipments",
                            "kind": "required",
                            "type": "array",
                            "description": "Carrier and tracking details for the shipment",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "carrier",
                                "kind": "required",
                                "type": "string",
                                "description": "",
                                "example": "Carrier Company Ltd"
                              },
                              {
                                "name": "carrier_id",
                                "kind": "required",
                                "type": "string",
                                "description": "<p>The tracking number/ID used by the carrier</p>"
                              },
                              {
                                "name": "tracking_url",
                                "kind": "optional",
                                "type": "string<uri>",
                                "nullable": true,
                                "description": "The URL the customer can use to track their shipment",
                                "format": "uri"
                              }
                            ]
                          },
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<cancelled>",
                            "description": "",
                            "enum": [
                              "cancelled"
                            ]
                          },
                          {
                            "name": "dates",
                            "kind": "required",
                            "type": "object",
                            "description": "",
                            "example": "",
                            "schema": [
                              {
                                "name": "cancelled_at",
                                "kind": "optional",
                                "type": "string<date-time>",
                                "nullable": true,
                                "description": "<p>The date at which the package was cancelled - include user timezone or Z for UTC (RFC-3339)</p>",
                                "example": "2020-01-01T00:00:00+02:00",
                                "format": "date-time"
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "Return",
                        "description": "",
                        "modelRef": "#/components/schemas/Return",
                        "schema": [
                          {
                            "name": "",
                            "description": "",
                            "customType": "Max depth limit reached"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "accounting_files",
                    "kind": "required",
                    "type": "array",
                    "description": "Any accounting files associated with this package e.g. invoices",
                    "modelRef": "#/components/schemas/PurchaseFiles",
                    "customType": "PurchaseFiles[]",
                    "schema": [
                      {
                        "name": "identifiers",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "internal",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier of the purchase file that is used by your system",
                            "example": "INV011",
                            "minLength": 1
                          },
                          {
                            "name": "visible",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The identifier of the purchase file that should be shown to the customer",
                            "default": "INV011"
                          }
                        ]
                      },
                      {
                        "name": "data",
                        "kind": "required",
                        "type": "object",
                        "description": "",
                        "complexType": "anyOf",
                        "complexItems": [
                          {
                            "name": "object",
                            "description": "",
                            "schema": [
                              {
                                "name": "uri",
                                "kind": "optional",
                                "type": "string<uri>",
                                "nullable": true,
                                "description": "",
                                "format": "uri"
                              },
                              {
                                "name": "type",
                                "kind": "required",
                                "type": "string<uri>",
                                "description": "",
                                "example": "uri",
                                "default": "uri",
                                "enum": [
                                  "uri"
                                ]
                              }
                            ]
                          }
                        ],
                        "schema": []
                      },
                      {
                        "name": "file_type",
                        "kind": "required",
                        "type": "string<credit | invoice | payment>",
                        "description": "",
                        "example": "invoice",
                        "enum": [
                          "credit",
                          "invoice",
                          "payment"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "custom_fields",
                    "kind": "required",
                    "type": "array",
                    "description": "Extra information for the purchase. This will be shown to the customer in their recent orders",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>Name/identifier for the custom field</p>",
                        "example": "delivery-date",
                        "minLength": 1
                      },
                      {
                        "name": "value",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Data for the custom field",
                        "example": "2023-10-28"
                      }
                    ]
                  },
                  {
                    "name": "metadata",
                    "kind": "optional",
                    "type": "array",
                    "description": "Extra information for the purchase. This not will be shown to the customer",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>Name/identifier for the metadata</p>",
                        "example": "example-key",
                        "minLength": 1
                      },
                      {
                        "name": "value",
                        "kind": "required",
                        "type": "string",
                        "description": "Data for the metadata",
                        "example": "1234"
                      }
                    ]
                  }
                ]
              }
            ],
            "complexType": "allOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Stats
[path] Untitled/Purchasing API Docs/


[title] Create a purchase history entry
[path] Untitled/Purchasing API Docs/Purchasing/

{
  "id": "hxmJUWF58_B9duFFW0SV3",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/v1/purchases/{lookupBy}/{identifier}/history",
    "servers": [],
    "name": "Create a purchase history entry",
    "description": "create a new purchase history event",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "lookupBy",
          "type": "string",
          "example": "platform",
          "description": "<p>Lookup by an identifier set within the purchase_identifiers object</p>",
          "enum": [
            "sparklayer",
            "platform",
            "internal",
            "visible"
          ]
        },
        {
          "kind": "required",
          "name": "identifier",
          "type": "string",
          "example": "123456789",
          "description": "Lookup by an identifier",
          "minLength": 1
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "discriminator": {
            "propertyName": "event_type",
            "mapping": {
              "message": "#/components/schemas/MessageEventBase",
              "note": "#/components/schemas/MessageEventBase",
              "email": "#/components/schemas/EmailEventBase"
            }
          },
          "schema": [],
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "event_type",
                  "kind": "required",
                  "type": "string<message | note>",
                  "description": "",
                  "enum": [
                    "message",
                    "note"
                  ]
                },
                {
                  "name": "created_by",
                  "kind": "required",
                  "type": "string",
                  "nullable": true,
                  "description": "<p>The ID of the actor (customer, sales agent..) that created the message.</p>",
                  "example": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
                },
                {
                  "name": "body",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "maxLength": 2047
                }
              ],
              "modelRef": "#/components/schemas/MessageEventBase",
              "customType": "MessageEventBase"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "event_type",
                  "kind": "required",
                  "type": "string<email>",
                  "description": "",
                  "enum": [
                    "email"
                  ]
                },
                {
                  "name": "sent_by",
                  "kind": "required",
                  "type": "string",
                  "nullable": true,
                  "description": "An identity for the sender of the email creating the notification",
                  "example": "Joe Bloggs <joe.bloggs@example.com>"
                },
                {
                  "name": "body",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "maxLength": 2047
                }
              ],
              "modelRef": "#/components/schemas/EmailEventBase",
              "customType": "EmailEventBase"
            }
          ],
          "complexType": "oneOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "PurchaseHistory",
            "schema": [],
            "modelRef": "#/components/schemas/PurchaseHistory",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get Purchase Transactions
[path] Untitled/Purchasing API Docs/Purchasing/

{
  "id": "PzCBrdjG2xgJS7djKCmV2",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/purchases/{lookupBy}/{identifier}/transactions",
    "servers": [],
    "name": "Get Purchase Transactions",
    "description": "Retrieve transactions for a given purchase",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID",
          "minLength": 1
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "Transaction[]",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "nullable": true,
                "description": "The identifier SparkLayer uses for the transaction.",
                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                "format": "uuid",
                "minLength": 1
              },
              {
                "name": "purchase_spark_id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "nullable": true,
                "description": "The identifier SparkLayer uses for the purchase.",
                "example": "63428136-658f-48a6-beb7-7f333dfd9686",
                "format": "uuid",
                "minLength": 1
              },
              {
                "name": "platform_id",
                "kind": "optional",
                "type": "string",
                "description": "<p>The identifier for this transaction on the e-commerce platform</p>",
                "example": "123456789",
                "minLength": 1
              },
              {
                "name": "full_transaction",
                "kind": "optional",
                "type": "string",
                "description": "A JSON string representing the full details of the transaction"
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string",
                "description": "<p>The type of the transaction e.g. charge, refund</p>"
              },
              {
                "name": "apply_to_balance",
                "kind": "optional",
                "type": "boolean",
                "description": "Set to true to signal that the value of this transaction should contribute to customer balances"
              },
              {
                "name": "currency_code",
                "kind": "optional",
                "type": "string",
                "description": "The 3 letter currency code used in this transaction",
                "example": "GBP",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "total",
                "kind": "optional",
                "type": "string",
                "description": "The amount of this transaction",
                "example": "20.99"
              },
              {
                "name": "transaction_date",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "The date the transaction was created",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "<p>The date the transaction was created in SparkLayer (RFC-3339). This is read only - it should not be sent to the API, but will be returned from it</p>",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              }
            ],
            "modelRef": "#/components/schemas/Transaction",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Delete Purchase
[path] Untitled/Purchasing API Docs/Purchasing/

{
  "id": "JTxggqxTflT7nX-1_g_ND",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "/api/v1/purchases/{lookupBy}/{identifier}",
    "servers": [],
    "name": "Delete Purchase",
    "description": "Delete a purchase",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "lookupBy",
          "type": "string",
          "example": "platform",
          "description": "<p>Lookup by an identifier set within the purchase_identifiers object</p>",
          "enum": [
            "sparklayer",
            "platform",
            "internal",
            "visible"
          ]
        },
        {
          "kind": "required",
          "name": "identifier",
          "type": "object",
          "description": "<p>Lookup by an identifier. Note: lookupBy=sparklayer requires UUID</p>",
          "schema": [],
          "complexItems": [
            {
              "name": "object",
              "schema": []
            },
            {
              "name": "object",
              "schema": []
            }
          ],
          "complexType": "anyOf"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "No Content",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] /api/v1/store-currency
[path] Untitled/Purchasing API Docs/Purchasing/

{
  "id": "zbUa3dMUfFGVTLwdER2Uv",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/store-currency",
    "servers": [],
    "name": "",
    "description": "Get the store base currency",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The store base currency",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "currency_code",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "GBP",
                "minLength": 3,
                "maxLength": 3
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Store base currency not set",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get purchase history
[path] Untitled/Purchasing API Docs/Purchasing/

{
  "id": "jO9KYNpX3Er-Es6knAqmU",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/purchases/{lookupBy}/{identifier}/history",
    "servers": [],
    "name": "Get purchase history",
    "description": "Returns the history for a purchase",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID",
          "minLength": 1
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "PurchaseHistory",
            "schema": [],
            "modelRef": "#/components/schemas/PurchaseHistory",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get order stats for a customer
[path] Untitled/Purchasing API Docs/Stats/

{
  "id": "oCOVWayxFKaFeKXWMBPo4",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/purchases/stats/order/sku",
    "servers": [],
    "name": "Get order stats for a customer",
    "description": "Provides stats on SKU orders within a date period",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID",
          "minLength": 1
        }
      ],
      "queryParameters": [
        {
          "kind": "required",
          "name": "spark_customer_id",
          "type": "string",
          "description": "SparkLayer Customer ID",
          "minLength": 1
        },
        {
          "kind": "required",
          "name": "start_date",
          "type": "string<date-time>",
          "example": "2020-01-01T00:00:00+02:00",
          "description": "<p>Starting date-time from which to get stats - include user timezone or Z for UTC (RFC-3339)</p>",
          "format": "date-time"
        },
        {
          "kind": "required",
          "name": "end_date",
          "type": "string<date-time>",
          "example": "2020-04-30T23:59:59+02:00",
          "description": "<p>Ending date-time until which to get stats - include user timezone or Z for UTC (RFC-3339)</p>",
          "format": "date-time"
        },
        {
          "kind": "required",
          "name": "date_period_type",
          "type": "string",
          "description": "Date period type to group stats by",
          "enum": [
            "week",
            "month",
            "quarter"
          ]
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "example": "[{\"sku\":\"SKU999\",\"periods\":[{\"period_start_date\":\"2020-01-01T00:00:00Z\",\"sold_qty\":8},{\"period_start_date\":\"2020-02-01T00:00:00Z\",\"sold_qty\":2}]},{\"sku\":\"SKU888\",\"periods\":[{\"period_start_date\":\"2020-01-01T00:00:00Z\",\"sold_qty\":1},{\"period_start_date\":\"2020-03-01T00:00:00Z\",\"sold_qty\":8}]}]",
            "description": "",
            "schema": [
              {
                "name": "sku",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "periods",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "period_start_date",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "<p>Start date of the period group - always returned as UTC (RFC-3339)</p>",
                    "format": "date-time"
                  },
                  {
                    "name": "sold_qty",
                    "kind": "optional",
                    "type": "integer",
                    "description": ""
                  }
                ]
              }
            ],
            "itemType": "object",
            "customType": "object[]",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Purchasing
[path] Untitled/Purchasing API Docs/


[title] /api/v1/store-currency
[path] Untitled/Purchasing API Docs/Purchasing/

{
  "id": "7pA5vNdt3x1trJJKZ6Hrc",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "/api/v1/store-currency",
    "servers": [],
    "name": "",
    "description": "Set the store base currency.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "currency_code",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "GBP",
              "minLength": 3,
              "maxLength": 3
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Store base currency set successfully",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "currency_code",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "GBP",
                "minLength": 3,
                "maxLength": 3
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "409",
        "description": "Store base currency already set to a different value",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get a file
[path] Untitled/Files API Docs/Files/

{
  "id": "eGVF-EnJkE108C1eKVW9n",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/files/{id}",
    "servers": [],
    "name": "Get a file",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "allowRejected",
          "type": "boolean",
          "description": ""
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "File",
            "schema": [
              {
                "name": "file_handle",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "",
                "modelRef": "#/components/schemas/FileHandle",
                "customType": "FileHandle",
                "schema": [
                  {
                    "name": "file_path",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "<p>The path to the file, including the file name</p>",
                    "example": "folder/file.png"
                  },
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "The ID of this type",
                    "example": "86027e2c-e853-11ee-b1d4-7c214a6ed8c7"
                  },
                  {
                    "name": "url",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "nullable": true,
                    "description": "<p>URL to download/upload the file. For GET, this will be a readable link. If the file is not ready, this will be <code>null</code>. For POST/PATCH this will be a writeable link</p>",
                    "example": "https://files.sparklayer.io/siteId/siteEnv/path/to/file.png."
                  },
                  {
                    "name": "required_headers",
                    "kind": "optional",
                    "type": "array",
                    "readOnly": true,
                    "description": "<p>An array of headers you must include in the file upload/download request</p>",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "optional",
                        "type": "string",
                        "readOnly": true,
                        "description": "Name of the header",
                        "example": "Content-Type"
                      },
                      {
                        "name": "value",
                        "kind": "optional",
                        "type": "string",
                        "readOnly": true,
                        "description": "Value of the header",
                        "example": "application/pdf"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "ready",
                "kind": "optional",
                "type": "boolean",
                "readOnly": true,
                "description": "Whether the file has been fully uploaded and verified",
                "example": true
              },
              {
                "name": "mime_type",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "The mime type of this file",
                "example": "image/png"
              },
              {
                "name": "file_size",
                "kind": "optional",
                "type": "integer",
                "readOnly": true,
                "description": "The size of this file in bytes",
                "example": 255
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "<p>The date at which the file was created (RFC-3339)</p>",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "<p>The date at which the file was updated (RFC-3339)</p>",
                "example": "2020-01-01T00:00:00+02:00",
                "format": "date-time"
              },
              {
                "name": "metadata",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "",
                "example": "{\"sparklayer\":{\"forms\":{\"context\":\"email_template\",\"step_id\":\"erkjs\"},\"emails\":{\"attachments\":[\"86027e2c-e853-11ee-b1d4-7c214a6ed8c7\"]}}}",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/File",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "410",
        "description": "File Rejected",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "complexItems": [
              {
                "name": "object",
                "schema": [
                  {
                    "name": "detail",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>Human-readable summary of the error</p>",
                    "example": "Data Validation Failed"
                  },
                  {
                    "name": "status",
                    "kind": "optional",
                    "type": "integer",
                    "description": "HTTP Status code returned from API",
                    "example": 400
                  },
                  {
                    "name": "title",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>Machine-readable error code</p>",
                    "example": "invalid-api-request-contents"
                  },
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "https://docs.sparklayer.io/api/errors#invalid-api-request-contents"
                  },
                  {
                    "name": "errors",
                    "kind": "optional",
                    "type": "array",
                    "nullable": true,
                    "description": "A list of errors related to the call",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "code",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>Machine-readable error code</p>",
                        "example": "resource-not-found"
                      },
                      {
                        "name": "property",
                        "kind": "optional",
                        "type": "string",
                        "description": "The property the error relates to",
                        "example": "template"
                      },
                      {
                        "name": "message",
                        "kind": "optional",
                        "type": "string",
                        "description": "Human readable summary of the error",
                        "example": "template not found"
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/Error",
                "customType": "Error"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "file_handle",
                    "kind": "optional",
                    "type": "object",
                    "readOnly": true,
                    "description": "",
                    "modelRef": "#/components/schemas/FileHandle",
                    "customType": "FileHandle",
                    "schema": [
                      {
                        "name": "file_path",
                        "kind": "optional",
                        "type": "string",
                        "readOnly": true,
                        "description": "<p>The path to the file, including the file name</p>",
                        "example": "folder/file.png"
                      },
                      {
                        "name": "id",
                        "kind": "optional",
                        "type": "string",
                        "readOnly": true,
                        "description": "The ID of this type",
                        "example": "86027e2c-e853-11ee-b1d4-7c214a6ed8c7"
                      },
                      {
                        "name": "url",
                        "kind": "optional",
                        "type": "string",
                        "readOnly": true,
                        "nullable": true,
                        "description": "<p>URL to download/upload the file. For GET, this will be a readable link. If the file is not ready, this will be <code>null</code>. For POST/PATCH this will be a writeable link</p>",
                        "example": "https://files.sparklayer.io/siteId/siteEnv/path/to/file.png."
                      },
                      {
                        "name": "required_headers",
                        "kind": "optional",
                        "type": "array",
                        "readOnly": true,
                        "description": "<p>An array of headers you must include in the file upload/download request</p>",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "readOnly": true,
                            "description": "Name of the header",
                            "example": "Content-Type"
                          },
                          {
                            "name": "value",
                            "kind": "optional",
                            "type": "string",
                            "readOnly": true,
                            "description": "Value of the header",
                            "example": "application/pdf"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "ready",
                    "kind": "optional",
                    "type": "boolean",
                    "readOnly": true,
                    "description": "Whether the file has been fully uploaded and verified",
                    "example": true
                  },
                  {
                    "name": "mime_type",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "The mime type of this file",
                    "example": "image/png"
                  },
                  {
                    "name": "file_size",
                    "kind": "optional",
                    "type": "integer",
                    "readOnly": true,
                    "description": "The size of this file in bytes",
                    "example": 255
                  },
                  {
                    "name": "created_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>The date at which the file was created (RFC-3339)</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "updated_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "<p>The date at which the file was updated (RFC-3339)</p>",
                    "example": "2020-01-01T00:00:00+02:00",
                    "format": "date-time"
                  },
                  {
                    "name": "metadata",
                    "kind": "optional",
                    "type": "object",
                    "readOnly": true,
                    "description": "",
                    "example": "{\"sparklayer\":{\"forms\":{\"context\":\"email_template\",\"step_id\":\"erkjs\"},\"emails\":{\"attachments\":[\"86027e2c-e853-11ee-b1d4-7c214a6ed8c7\"]}}}",
                    "schema": []
                  }
                ],
                "modelRef": "#/components/schemas/File",
                "customType": "File"
              }
            ],
            "complexType": "oneOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] /api/v1/batch-delete-files
[path] Untitled/Files API Docs/Files/

{
  "id": "7hPJQfVrcH3omvL2C9HCX",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/v1/batch-delete-files",
    "servers": [],
    "name": "",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "array",
          "description": "",
          "schema": [],
          "itemType": "string",
          "customType": "string[]",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Success",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Files
[path] Untitled/Files API Docs/


[title] Update a file
[path] Untitled/Files API Docs/Files/

{
  "id": "iFtYUeunMsIjFMzo4-kNl",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "/api/v1/files/{id}",
    "servers": [],
    "name": "Update a file",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string<uuid>",
          "description": "ID of the file to get",
          "format": "uuid"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "202",
        "description": "<p>Operation started, but still in progress</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "FileHandle",
            "schema": [
              {
                "name": "file_path",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "<p>The path to the file, including the file name</p>",
                "example": "folder/file.png"
              },
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "The ID of this type",
                "example": "86027e2c-e853-11ee-b1d4-7c214a6ed8c7"
              },
              {
                "name": "url",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "nullable": true,
                "description": "<p>URL to download/upload the file. For GET, this will be a readable link. If the file is not ready, this will be <code>null</code>. For POST/PATCH this will be a writeable link</p>",
                "example": "https://files.sparklayer.io/siteId/siteEnv/path/to/file.png."
              },
              {
                "name": "required_headers",
                "kind": "optional",
                "type": "array",
                "readOnly": true,
                "description": "<p>An array of headers you must include in the file upload/download request</p>",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "Name of the header",
                    "example": "Content-Type"
                  },
                  {
                    "name": "value",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "Value of the header",
                    "example": "application/pdf"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/FileHandle",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Create a new file
[path] Untitled/Files API Docs/Files/

{
  "id": "zgSoCo9syzqiNMaP68zEo",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/v1/files",
    "servers": [],
    "name": "Create a new file",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "file_path",
              "kind": "required",
              "type": "string",
              "description": "<p>The path to the file, including the file name</p>",
              "example": "folder/file.png"
            },
            {
              "name": "expires_at",
              "kind": "optional",
              "type": "string<date-time>",
              "description": "An optional RFC3339 date string indicating when a file should be auto deleted",
              "example": "2017-07-21T17:32:28Z",
              "format": "date-time"
            },
            {
              "name": "metadata",
              "kind": "optional",
              "type": "object",
              "description": "Metadata attached to the file",
              "example": "{\"sparklayer\":{\"forms\":{\"context\":\"email_template\",\"step_id\":\"erkjs\"},\"emails\":{\"attachments\":[\"86027e2c-e853-11ee-b1d4-7c214a6ed8c7\"]}}}",
              "schema": []
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "202",
        "description": "<p>Operation started, but still in progress</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "FileHandle",
            "schema": [
              {
                "name": "file_path",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "<p>The path to the file, including the file name</p>",
                "example": "folder/file.png"
              },
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "The ID of this type",
                "example": "86027e2c-e853-11ee-b1d4-7c214a6ed8c7"
              },
              {
                "name": "url",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "nullable": true,
                "description": "<p>URL to download/upload the file. For GET, this will be a readable link. If the file is not ready, this will be <code>null</code>. For POST/PATCH this will be a writeable link</p>",
                "example": "https://files.sparklayer.io/siteId/siteEnv/path/to/file.png."
              },
              {
                "name": "required_headers",
                "kind": "optional",
                "type": "array",
                "readOnly": true,
                "description": "<p>An array of headers you must include in the file upload/download request</p>",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "Name of the header",
                    "example": "Content-Type"
                  },
                  {
                    "name": "value",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "Value of the header",
                    "example": "application/pdf"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/FileHandle",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Delete all files for a specific client
[path] Untitled/Files API Docs/Files/

{
  "id": "qxZywLsuiWvPIhq-tOZZB",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "/api/v1/files",
    "servers": [],
    "name": "Delete all files for a specific client",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Deletion successfully completed",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Delete a file
[path] Untitled/Files API Docs/Files/

{
  "id": "F92o2fZGLNuDCg1_lRE9m",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "/api/v1/files/{id}",
    "servers": [],
    "name": "Delete a file",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string<uuid>",
          "description": "ID of the file to get",
          "format": "uuid"
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Success",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Core-api.yaml
[path] Untitled/


[title] Update Customer Group Setting
[path] Untitled/Core API Docs/Settings/

{
  "id": "uCaH6_pbQt8zD49DMeN97",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://app.sparklayer.io/api/v1/settings/{slug}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/settings/{slug}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/settings/{slug}",
        "description": "Test"
      }
    ],
    "name": "Update Customer Group Setting",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "slug",
          "type": "string",
          "description": ""
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "array",
          "description": "",
          "customType": "SettingCustomerGroup[]",
          "schema": [],
          "modelRef": "#/components/schemas/SettingCustomerGroup",
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<orderTotalsValidation>",
                  "description": "",
                  "enum": [
                    "orderTotalsValidation"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "array",
                  "nullable": true,
                  "description": "",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "currency_code",
                      "kind": "required",
                      "type": "string",
                      "description": "<p><a href=\"http://en.wikipedia.org/wiki/ISO_4217\" target=\"_blank\">ISO 4217</a> currency code</p>",
                      "example": "gbp",
                      "minLength": 3,
                      "maxLength": 3
                    },
                    {
                      "name": "minimum_value",
                      "kind": "required",
                      "type": "number",
                      "description": "",
                      "minimum": 0
                    },
                    {
                      "name": "maximum_value",
                      "kind": "optional",
                      "type": "number",
                      "nullable": true,
                      "description": "",
                      "minimum": 0
                    },
                    {
                      "name": "compare_type",
                      "kind": "required",
                      "type": "string<gross | net>",
                      "description": "",
                      "enum": [
                        "gross",
                        "net"
                      ]
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/Settings.orderTotalsValidation",
              "customType": "Settings.orderTotalsValidation"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<orderItemQuantityValidation>",
                  "description": "",
                  "enum": [
                    "orderItemQuantityValidation"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "object",
                  "nullable": true,
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "minimum_quantity",
                      "kind": "optional",
                      "type": "number",
                      "nullable": true,
                      "description": "",
                      "minimum": 1
                    },
                    {
                      "name": "maximum_quantity",
                      "kind": "optional",
                      "type": "number",
                      "nullable": true,
                      "description": "",
                      "minimum": 1
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/Settings.orderItemQuantityValidation",
              "customType": "Settings.orderItemQuantityValidation"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<priceListSelection>",
                  "description": "",
                  "enum": [
                    "priceListSelection"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "array",
                  "nullable": true,
                  "description": "",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "price_list_slug",
                      "kind": "required",
                      "type": "string",
                      "description": "Price List Slug",
                      "example": "base-list"
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/Settings.priceListSelection",
              "customType": "Settings.priceListSelection"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<allowedPaymentMethods>",
                  "description": "",
                  "enum": [
                    "allowedPaymentMethods"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "object",
                  "nullable": true,
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "payment_by_invoice",
                      "kind": "optional",
                      "type": "boolean",
                      "description": ""
                    },
                    {
                      "name": "payment_on_account",
                      "kind": "optional",
                      "type": "boolean",
                      "description": ""
                    },
                    {
                      "name": "upfront_payment",
                      "kind": "optional",
                      "type": "boolean",
                      "description": ""
                    },
                    {
                      "name": "quote",
                      "kind": "optional",
                      "type": "boolean",
                      "description": ""
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/Settings.allowedPaymentMethods",
              "customType": "Settings.allowedPaymentMethods"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<allowAddressEditing>",
                  "description": "",
                  "enum": [
                    "allowAddressEditing"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "boolean",
                  "nullable": true,
                  "description": ""
                }
              ],
              "modelRef": "#/components/schemas/Settings.allowAddressEditing",
              "customType": "Settings.allowAddressEditing"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<allowDefaultBillingModification>",
                  "description": "",
                  "enum": [
                    "allowDefaultBillingModification"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "boolean",
                  "nullable": true,
                  "description": ""
                }
              ],
              "modelRef": "#/components/schemas/Settings.allowDefaultBillingModification",
              "customType": "Settings.allowDefaultBillingModification"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<paymentOnAccountEnforceCreditLimit>",
                  "description": "",
                  "enum": [
                    "paymentOnAccountEnforceCreditLimit"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "boolean",
                  "nullable": true,
                  "description": ""
                }
              ],
              "modelRef": "#/components/schemas/Settings.paymentOnAccountEnforceCreditLimit",
              "customType": "Settings.paymentOnAccountEnforceCreditLimit"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<useMultiLocationStock>",
                  "description": "",
                  "enum": [
                    "useMultiLocationStock"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "boolean",
                  "nullable": true,
                  "description": ""
                }
              ],
              "modelRef": "#/components/schemas/Settings.useMultiLocationStock",
              "customType": "Settings.useMultiLocationStock"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<multiLocationStockConfig>",
                  "description": "",
                  "enum": [
                    "multiLocationStockConfig"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "object",
                  "nullable": true,
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "useDefault",
                      "kind": "optional",
                      "type": "boolean",
                      "description": ""
                    },
                    {
                      "name": "allowedStockLocationIds",
                      "kind": "optional",
                      "type": "array",
                      "description": "",
                      "example": "",
                      "itemType": "string",
                      "customType": "string[]",
                      "itemExample": "",
                      "itemDefault": ""
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/Settings.multiLocationStockConfig",
              "customType": "Settings.multiLocationStockConfig"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<stockDisplay>",
                  "description": "",
                  "enum": [
                    "stockDisplay"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "object",
                  "nullable": true,
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "show_status",
                      "kind": "optional",
                      "type": "boolean",
                      "description": ""
                    },
                    {
                      "name": "show_units",
                      "kind": "optional",
                      "type": "boolean",
                      "description": ""
                    },
                    {
                      "name": "max",
                      "kind": "optional",
                      "type": "integer",
                      "description": ""
                    },
                    {
                      "name": "low",
                      "kind": "optional",
                      "type": "integer",
                      "description": ""
                    },
                    {
                      "name": "last",
                      "kind": "optional",
                      "type": "integer",
                      "description": ""
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/Settings.stockDisplay",
              "customType": "Settings.stockDisplay"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<quotingEngine>",
                  "description": "",
                  "enum": [
                    "quotingEngine"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "object",
                  "nullable": true,
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "customer_create_quote",
                      "kind": "optional",
                      "type": "boolean",
                      "description": ""
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/Settings.quotingEngine",
              "customType": "Settings.quotingEngine"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<allowCheckout>",
                  "description": "",
                  "enum": [
                    "allowCheckout"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "boolean",
                  "nullable": true,
                  "description": ""
                }
              ],
              "modelRef": "#/components/schemas/Settings.allowCheckout",
              "customType": "Settings.allowCheckout"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string<recurringOrdersEngine>",
                  "description": "",
                  "enum": [
                    "recurringOrdersEngine"
                  ]
                },
                {
                  "name": "value",
                  "kind": "required",
                  "type": "object",
                  "nullable": true,
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "customer_create_recurring_orders",
                      "kind": "optional",
                      "type": "boolean",
                      "description": ""
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/Settings.recurringOrdersEngine",
              "customType": "Settings.recurringOrdersEngine"
            }
          ],
          "complexType": "oneOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Empty Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Customers
[path] Untitled/Core API Docs/


[title] Update a Discount
[path] Untitled/Core API Docs/Discounts/

{
  "id": "5HipQJ_MjFpa7apql59p5",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://app.sparklayer.io/api/v1/discounts/{id}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/discounts/{id}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/discounts/{id}",
        "description": "Test"
      }
    ],
    "name": "Update a Discount",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "Discount",
          "schema": [
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "description": "A user friendly name for the discount",
              "maxLength": 256
            },
            {
              "name": "internal_name",
              "kind": "required",
              "type": "string",
              "description": "",
              "maxLength": 45
            },
            {
              "name": "internal_slug",
              "kind": "required",
              "type": "string",
              "description": "",
              "maxLength": 45
            },
            {
              "name": "template",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "<p>Discount template type. If not null allowed values are - 'order_level_get_amount_off', 'order_level_get_free_product', 'product_level_get_amount_off', 'order_level_get_shipping_reward', 'advanced_order_level_get_amount_off', 'order_level_requirement_amount_off', 'advanced_discount', 'advanced_free_products'</p>"
            },
            {
              "name": "calculation_group",
              "kind": "required",
              "type": "number",
              "description": "<p>Dependency level = Calculation Group. All discounts with the same dependency level will share the same base, pre-discount totals. E.g. discount A (50% off) and discount B (50% off) will reward 100% off - not 75% off.</p>",
              "minimum": 0,
              "maximum": 127
            },
            {
              "name": "priority",
              "kind": "required",
              "type": "number",
              "description": "<p>The sequence to apply the discounts (within each discount 'dependency level')</p>",
              "minimum": 0,
              "maximum": 10000
            },
            {
              "name": "times_applicable_per_order",
              "kind": "required",
              "type": "number",
              "description": "<p>Per order application limits. If -1 allow unlimited applications, otherwise limited</p>",
              "minimum": -1,
              "maximum": 127
            },
            {
              "name": "max_rewards",
              "kind": "optional",
              "type": "number",
              "nullable": true,
              "description": "Used when rewardSelectionType is cheapest or expensive to determine the number of rewards available",
              "default": 1,
              "minimum": 1,
              "maximum": 127
            },
            {
              "name": "groups",
              "kind": "required",
              "type": "array",
              "description": "<p>Customer groups covered by this discount (use default to cover all groups)</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "default",
              "itemDefault": ""
            },
            {
              "name": "excluded_customers",
              "kind": "optional",
              "type": "array",
              "description": "Array of email address or accounting ids of customers to exclude from the discount",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "customer@b2b.com",
              "itemDefault": ""
            },
            {
              "name": "simultaneity",
              "kind": "optional",
              "type": "array",
              "nullable": true,
              "description": "<p>Other discounts which can be applied simultaneous, if null no limitation</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "default",
              "itemDefault": ""
            },
            {
              "name": "requirement_selection_type",
              "kind": "required",
              "type": "string<any | all>",
              "description": "Products which must be in the cart must match all or any one of the combo groups",
              "enum": [
                "any",
                "all"
              ]
            },
            {
              "name": "reward_selection_type",
              "kind": "required",
              "type": "string<all | cheapest | expensive>",
              "description": "",
              "enum": [
                "all",
                "cheapest",
                "expensive"
              ]
            },
            {
              "name": "currency_code",
              "kind": "required",
              "type": "string",
              "nullable": true,
              "description": "",
              "example": "gbp",
              "minLength": 3,
              "maxLength": 3
            },
            {
              "name": "start_date",
              "kind": "required",
              "type": "string<date-time>",
              "nullable": true,
              "description": "Start Date",
              "format": "date-time"
            },
            {
              "name": "end_date",
              "kind": "required",
              "type": "string<date-time>",
              "nullable": true,
              "description": "End Date",
              "format": "date-time"
            },
            {
              "name": "active",
              "kind": "required",
              "type": "boolean",
              "description": ""
            },
            {
              "name": "requirements",
              "kind": "required",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/Discount.Requirement",
              "customType": "Discount.Requirement[]",
              "schema": [
                {
                  "name": "items",
                  "kind": "required",
                  "type": "array",
                  "description": "",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "restrictions",
                      "kind": "required",
                      "type": "array",
                      "description": "",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "required",
                          "type": "string<productSKU | excludeProductSKU | productSKUContains | excludeProductSKUContains | productMetadata | excludeProductMetadata>",
                          "description": "",
                          "enum": [
                            "productSKU",
                            "excludeProductSKU",
                            "productSKUContains",
                            "excludeProductSKUContains",
                            "productMetadata",
                            "excludeProductMetadata"
                          ]
                        },
                        {
                          "name": "ref",
                          "kind": "required",
                          "type": "string",
                          "description": ""
                        },
                        {
                          "name": "metadata_namespace",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "erp",
                          "maxLength": 256
                        },
                        {
                          "name": "metadata_key",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "vendor",
                          "maxLength": 128
                        }
                      ]
                    },
                    {
                      "name": "points_type",
                      "kind": "required",
                      "type": "string<line | item>",
                      "description": "<p>Add X point(s) for each matching product OR Add X point(s) for once only</p>",
                      "enum": [
                        "line",
                        "item"
                      ]
                    },
                    {
                      "name": "points",
                      "kind": "required",
                      "type": "integer",
                      "description": "",
                      "default": 1
                    },
                    {
                      "name": "quantity",
                      "kind": "required",
                      "type": "integer",
                      "description": ""
                    },
                    {
                      "name": "selection_type",
                      "kind": "required",
                      "type": "string<minimum | exact>",
                      "description": "<p>At least X quantity of product(s) must match OR Exactly X quantity of product(s)</p>",
                      "enum": [
                        "minimum",
                        "exact"
                      ]
                    }
                  ]
                },
                {
                  "name": "max_rewards",
                  "kind": "required",
                  "type": "integer",
                  "nullable": true,
                  "description": "Limit the number of rewards when this requirement applies"
                },
                {
                  "name": "min_spend",
                  "kind": "required",
                  "type": "number",
                  "nullable": true,
                  "description": "<p>The cart must contain between min_spend and max_spend based on spend_tax_type of the requirement.</p>"
                },
                {
                  "name": "max_spend",
                  "kind": "required",
                  "type": "number",
                  "nullable": true,
                  "description": ""
                },
                {
                  "name": "spend_tax_type",
                  "kind": "required",
                  "type": "string<net>",
                  "description": "",
                  "enum": [
                    "net"
                  ]
                },
                {
                  "name": "selection_type",
                  "kind": "required",
                  "type": "string<minimum | all>",
                  "description": "<p>Apply only if 'all' items matched in the cart OR if cart worth minimum of min_points requirement items(s) using requirements</p>",
                  "enum": [
                    "minimum",
                    "all"
                  ]
                },
                {
                  "name": "min_points",
                  "kind": "required",
                  "type": "integer",
                  "nullable": true,
                  "description": "<p>Only applies when selection_type is minimum</p>"
                }
              ]
            },
            {
              "name": "rewards",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/Discount.Reward",
              "customType": "Discount.Reward[]",
              "schema": [
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string<requirements|all | requirements|cheapest | cart|productSKU | cart|cheapestProductSKU | cart|productMetadata | cart|cheapestProductMetadata | product | shipping | order>",
                  "description": "",
                  "enum": [
                    "requirements|all",
                    "requirements|cheapest",
                    "cart|productSKU",
                    "cart|cheapestProductSKU",
                    "cart|productMetadata",
                    "cart|cheapestProductMetadata",
                    "product",
                    "shipping",
                    "order"
                  ]
                },
                {
                  "name": "amount_type",
                  "kind": "required",
                  "type": "string<percent | percentPreDiscount | priceAllGross | priceAllNet | priceLineGross | priceLineNet | fixedAllGross | fixedAllNet | fixedLineGross | fixedLineNet | none>",
                  "description": "",
                  "enum": [
                    "percent",
                    "percentPreDiscount",
                    "priceAllGross",
                    "priceAllNet",
                    "priceLineGross",
                    "priceLineNet",
                    "fixedAllGross",
                    "fixedAllNet",
                    "fixedLineGross",
                    "fixedLineNet",
                    "none"
                  ]
                },
                {
                  "name": "restriction_type",
                  "kind": "optional",
                  "type": "string<equals | notEquals | contains | notContains>",
                  "description": "",
                  "enum": [
                    "equals",
                    "notEquals",
                    "contains",
                    "notContains"
                  ]
                },
                {
                  "name": "item_id",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "maxLength": 100
                },
                {
                  "name": "metadata_namespace",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "erp",
                  "maxLength": 256
                },
                {
                  "name": "metadata_key",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "vendor",
                  "maxLength": 128
                },
                {
                  "name": "amount",
                  "kind": "required",
                  "type": "number",
                  "description": "",
                  "maximum": 1000000000
                }
              ]
            },
            {
              "name": "other_requirements",
              "kind": "required",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/Discount.OtherRequirements.MaxUsesPerCustomer",
              "customType": "Discount.OtherRequirements.MaxUsesPerCustomer[]",
              "schema": [
                {
                  "name": "requirement_type",
                  "kind": "optional",
                  "type": "string<maxUsesPerCustomer>",
                  "description": "",
                  "enum": [
                    "maxUsesPerCustomer"
                  ]
                },
                {
                  "name": "number",
                  "kind": "optional",
                  "type": "number",
                  "description": ""
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/Discount",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Discount",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "description": "<p>Discount ID (uuid)</p>",
                "example": "942651af-f950-4716-9916-16170fe0645f",
                "format": "uuid"
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "deleted_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "nullable": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "A user friendly name for the discount",
                "maxLength": 256
              },
              {
                "name": "internal_name",
                "kind": "required",
                "type": "string",
                "description": "",
                "maxLength": 45
              },
              {
                "name": "internal_slug",
                "kind": "required",
                "type": "string",
                "description": "",
                "maxLength": 45
              },
              {
                "name": "template",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p>Discount template type. If not null allowed values are - 'order_level_get_amount_off', 'order_level_get_free_product', 'product_level_get_amount_off', 'order_level_get_shipping_reward', 'advanced_order_level_get_amount_off', 'order_level_requirement_amount_off', 'advanced_discount', 'advanced_free_products'</p>"
              },
              {
                "name": "calculation_group",
                "kind": "required",
                "type": "number",
                "description": "<p>Dependency level = Calculation Group. All discounts with the same dependency level will share the same base, pre-discount totals. E.g. discount A (50% off) and discount B (50% off) will reward 100% off - not 75% off.</p>",
                "minimum": 0,
                "maximum": 127
              },
              {
                "name": "priority",
                "kind": "required",
                "type": "number",
                "description": "<p>The sequence to apply the discounts (within each discount 'dependency level')</p>",
                "minimum": 0,
                "maximum": 10000
              },
              {
                "name": "times_applicable_per_order",
                "kind": "required",
                "type": "number",
                "description": "<p>Per order application limits. If -1 allow unlimited applications, otherwise limited</p>",
                "minimum": -1,
                "maximum": 127
              },
              {
                "name": "max_rewards",
                "kind": "optional",
                "type": "number",
                "nullable": true,
                "description": "Used when rewardSelectionType is cheapest or expensive to determine the number of rewards available",
                "default": 1,
                "minimum": 1,
                "maximum": 127
              },
              {
                "name": "groups",
                "kind": "required",
                "type": "array",
                "description": "<p>Customer groups covered by this discount (use default to cover all groups)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "excluded_customers",
                "kind": "optional",
                "type": "array",
                "description": "Array of email address or accounting ids of customers to exclude from the discount",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "customer@b2b.com",
                "itemDefault": ""
              },
              {
                "name": "simultaneity",
                "kind": "optional",
                "type": "array",
                "nullable": true,
                "description": "<p>Other discounts which can be applied simultaneous, if null no limitation</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "requirement_selection_type",
                "kind": "required",
                "type": "string<any | all>",
                "description": "Products which must be in the cart must match all or any one of the combo groups",
                "enum": [
                  "any",
                  "all"
                ]
              },
              {
                "name": "reward_selection_type",
                "kind": "required",
                "type": "string<all | cheapest | expensive>",
                "description": "",
                "enum": [
                  "all",
                  "cheapest",
                  "expensive"
                ]
              },
              {
                "name": "currency_code",
                "kind": "required",
                "type": "string",
                "nullable": true,
                "description": "",
                "example": "gbp",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "start_date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "Start Date",
                "format": "date-time"
              },
              {
                "name": "end_date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "End Date",
                "format": "date-time"
              },
              {
                "name": "active",
                "kind": "required",
                "type": "boolean",
                "description": ""
              },
              {
                "name": "requirements",
                "kind": "required",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.Requirement",
                "customType": "Discount.Requirement[]",
                "schema": [
                  {
                    "name": "items",
                    "kind": "required",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "restrictions",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<productSKU | excludeProductSKU | productSKUContains | excludeProductSKUContains | productMetadata | excludeProductMetadata>",
                            "description": "",
                            "enum": [
                              "productSKU",
                              "excludeProductSKU",
                              "productSKUContains",
                              "excludeProductSKUContains",
                              "productMetadata",
                              "excludeProductMetadata"
                            ]
                          },
                          {
                            "name": "ref",
                            "kind": "required",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "metadata_namespace",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "erp",
                            "maxLength": 256
                          },
                          {
                            "name": "metadata_key",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "vendor",
                            "maxLength": 128
                          }
                        ]
                      },
                      {
                        "name": "points_type",
                        "kind": "required",
                        "type": "string<line | item>",
                        "description": "<p>Add X point(s) for each matching product OR Add X point(s) for once only</p>",
                        "enum": [
                          "line",
                          "item"
                        ]
                      },
                      {
                        "name": "points",
                        "kind": "required",
                        "type": "integer",
                        "description": "",
                        "default": 1
                      },
                      {
                        "name": "quantity",
                        "kind": "required",
                        "type": "integer",
                        "description": ""
                      },
                      {
                        "name": "selection_type",
                        "kind": "required",
                        "type": "string<minimum | exact>",
                        "description": "<p>At least X quantity of product(s) must match OR Exactly X quantity of product(s)</p>",
                        "enum": [
                          "minimum",
                          "exact"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "max_rewards",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "Limit the number of rewards when this requirement applies"
                  },
                  {
                    "name": "min_spend",
                    "kind": "required",
                    "type": "number",
                    "nullable": true,
                    "description": "<p>The cart must contain between min_spend and max_spend based on spend_tax_type of the requirement.</p>"
                  },
                  {
                    "name": "max_spend",
                    "kind": "required",
                    "type": "number",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "spend_tax_type",
                    "kind": "required",
                    "type": "string<net>",
                    "description": "",
                    "enum": [
                      "net"
                    ]
                  },
                  {
                    "name": "selection_type",
                    "kind": "required",
                    "type": "string<minimum | all>",
                    "description": "<p>Apply only if 'all' items matched in the cart OR if cart worth minimum of min_points requirement items(s) using requirements</p>",
                    "enum": [
                      "minimum",
                      "all"
                    ]
                  },
                  {
                    "name": "min_points",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "<p>Only applies when selection_type is minimum</p>"
                  }
                ]
              },
              {
                "name": "rewards",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.Reward",
                "customType": "Discount.Reward[]",
                "schema": [
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string<requirements|all | requirements|cheapest | cart|productSKU | cart|cheapestProductSKU | cart|productMetadata | cart|cheapestProductMetadata | product | shipping | order>",
                    "description": "",
                    "enum": [
                      "requirements|all",
                      "requirements|cheapest",
                      "cart|productSKU",
                      "cart|cheapestProductSKU",
                      "cart|productMetadata",
                      "cart|cheapestProductMetadata",
                      "product",
                      "shipping",
                      "order"
                    ]
                  },
                  {
                    "name": "amount_type",
                    "kind": "required",
                    "type": "string<percent | percentPreDiscount | priceAllGross | priceAllNet | priceLineGross | priceLineNet | fixedAllGross | fixedAllNet | fixedLineGross | fixedLineNet | none>",
                    "description": "",
                    "enum": [
                      "percent",
                      "percentPreDiscount",
                      "priceAllGross",
                      "priceAllNet",
                      "priceLineGross",
                      "priceLineNet",
                      "fixedAllGross",
                      "fixedAllNet",
                      "fixedLineGross",
                      "fixedLineNet",
                      "none"
                    ]
                  },
                  {
                    "name": "restriction_type",
                    "kind": "optional",
                    "type": "string<equals | notEquals | contains | notContains>",
                    "description": "",
                    "enum": [
                      "equals",
                      "notEquals",
                      "contains",
                      "notContains"
                    ]
                  },
                  {
                    "name": "item_id",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "maxLength": 100
                  },
                  {
                    "name": "metadata_namespace",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "erp",
                    "maxLength": 256
                  },
                  {
                    "name": "metadata_key",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "vendor",
                    "maxLength": 128
                  },
                  {
                    "name": "amount",
                    "kind": "required",
                    "type": "number",
                    "description": "",
                    "maximum": 1000000000
                  }
                ]
              },
              {
                "name": "other_requirements",
                "kind": "required",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.OtherRequirements.MaxUsesPerCustomer",
                "customType": "Discount.OtherRequirements.MaxUsesPerCustomer[]",
                "schema": [
                  {
                    "name": "requirement_type",
                    "kind": "optional",
                    "type": "string<maxUsesPerCustomer>",
                    "description": "",
                    "enum": [
                      "maxUsesPerCustomer"
                    ]
                  },
                  {
                    "name": "number",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Discount",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Create a Shipping Method
[path] Untitled/Core API Docs/Shipping/

{
  "id": "_EKWPUGiA7s9frlI4atfB",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.sparklayer.io/api/v1/shipping-methods",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/shipping-methods",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/shipping-methods",
        "description": "Test"
      }
    ],
    "name": "Create a Shipping Method",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "string",
              "readOnly": true,
              "description": "<p>Shipping Method ID (always prefixed with sm_)</p>",
              "example": "sm_123",
              "maxLength": 15
            },
            {
              "name": "created_at",
              "kind": "optional",
              "type": "string<date-time>",
              "readOnly": true,
              "description": "Created At",
              "format": "date-time"
            },
            {
              "name": "updated_at",
              "kind": "optional",
              "type": "string<date-time>",
              "readOnly": true,
              "description": "Updated At",
              "format": "date-time"
            },
            {
              "name": "sku",
              "kind": "optional",
              "type": "string",
              "description": "Shipping SKU",
              "example": "SKU001",
              "maxLength": 50
            },
            {
              "name": "title",
              "kind": "optional",
              "type": "string",
              "description": "Shiping Method Name shown at checkout",
              "example": "Standard Shipping",
              "maxLength": 50
            },
            {
              "name": "priority",
              "kind": "optional",
              "type": "number",
              "description": "<p>Shown by order (lower first)</p>",
              "default": 0,
              "minimum": 0,
              "maximum": 127
            },
            {
              "name": "countries",
              "kind": "optional",
              "type": "array",
              "description": "<p>Countries covered by this shipping method (ISO 3166-1 alpha-2)</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "GB",
              "itemDefault": ""
            },
            {
              "name": "regions",
              "kind": "optional",
              "type": "map",
              "description": "<p>Regions covered by this shipping method (per country) Keys are country codes (ISO 3166-1 alpha-2) Values are lists of region codes. If the list is empty, all regions are allowed</p>",
              "example": "",
              "customType": "map<string, string[]>",
              "schema": []
            },
            {
              "name": "groups",
              "kind": "optional",
              "type": "array",
              "description": "<p>Customer groups covered by this shipping method (use default to cover all groups)</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "default",
              "itemDefault": ""
            },
            {
              "name": "bands",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "description": "Internal Band Name",
                  "example": "Band 1",
                  "maxLength": 50
                },
                {
                  "name": "priority",
                  "kind": "optional",
                  "type": "number",
                  "description": "<p>Filtered by first found by percentage_charge order (lower first)</p>",
                  "default": 0,
                  "minimum": 0,
                  "maximum": 127
                },
                {
                  "name": "sku",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "<p>Shipping SKU (Leave null to use the Shipping Method SKU)</p>",
                  "example": "ship_123",
                  "maxLength": 15
                },
                {
                  "name": "requirement",
                  "kind": "optional",
                  "type": "object",
                  "discriminator": {
                    "propertyName": "type",
                    "mapping": {
                      "weight": "#/components/schemas/ShippingMethod.Requirement.Weight",
                      "none": "#/components/schemas/ShippingMethod.Requirement.None",
                      "net_total": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                      "gross_total": "#/components/schemas/ShippingMethod.Requirement.GrossTotal"
                    }
                  },
                  "description": "",
                  "complexType": "oneOf",
                  "complexItems": [
                    {
                      "name": "ShippingMethod.Requirement.Weight",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Requirement.Weight",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<weight>",
                          "description": "",
                          "enum": [
                            "weight"
                          ]
                        },
                        {
                          "name": "min",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        },
                        {
                          "name": "max",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Requirement.GrossTotal",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Requirement.GrossTotal",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<gross_total>",
                          "description": "",
                          "enum": [
                            "gross_total"
                          ]
                        },
                        {
                          "name": "min_total",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        },
                        {
                          "name": "max_total",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Requirement.NetTotal",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<net_total>",
                          "description": "",
                          "enum": [
                            "net_total"
                          ]
                        },
                        {
                          "name": "min",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        },
                        {
                          "name": "max",
                          "kind": "optional",
                          "type": "number",
                          "nullable": true,
                          "description": ""
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Requirement.None",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Requirement.None",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<none>",
                          "description": "",
                          "enum": [
                            "none"
                          ]
                        }
                      ]
                    }
                  ],
                  "schema": []
                },
                {
                  "name": "cost",
                  "kind": "optional",
                  "type": "object",
                  "discriminator": {
                    "propertyName": "type",
                    "mapping": {
                      "free": "#/components/schemas/ShippingMethod.Cost.Free",
                      "fixed_price": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                      "percent_net_total": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                      "custom": "#/components/schemas/ShippingMethod.Cost.Custom"
                    }
                  },
                  "description": "",
                  "complexType": "oneOf",
                  "complexItems": [
                    {
                      "name": "ShippingMethod.Cost.Free",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Cost.Free",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<free>",
                          "description": "",
                          "enum": [
                            "free"
                          ]
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Cost.FixedCost",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<fixed_price>",
                          "description": "",
                          "enum": [
                            "fixed_price"
                          ]
                        },
                        {
                          "name": "price",
                          "kind": "optional",
                          "type": "number",
                          "description": ""
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Cost.PercentNetTotal",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<percent_net_total>",
                          "description": "",
                          "enum": [
                            "percent_net_total"
                          ]
                        },
                        {
                          "name": "percentage_charge",
                          "kind": "optional",
                          "type": "number<float>",
                          "description": "",
                          "format": "float",
                          "minimum": 0,
                          "maximum": 100
                        }
                      ]
                    },
                    {
                      "name": "ShippingMethod.Cost.Custom",
                      "description": "",
                      "modelRef": "#/components/schemas/ShippingMethod.Cost.Custom",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "optional",
                          "type": "string<custom>",
                          "description": "",
                          "enum": [
                            "custom"
                          ]
                        },
                        {
                          "name": "cost_language_string",
                          "kind": "optional",
                          "type": "string",
                          "description": ""
                        }
                      ]
                    }
                  ],
                  "schema": []
                }
              ]
            }
          ],
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "string",
                  "readOnly": true,
                  "description": "<p>Shipping Method ID (always prefixed with sm_)</p>",
                  "example": "sm_123",
                  "maxLength": 15
                },
                {
                  "name": "created_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "readOnly": true,
                  "description": "Created At",
                  "format": "date-time"
                },
                {
                  "name": "updated_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "readOnly": true,
                  "description": "Updated At",
                  "format": "date-time"
                },
                {
                  "name": "sku",
                  "kind": "optional",
                  "type": "string",
                  "description": "Shipping SKU",
                  "example": "SKU001",
                  "maxLength": 50
                },
                {
                  "name": "title",
                  "kind": "optional",
                  "type": "string",
                  "description": "Shiping Method Name shown at checkout",
                  "example": "Standard Shipping",
                  "maxLength": 50
                },
                {
                  "name": "priority",
                  "kind": "optional",
                  "type": "number",
                  "description": "<p>Shown by order (lower first)</p>",
                  "default": 0,
                  "minimum": 0,
                  "maximum": 127
                },
                {
                  "name": "countries",
                  "kind": "optional",
                  "type": "array",
                  "description": "<p>Countries covered by this shipping method (ISO 3166-1 alpha-2)</p>",
                  "example": "",
                  "itemType": "string",
                  "customType": "string[]",
                  "itemExample": "GB",
                  "itemDefault": ""
                },
                {
                  "name": "regions",
                  "kind": "optional",
                  "type": "map",
                  "description": "<p>Regions covered by this shipping method (per country) Keys are country codes (ISO 3166-1 alpha-2) Values are lists of region codes. If the list is empty, all regions are allowed</p>",
                  "example": "",
                  "customType": "map<string, string[]>",
                  "schema": []
                },
                {
                  "name": "groups",
                  "kind": "optional",
                  "type": "array",
                  "description": "<p>Customer groups covered by this shipping method (use default to cover all groups)</p>",
                  "example": "",
                  "itemType": "string",
                  "customType": "string[]",
                  "itemExample": "default",
                  "itemDefault": ""
                },
                {
                  "name": "bands",
                  "kind": "optional",
                  "type": "array",
                  "description": "",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "name",
                      "kind": "optional",
                      "type": "string",
                      "description": "Internal Band Name",
                      "example": "Band 1",
                      "maxLength": 50
                    },
                    {
                      "name": "priority",
                      "kind": "optional",
                      "type": "number",
                      "description": "<p>Filtered by first found by percentage_charge order (lower first)</p>",
                      "default": 0,
                      "minimum": 0,
                      "maximum": 127
                    },
                    {
                      "name": "sku",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "<p>Shipping SKU (Leave null to use the Shipping Method SKU)</p>",
                      "example": "ship_123",
                      "maxLength": 15
                    },
                    {
                      "name": "requirement",
                      "kind": "optional",
                      "type": "object",
                      "discriminator": {
                        "propertyName": "type",
                        "mapping": {
                          "weight": "#/components/schemas/ShippingMethod.Requirement.Weight",
                          "none": "#/components/schemas/ShippingMethod.Requirement.None",
                          "net_total": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                          "gross_total": "#/components/schemas/ShippingMethod.Requirement.GrossTotal"
                        }
                      },
                      "description": "",
                      "complexType": "oneOf",
                      "complexItems": [
                        {
                          "name": "ShippingMethod.Requirement.Weight",
                          "description": "",
                          "modelRef": "#/components/schemas/ShippingMethod.Requirement.Weight",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<weight>",
                              "description": "",
                              "enum": [
                                "weight"
                              ]
                            },
                            {
                              "name": "min",
                              "kind": "optional",
                              "type": "number",
                              "nullable": true,
                              "description": ""
                            },
                            {
                              "name": "max",
                              "kind": "optional",
                              "type": "number",
                              "nullable": true,
                              "description": ""
                            }
                          ]
                        },
                        {
                          "name": "ShippingMethod.Requirement.GrossTotal",
                          "description": "",
                          "modelRef": "#/components/schemas/ShippingMethod.Requirement.GrossTotal",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<gross_total>",
                              "description": "",
                              "enum": [
                                "gross_total"
                              ]
                            },
                            {
                              "name": "min_total",
                              "kind": "optional",
                              "type": "number",
                              "nullable": true,
                              "description": ""
                            },
                            {
                              "name": "max_total",
                              "kind": "optional",
                              "type": "number",
                              "nullable": true,
                              "description": ""
                            }
                          ]
                        },
                        {
                          "name": "ShippingMethod.Requirement.NetTotal",
                          "description": "",
                          "modelRef": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<net_total>",
                              "description": "",
                              "enum": [
                                "net_total"
                              ]
                            },
                            {
                              "name": "min",
                              "kind": "optional",
                              "type": "number",
                              "nullable": true,
                              "description": ""
                            },
                            {
                              "name": "max",
                              "kind": "optional",
                              "type": "number",
                              "nullable": true,
                              "description": ""
                            }
                          ]
                        },
                        {
                          "name": "ShippingMethod.Requirement.None",
                          "description": "",
                          "modelRef": "#/components/schemas/ShippingMethod.Requirement.None",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<none>",
                              "description": "",
                              "enum": [
                                "none"
                              ]
                            }
                          ]
                        }
                      ],
                      "schema": []
                    },
                    {
                      "name": "cost",
                      "kind": "optional",
                      "type": "object",
                      "discriminator": {
                        "propertyName": "type",
                        "mapping": {
                          "free": "#/components/schemas/ShippingMethod.Cost.Free",
                          "fixed_price": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                          "percent_net_total": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                          "custom": "#/components/schemas/ShippingMethod.Cost.Custom"
                        }
                      },
                      "description": "",
                      "complexType": "oneOf",
                      "complexItems": [
                        {
                          "name": "ShippingMethod.Cost.Free",
                          "description": "",
                          "modelRef": "#/components/schemas/ShippingMethod.Cost.Free",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<free>",
                              "description": "",
                              "enum": [
                                "free"
                              ]
                            }
                          ]
                        },
                        {
                          "name": "ShippingMethod.Cost.FixedCost",
                          "description": "",
                          "modelRef": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<fixed_price>",
                              "description": "",
                              "enum": [
                                "fixed_price"
                              ]
                            },
                            {
                              "name": "price",
                              "kind": "optional",
                              "type": "number",
                              "description": ""
                            }
                          ]
                        },
                        {
                          "name": "ShippingMethod.Cost.PercentNetTotal",
                          "description": "",
                          "modelRef": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<percent_net_total>",
                              "description": "",
                              "enum": [
                                "percent_net_total"
                              ]
                            },
                            {
                              "name": "percentage_charge",
                              "kind": "optional",
                              "type": "number<float>",
                              "description": "",
                              "format": "float",
                              "minimum": 0,
                              "maximum": 100
                            }
                          ]
                        },
                        {
                          "name": "ShippingMethod.Cost.Custom",
                          "description": "",
                          "modelRef": "#/components/schemas/ShippingMethod.Cost.Custom",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string<custom>",
                              "description": "",
                              "enum": [
                                "custom"
                              ]
                            },
                            {
                              "name": "cost_language_string",
                              "kind": "optional",
                              "type": "string",
                              "description": ""
                            }
                          ]
                        }
                      ],
                      "schema": []
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/ShippingMethod",
              "customType": "ShippingMethod"
            },
            {
              "name": "object",
              "schema": []
            }
          ],
          "complexType": "allOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ShippingMethod",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "<p>Shipping Method ID (always prefixed with sm_)</p>",
                "example": "sm_123",
                "maxLength": 15
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Created At",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Updated At",
                "format": "date-time"
              },
              {
                "name": "sku",
                "kind": "optional",
                "type": "string",
                "description": "Shipping SKU",
                "example": "SKU001",
                "maxLength": 50
              },
              {
                "name": "title",
                "kind": "optional",
                "type": "string",
                "description": "Shiping Method Name shown at checkout",
                "example": "Standard Shipping",
                "maxLength": 50
              },
              {
                "name": "priority",
                "kind": "optional",
                "type": "number",
                "description": "<p>Shown by order (lower first)</p>",
                "default": 0,
                "minimum": 0,
                "maximum": 127
              },
              {
                "name": "countries",
                "kind": "optional",
                "type": "array",
                "description": "<p>Countries covered by this shipping method (ISO 3166-1 alpha-2)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "GB",
                "itemDefault": ""
              },
              {
                "name": "regions",
                "kind": "optional",
                "type": "map",
                "description": "<p>Regions covered by this shipping method (per country) Keys are country codes (ISO 3166-1 alpha-2) Values are lists of region codes. If the list is empty, all regions are allowed</p>",
                "example": "",
                "customType": "map<string, string[]>",
                "schema": []
              },
              {
                "name": "groups",
                "kind": "optional",
                "type": "array",
                "description": "<p>Customer groups covered by this shipping method (use default to cover all groups)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "bands",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Internal Band Name",
                    "example": "Band 1",
                    "maxLength": 50
                  },
                  {
                    "name": "priority",
                    "kind": "optional",
                    "type": "number",
                    "description": "<p>Filtered by first found by percentage_charge order (lower first)</p>",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 127
                  },
                  {
                    "name": "sku",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>Shipping SKU (Leave null to use the Shipping Method SKU)</p>",
                    "example": "ship_123",
                    "maxLength": 15
                  },
                  {
                    "name": "requirement",
                    "kind": "optional",
                    "type": "object",
                    "discriminator": {
                      "propertyName": "type",
                      "mapping": {
                        "weight": "#/components/schemas/ShippingMethod.Requirement.Weight",
                        "none": "#/components/schemas/ShippingMethod.Requirement.None",
                        "net_total": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                        "gross_total": "#/components/schemas/ShippingMethod.Requirement.GrossTotal"
                      }
                    },
                    "description": "",
                    "complexType": "oneOf",
                    "complexItems": [
                      {
                        "name": "ShippingMethod.Requirement.Weight",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.Weight",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<weight>",
                            "description": "",
                            "enum": [
                              "weight"
                            ]
                          },
                          {
                            "name": "min",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.GrossTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.GrossTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<gross_total>",
                            "description": "",
                            "enum": [
                              "gross_total"
                            ]
                          },
                          {
                            "name": "min_total",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max_total",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.NetTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.NetTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<net_total>",
                            "description": "",
                            "enum": [
                              "net_total"
                            ]
                          },
                          {
                            "name": "min",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          },
                          {
                            "name": "max",
                            "kind": "optional",
                            "type": "number",
                            "nullable": true,
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Requirement.None",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Requirement.None",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<none>",
                            "description": "",
                            "enum": [
                              "none"
                            ]
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "cost",
                    "kind": "optional",
                    "type": "object",
                    "discriminator": {
                      "propertyName": "type",
                      "mapping": {
                        "free": "#/components/schemas/ShippingMethod.Cost.Free",
                        "fixed_price": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                        "percent_net_total": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                        "custom": "#/components/schemas/ShippingMethod.Cost.Custom"
                      }
                    },
                    "description": "",
                    "complexType": "oneOf",
                    "complexItems": [
                      {
                        "name": "ShippingMethod.Cost.Free",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.Free",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<free>",
                            "description": "",
                            "enum": [
                              "free"
                            ]
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.FixedCost",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.FixedCost",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<fixed_price>",
                            "description": "",
                            "enum": [
                              "fixed_price"
                            ]
                          },
                          {
                            "name": "price",
                            "kind": "optional",
                            "type": "number",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.PercentNetTotal",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.PercentNetTotal",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<percent_net_total>",
                            "description": "",
                            "enum": [
                              "percent_net_total"
                            ]
                          },
                          {
                            "name": "percentage_charge",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float",
                            "minimum": 0,
                            "maximum": 100
                          }
                        ]
                      },
                      {
                        "name": "ShippingMethod.Cost.Custom",
                        "description": "",
                        "modelRef": "#/components/schemas/ShippingMethod.Cost.Custom",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "optional",
                            "type": "string<custom>",
                            "description": "",
                            "enum": [
                              "custom"
                            ]
                          },
                          {
                            "name": "cost_language_string",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      }
                    ],
                    "schema": []
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/ShippingMethod",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get Stock Locations for the site
[path] Untitled/Stock API Docs/Stock Locations/

{
  "id": "AVtNVft5zN3c-cplXd126",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/stock-locations",
    "servers": [],
    "name": "Get Stock Locations for the site",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>Successful response (ordered by ID - asc)</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "StockLocation[]",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "description": "SparkLayer site Stock Location ID",
                "example": "123e4567-e89b-12d3-a456-426614174000",
                "format": "uuid"
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "Name",
                "example": "Stock Warehouse 1",
                "maxLength": 255
              },
              {
                "name": "external_id",
                "kind": "required",
                "type": "string",
                "description": "<p>External ID (must be unique for the site)</p>",
                "example": "warehouse-1",
                "maxLength": 255
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              }
            ],
            "modelRef": "#/components/schemas/StockLocation",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Settings
[path] Untitled/Core API Docs/


[title] List Customer Group Settings
[path] Untitled/Core API Docs/Settings/

{
  "id": "HjJzVKWLVrPK7hUnr9mhg",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.sparklayer.io/api/v1/settings/{slug}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/settings/{slug}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/settings/{slug}",
        "description": "Test"
      }
    ],
    "name": "List Customer Group Settings",
    "description": "Lists Customer Group settings by Customer Group",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "slug",
          "type": "string",
          "description": ""
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "SettingCustomerGroup[]",
            "schema": [],
            "modelRef": "#/components/schemas/SettingCustomerGroup",
            "complexItems": [
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<orderTotalsValidation>",
                    "description": "",
                    "enum": [
                      "orderTotalsValidation"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "array",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "currency_code",
                        "kind": "required",
                        "type": "string",
                        "description": "<p><a href=\"http://en.wikipedia.org/wiki/ISO_4217\" target=\"_blank\">ISO 4217</a> currency code</p>",
                        "example": "gbp",
                        "minLength": 3,
                        "maxLength": 3
                      },
                      {
                        "name": "minimum_value",
                        "kind": "required",
                        "type": "number",
                        "description": "",
                        "minimum": 0
                      },
                      {
                        "name": "maximum_value",
                        "kind": "optional",
                        "type": "number",
                        "nullable": true,
                        "description": "",
                        "minimum": 0
                      },
                      {
                        "name": "compare_type",
                        "kind": "required",
                        "type": "string<gross | net>",
                        "description": "",
                        "enum": [
                          "gross",
                          "net"
                        ]
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/Settings.orderTotalsValidation",
                "customType": "Settings.orderTotalsValidation"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<orderItemQuantityValidation>",
                    "description": "",
                    "enum": [
                      "orderItemQuantityValidation"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "minimum_quantity",
                        "kind": "optional",
                        "type": "number",
                        "nullable": true,
                        "description": "",
                        "minimum": 1
                      },
                      {
                        "name": "maximum_quantity",
                        "kind": "optional",
                        "type": "number",
                        "nullable": true,
                        "description": "",
                        "minimum": 1
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/Settings.orderItemQuantityValidation",
                "customType": "Settings.orderItemQuantityValidation"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<priceListSelection>",
                    "description": "",
                    "enum": [
                      "priceListSelection"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "array",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "price_list_slug",
                        "kind": "required",
                        "type": "string",
                        "description": "Price List Slug",
                        "example": "base-list"
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/Settings.priceListSelection",
                "customType": "Settings.priceListSelection"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<allowedPaymentMethods>",
                    "description": "",
                    "enum": [
                      "allowedPaymentMethods"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "payment_by_invoice",
                        "kind": "optional",
                        "type": "boolean",
                        "description": ""
                      },
                      {
                        "name": "payment_on_account",
                        "kind": "optional",
                        "type": "boolean",
                        "description": ""
                      },
                      {
                        "name": "upfront_payment",
                        "kind": "optional",
                        "type": "boolean",
                        "description": ""
                      },
                      {
                        "name": "quote",
                        "kind": "optional",
                        "type": "boolean",
                        "description": ""
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/Settings.allowedPaymentMethods",
                "customType": "Settings.allowedPaymentMethods"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<allowAddressEditing>",
                    "description": "",
                    "enum": [
                      "allowAddressEditing"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "boolean",
                    "nullable": true,
                    "description": ""
                  }
                ],
                "modelRef": "#/components/schemas/Settings.allowAddressEditing",
                "customType": "Settings.allowAddressEditing"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<allowDefaultBillingModification>",
                    "description": "",
                    "enum": [
                      "allowDefaultBillingModification"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "boolean",
                    "nullable": true,
                    "description": ""
                  }
                ],
                "modelRef": "#/components/schemas/Settings.allowDefaultBillingModification",
                "customType": "Settings.allowDefaultBillingModification"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<paymentOnAccountEnforceCreditLimit>",
                    "description": "",
                    "enum": [
                      "paymentOnAccountEnforceCreditLimit"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "boolean",
                    "nullable": true,
                    "description": ""
                  }
                ],
                "modelRef": "#/components/schemas/Settings.paymentOnAccountEnforceCreditLimit",
                "customType": "Settings.paymentOnAccountEnforceCreditLimit"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<useMultiLocationStock>",
                    "description": "",
                    "enum": [
                      "useMultiLocationStock"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "boolean",
                    "nullable": true,
                    "description": ""
                  }
                ],
                "modelRef": "#/components/schemas/Settings.useMultiLocationStock",
                "customType": "Settings.useMultiLocationStock"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<multiLocationStockConfig>",
                    "description": "",
                    "enum": [
                      "multiLocationStockConfig"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "useDefault",
                        "kind": "optional",
                        "type": "boolean",
                        "description": ""
                      },
                      {
                        "name": "allowedStockLocationIds",
                        "kind": "optional",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "string",
                        "customType": "string[]",
                        "itemExample": "",
                        "itemDefault": ""
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/Settings.multiLocationStockConfig",
                "customType": "Settings.multiLocationStockConfig"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<stockDisplay>",
                    "description": "",
                    "enum": [
                      "stockDisplay"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "show_status",
                        "kind": "optional",
                        "type": "boolean",
                        "description": ""
                      },
                      {
                        "name": "show_units",
                        "kind": "optional",
                        "type": "boolean",
                        "description": ""
                      },
                      {
                        "name": "max",
                        "kind": "optional",
                        "type": "integer",
                        "description": ""
                      },
                      {
                        "name": "low",
                        "kind": "optional",
                        "type": "integer",
                        "description": ""
                      },
                      {
                        "name": "last",
                        "kind": "optional",
                        "type": "integer",
                        "description": ""
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/Settings.stockDisplay",
                "customType": "Settings.stockDisplay"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<quotingEngine>",
                    "description": "",
                    "enum": [
                      "quotingEngine"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "customer_create_quote",
                        "kind": "optional",
                        "type": "boolean",
                        "description": ""
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/Settings.quotingEngine",
                "customType": "Settings.quotingEngine"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<allowCheckout>",
                    "description": "",
                    "enum": [
                      "allowCheckout"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "boolean",
                    "nullable": true,
                    "description": ""
                  }
                ],
                "modelRef": "#/components/schemas/Settings.allowCheckout",
                "customType": "Settings.allowCheckout"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "key",
                    "kind": "required",
                    "type": "string<recurringOrdersEngine>",
                    "description": "",
                    "enum": [
                      "recurringOrdersEngine"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "customer_create_recurring_orders",
                        "kind": "optional",
                        "type": "boolean",
                        "description": ""
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/Settings.recurringOrdersEngine",
                "customType": "Settings.recurringOrdersEngine"
              }
            ],
            "complexType": "oneOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Customer group not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Discounts
[path] Untitled/Core API Docs/


[title] Core-api-sync-log.yaml
[path] Untitled/


[title] Delete a store's sync logs
[path] Untitled/Sync Logging API Docs/Sync Logging/

{
  "id": "mX7L8uBWOii9rbrpOz7fg",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "/api/v1/sync-log",
    "servers": [],
    "name": "Delete a store's sync logs",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Empty response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get Cart
[path] Untitled/Core API Docs/Orders/

{
  "id": "O54HNfUD6uhueE9I92-yC",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.sparklayer.io/api/v1/carts/{id}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/carts/{id}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/carts/{id}",
        "description": "Test"
      }
    ],
    "name": "Get Cart",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Cart",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              },
              {
                "name": "intent",
                "kind": "optional",
                "type": "string<ORDER | QUOTE>",
                "description": "",
                "enum": [
                  "ORDER",
                  "QUOTE"
                ]
              },
              {
                "name": "customer_id",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              },
              {
                "name": "shipping_address_id",
                "kind": "optional",
                "type": "string<uuid>",
                "nullable": true,
                "description": "",
                "format": "uuid"
              },
              {
                "name": "billing_address_id",
                "kind": "optional",
                "type": "string<uuid>",
                "nullable": true,
                "description": "",
                "format": "uuid"
              },
              {
                "name": "items",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "sku",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "quantity",
                    "kind": "optional",
                    "type": "integer",
                    "description": ""
                  },
                  {
                    "name": "line_total",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/Price",
                    "customType": "Price",
                    "schema": [
                      {
                        "name": "net",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "gross",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "tax_rate",
                        "kind": "optional",
                        "type": "number<float>",
                        "nullable": true,
                        "description": "",
                        "format": "float"
                      },
                      {
                        "name": "currency_code",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "tax_inclusive_display",
                        "kind": "optional",
                        "type": "boolean",
                        "description": "<p>Whether the storefront should show the gross amount and label it tax inclusive. Not derivable from tax_rate, since a zero-rated SKU on a tax-inclusive price list has a rate of 0 but must still be labelled. Display only - it says nothing about what is charged.</p>",
                        "default": false
                      }
                    ]
                  },
                  {
                    "name": "unit_total",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "Price",
                        "description": "",
                        "modelRef": "#/components/schemas/Price",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "nullable": true,
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency_code",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "tax_inclusive_display",
                            "kind": "optional",
                            "type": "boolean",
                            "description": "<p>Whether the storefront should show the gross amount and label it tax inclusive. Not derivable from tax_rate, since a zero-rated SKU on a tax-inclusive price list has a rate of 0 but must still be labelled. Display only - it says nothing about what is charged.</p>",
                            "default": false
                          }
                        ]
                      }
                    ],
                    "schema": []
                  }
                ]
              },
              {
                "name": "totals",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/CartTotals",
                "customType": "CartTotals",
                "schema": [
                  {
                    "name": "total",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/Totals",
                    "customType": "Totals",
                    "schema": [
                      {
                        "name": "pre_discount",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "discount",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "charge",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "shipping",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/Totals",
                    "customType": "Totals",
                    "schema": [
                      {
                        "name": "pre_discount",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "discount",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "charge",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "sub_total",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/Totals",
                    "customType": "Totals",
                    "schema": [
                      {
                        "name": "pre_discount",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "discount",
                        "kind": "optional",
                        "type": "object",
                        "nullable": true,
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "charge",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "net",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "gross",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "tax",
                            "kind": "optional",
                            "type": "object",
                            "description": "",
                            "modelRef": "#/components/schemas/Amount",
                            "customType": "Amount",
                            "schema": [
                              {
                                "name": "amount",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "currency_code",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "apportioned_tax_rate",
                            "kind": "optional",
                            "type": "number<float>",
                            "description": "",
                            "format": "float"
                          },
                          {
                            "name": "currency",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                "name": "customer_addresses",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "uuid",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "first_name",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "last_name",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "company",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "description",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "address_line_1",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "address_line_2",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "city",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "postal_code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "country_code",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "region_code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "phone",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "external_id",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  }
                ]
              },
              {
                "name": "shipping_rate_handle",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": ""
              },
              {
                "name": "payment_method",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": ""
              },
              {
                "name": "validation_errors",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/CartValidationErrors",
                "customType": "CartValidationErrors",
                "schema": []
              },
              {
                "name": "customer_reference",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": ""
              },
              {
                "name": "po_number",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": ""
              },
              {
                "name": "shipping_requested_date",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": ""
              },
              {
                "name": "custom_fields",
                "kind": "optional",
                "type": "array",
                "description": "The cart's current custom fields.",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "string",
                    "description": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Cart",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Cart not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "422",
        "description": "Unprocessable Entity",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "complexItems": [
              {
                "name": "object",
                "schema": [],
                "modelRef": "#/components/schemas/responses-CartErrorResponse",
                "customType": "responses-CartErrorResponse"
              },
              {
                "name": "object",
                "schema": [],
                "modelRef": "#/components/schemas/Default",
                "customType": "Default"
              }
            ],
            "complexType": "oneOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get a Discount
[path] Untitled/Core API Docs/Discounts/

{
  "id": "Kid_tdMnp0FgKmaKLekjx",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.sparklayer.io/api/v1/discounts/{id}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/discounts/{id}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/discounts/{id}",
        "description": "Test"
      }
    ],
    "name": "Get a Discount",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Discount",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "description": "<p>Discount ID (uuid)</p>",
                "example": "942651af-f950-4716-9916-16170fe0645f",
                "format": "uuid"
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "deleted_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "nullable": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "A user friendly name for the discount",
                "maxLength": 256
              },
              {
                "name": "internal_name",
                "kind": "required",
                "type": "string",
                "description": "",
                "maxLength": 45
              },
              {
                "name": "internal_slug",
                "kind": "required",
                "type": "string",
                "description": "",
                "maxLength": 45
              },
              {
                "name": "template",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p>Discount template type. If not null allowed values are - 'order_level_get_amount_off', 'order_level_get_free_product', 'product_level_get_amount_off', 'order_level_get_shipping_reward', 'advanced_order_level_get_amount_off', 'order_level_requirement_amount_off', 'advanced_discount', 'advanced_free_products'</p>"
              },
              {
                "name": "calculation_group",
                "kind": "required",
                "type": "number",
                "description": "<p>Dependency level = Calculation Group. All discounts with the same dependency level will share the same base, pre-discount totals. E.g. discount A (50% off) and discount B (50% off) will reward 100% off - not 75% off.</p>",
                "minimum": 0,
                "maximum": 127
              },
              {
                "name": "priority",
                "kind": "required",
                "type": "number",
                "description": "<p>The sequence to apply the discounts (within each discount 'dependency level')</p>",
                "minimum": 0,
                "maximum": 10000
              },
              {
                "name": "times_applicable_per_order",
                "kind": "required",
                "type": "number",
                "description": "<p>Per order application limits. If -1 allow unlimited applications, otherwise limited</p>",
                "minimum": -1,
                "maximum": 127
              },
              {
                "name": "max_rewards",
                "kind": "optional",
                "type": "number",
                "nullable": true,
                "description": "Used when rewardSelectionType is cheapest or expensive to determine the number of rewards available",
                "default": 1,
                "minimum": 1,
                "maximum": 127
              },
              {
                "name": "groups",
                "kind": "required",
                "type": "array",
                "description": "<p>Customer groups covered by this discount (use default to cover all groups)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "excluded_customers",
                "kind": "optional",
                "type": "array",
                "description": "Array of email address or accounting ids of customers to exclude from the discount",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "customer@b2b.com",
                "itemDefault": ""
              },
              {
                "name": "simultaneity",
                "kind": "optional",
                "type": "array",
                "nullable": true,
                "description": "<p>Other discounts which can be applied simultaneous, if null no limitation</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "requirement_selection_type",
                "kind": "required",
                "type": "string<any | all>",
                "description": "Products which must be in the cart must match all or any one of the combo groups",
                "enum": [
                  "any",
                  "all"
                ]
              },
              {
                "name": "reward_selection_type",
                "kind": "required",
                "type": "string<all | cheapest | expensive>",
                "description": "",
                "enum": [
                  "all",
                  "cheapest",
                  "expensive"
                ]
              },
              {
                "name": "currency_code",
                "kind": "required",
                "type": "string",
                "nullable": true,
                "description": "",
                "example": "gbp",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "start_date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "Start Date",
                "format": "date-time"
              },
              {
                "name": "end_date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "End Date",
                "format": "date-time"
              },
              {
                "name": "active",
                "kind": "required",
                "type": "boolean",
                "description": ""
              },
              {
                "name": "requirements",
                "kind": "required",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.Requirement",
                "customType": "Discount.Requirement[]",
                "schema": [
                  {
                    "name": "items",
                    "kind": "required",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "restrictions",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<productSKU | excludeProductSKU | productSKUContains | excludeProductSKUContains | productMetadata | excludeProductMetadata>",
                            "description": "",
                            "enum": [
                              "productSKU",
                              "excludeProductSKU",
                              "productSKUContains",
                              "excludeProductSKUContains",
                              "productMetadata",
                              "excludeProductMetadata"
                            ]
                          },
                          {
                            "name": "ref",
                            "kind": "required",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "metadata_namespace",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "erp",
                            "maxLength": 256
                          },
                          {
                            "name": "metadata_key",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "vendor",
                            "maxLength": 128
                          }
                        ]
                      },
                      {
                        "name": "points_type",
                        "kind": "required",
                        "type": "string<line | item>",
                        "description": "<p>Add X point(s) for each matching product OR Add X point(s) for once only</p>",
                        "enum": [
                          "line",
                          "item"
                        ]
                      },
                      {
                        "name": "points",
                        "kind": "required",
                        "type": "integer",
                        "description": "",
                        "default": 1
                      },
                      {
                        "name": "quantity",
                        "kind": "required",
                        "type": "integer",
                        "description": ""
                      },
                      {
                        "name": "selection_type",
                        "kind": "required",
                        "type": "string<minimum | exact>",
                        "description": "<p>At least X quantity of product(s) must match OR Exactly X quantity of product(s)</p>",
                        "enum": [
                          "minimum",
                          "exact"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "max_rewards",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "Limit the number of rewards when this requirement applies"
                  },
                  {
                    "name": "min_spend",
                    "kind": "required",
                    "type": "number",
                    "nullable": true,
                    "description": "<p>The cart must contain between min_spend and max_spend based on spend_tax_type of the requirement.</p>"
                  },
                  {
                    "name": "max_spend",
                    "kind": "required",
                    "type": "number",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "spend_tax_type",
                    "kind": "required",
                    "type": "string<net>",
                    "description": "",
                    "enum": [
                      "net"
                    ]
                  },
                  {
                    "name": "selection_type",
                    "kind": "required",
                    "type": "string<minimum | all>",
                    "description": "<p>Apply only if 'all' items matched in the cart OR if cart worth minimum of min_points requirement items(s) using requirements</p>",
                    "enum": [
                      "minimum",
                      "all"
                    ]
                  },
                  {
                    "name": "min_points",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "<p>Only applies when selection_type is minimum</p>"
                  }
                ]
              },
              {
                "name": "rewards",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.Reward",
                "customType": "Discount.Reward[]",
                "schema": [
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string<requirements|all | requirements|cheapest | cart|productSKU | cart|cheapestProductSKU | cart|productMetadata | cart|cheapestProductMetadata | product | shipping | order>",
                    "description": "",
                    "enum": [
                      "requirements|all",
                      "requirements|cheapest",
                      "cart|productSKU",
                      "cart|cheapestProductSKU",
                      "cart|productMetadata",
                      "cart|cheapestProductMetadata",
                      "product",
                      "shipping",
                      "order"
                    ]
                  },
                  {
                    "name": "amount_type",
                    "kind": "required",
                    "type": "string<percent | percentPreDiscount | priceAllGross | priceAllNet | priceLineGross | priceLineNet | fixedAllGross | fixedAllNet | fixedLineGross | fixedLineNet | none>",
                    "description": "",
                    "enum": [
                      "percent",
                      "percentPreDiscount",
                      "priceAllGross",
                      "priceAllNet",
                      "priceLineGross",
                      "priceLineNet",
                      "fixedAllGross",
                      "fixedAllNet",
                      "fixedLineGross",
                      "fixedLineNet",
                      "none"
                    ]
                  },
                  {
                    "name": "restriction_type",
                    "kind": "optional",
                    "type": "string<equals | notEquals | contains | notContains>",
                    "description": "",
                    "enum": [
                      "equals",
                      "notEquals",
                      "contains",
                      "notContains"
                    ]
                  },
                  {
                    "name": "item_id",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "maxLength": 100
                  },
                  {
                    "name": "metadata_namespace",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "erp",
                    "maxLength": 256
                  },
                  {
                    "name": "metadata_key",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "vendor",
                    "maxLength": 128
                  },
                  {
                    "name": "amount",
                    "kind": "required",
                    "type": "number",
                    "description": "",
                    "maximum": 1000000000
                  }
                ]
              },
              {
                "name": "other_requirements",
                "kind": "required",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.OtherRequirements.MaxUsesPerCustomer",
                "customType": "Discount.OtherRequirements.MaxUsesPerCustomer[]",
                "schema": [
                  {
                    "name": "requirement_type",
                    "kind": "optional",
                    "type": "string<maxUsesPerCustomer>",
                    "description": "",
                    "enum": [
                      "maxUsesPerCustomer"
                    ]
                  },
                  {
                    "name": "number",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Discount",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Orders
[path] Untitled/Core API Docs/


[title] Core API
[path] /

The Core API can be used for more custom implementations of SparkLayer where additional data is required beyond that available in our standard Pricing API

The SparkLayer Core API has support for the following data elements:

| Area              | Data required                         |
| ----------------- | ------------------------------------- |
| `Products`        | Product and Variant Data              |
| `Stock`           | Product Stock Data                    |
| `Customers`       | Customer information                  |
| `Addresses`       | Customer Addresses                    |
| `Orders`          | Order Data (Deprecated)               |
| `Shipping`        | Shipping pricing and rules            |
| `Stock Locations` | Locations where stock is stored       |
| `Sync Log`        | Logging for data syncing              |
| `Purchasing`      | Storage of orders, quotes & carts     |
| `Orders`          | Create & manage carts, create orders. |

[title] Shipping
[path] Untitled/Core API Docs/


[title] Sync Logging
[path] Untitled/Sync Logging API Docs/


[title] Delete a Shipping Method
[path] Untitled/Core API Docs/Shipping/

{
  "id": "w5s7CRrHJtemY0o88GeNF",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://app.sparklayer.io/api/v1/shipping-methods/{id}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/shipping-methods/{id}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/shipping-methods/{id}",
        "description": "Test"
      }
    ],
    "name": "Delete a Shipping Method",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Empty Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Update sync logs with a full sync
[path] Untitled/Sync Logging API Docs/Sync Logging/

{
  "id": "-i35IqWV5nEDPwtdnMPiZ",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "/api/v1/sync-log/{integration}/{data_type}",
    "servers": [],
    "name": "Update sync logs with a full sync",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "integration",
          "type": "string",
          "example": "shopify",
          "description": ""
        },
        {
          "kind": "required",
          "name": "data_type",
          "type": "string",
          "example": "products",
          "description": "",
          "enum": [
            "products",
            "customers",
            "merchant",
            "purchases",
            "pricing",
            "accountancy"
          ]
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "started_full_sync",
              "kind": "required",
              "type": "string",
              "description": "Started full sync",
              "example": "2023-01-01T01:01:01Z",
              "modelRef": "#/components/schemas/StartedFullSync",
              "customType": "StartedFullSync",
              "schema": []
            },
            {
              "name": "last_full_sync",
              "kind": "optional",
              "type": "string",
              "description": "Last full sync",
              "example": "2023-01-01T01:01:01Z",
              "modelRef": "#/components/schemas/LastFullSync",
              "customType": "LastFullSync",
              "schema": []
            },
            {
              "name": "last_full_sync_succeeded",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>Was the last full sync successful? A successful sync may still have logging errors. A failed full sync may indicate integration configuration issues or timeout.</p>",
              "example": true,
              "modelRef": "#/components/schemas/LastFullSyncSucceeded",
              "customType": "LastFullSyncSucceeded",
              "schema": []
            },
            {
              "name": "errors",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/SyncErrors",
              "customType": "SyncErrors",
              "schema": [
                {
                  "name": "external_id",
                  "kind": "optional",
                  "type": "string",
                  "description": "External ID",
                  "example": "ABC-123",
                  "modelRef": "#/components/schemas/ExternalId",
                  "customType": "ExternalId",
                  "schema": []
                },
                {
                  "name": "external_url",
                  "kind": "optional",
                  "type": "string",
                  "description": "External URL",
                  "example": "https://example.com/products/ABC-123",
                  "minLength": 1,
                  "maxLength": 1024
                },
                {
                  "name": "visible_name",
                  "kind": "optional",
                  "type": "string",
                  "description": "User friendly name",
                  "example": "The ABC 123 Book",
                  "maxLength": 1024
                },
                {
                  "name": "api_response",
                  "kind": "optional",
                  "type": "string",
                  "description": "API response from sync",
                  "example": "Error - Product ABC-123 not found",
                  "minLength": 1,
                  "maxLength": 4294967295
                },
                {
                  "name": "friendly_error",
                  "kind": "optional",
                  "type": "string",
                  "description": "User friendly error",
                  "example": "ABC-123 not found",
                  "minLength": 1,
                  "maxLength": 4294967295
                }
              ]
            }
          ],
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "started_full_sync",
                  "kind": "required",
                  "type": "string",
                  "description": "Started full sync",
                  "example": "2023-01-01T01:01:01Z",
                  "modelRef": "#/components/schemas/StartedFullSync",
                  "customType": "StartedFullSync",
                  "schema": []
                },
                {
                  "name": "last_full_sync",
                  "kind": "optional",
                  "type": "string",
                  "description": "Last full sync",
                  "example": "2023-01-01T01:01:01Z",
                  "modelRef": "#/components/schemas/LastFullSync",
                  "customType": "LastFullSync",
                  "schema": []
                },
                {
                  "name": "last_full_sync_succeeded",
                  "kind": "optional",
                  "type": "boolean",
                  "description": "<p>Was the last full sync successful? A successful sync may still have logging errors. A failed full sync may indicate integration configuration issues or timeout.</p>",
                  "example": true,
                  "modelRef": "#/components/schemas/LastFullSyncSucceeded",
                  "customType": "LastFullSyncSucceeded",
                  "schema": []
                },
                {
                  "name": "errors",
                  "kind": "optional",
                  "type": "array",
                  "description": "",
                  "modelRef": "#/components/schemas/SyncErrors",
                  "customType": "SyncErrors",
                  "schema": [
                    {
                      "name": "external_id",
                      "kind": "optional",
                      "type": "string",
                      "description": "External ID",
                      "example": "ABC-123",
                      "modelRef": "#/components/schemas/ExternalId",
                      "customType": "ExternalId",
                      "schema": []
                    },
                    {
                      "name": "external_url",
                      "kind": "optional",
                      "type": "string",
                      "description": "External URL",
                      "example": "https://example.com/products/ABC-123",
                      "minLength": 1,
                      "maxLength": 1024
                    },
                    {
                      "name": "visible_name",
                      "kind": "optional",
                      "type": "string",
                      "description": "User friendly name",
                      "example": "The ABC 123 Book",
                      "maxLength": 1024
                    },
                    {
                      "name": "api_response",
                      "kind": "optional",
                      "type": "string",
                      "description": "API response from sync",
                      "example": "Error - Product ABC-123 not found",
                      "minLength": 1,
                      "maxLength": 4294967295
                    },
                    {
                      "name": "friendly_error",
                      "kind": "optional",
                      "type": "string",
                      "description": "User friendly error",
                      "example": "ABC-123 not found",
                      "minLength": 1,
                      "maxLength": 4294967295
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/PutSyncLog",
              "customType": "PutSyncLog"
            },
            {
              "name": "object",
              "schema": []
            }
          ],
          "complexType": "allOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Batch delete stock levels for the provided SKUs
[path] Untitled/Stock API Docs/Stock Levels - Bulk operations/

{
  "id": "uPWQkMfP_6MT0v4PbE2Qt",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/v1/batch-delete-stock",
    "servers": [],
    "name": "Batch delete stock levels for the provided SKUs",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "SKUs",
          "schema": [
            {
              "name": "skus",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "SKU-1",
              "itemDefault": ""
            }
          ],
          "modelRef": "#/components/schemas/SKUs",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "<p>Success - No Content</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Update discount priorities
[path] Untitled/Core API Docs/Discounts/

{
  "id": "ItPX0xsoWtHw_iTwM3sJo",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://app.sparklayer.io/api/v1/set-discount-priorities",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/set-discount-priorities",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/set-discount-priorities",
        "description": "Test"
      }
    ],
    "name": "Update discount priorities",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "array",
          "description": "",
          "schema": [
            {
              "name": "id",
              "kind": "required",
              "type": "string<uuid>",
              "description": "<p>Discount ID (uuid)</p>",
              "example": "942651af-f950-4716-9916-16170fe0645f",
              "format": "uuid"
            },
            {
              "name": "priority",
              "kind": "required",
              "type": "integer",
              "description": "Discount priority"
            }
          ],
          "itemType": "object",
          "customType": "object[]",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "Discount[]",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "description": "<p>Discount ID (uuid)</p>",
                "example": "942651af-f950-4716-9916-16170fe0645f",
                "format": "uuid"
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "deleted_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "nullable": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "A user friendly name for the discount",
                "maxLength": 256
              },
              {
                "name": "internal_name",
                "kind": "required",
                "type": "string",
                "description": "",
                "maxLength": 45
              },
              {
                "name": "internal_slug",
                "kind": "required",
                "type": "string",
                "description": "",
                "maxLength": 45
              },
              {
                "name": "template",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p>Discount template type. If not null allowed values are - 'order_level_get_amount_off', 'order_level_get_free_product', 'product_level_get_amount_off', 'order_level_get_shipping_reward', 'advanced_order_level_get_amount_off', 'order_level_requirement_amount_off', 'advanced_discount', 'advanced_free_products'</p>"
              },
              {
                "name": "calculation_group",
                "kind": "required",
                "type": "number",
                "description": "<p>Dependency level = Calculation Group. All discounts with the same dependency level will share the same base, pre-discount totals. E.g. discount A (50% off) and discount B (50% off) will reward 100% off - not 75% off.</p>",
                "minimum": 0,
                "maximum": 127
              },
              {
                "name": "priority",
                "kind": "required",
                "type": "number",
                "description": "<p>The sequence to apply the discounts (within each discount 'dependency level')</p>",
                "minimum": 0,
                "maximum": 10000
              },
              {
                "name": "times_applicable_per_order",
                "kind": "required",
                "type": "number",
                "description": "<p>Per order application limits. If -1 allow unlimited applications, otherwise limited</p>",
                "minimum": -1,
                "maximum": 127
              },
              {
                "name": "max_rewards",
                "kind": "optional",
                "type": "number",
                "nullable": true,
                "description": "Used when rewardSelectionType is cheapest or expensive to determine the number of rewards available",
                "default": 1,
                "minimum": 1,
                "maximum": 127
              },
              {
                "name": "groups",
                "kind": "required",
                "type": "array",
                "description": "<p>Customer groups covered by this discount (use default to cover all groups)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "excluded_customers",
                "kind": "optional",
                "type": "array",
                "description": "Array of email address or accounting ids of customers to exclude from the discount",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "customer@b2b.com",
                "itemDefault": ""
              },
              {
                "name": "simultaneity",
                "kind": "optional",
                "type": "array",
                "nullable": true,
                "description": "<p>Other discounts which can be applied simultaneous, if null no limitation</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "requirement_selection_type",
                "kind": "required",
                "type": "string<any | all>",
                "description": "Products which must be in the cart must match all or any one of the combo groups",
                "enum": [
                  "any",
                  "all"
                ]
              },
              {
                "name": "reward_selection_type",
                "kind": "required",
                "type": "string<all | cheapest | expensive>",
                "description": "",
                "enum": [
                  "all",
                  "cheapest",
                  "expensive"
                ]
              },
              {
                "name": "currency_code",
                "kind": "required",
                "type": "string",
                "nullable": true,
                "description": "",
                "example": "gbp",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "start_date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "Start Date",
                "format": "date-time"
              },
              {
                "name": "end_date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "End Date",
                "format": "date-time"
              },
              {
                "name": "active",
                "kind": "required",
                "type": "boolean",
                "description": ""
              },
              {
                "name": "requirements",
                "kind": "required",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.Requirement",
                "customType": "Discount.Requirement[]",
                "schema": [
                  {
                    "name": "items",
                    "kind": "required",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "restrictions",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<productSKU | excludeProductSKU | productSKUContains | excludeProductSKUContains | productMetadata | excludeProductMetadata>",
                            "description": "",
                            "enum": [
                              "productSKU",
                              "excludeProductSKU",
                              "productSKUContains",
                              "excludeProductSKUContains",
                              "productMetadata",
                              "excludeProductMetadata"
                            ]
                          },
                          {
                            "name": "ref",
                            "kind": "required",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "metadata_namespace",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "erp",
                            "maxLength": 256
                          },
                          {
                            "name": "metadata_key",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "vendor",
                            "maxLength": 128
                          }
                        ]
                      },
                      {
                        "name": "points_type",
                        "kind": "required",
                        "type": "string<line | item>",
                        "description": "<p>Add X point(s) for each matching product OR Add X point(s) for once only</p>",
                        "enum": [
                          "line",
                          "item"
                        ]
                      },
                      {
                        "name": "points",
                        "kind": "required",
                        "type": "integer",
                        "description": "",
                        "default": 1
                      },
                      {
                        "name": "quantity",
                        "kind": "required",
                        "type": "integer",
                        "description": ""
                      },
                      {
                        "name": "selection_type",
                        "kind": "required",
                        "type": "string<minimum | exact>",
                        "description": "<p>At least X quantity of product(s) must match OR Exactly X quantity of product(s)</p>",
                        "enum": [
                          "minimum",
                          "exact"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "max_rewards",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "Limit the number of rewards when this requirement applies"
                  },
                  {
                    "name": "min_spend",
                    "kind": "required",
                    "type": "number",
                    "nullable": true,
                    "description": "<p>The cart must contain between min_spend and max_spend based on spend_tax_type of the requirement.</p>"
                  },
                  {
                    "name": "max_spend",
                    "kind": "required",
                    "type": "number",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "spend_tax_type",
                    "kind": "required",
                    "type": "string<net>",
                    "description": "",
                    "enum": [
                      "net"
                    ]
                  },
                  {
                    "name": "selection_type",
                    "kind": "required",
                    "type": "string<minimum | all>",
                    "description": "<p>Apply only if 'all' items matched in the cart OR if cart worth minimum of min_points requirement items(s) using requirements</p>",
                    "enum": [
                      "minimum",
                      "all"
                    ]
                  },
                  {
                    "name": "min_points",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "<p>Only applies when selection_type is minimum</p>"
                  }
                ]
              },
              {
                "name": "rewards",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.Reward",
                "customType": "Discount.Reward[]",
                "schema": [
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string<requirements|all | requirements|cheapest | cart|productSKU | cart|cheapestProductSKU | cart|productMetadata | cart|cheapestProductMetadata | product | shipping | order>",
                    "description": "",
                    "enum": [
                      "requirements|all",
                      "requirements|cheapest",
                      "cart|productSKU",
                      "cart|cheapestProductSKU",
                      "cart|productMetadata",
                      "cart|cheapestProductMetadata",
                      "product",
                      "shipping",
                      "order"
                    ]
                  },
                  {
                    "name": "amount_type",
                    "kind": "required",
                    "type": "string<percent | percentPreDiscount | priceAllGross | priceAllNet | priceLineGross | priceLineNet | fixedAllGross | fixedAllNet | fixedLineGross | fixedLineNet | none>",
                    "description": "",
                    "enum": [
                      "percent",
                      "percentPreDiscount",
                      "priceAllGross",
                      "priceAllNet",
                      "priceLineGross",
                      "priceLineNet",
                      "fixedAllGross",
                      "fixedAllNet",
                      "fixedLineGross",
                      "fixedLineNet",
                      "none"
                    ]
                  },
                  {
                    "name": "restriction_type",
                    "kind": "optional",
                    "type": "string<equals | notEquals | contains | notContains>",
                    "description": "",
                    "enum": [
                      "equals",
                      "notEquals",
                      "contains",
                      "notContains"
                    ]
                  },
                  {
                    "name": "item_id",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "maxLength": 100
                  },
                  {
                    "name": "metadata_namespace",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "erp",
                    "maxLength": 256
                  },
                  {
                    "name": "metadata_key",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "vendor",
                    "maxLength": 128
                  },
                  {
                    "name": "amount",
                    "kind": "required",
                    "type": "number",
                    "description": "",
                    "maximum": 1000000000
                  }
                ]
              },
              {
                "name": "other_requirements",
                "kind": "required",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.OtherRequirements.MaxUsesPerCustomer",
                "customType": "Discount.OtherRequirements.MaxUsesPerCustomer[]",
                "schema": [
                  {
                    "name": "requirement_type",
                    "kind": "optional",
                    "type": "string<maxUsesPerCustomer>",
                    "description": "",
                    "enum": [
                      "maxUsesPerCustomer"
                    ]
                  },
                  {
                    "name": "number",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Discount",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Create a Discount
[path] Untitled/Core API Docs/Discounts/

{
  "id": "5EKACt_6w9CL3W82FIgpe",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.sparklayer.io/api/v1/discounts",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/discounts",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/discounts",
        "description": "Test"
      }
    ],
    "name": "Create a Discount",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "string<uuid>",
              "readOnly": true,
              "description": "<p>Discount ID (uuid)</p>",
              "example": "942651af-f950-4716-9916-16170fe0645f",
              "format": "uuid"
            },
            {
              "name": "created_at",
              "kind": "optional",
              "type": "string<date-time>",
              "readOnly": true,
              "description": "",
              "format": "date-time"
            },
            {
              "name": "deleted_at",
              "kind": "optional",
              "type": "string<date-time>",
              "readOnly": true,
              "nullable": true,
              "description": "",
              "format": "date-time"
            },
            {
              "name": "updated_at",
              "kind": "optional",
              "type": "string<date-time>",
              "readOnly": true,
              "description": "",
              "format": "date-time"
            },
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "description": "A user friendly name for the discount",
              "maxLength": 256
            },
            {
              "name": "internal_name",
              "kind": "required",
              "type": "string",
              "description": "",
              "maxLength": 45
            },
            {
              "name": "internal_slug",
              "kind": "required",
              "type": "string",
              "description": "",
              "maxLength": 45
            },
            {
              "name": "template",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "<p>Discount template type. If not null allowed values are - 'order_level_get_amount_off', 'order_level_get_free_product', 'product_level_get_amount_off', 'order_level_get_shipping_reward', 'advanced_order_level_get_amount_off', 'order_level_requirement_amount_off', 'advanced_discount', 'advanced_free_products'</p>"
            },
            {
              "name": "calculation_group",
              "kind": "required",
              "type": "number",
              "description": "<p>Dependency level = Calculation Group. All discounts with the same dependency level will share the same base, pre-discount totals. E.g. discount A (50% off) and discount B (50% off) will reward 100% off - not 75% off.</p>",
              "minimum": 0,
              "maximum": 127
            },
            {
              "name": "priority",
              "kind": "required",
              "type": "number",
              "description": "<p>The sequence to apply the discounts (within each discount 'dependency level')</p>",
              "minimum": 0,
              "maximum": 10000
            },
            {
              "name": "times_applicable_per_order",
              "kind": "required",
              "type": "number",
              "description": "<p>Per order application limits. If -1 allow unlimited applications, otherwise limited</p>",
              "minimum": -1,
              "maximum": 127
            },
            {
              "name": "max_rewards",
              "kind": "optional",
              "type": "number",
              "nullable": true,
              "description": "Used when rewardSelectionType is cheapest or expensive to determine the number of rewards available",
              "default": 1,
              "minimum": 1,
              "maximum": 127
            },
            {
              "name": "groups",
              "kind": "required",
              "type": "array",
              "description": "<p>Customer groups covered by this discount (use default to cover all groups)</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "default",
              "itemDefault": ""
            },
            {
              "name": "excluded_customers",
              "kind": "optional",
              "type": "array",
              "description": "Array of email address or accounting ids of customers to exclude from the discount",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "customer@b2b.com",
              "itemDefault": ""
            },
            {
              "name": "simultaneity",
              "kind": "optional",
              "type": "array",
              "nullable": true,
              "description": "<p>Other discounts which can be applied simultaneous, if null no limitation</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "default",
              "itemDefault": ""
            },
            {
              "name": "requirement_selection_type",
              "kind": "required",
              "type": "string<any | all>",
              "description": "Products which must be in the cart must match all or any one of the combo groups",
              "enum": [
                "any",
                "all"
              ]
            },
            {
              "name": "reward_selection_type",
              "kind": "required",
              "type": "string<all | cheapest | expensive>",
              "description": "",
              "enum": [
                "all",
                "cheapest",
                "expensive"
              ]
            },
            {
              "name": "currency_code",
              "kind": "required",
              "type": "string",
              "nullable": true,
              "description": "",
              "example": "gbp",
              "minLength": 3,
              "maxLength": 3
            },
            {
              "name": "start_date",
              "kind": "required",
              "type": "string<date-time>",
              "nullable": true,
              "description": "Start Date",
              "format": "date-time"
            },
            {
              "name": "end_date",
              "kind": "required",
              "type": "string<date-time>",
              "nullable": true,
              "description": "End Date",
              "format": "date-time"
            },
            {
              "name": "active",
              "kind": "required",
              "type": "boolean",
              "description": ""
            },
            {
              "name": "requirements",
              "kind": "required",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/Discount.Requirement",
              "customType": "Discount.Requirement[]",
              "schema": [
                {
                  "name": "items",
                  "kind": "required",
                  "type": "array",
                  "description": "",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "restrictions",
                      "kind": "required",
                      "type": "array",
                      "description": "",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "type",
                          "kind": "required",
                          "type": "string<productSKU | excludeProductSKU | productSKUContains | excludeProductSKUContains | productMetadata | excludeProductMetadata>",
                          "description": "",
                          "enum": [
                            "productSKU",
                            "excludeProductSKU",
                            "productSKUContains",
                            "excludeProductSKUContains",
                            "productMetadata",
                            "excludeProductMetadata"
                          ]
                        },
                        {
                          "name": "ref",
                          "kind": "required",
                          "type": "string",
                          "description": ""
                        },
                        {
                          "name": "metadata_namespace",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "erp",
                          "maxLength": 256
                        },
                        {
                          "name": "metadata_key",
                          "kind": "optional",
                          "type": "string",
                          "nullable": true,
                          "description": "",
                          "example": "vendor",
                          "maxLength": 128
                        }
                      ]
                    },
                    {
                      "name": "points_type",
                      "kind": "required",
                      "type": "string<line | item>",
                      "description": "<p>Add X point(s) for each matching product OR Add X point(s) for once only</p>",
                      "enum": [
                        "line",
                        "item"
                      ]
                    },
                    {
                      "name": "points",
                      "kind": "required",
                      "type": "integer",
                      "description": "",
                      "default": 1
                    },
                    {
                      "name": "quantity",
                      "kind": "required",
                      "type": "integer",
                      "description": ""
                    },
                    {
                      "name": "selection_type",
                      "kind": "required",
                      "type": "string<minimum | exact>",
                      "description": "<p>At least X quantity of product(s) must match OR Exactly X quantity of product(s)</p>",
                      "enum": [
                        "minimum",
                        "exact"
                      ]
                    }
                  ]
                },
                {
                  "name": "max_rewards",
                  "kind": "required",
                  "type": "integer",
                  "nullable": true,
                  "description": "Limit the number of rewards when this requirement applies"
                },
                {
                  "name": "min_spend",
                  "kind": "required",
                  "type": "number",
                  "nullable": true,
                  "description": "<p>The cart must contain between min_spend and max_spend based on spend_tax_type of the requirement.</p>"
                },
                {
                  "name": "max_spend",
                  "kind": "required",
                  "type": "number",
                  "nullable": true,
                  "description": ""
                },
                {
                  "name": "spend_tax_type",
                  "kind": "required",
                  "type": "string<net>",
                  "description": "",
                  "enum": [
                    "net"
                  ]
                },
                {
                  "name": "selection_type",
                  "kind": "required",
                  "type": "string<minimum | all>",
                  "description": "<p>Apply only if 'all' items matched in the cart OR if cart worth minimum of min_points requirement items(s) using requirements</p>",
                  "enum": [
                    "minimum",
                    "all"
                  ]
                },
                {
                  "name": "min_points",
                  "kind": "required",
                  "type": "integer",
                  "nullable": true,
                  "description": "<p>Only applies when selection_type is minimum</p>"
                }
              ]
            },
            {
              "name": "rewards",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/Discount.Reward",
              "customType": "Discount.Reward[]",
              "schema": [
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string<requirements|all | requirements|cheapest | cart|productSKU | cart|cheapestProductSKU | cart|productMetadata | cart|cheapestProductMetadata | product | shipping | order>",
                  "description": "",
                  "enum": [
                    "requirements|all",
                    "requirements|cheapest",
                    "cart|productSKU",
                    "cart|cheapestProductSKU",
                    "cart|productMetadata",
                    "cart|cheapestProductMetadata",
                    "product",
                    "shipping",
                    "order"
                  ]
                },
                {
                  "name": "amount_type",
                  "kind": "required",
                  "type": "string<percent | percentPreDiscount | priceAllGross | priceAllNet | priceLineGross | priceLineNet | fixedAllGross | fixedAllNet | fixedLineGross | fixedLineNet | none>",
                  "description": "",
                  "enum": [
                    "percent",
                    "percentPreDiscount",
                    "priceAllGross",
                    "priceAllNet",
                    "priceLineGross",
                    "priceLineNet",
                    "fixedAllGross",
                    "fixedAllNet",
                    "fixedLineGross",
                    "fixedLineNet",
                    "none"
                  ]
                },
                {
                  "name": "restriction_type",
                  "kind": "optional",
                  "type": "string<equals | notEquals | contains | notContains>",
                  "description": "",
                  "enum": [
                    "equals",
                    "notEquals",
                    "contains",
                    "notContains"
                  ]
                },
                {
                  "name": "item_id",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "maxLength": 100
                },
                {
                  "name": "metadata_namespace",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "erp",
                  "maxLength": 256
                },
                {
                  "name": "metadata_key",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "vendor",
                  "maxLength": 128
                },
                {
                  "name": "amount",
                  "kind": "required",
                  "type": "number",
                  "description": "",
                  "maximum": 1000000000
                }
              ]
            },
            {
              "name": "other_requirements",
              "kind": "required",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/Discount.OtherRequirements.MaxUsesPerCustomer",
              "customType": "Discount.OtherRequirements.MaxUsesPerCustomer[]",
              "schema": [
                {
                  "name": "requirement_type",
                  "kind": "optional",
                  "type": "string<maxUsesPerCustomer>",
                  "description": "",
                  "enum": [
                    "maxUsesPerCustomer"
                  ]
                },
                {
                  "name": "number",
                  "kind": "optional",
                  "type": "number",
                  "description": ""
                }
              ]
            }
          ],
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "string<uuid>",
                  "readOnly": true,
                  "description": "<p>Discount ID (uuid)</p>",
                  "example": "942651af-f950-4716-9916-16170fe0645f",
                  "format": "uuid"
                },
                {
                  "name": "created_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "readOnly": true,
                  "description": "",
                  "format": "date-time"
                },
                {
                  "name": "deleted_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "readOnly": true,
                  "nullable": true,
                  "description": "",
                  "format": "date-time"
                },
                {
                  "name": "updated_at",
                  "kind": "optional",
                  "type": "string<date-time>",
                  "readOnly": true,
                  "description": "",
                  "format": "date-time"
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "description": "A user friendly name for the discount",
                  "maxLength": 256
                },
                {
                  "name": "internal_name",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "maxLength": 45
                },
                {
                  "name": "internal_slug",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "maxLength": 45
                },
                {
                  "name": "template",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": "<p>Discount template type. If not null allowed values are - 'order_level_get_amount_off', 'order_level_get_free_product', 'product_level_get_amount_off', 'order_level_get_shipping_reward', 'advanced_order_level_get_amount_off', 'order_level_requirement_amount_off', 'advanced_discount', 'advanced_free_products'</p>"
                },
                {
                  "name": "calculation_group",
                  "kind": "required",
                  "type": "number",
                  "description": "<p>Dependency level = Calculation Group. All discounts with the same dependency level will share the same base, pre-discount totals. E.g. discount A (50% off) and discount B (50% off) will reward 100% off - not 75% off.</p>",
                  "minimum": 0,
                  "maximum": 127
                },
                {
                  "name": "priority",
                  "kind": "required",
                  "type": "number",
                  "description": "<p>The sequence to apply the discounts (within each discount 'dependency level')</p>",
                  "minimum": 0,
                  "maximum": 10000
                },
                {
                  "name": "times_applicable_per_order",
                  "kind": "required",
                  "type": "number",
                  "description": "<p>Per order application limits. If -1 allow unlimited applications, otherwise limited</p>",
                  "minimum": -1,
                  "maximum": 127
                },
                {
                  "name": "max_rewards",
                  "kind": "optional",
                  "type": "number",
                  "nullable": true,
                  "description": "Used when rewardSelectionType is cheapest or expensive to determine the number of rewards available",
                  "default": 1,
                  "minimum": 1,
                  "maximum": 127
                },
                {
                  "name": "groups",
                  "kind": "required",
                  "type": "array",
                  "description": "<p>Customer groups covered by this discount (use default to cover all groups)</p>",
                  "example": "",
                  "itemType": "string",
                  "customType": "string[]",
                  "itemExample": "default",
                  "itemDefault": ""
                },
                {
                  "name": "excluded_customers",
                  "kind": "optional",
                  "type": "array",
                  "description": "Array of email address or accounting ids of customers to exclude from the discount",
                  "example": "",
                  "itemType": "string",
                  "customType": "string[]",
                  "itemExample": "customer@b2b.com",
                  "itemDefault": ""
                },
                {
                  "name": "simultaneity",
                  "kind": "optional",
                  "type": "array",
                  "nullable": true,
                  "description": "<p>Other discounts which can be applied simultaneous, if null no limitation</p>",
                  "example": "",
                  "itemType": "string",
                  "customType": "string[]",
                  "itemExample": "default",
                  "itemDefault": ""
                },
                {
                  "name": "requirement_selection_type",
                  "kind": "required",
                  "type": "string<any | all>",
                  "description": "Products which must be in the cart must match all or any one of the combo groups",
                  "enum": [
                    "any",
                    "all"
                  ]
                },
                {
                  "name": "reward_selection_type",
                  "kind": "required",
                  "type": "string<all | cheapest | expensive>",
                  "description": "",
                  "enum": [
                    "all",
                    "cheapest",
                    "expensive"
                  ]
                },
                {
                  "name": "currency_code",
                  "kind": "required",
                  "type": "string",
                  "nullable": true,
                  "description": "",
                  "example": "gbp",
                  "minLength": 3,
                  "maxLength": 3
                },
                {
                  "name": "start_date",
                  "kind": "required",
                  "type": "string<date-time>",
                  "nullable": true,
                  "description": "Start Date",
                  "format": "date-time"
                },
                {
                  "name": "end_date",
                  "kind": "required",
                  "type": "string<date-time>",
                  "nullable": true,
                  "description": "End Date",
                  "format": "date-time"
                },
                {
                  "name": "active",
                  "kind": "required",
                  "type": "boolean",
                  "description": ""
                },
                {
                  "name": "requirements",
                  "kind": "required",
                  "type": "array",
                  "description": "",
                  "modelRef": "#/components/schemas/Discount.Requirement",
                  "customType": "Discount.Requirement[]",
                  "schema": [
                    {
                      "name": "items",
                      "kind": "required",
                      "type": "array",
                      "description": "",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "restrictions",
                          "kind": "required",
                          "type": "array",
                          "description": "",
                          "example": "",
                          "itemType": "object",
                          "customType": "object[]",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "required",
                              "type": "string<productSKU | excludeProductSKU | productSKUContains | excludeProductSKUContains | productMetadata | excludeProductMetadata>",
                              "description": "",
                              "enum": [
                                "productSKU",
                                "excludeProductSKU",
                                "productSKUContains",
                                "excludeProductSKUContains",
                                "productMetadata",
                                "excludeProductMetadata"
                              ]
                            },
                            {
                              "name": "ref",
                              "kind": "required",
                              "type": "string",
                              "description": ""
                            },
                            {
                              "name": "metadata_namespace",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "erp",
                              "maxLength": 256
                            },
                            {
                              "name": "metadata_key",
                              "kind": "optional",
                              "type": "string",
                              "nullable": true,
                              "description": "",
                              "example": "vendor",
                              "maxLength": 128
                            }
                          ]
                        },
                        {
                          "name": "points_type",
                          "kind": "required",
                          "type": "string<line | item>",
                          "description": "<p>Add X point(s) for each matching product OR Add X point(s) for once only</p>",
                          "enum": [
                            "line",
                            "item"
                          ]
                        },
                        {
                          "name": "points",
                          "kind": "required",
                          "type": "integer",
                          "description": "",
                          "default": 1
                        },
                        {
                          "name": "quantity",
                          "kind": "required",
                          "type": "integer",
                          "description": ""
                        },
                        {
                          "name": "selection_type",
                          "kind": "required",
                          "type": "string<minimum | exact>",
                          "description": "<p>At least X quantity of product(s) must match OR Exactly X quantity of product(s)</p>",
                          "enum": [
                            "minimum",
                            "exact"
                          ]
                        }
                      ]
                    },
                    {
                      "name": "max_rewards",
                      "kind": "required",
                      "type": "integer",
                      "nullable": true,
                      "description": "Limit the number of rewards when this requirement applies"
                    },
                    {
                      "name": "min_spend",
                      "kind": "required",
                      "type": "number",
                      "nullable": true,
                      "description": "<p>The cart must contain between min_spend and max_spend based on spend_tax_type of the requirement.</p>"
                    },
                    {
                      "name": "max_spend",
                      "kind": "required",
                      "type": "number",
                      "nullable": true,
                      "description": ""
                    },
                    {
                      "name": "spend_tax_type",
                      "kind": "required",
                      "type": "string<net>",
                      "description": "",
                      "enum": [
                        "net"
                      ]
                    },
                    {
                      "name": "selection_type",
                      "kind": "required",
                      "type": "string<minimum | all>",
                      "description": "<p>Apply only if 'all' items matched in the cart OR if cart worth minimum of min_points requirement items(s) using requirements</p>",
                      "enum": [
                        "minimum",
                        "all"
                      ]
                    },
                    {
                      "name": "min_points",
                      "kind": "required",
                      "type": "integer",
                      "nullable": true,
                      "description": "<p>Only applies when selection_type is minimum</p>"
                    }
                  ]
                },
                {
                  "name": "rewards",
                  "kind": "optional",
                  "type": "array",
                  "description": "",
                  "modelRef": "#/components/schemas/Discount.Reward",
                  "customType": "Discount.Reward[]",
                  "schema": [
                    {
                      "name": "type",
                      "kind": "required",
                      "type": "string<requirements|all | requirements|cheapest | cart|productSKU | cart|cheapestProductSKU | cart|productMetadata | cart|cheapestProductMetadata | product | shipping | order>",
                      "description": "",
                      "enum": [
                        "requirements|all",
                        "requirements|cheapest",
                        "cart|productSKU",
                        "cart|cheapestProductSKU",
                        "cart|productMetadata",
                        "cart|cheapestProductMetadata",
                        "product",
                        "shipping",
                        "order"
                      ]
                    },
                    {
                      "name": "amount_type",
                      "kind": "required",
                      "type": "string<percent | percentPreDiscount | priceAllGross | priceAllNet | priceLineGross | priceLineNet | fixedAllGross | fixedAllNet | fixedLineGross | fixedLineNet | none>",
                      "description": "",
                      "enum": [
                        "percent",
                        "percentPreDiscount",
                        "priceAllGross",
                        "priceAllNet",
                        "priceLineGross",
                        "priceLineNet",
                        "fixedAllGross",
                        "fixedAllNet",
                        "fixedLineGross",
                        "fixedLineNet",
                        "none"
                      ]
                    },
                    {
                      "name": "restriction_type",
                      "kind": "optional",
                      "type": "string<equals | notEquals | contains | notContains>",
                      "description": "",
                      "enum": [
                        "equals",
                        "notEquals",
                        "contains",
                        "notContains"
                      ]
                    },
                    {
                      "name": "item_id",
                      "kind": "required",
                      "type": "string",
                      "description": "",
                      "maxLength": 100
                    },
                    {
                      "name": "metadata_namespace",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "",
                      "example": "erp",
                      "maxLength": 256
                    },
                    {
                      "name": "metadata_key",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": "",
                      "example": "vendor",
                      "maxLength": 128
                    },
                    {
                      "name": "amount",
                      "kind": "required",
                      "type": "number",
                      "description": "",
                      "maximum": 1000000000
                    }
                  ]
                },
                {
                  "name": "other_requirements",
                  "kind": "required",
                  "type": "array",
                  "description": "",
                  "modelRef": "#/components/schemas/Discount.OtherRequirements.MaxUsesPerCustomer",
                  "customType": "Discount.OtherRequirements.MaxUsesPerCustomer[]",
                  "schema": [
                    {
                      "name": "requirement_type",
                      "kind": "optional",
                      "type": "string<maxUsesPerCustomer>",
                      "description": "",
                      "enum": [
                        "maxUsesPerCustomer"
                      ]
                    },
                    {
                      "name": "number",
                      "kind": "optional",
                      "type": "number",
                      "description": ""
                    }
                  ]
                }
              ],
              "modelRef": "#/components/schemas/Discount",
              "customType": "Discount"
            }
          ],
          "complexType": "allOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Discount",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "description": "<p>Discount ID (uuid)</p>",
                "example": "942651af-f950-4716-9916-16170fe0645f",
                "format": "uuid"
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "deleted_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "nullable": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "A user friendly name for the discount",
                "maxLength": 256
              },
              {
                "name": "internal_name",
                "kind": "required",
                "type": "string",
                "description": "",
                "maxLength": 45
              },
              {
                "name": "internal_slug",
                "kind": "required",
                "type": "string",
                "description": "",
                "maxLength": 45
              },
              {
                "name": "template",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p>Discount template type. If not null allowed values are - 'order_level_get_amount_off', 'order_level_get_free_product', 'product_level_get_amount_off', 'order_level_get_shipping_reward', 'advanced_order_level_get_amount_off', 'order_level_requirement_amount_off', 'advanced_discount', 'advanced_free_products'</p>"
              },
              {
                "name": "calculation_group",
                "kind": "required",
                "type": "number",
                "description": "<p>Dependency level = Calculation Group. All discounts with the same dependency level will share the same base, pre-discount totals. E.g. discount A (50% off) and discount B (50% off) will reward 100% off - not 75% off.</p>",
                "minimum": 0,
                "maximum": 127
              },
              {
                "name": "priority",
                "kind": "required",
                "type": "number",
                "description": "<p>The sequence to apply the discounts (within each discount 'dependency level')</p>",
                "minimum": 0,
                "maximum": 10000
              },
              {
                "name": "times_applicable_per_order",
                "kind": "required",
                "type": "number",
                "description": "<p>Per order application limits. If -1 allow unlimited applications, otherwise limited</p>",
                "minimum": -1,
                "maximum": 127
              },
              {
                "name": "max_rewards",
                "kind": "optional",
                "type": "number",
                "nullable": true,
                "description": "Used when rewardSelectionType is cheapest or expensive to determine the number of rewards available",
                "default": 1,
                "minimum": 1,
                "maximum": 127
              },
              {
                "name": "groups",
                "kind": "required",
                "type": "array",
                "description": "<p>Customer groups covered by this discount (use default to cover all groups)</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "excluded_customers",
                "kind": "optional",
                "type": "array",
                "description": "Array of email address or accounting ids of customers to exclude from the discount",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "customer@b2b.com",
                "itemDefault": ""
              },
              {
                "name": "simultaneity",
                "kind": "optional",
                "type": "array",
                "nullable": true,
                "description": "<p>Other discounts which can be applied simultaneous, if null no limitation</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "default",
                "itemDefault": ""
              },
              {
                "name": "requirement_selection_type",
                "kind": "required",
                "type": "string<any | all>",
                "description": "Products which must be in the cart must match all or any one of the combo groups",
                "enum": [
                  "any",
                  "all"
                ]
              },
              {
                "name": "reward_selection_type",
                "kind": "required",
                "type": "string<all | cheapest | expensive>",
                "description": "",
                "enum": [
                  "all",
                  "cheapest",
                  "expensive"
                ]
              },
              {
                "name": "currency_code",
                "kind": "required",
                "type": "string",
                "nullable": true,
                "description": "",
                "example": "gbp",
                "minLength": 3,
                "maxLength": 3
              },
              {
                "name": "start_date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "Start Date",
                "format": "date-time"
              },
              {
                "name": "end_date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "End Date",
                "format": "date-time"
              },
              {
                "name": "active",
                "kind": "required",
                "type": "boolean",
                "description": ""
              },
              {
                "name": "requirements",
                "kind": "required",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.Requirement",
                "customType": "Discount.Requirement[]",
                "schema": [
                  {
                    "name": "items",
                    "kind": "required",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "restrictions",
                        "kind": "required",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "object",
                        "customType": "object[]",
                        "schema": [
                          {
                            "name": "type",
                            "kind": "required",
                            "type": "string<productSKU | excludeProductSKU | productSKUContains | excludeProductSKUContains | productMetadata | excludeProductMetadata>",
                            "description": "",
                            "enum": [
                              "productSKU",
                              "excludeProductSKU",
                              "productSKUContains",
                              "excludeProductSKUContains",
                              "productMetadata",
                              "excludeProductMetadata"
                            ]
                          },
                          {
                            "name": "ref",
                            "kind": "required",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "metadata_namespace",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "erp",
                            "maxLength": 256
                          },
                          {
                            "name": "metadata_key",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "",
                            "example": "vendor",
                            "maxLength": 128
                          }
                        ]
                      },
                      {
                        "name": "points_type",
                        "kind": "required",
                        "type": "string<line | item>",
                        "description": "<p>Add X point(s) for each matching product OR Add X point(s) for once only</p>",
                        "enum": [
                          "line",
                          "item"
                        ]
                      },
                      {
                        "name": "points",
                        "kind": "required",
                        "type": "integer",
                        "description": "",
                        "default": 1
                      },
                      {
                        "name": "quantity",
                        "kind": "required",
                        "type": "integer",
                        "description": ""
                      },
                      {
                        "name": "selection_type",
                        "kind": "required",
                        "type": "string<minimum | exact>",
                        "description": "<p>At least X quantity of product(s) must match OR Exactly X quantity of product(s)</p>",
                        "enum": [
                          "minimum",
                          "exact"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "max_rewards",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "Limit the number of rewards when this requirement applies"
                  },
                  {
                    "name": "min_spend",
                    "kind": "required",
                    "type": "number",
                    "nullable": true,
                    "description": "<p>The cart must contain between min_spend and max_spend based on spend_tax_type of the requirement.</p>"
                  },
                  {
                    "name": "max_spend",
                    "kind": "required",
                    "type": "number",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "spend_tax_type",
                    "kind": "required",
                    "type": "string<net>",
                    "description": "",
                    "enum": [
                      "net"
                    ]
                  },
                  {
                    "name": "selection_type",
                    "kind": "required",
                    "type": "string<minimum | all>",
                    "description": "<p>Apply only if 'all' items matched in the cart OR if cart worth minimum of min_points requirement items(s) using requirements</p>",
                    "enum": [
                      "minimum",
                      "all"
                    ]
                  },
                  {
                    "name": "min_points",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "<p>Only applies when selection_type is minimum</p>"
                  }
                ]
              },
              {
                "name": "rewards",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.Reward",
                "customType": "Discount.Reward[]",
                "schema": [
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string<requirements|all | requirements|cheapest | cart|productSKU | cart|cheapestProductSKU | cart|productMetadata | cart|cheapestProductMetadata | product | shipping | order>",
                    "description": "",
                    "enum": [
                      "requirements|all",
                      "requirements|cheapest",
                      "cart|productSKU",
                      "cart|cheapestProductSKU",
                      "cart|productMetadata",
                      "cart|cheapestProductMetadata",
                      "product",
                      "shipping",
                      "order"
                    ]
                  },
                  {
                    "name": "amount_type",
                    "kind": "required",
                    "type": "string<percent | percentPreDiscount | priceAllGross | priceAllNet | priceLineGross | priceLineNet | fixedAllGross | fixedAllNet | fixedLineGross | fixedLineNet | none>",
                    "description": "",
                    "enum": [
                      "percent",
                      "percentPreDiscount",
                      "priceAllGross",
                      "priceAllNet",
                      "priceLineGross",
                      "priceLineNet",
                      "fixedAllGross",
                      "fixedAllNet",
                      "fixedLineGross",
                      "fixedLineNet",
                      "none"
                    ]
                  },
                  {
                    "name": "restriction_type",
                    "kind": "optional",
                    "type": "string<equals | notEquals | contains | notContains>",
                    "description": "",
                    "enum": [
                      "equals",
                      "notEquals",
                      "contains",
                      "notContains"
                    ]
                  },
                  {
                    "name": "item_id",
                    "kind": "required",
                    "type": "string",
                    "description": "",
                    "maxLength": 100
                  },
                  {
                    "name": "metadata_namespace",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "erp",
                    "maxLength": 256
                  },
                  {
                    "name": "metadata_key",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "vendor",
                    "maxLength": 128
                  },
                  {
                    "name": "amount",
                    "kind": "required",
                    "type": "number",
                    "description": "",
                    "maximum": 1000000000
                  }
                ]
              },
              {
                "name": "other_requirements",
                "kind": "required",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/Discount.OtherRequirements.MaxUsesPerCustomer",
                "customType": "Discount.OtherRequirements.MaxUsesPerCustomer[]",
                "schema": [
                  {
                    "name": "requirement_type",
                    "kind": "optional",
                    "type": "string<maxUsesPerCustomer>",
                    "description": "",
                    "enum": [
                      "maxUsesPerCustomer"
                    ]
                  },
                  {
                    "name": "number",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Discount",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] /api/v1/fetch-customer-pricing
[path] Untitled/Core API Docs/

{
  "id": "1uvIgLc5na0bMO9HegHwx",
  "type": "api-oas-v2",
  "data": {
    "method": "COMPONENTS",
    "url": "https://app.sparklayer.io/api/v1/fetch-customer-pricing",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/fetch-customer-pricing",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/fetch-customer-pricing",
        "description": "Test"
      }
    ],
    "name": "",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": ""
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] List Customer Groups
[path] Untitled/Core API Docs/Customer Groups/

{
  "id": "wOLcJ3gg264eC7dQszmY4",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.sparklayer.io/api/v1/customer-groups",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/customer-groups",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/customer-groups",
        "description": "Test"
      }
    ],
    "name": "List Customer Groups",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "CustomerGroupResponse[]",
            "schema": [
              {
                "name": "slug",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "eu_gbp",
                "maxLength": 128
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "Europe (GBP) Customers",
                "maxLength": 256
              },
              {
                "name": "parent_slug",
                "kind": "optional",
                "type": "string",
                "description": "",
                "example": "base",
                "maxLength": 128
              }
            ],
            "modelRef": "#/components/schemas/CustomerGroupResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Stock Levels - Bulk operations
[path] Untitled/Stock API Docs/


[title] Update Global Setting
[path] Untitled/Core API Docs/Settings/

{
  "id": "Q9tZ_d5nkzKVpfrlq2tJC",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://app.sparklayer.io/api/v1/settings",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/settings",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/settings",
        "description": "Test"
      }
    ],
    "name": "Update Global Setting",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "array",
          "description": "",
          "customType": "SettingGlobal[]",
          "schema": [
            {
              "name": "key",
              "kind": "required",
              "type": "string",
              "description": ""
            },
            {
              "name": "value",
              "kind": "required",
              "type": "object",
              "nullable": true,
              "description": "",
              "complexType": "allOf",
              "complexItems": [],
              "schema": []
            }
          ],
          "modelRef": "#/components/schemas/SettingGlobal",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Empty Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Create Cart
[path] Untitled/Core API Docs/Orders/

{
  "id": "clgSCmKOEcIlPi-s1xVfP",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.sparklayer.io/api/v1/carts",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/carts",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/carts",
        "description": "Test"
      }
    ],
    "name": "Create Cart",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "customer_id",
              "kind": "optional",
              "type": "string",
              "description": ""
            },
            {
              "name": "customer_lookup_by",
              "kind": "optional",
              "type": "string<sparklayer | platform | email>",
              "description": "",
              "enum": [
                "sparklayer",
                "platform",
                "email"
              ]
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "cart_id",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "example": "9151f21f-43ae-43b4-92f3-f4af67cdf544",
                "format": "uuid"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Update sync logs with a partial sync
[path] Untitled/Sync Logging API Docs/Sync Logging/

{
  "id": "5eAegoEd2h78YO_VUXjDk",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "/api/v1/sync-log/{integration}/{data_type}",
    "servers": [],
    "name": "Update sync logs with a partial sync",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "integration",
          "type": "string",
          "example": "shopify",
          "description": ""
        },
        {
          "kind": "required",
          "name": "data_type",
          "type": "string",
          "example": "products",
          "description": "",
          "enum": [
            "products",
            "customers",
            "merchant",
            "purchases",
            "pricing",
            "accountancy"
          ]
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "last_partial_sync",
              "kind": "optional",
              "type": "string",
              "description": "",
              "example": "2023-01-01T01:01:01Z",
              "modelRef": "#/components/schemas/LastPartialSync",
              "customType": "LastPartialSync",
              "schema": []
            },
            {
              "name": "last_full_sync",
              "kind": "optional",
              "type": "string",
              "description": "Last full sync",
              "example": "2023-01-01T01:01:01Z",
              "modelRef": "#/components/schemas/LastFullSync",
              "customType": "LastFullSync",
              "schema": []
            },
            {
              "name": "last_full_sync_succeeded",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>Was the last full sync successful? A successful sync may still have logging errors. A failed full sync may indicate integration configuration issues or timeout.</p>",
              "example": true,
              "modelRef": "#/components/schemas/LastFullSyncSucceeded",
              "customType": "LastFullSyncSucceeded",
              "schema": []
            },
            {
              "name": "errors",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/SyncErrors",
              "customType": "SyncErrors",
              "schema": [
                {
                  "name": "external_id",
                  "kind": "optional",
                  "type": "string",
                  "description": "External ID",
                  "example": "ABC-123",
                  "modelRef": "#/components/schemas/ExternalId",
                  "customType": "ExternalId",
                  "schema": []
                },
                {
                  "name": "external_url",
                  "kind": "optional",
                  "type": "string",
                  "description": "External URL",
                  "example": "https://example.com/products/ABC-123",
                  "minLength": 1,
                  "maxLength": 1024
                },
                {
                  "name": "visible_name",
                  "kind": "optional",
                  "type": "string",
                  "description": "User friendly name",
                  "example": "The ABC 123 Book",
                  "maxLength": 1024
                },
                {
                  "name": "api_response",
                  "kind": "optional",
                  "type": "string",
                  "description": "API response from sync",
                  "example": "Error - Product ABC-123 not found",
                  "minLength": 1,
                  "maxLength": 4294967295
                },
                {
                  "name": "friendly_error",
                  "kind": "optional",
                  "type": "string",
                  "description": "User friendly error",
                  "example": "ABC-123 not found",
                  "minLength": 1,
                  "maxLength": 4294967295
                }
              ]
            },
            {
              "name": "successfully_synced",
              "kind": "optional",
              "type": "array",
              "description": "External ID",
              "modelRef": "#/components/schemas/ExternalId",
              "customType": "ExternalId[]",
              "schema": []
            }
          ],
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "last_partial_sync",
                  "kind": "optional",
                  "type": "string",
                  "description": "",
                  "example": "2023-01-01T01:01:01Z",
                  "modelRef": "#/components/schemas/LastPartialSync",
                  "customType": "LastPartialSync",
                  "schema": []
                },
                {
                  "name": "last_full_sync",
                  "kind": "optional",
                  "type": "string",
                  "description": "Last full sync",
                  "example": "2023-01-01T01:01:01Z",
                  "modelRef": "#/components/schemas/LastFullSync",
                  "customType": "LastFullSync",
                  "schema": []
                },
                {
                  "name": "last_full_sync_succeeded",
                  "kind": "optional",
                  "type": "boolean",
                  "description": "<p>Was the last full sync successful? A successful sync may still have logging errors. A failed full sync may indicate integration configuration issues or timeout.</p>",
                  "example": true,
                  "modelRef": "#/components/schemas/LastFullSyncSucceeded",
                  "customType": "LastFullSyncSucceeded",
                  "schema": []
                },
                {
                  "name": "errors",
                  "kind": "optional",
                  "type": "array",
                  "description": "",
                  "modelRef": "#/components/schemas/SyncErrors",
                  "customType": "SyncErrors",
                  "schema": [
                    {
                      "name": "external_id",
                      "kind": "optional",
                      "type": "string",
                      "description": "External ID",
                      "example": "ABC-123",
                      "modelRef": "#/components/schemas/ExternalId",
                      "customType": "ExternalId",
                      "schema": []
                    },
                    {
                      "name": "external_url",
                      "kind": "optional",
                      "type": "string",
                      "description": "External URL",
                      "example": "https://example.com/products/ABC-123",
                      "minLength": 1,
                      "maxLength": 1024
                    },
                    {
                      "name": "visible_name",
                      "kind": "optional",
                      "type": "string",
                      "description": "User friendly name",
                      "example": "The ABC 123 Book",
                      "maxLength": 1024
                    },
                    {
                      "name": "api_response",
                      "kind": "optional",
                      "type": "string",
                      "description": "API response from sync",
                      "example": "Error - Product ABC-123 not found",
                      "minLength": 1,
                      "maxLength": 4294967295
                    },
                    {
                      "name": "friendly_error",
                      "kind": "optional",
                      "type": "string",
                      "description": "User friendly error",
                      "example": "ABC-123 not found",
                      "minLength": 1,
                      "maxLength": 4294967295
                    }
                  ]
                },
                {
                  "name": "successfully_synced",
                  "kind": "optional",
                  "type": "array",
                  "description": "External ID",
                  "modelRef": "#/components/schemas/ExternalId",
                  "customType": "ExternalId[]",
                  "schema": []
                }
              ],
              "modelRef": "#/components/schemas/PatchSyncLog",
              "customType": "PatchSyncLog"
            },
            {
              "name": "object",
              "schema": []
            }
          ],
          "complexType": "allOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get a Stock Location
[path] Untitled/Stock API Docs/Stock Locations/

{
  "id": "YylBWTh0l6NJYLophDE8N",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/stock-locations/{StockLocationID}",
    "servers": [],
    "name": "Get a Stock Location",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "StockLocationID",
          "type": "string",
          "description": "<p>Stock Location ID (internal or external)</p>"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "StockLocation",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "description": "SparkLayer site Stock Location ID",
                "example": "123e4567-e89b-12d3-a456-426614174000",
                "format": "uuid"
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "Name",
                "example": "Stock Warehouse 1",
                "maxLength": 255
              },
              {
                "name": "external_id",
                "kind": "required",
                "type": "string",
                "description": "<p>External ID (must be unique for the site)</p>",
                "example": "warehouse-1",
                "maxLength": 255
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              }
            ],
            "modelRef": "#/components/schemas/StockLocation",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Batch update stock levels for the provided SKUs
[path] Untitled/Stock API Docs/Stock Levels - Bulk operations/

{
  "id": "9WgWbAtlqRZVmK3o4anzH",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/v1/batch-update-stock",
    "servers": [],
    "name": "Batch update stock levels for the provided SKUs",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "array",
          "description": "",
          "minItems": 1,
          "schema": [
            {
              "name": "stock_location_id",
              "kind": "optional",
              "type": "string<uuid>",
              "description": "<p>Stock Location ID (internal UUID)</p>",
              "example": "123e4567-e89b-12d3-a456-426614174000",
              "format": "uuid"
            },
            {
              "name": "sku",
              "kind": "required",
              "type": "string",
              "description": "Product Variant SKU",
              "maxLength": 128
            },
            {
              "name": "stock_level",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "Quantity of stock held at the location",
              "example": 9,
              "default": 0,
              "format": "int32"
            },
            {
              "name": "restock_date",
              "kind": "optional",
              "type": "string<date>",
              "nullable": true,
              "description": "Restock Date",
              "example": "2020-01-01",
              "format": "date"
            },
            {
              "name": "min_stock_level",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "<p>Allow pre-ordering / overselling up to this qty. For example, if set to -9 and stock level was 0, 9 units could be sold.</p>",
              "example": -9,
              "default": 0,
              "format": "int32"
            },
            {
              "name": "created_at",
              "kind": "optional",
              "type": "string<date-time>",
              "readOnly": true,
              "description": "",
              "format": "date-time"
            },
            {
              "name": "updated_at",
              "kind": "optional",
              "type": "string<date-time>",
              "readOnly": true,
              "description": "",
              "format": "date-time"
            },
            {
              "name": "stock_location_external_id",
              "kind": "required",
              "type": "string",
              "description": "<p>External ID (must be unique for the site)</p>",
              "example": "warehouse-1",
              "maxLength": 255
            },
            {
              "name": "sku",
              "kind": "required",
              "type": "string",
              "description": "Product Variant SKU",
              "maxLength": 128
            },
            {
              "name": "stock_level",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "Quantity of stock held at the location",
              "example": 9,
              "default": 0,
              "format": "int32"
            },
            {
              "name": "restock_date",
              "kind": "optional",
              "type": "string<date>",
              "nullable": true,
              "description": "Restock Date",
              "example": "2020-01-01",
              "format": "date"
            },
            {
              "name": "min_stock_level",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "<p>Allow pre-ordering / overselling up to this qty. For example, if set to -9 and stock level was 0, 9 units could be sold.</p>",
              "example": -9,
              "default": 0,
              "format": "int32"
            },
            {
              "name": "created_at",
              "kind": "optional",
              "type": "string<date-time>",
              "readOnly": true,
              "description": "",
              "format": "date-time"
            },
            {
              "name": "updated_at",
              "kind": "optional",
              "type": "string<date-time>",
              "readOnly": true,
              "description": "",
              "format": "date-time"
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "<p>Success - No Content</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Delete a Stock Location
[path] Untitled/Stock API Docs/Stock Locations/

{
  "id": "WsJVOO_LRyh4bnQDMp2SP",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "/api/v1/stock-locations/{StockLocationID}",
    "servers": [],
    "name": "Delete a Stock Location",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "StockLocationID",
          "type": "string",
          "description": "<p>Stock Location ID (internal or external)</p>"
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "<p>Success - No Content</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Delete Cart
[path] Untitled/Core API Docs/Orders/

{
  "id": "ufX2Ttyv63My0M6LLOZnV",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://app.sparklayer.io/api/v1/carts/{id}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/carts/{id}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/carts/{id}",
        "description": "Test"
      }
    ],
    "name": "Delete Cart",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Delete a Discount
[path] Untitled/Core API Docs/Discounts/

{
  "id": "s8yhUkDuYGJGbMvXo57NK",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://app.sparklayer.io/api/v1/discounts/{id}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/discounts/{id}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/discounts/{id}",
        "description": "Test"
      }
    ],
    "name": "Delete a Discount",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Empty Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Delete a Customer
[path] Untitled/Core API Docs/Customers/

{
  "id": "Fx4Jsuf7Rd0Jb6Ccp1SkM",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://app.sparklayer.io/api/v1/customers/{lookupBy}/{id}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/customers/{lookupBy}/{id}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/customers/{lookupBy}/{id}",
        "description": "Test"
      }
    ],
    "name": "Delete a Customer",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "lookupBy",
          "type": "object",
          "description": "<p>Property to use for customer look up. Note: emails must be url encoded</p>",
          "customType": "CustomerLookupBy",
          "schema": [],
          "modelRef": "#/components/schemas/CustomerLookupBy"
        },
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Empty Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Update Customer Group
[path] Untitled/Core API Docs/Customer Groups/

{
  "id": "jsiRLwjebWgri1ZkSbzZQ",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://app.sparklayer.io/api/v1/customer-groups/{slug}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/customer-groups/{slug}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/customer-groups/{slug}",
        "description": "Test"
      }
    ],
    "name": "Update Customer Group",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "slug",
          "type": "string",
          "description": ""
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "customer group",
          "description": "",
          "schema": [
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "Europe (GBP) Customers",
              "maxLength": 256
            },
            {
              "name": "parent_slug",
              "kind": "optional",
              "type": "string",
              "description": "",
              "example": "base",
              "maxLength": 128
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "CustomerGroupResponse[]",
            "schema": [
              {
                "name": "slug",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "eu_gbp",
                "maxLength": 128
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "Europe (GBP) Customers",
                "maxLength": 256
              },
              {
                "name": "parent_slug",
                "kind": "optional",
                "type": "string",
                "description": "",
                "example": "base",
                "maxLength": 128
              }
            ],
            "modelRef": "#/components/schemas/CustomerGroupResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Delete Customer Group
[path] Untitled/Core API Docs/Customer Groups/

{
  "id": "G55NDeNapvW6Vi5A2JQVD",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://app.sparklayer.io/api/v1/customer-groups/{slug}",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/customer-groups/{slug}",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/customer-groups/{slug}",
        "description": "Test"
      }
    ],
    "name": "Delete Customer Group",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "slug",
          "type": "string",
          "description": ""
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "Empty Response",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Update a Stock Location
[path] Untitled/Stock API Docs/Stock Locations/

{
  "id": "o1LJEnr_Dpf2F-9mxIHZl",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "/api/v1/stock-locations/{StockLocationID}",
    "servers": [],
    "name": "Update a Stock Location",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "StockLocationID",
          "type": "string",
          "description": "<p>Stock Location ID (internal or external)</p>"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "StockLocation",
          "schema": [
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "Name",
              "example": "Stock Warehouse 1",
              "maxLength": 255
            },
            {
              "name": "external_id",
              "kind": "required",
              "type": "string",
              "description": "<p>External ID (must be unique for the site)</p>",
              "example": "warehouse-1",
              "maxLength": 255
            }
          ],
          "modelRef": "#/components/schemas/StockLocation",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "StockLocation",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "description": "SparkLayer site Stock Location ID",
                "example": "123e4567-e89b-12d3-a456-426614174000",
                "format": "uuid"
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "Name",
                "example": "Stock Warehouse 1",
                "maxLength": 255
              },
              {
                "name": "external_id",
                "kind": "required",
                "type": "string",
                "description": "<p>External ID (must be unique for the site)</p>",
                "example": "warehouse-1",
                "maxLength": 255
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              }
            ],
            "modelRef": "#/components/schemas/StockLocation",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Complete Cart
[path] Untitled/Core API Docs/Orders/

{
  "id": "oZNyp3jCujL4-_DQXyT44",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.sparklayer.io/api/v1/carts/{id}/complete",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/carts/{id}/complete",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/carts/{id}/complete",
        "description": "Test"
      }
    ],
    "name": "Complete Cart",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "Either the Internal or External ID"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "shipping_rate_handle",
              "kind": "required",
              "type": "string",
              "description": ""
            },
            {
              "name": "payment_method",
              "kind": "required",
              "type": "string<paymentByInvoice | paymentOnAccount>",
              "description": "",
              "enum": [
                "paymentByInvoice",
                "paymentOnAccount"
              ]
            },
            {
              "name": "ignore_validation_errors",
              "kind": "required",
              "type": "array",
              "description": "<p>Specify which validation errors to ignore and allow the cart to complete checkout. Passing \"*\" will ignore all validation errors.</p>",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "itemExample": "",
              "itemDefault": ""
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "purchase_id",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": ""
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Cart not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "422",
        "description": "Unprocessable Entity",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "complexItems": [
              {
                "name": "object",
                "schema": [],
                "modelRef": "#/components/schemas/responses-CartErrorResponse",
                "customType": "responses-CartErrorResponse"
              },
              {
                "name": "object",
                "schema": [],
                "modelRef": "#/components/schemas/responses-CartValidationErrorResponse",
                "customType": "responses-CartValidationErrorResponse"
              },
              {
                "name": "object",
                "schema": [],
                "modelRef": "#/components/schemas/Default",
                "customType": "Default"
              }
            ],
            "complexType": "oneOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Stock Locations
[path] Untitled/Stock API Docs/


[title] New Customer Group
[path] Untitled/Core API Docs/Customer Groups/

{
  "id": "jrRRMEin-cn7aND230Tg4",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.sparklayer.io/api/v1/customer-groups",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/customer-groups",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/customer-groups",
        "description": "Test"
      }
    ],
    "name": "New Customer Group",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "slug",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "eu_gbp",
              "maxLength": 128,
              "pattern": "^(?!^null$)(?!^default$)[a-z]([a-z0-9\\-~_]*$)"
            },
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "Europe (GBP) Customers",
              "maxLength": 256
            },
            {
              "name": "parent_slug",
              "kind": "optional",
              "type": "string",
              "description": "",
              "example": "base",
              "maxLength": 128
            }
          ],
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "slug",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "example": "eu_gbp",
                  "maxLength": 128,
                  "pattern": "^(?!^null$)(?!^default$)[a-z]([a-z0-9\\-~_]*$)"
                },
                {
                  "name": "name",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "example": "Europe (GBP) Customers",
                  "maxLength": 256
                },
                {
                  "name": "parent_slug",
                  "kind": "optional",
                  "type": "string",
                  "description": "",
                  "example": "base",
                  "maxLength": 128
                }
              ],
              "modelRef": "#/components/schemas/CustomerGroupRequest",
              "customType": "CustomerGroupRequest"
            }
          ],
          "complexType": "allOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "CustomerGroupResponse[]",
            "schema": [
              {
                "name": "slug",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "eu_gbp",
                "maxLength": 128
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "Europe (GBP) Customers",
                "maxLength": 256
              },
              {
                "name": "parent_slug",
                "kind": "optional",
                "type": "string",
                "description": "",
                "example": "base",
                "maxLength": 128
              }
            ],
            "modelRef": "#/components/schemas/CustomerGroupResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Create a Stock Location
[path] Untitled/Stock API Docs/Stock Locations/

{
  "id": "-V3oTq-Y2ctCBbiOoltqo",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/v1/stock-locations",
    "servers": [],
    "name": "Create a Stock Location",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "StockLocation",
          "schema": [
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "Name",
              "example": "Stock Warehouse 1",
              "maxLength": 255
            },
            {
              "name": "external_id",
              "kind": "required",
              "type": "string",
              "description": "<p>External ID (must be unique for the site)</p>",
              "example": "warehouse-1",
              "maxLength": 255
            }
          ],
          "modelRef": "#/components/schemas/StockLocation",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "StockLocation",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "description": "SparkLayer site Stock Location ID",
                "example": "123e4567-e89b-12d3-a456-426614174000",
                "format": "uuid"
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "Name",
                "example": "Stock Warehouse 1",
                "maxLength": 255
              },
              {
                "name": "external_id",
                "kind": "required",
                "type": "string",
                "description": "<p>External ID (must be unique for the site)</p>",
                "example": "warehouse-1",
                "maxLength": 255
              },
              {
                "name": "created_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "format": "date-time"
              }
            ],
            "modelRef": "#/components/schemas/StockLocation",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] List Global Settings
[path] Untitled/Core API Docs/Settings/

{
  "id": "liyjcmgCXP5u_NaJI45pM",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.sparklayer.io/api/v1/settings",
    "servers": [
      {
        "url": "https://app.sparklayer.io/api/v1/settings",
        "description": "Live"
      },
      {
        "url": "https://test.app.sparklayer.io/api/v1/settings",
        "description": "Test"
      }
    ],
    "name": "List Global Settings",
    "description": "<p>Lists Global settings (minus settings which include authentication details)</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "SettingGlobal[]",
            "schema": [
              {
                "name": "key",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "value",
                "kind": "required",
                "type": "object",
                "nullable": true,
                "description": "",
                "complexType": "allOf",
                "complexItems": [],
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/SettingGlobal",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Customer Groups
[path] Untitled/Core API Docs/


[title] Get Sync Logging status
[path] Untitled/Sync Logging API Docs/Sync Logging/

{
  "id": "FMzWrGjDiavldLpXRJcZO",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/sync-log/{integration}/{data_type}",
    "servers": [],
    "name": "Get Sync Logging status",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "integration",
          "type": "string",
          "example": "shopify",
          "description": ""
        },
        {
          "kind": "required",
          "name": "data_type",
          "type": "string",
          "example": "products",
          "description": "",
          "enum": [
            "products",
            "customers",
            "merchant",
            "purchases",
            "pricing",
            "accountancy"
          ]
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "SyncStatus",
            "schema": [
              {
                "name": "started_full_sync",
                "kind": "optional",
                "type": "string",
                "description": "Started full sync",
                "example": "2023-01-01T01:01:01Z",
                "modelRef": "#/components/schemas/StartedFullSync",
                "customType": "StartedFullSync",
                "schema": []
              },
              {
                "name": "last_full_sync",
                "kind": "optional",
                "type": "string",
                "description": "Last full sync",
                "example": "2023-01-01T01:01:01Z",
                "modelRef": "#/components/schemas/LastFullSync",
                "customType": "LastFullSync",
                "schema": []
              },
              {
                "name": "last_full_sync_succeeded",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>Was the last full sync successful? A successful sync may still have logging errors. A failed full sync may indicate integration configuration issues or timeout.</p>",
                "example": true,
                "modelRef": "#/components/schemas/LastFullSyncSucceeded",
                "customType": "LastFullSyncSucceeded",
                "schema": []
              },
              {
                "name": "last_partial_sync",
                "kind": "optional",
                "type": "string",
                "description": "",
                "example": "2023-01-01T01:01:01Z",
                "modelRef": "#/components/schemas/LastPartialSync",
                "customType": "LastPartialSync",
                "schema": []
              },
              {
                "name": "error_count",
                "kind": "optional",
                "type": "integer",
                "description": "Sync errors count",
                "example": 3,
                "modelRef": "#/components/schemas/ErrorCount",
                "customType": "ErrorCount",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/SyncStatus",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Get Sync Logging status errors
[path] Untitled/Sync Logging API Docs/Sync Logging/

{
  "id": "tLgIvj9PMzNHYQXMGhpit",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/api/v1/sync-log/{integration}/{data_type}/errors",
    "servers": [],
    "name": "Get Sync Logging status errors",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "integration",
          "type": "string",
          "example": "shopify",
          "description": ""
        },
        {
          "kind": "required",
          "name": "data_type",
          "type": "string",
          "example": "products",
          "description": "",
          "enum": [
            "products",
            "customers",
            "merchant",
            "purchases",
            "pricing",
            "accountancy"
          ]
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Site-Id",
          "type": "string",
          "example": "jones-climbing",
          "description": "Spark Layer Site ID"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "started_full_sync",
                "kind": "optional",
                "type": "string",
                "description": "Started full sync",
                "example": "2023-01-01T01:01:01Z",
                "modelRef": "#/components/schemas/StartedFullSync",
                "customType": "StartedFullSync",
                "schema": []
              },
              {
                "name": "last_full_sync",
                "kind": "optional",
                "type": "string",
                "description": "Last full sync",
                "example": "2023-01-01T01:01:01Z",
                "modelRef": "#/components/schemas/LastFullSync",
                "customType": "LastFullSync",
                "schema": []
              },
              {
                "name": "last_full_sync_succeeded",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>Was the last full sync successful? A successful sync may still have logging errors. A failed full sync may indicate integration configuration issues or timeout.</p>",
                "example": true,
                "modelRef": "#/components/schemas/LastFullSyncSucceeded",
                "customType": "LastFullSyncSucceeded",
                "schema": []
              },
              {
                "name": "last_partial_sync",
                "kind": "optional",
                "type": "string",
                "description": "",
                "example": "2023-01-01T01:01:01Z",
                "modelRef": "#/components/schemas/LastPartialSync",
                "customType": "LastPartialSync",
                "schema": []
              },
              {
                "name": "error_count",
                "kind": "optional",
                "type": "integer",
                "description": "Sync errors count",
                "example": 3,
                "modelRef": "#/components/schemas/ErrorCount",
                "customType": "ErrorCount",
                "schema": []
              }
            ],
            "complexItems": [
              {
                "name": "object",
                "schema": [
                  {
                    "name": "started_full_sync",
                    "kind": "optional",
                    "type": "string",
                    "description": "Started full sync",
                    "example": "2023-01-01T01:01:01Z",
                    "modelRef": "#/components/schemas/StartedFullSync",
                    "customType": "StartedFullSync",
                    "schema": []
                  },
                  {
                    "name": "last_full_sync",
                    "kind": "optional",
                    "type": "string",
                    "description": "Last full sync",
                    "example": "2023-01-01T01:01:01Z",
                    "modelRef": "#/components/schemas/LastFullSync",
                    "customType": "LastFullSync",
                    "schema": []
                  },
                  {
                    "name": "last_full_sync_succeeded",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "<p>Was the last full sync successful? A successful sync may still have logging errors. A failed full sync may indicate integration configuration issues or timeout.</p>",
                    "example": true,
                    "modelRef": "#/components/schemas/LastFullSyncSucceeded",
                    "customType": "LastFullSyncSucceeded",
                    "schema": []
                  },
                  {
                    "name": "last_partial_sync",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "2023-01-01T01:01:01Z",
                    "modelRef": "#/components/schemas/LastPartialSync",
                    "customType": "LastPartialSync",
                    "schema": []
                  },
                  {
                    "name": "error_count",
                    "kind": "optional",
                    "type": "integer",
                    "description": "Sync errors count",
                    "example": 3,
                    "modelRef": "#/components/schemas/ErrorCount",
                    "customType": "ErrorCount",
                    "schema": []
                  }
                ],
                "modelRef": "#/components/schemas/SyncStatus",
                "customType": "SyncStatus"
              },
              {
                "name": "object",
                "schema": []
              }
            ],
            "complexType": "allOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Error Response",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false
  },
  "children": [
    {
      "text": ""
    }
  ]
}
[title] Modifying Cart Contents
[path] Untitled/

We provide a function (`window.spark.updateCart`) that enables you to modify the cart contents - adding products, changing quantities, removing items, clearing the cart, and updating cart-level fields

```typescript
window.spark.updateCart(
  input: Partial<UpdateCart>,
  cartSuccessHandledLocally?: boolean,
  cartErrorsHandledLocally?: boolean,
): Promise<CartResults[] | null>
```

## Adding a product to the cart

Add a variant by SKU with `adjustQuantity`, which **increments** whatever quantity is already in the cart:

```javascript
await window.spark.updateCart({
  products: [{ sku: 'RED-SHIRT-M', adjustQuantity: 1 }],
});
```

Add several products/variants in one call:

```javascript
await window.spark.updateCart({
  products: [
    { sku: 'RED-SHIRT-M', adjustQuantity: 2 },
    { sku: 'BLUE-HAT-L', adjustQuantity: 1 },
  ],
});
```

Use `quantity` instead of `adjustQuantity` when you want to **set** the line to an absolute value rather than increment it (e.g. a quantity input on the cart page):

```javascript
await window.spark.updateCart({
  products: [{ sku: 'RED-SHIRT-M', quantity: 5 }],
});
```

## Adding custom attributes to a line item

Any product line can carry `customAttributes` - free-form key/value pairs that travel with that line through the cart and into the resulting order (e.g. customer-supplied customizations like engraving text or fabric choice)

### Text

To store a text value in the custom attributes, you can do the following:

```javascript
await window.spark.updateCart({
  products: [
    {
      sku: 'SHIRT-CUSTOM',
      adjustQuantity: 1,
      customAttributes: [
        { key: 'Shirt Length', value: '32in' },
        { key: 'Shirt Fabric', value: 'Cotton' },
      ],
    },
  ],
});
```

`key` / `value` are shown to the customer and staff under the line item, and persist through to past orders.

### Files

Attaching a file instead of text uses the same array, but `value` must be a JSON string of an array of GID(s) rather than plain text. The GID comes from `spark.uploadFile()`:

```javascript
const gid = await window.spark.uploadFile('design.png', fileBlob);

await window.spark.updateCart({
  products: [
    {
      sku: 'SHIRT-CUSTOM',
      adjustQuantity: 1,
      customAttributes: [
        { key: 'Design', value: JSON.stringify([gid]) },
      ],
    },
  ],
});
```

:::hint{type="warning"}
The file name you pass to `uploadFile()` (`design.png` above) must match the actual type of the data in `fileData` - e.g. don't name it `design.png` if the blob is actually a JPEG. A mismatch fails a post-upload check on the server, the file is deleted, and the `gid` you got back stops resolving to anything (any later lookup of it, including reading the cart, will error).
:::

:::hint{type="info"}
If you're building your own custom "add to cart" UI, this is all you need - `customAttributes` is just another field on the product you're already sending. If instead you want to attach custom attributes to an add-to-cart action performed by one of SparkLayer's built-in components (the PDP widget, product card, etc.), see [Customizing Add to Cart](docId\:dqn6YkfT1nH2i_0QZaywX) - you don't call `updateCart` yourself in that case, so this won't apply directly.
:::

## Removing an item / clearing the cart

Set `quantity` to `0` to remove a line. If you already have the cart line's `itemKey` (e.g. from `getCart()`), target it directly instead of by SKU:

```javascript
await window.spark.updateCart({
  products: [{ itemKey: 'abc123', quantity: 0 }],
});
```

Clear the whole cart:

```javascript
await window.spark.updateCart({ clearCart: true });
```

## Updating cart-level fields

`customerReference`, `poNumber`, `shippingRequestedDate`, etc. can all be updated the same way, independently of `products`:

```javascript
await window.spark.updateCart({
  customerReference: 'This is a note on the order',
  poNumber: 'PO-4567',
});
```

## Return value

Resolves to `CartResults[]` - one entry per product line you sent in - or `null` if the request failed outright. It does **not** return the updated `Cart` directly; use `spark.getCart()` or `spark.getCartCache()` to read the new cart state.

Each entry has:

- `requestedQuantity` / `resultantQuantity` - what you asked for vs. what was actually applied. These differ whenever a `messages` entry below fired (e.g. rounded to a pack size, clamped to a stock or order limit).
- `itemKey`, `sku`, `name`, `barcode` - identify which line the result is for.
- `messages` - a list of `{ type }` objects flagging anything that happened to this line. `type` is one of:

| type                          | meaning                                                                  |
| ----------------------------- | ------------------------------------------------------------------------ |
| `success`                     | line added/updated with no issues                                        |
| `pack-size`                   | quantity rounded down to the nearest pack size                           |
| `qty-excessive`               | quantity brought down to the allowed maximum                             |
| `qty-insufficient`            | quantity brought up to the allowed minimum                               |
| `qty-unavailable`             | quantity lowered to what's currently in stock                            |
| `qty-unavailable-no-clamp`    | added, but the requested quantity isn't fully available - check the cart |
| `excessive-lines`             | cart line limit reached; item wasn't added                               |
| `not-found`                   | SKU doesn't exist                                                        |
| `unavailable`                 | product isn't currently sellable                                         |
| `product-settings-overridden` | default product settings were overridden                                 |

These are just status codes, not display text - `updateCart` uses them to show its own toast automatically (see below). If you handle messages yourself, switch on `type` to show your own copy.

## Handling feedback

By default, `updateCart` shows toast messages for you. Pass `true` for the relevant flag to suppress SparkLayer's built-in toasts when you're showing your own feedback UI:

```javascript
// Suppress the built-in success toast, but keep automatic error toasts
await window.spark.updateCart(
  { products: [{ sku: 'RED-SHIRT-M', adjustQuantity: 1 }] },
  true, // cartSuccessHandledLocally
);
```

[title] Ordering API
[path] /

The Ordering API allows you to create and manage SparkLayer shopping carts on behalf of customers and convert those carts into orders. It also provides an endpoint for fetching customer-specific pricing, which can be used for validation or user feedback before creating a cart.

While our API specification provides full endpoint and schema details, this guide focuses on customer-specific pricing lookups, the typical cart / order lifecycle, and integration patterns.

## Customer-Specific Pricing Lookup

This endpoint can be used before creating a cart to check pricing and price breaks for validation or user feedback.

It calculates real-time pricing for one or more SKUs in the context of a specific customer. It returns per-line-item unit prices, line totals, and quantity price breaks, accounting for the customer's assigned price lists and any customer-level discount percentage.

### Price calculation

SparkLayer looks up the customer's assigned price lists and uses those to calculate accurate pricing for each requested product. This includes:

- **Quantity price breaks** — the price adjusts based on how many units are being ordered
- **Variant aggregation** — if your store is configured to apply price breaks across variants, quantities across sizes or colours of the same product are combined when determining the price tier. For example, ordering 5× size M and 5× size L could unlock the 10-unit price break for both.
- **Customer discounts** — any discount assigned to the customer is applied on top of the list price

Each product in the response includes the unit price, line total, and a full breakdown of available quantity price breaks. All prices are returned as net values.

### Potential Issues

- **Partial pricing failure** — if any product cannot be priced, affected line items will include an error with null pricing data, while successfully priced items are still returned alongside them.
- **Invalid request** — returned if the request is malformed, the customer does not exist, or the customer has no price lists configured.

***

## Orders Overview

All orders begin as a shopping cart associated with a customer. By using the same cart handling as the SparkLayer Cart, the platform can apply the same pricing, validation, ordering rules, and checkout logic that customers would experience when placing an order themselves.

A typical order lifecycle could follow these steps:

1. Create a cart
2. Update the cart contents with line items
3. Calculate totals and available shipping / payment options
4. Complete the cart and create the order

***

## 1. Create an Empty Cart

Start by creating a new cart for the customer you wish to create an order for.

A cart is initially empty and acts as a container for all order information, including line items, quantities, shipping details, and payment method selection.

The response includes a unique cart identifier which should be used for all subsequent cart operations.

***

## 2. Update the Cart

Once a cart has been created, you can populate it with the information required for the order.

Common updates include:

- Setting the line items & quantities
- Setting shipping methods

For drop-shipping scenarios, you may wish to use a temporary shipping address when the delivery destination should not be permanently stored against the customer account.

### Validation

Each cart update returns the latest cart state, including any validation errors generated by SparkLayer according to your configured business rules.

Validation errors may indicate issues such as:

- Minimum or maximum order quantity restrictions
- Product availability constraints
- Customer-specific purchasing restrictions

The response also includes item-level update results, allowing you to determine how each requested line item was processed and whether any adjustments or validation errors occurred.

The **Update Cart** and **Calculate Cart** operations always return a successful response, even when validation errors are present. Any validation errors are included in the response for your application to handle.

The **Complete Cart** operation behaves differently. If validation errors exist, the operation fails and the cart cannot be completed. If your implementation needs to allow specific validation errors, you can use the documented ignore\_validation\_errors property to specify which validation errors should be ignored during cart completion.

***

## 3. Calculate the Cart

Before completing an order, you should calculate the cart.

This step allows SparkLayer to:

- Calculate order totals with the connected platform
- Apply pricing
- Determine shipping costs & available shipping methods
- Determine available payment methods
- Validate the current cart state

The identifiers provided for these options can be used when selecting shipping and payment methods during the ordering process.

***

## 4. Complete the Cart

Once the cart has been validated and all required selections have been made, the cart can be completed.

Completing a cart converts it into a SparkLayer order and submits it to the connected ecommerce platform for processing.

After completion, the cart can no longer be modified and should be treated as a completed purchase.

***

## Recommended Workflow

For most integrations, we recommend the following sequence:

1. Create a cart
2. Add products and order details
3. Review any validation messages
4. Calculate the cart
5. Select shipping and payment methods
6. Calculate the cart & confirm totals
7. Complete the cart

[title] Templates
[path] /

This documentation is intended for the development of custom themes and their templates in SparkLayer. You can learn more [here](https://docs.sparklayer.io/templates)

## Templates

Available Templates:

| Template                                                 | Type    | Description                                                        |
| -------------------------------------------------------- | ------- | ------------------------------------------------------------------ |
| invoice.liquid                                           | pdf     | Invoice PDF template                                               |
| quote.liquid                                             | pdf     | Quote PDF template                                                 |
| limited-user-purchase-review\.liquid                     | email   | Notification of a new purchase placed by a limited user for review |
| limited-user-purchase-approve.liquid                     | email   | Notification of a new purchase placed by a limited user approved   |
| new-quote-notification-to-merchant.liquid                | email   | Notification of a new quote placed by a customer                   |
| quote-assigned-notification-to-agent.liquid              | email   | Notification of a quote assigned to an sales agent                 |
| purchase-history-message-notification-to-agent.liquid    | email   | Notification of a message on a purchase history to a sales agent   |
| purchase-history-message-notification-to-customer.liquid | email   | Notification of a message on a purchase history to a customer      |
| email-header.liquid                                      | section | Re-usable email header section                                     |
| email-footer.liquid                                      | section | Re-usable email footer section                                     |

**Note**: Only the above templates can be used, any other files uploaded to a theme are discarded, including supporting
files such as images and fonts.

### Template Markup & Liquid

Templates are written in [liquid](https://shopify.github.io/liquid/) and have access to the majority of liquids tags and
filters. We also have some additional helper filters documented below.

Styling must be added in the template using either the `style` HTML element, or inline styles. Note however all styles are
inlined when rendering the template for better compatibility with email clients.

The email templates provided have been tested in modern web based email clients such as Gmail, however we don't offer
support for older email clients such as desktop variations of Outlook. We recommend using testing your custom email
templates as they can be particularly problematic with modern HTML and CSS.

### Filters & Blocks

- [Currency](docId\:gBzZmVUZJ71DAA0OneNVw)
- [Translate](docId\:gBzZmVUZJ71DAA0OneNVw)
- [Localised Date Format](docId\:gBzZmVUZJ71DAA0OneNVw)
- [Country From Country Code](docId\:gBzZmVUZJ71DAA0OneNVw)
- [Template Sections](docId\:gBzZmVUZJ71DAA0OneNVw)

### Currency

Monetary values should use the `currency` filter in a template to properly render the currency and its appropriate
formatting based on locale.

```liquid
{{ "9.99" | currency: "gbp" }}
-
£9.99
```

You can also change the currency formatting with one of the following three options:

- `display_none`
- `display_code`
- `display_symbol` (default)

```liquid
{{ "9.99" | currency: "gbp", "display_code" }}
-
GBP 9.99
```

*Note this filter also has a shorthand alias&#x20;*`c`*&#x20;which works the same.*

### Translate

Internationalisation can be supported in templates using the `translate` filter. A theme will need to have the appropriate
language file with the desired translation strings. Documentation on theme language files can be found
[here](docId\:gBzZmVUZJ71DAA0OneNVw)

```json
{
  "example": {
    "heading": "Welcome to SparkLayer!"
  }
}
```

```liquid
{{ "example.heading" | translate }}
```

*Note this filter also has a shorthand alias&#x20;*`t`*&#x20;which works the same.*

Language strings can support interpolation by providing slots in the string, and arguments to the translate filter
like so:

```json
{
  "example": {
    "heading": "Dear ${1} of ${2}"
  }
}
```

```liquid
{{ "example.heading" | translate: "Jeremy Sparks", "SparkLayer" }}
```

This filter uses the store locale from the merchant core data to translate, falling back on the `en` translation file if
no translation is found for the respective locale.

### Localised Date Format

Localised date formatting is supported with the `ldate` filter. By default, this filter uses the stores locale, provided
in the merchant core data, but an optional locale parameter can be provided and used instead.

```liquid
{{ "2024-10-22T16:18:02.196Z" | ldate }}
-
22/10/2024
```

With a provided locale:

```liquid
{{ "2024-10-22T16:18:02.196Z" | ldate: "fr-CA" }}
-
24-10-22
```

### Country From Country Code

Country names can be rendered from the country code using the `country` filter. This is helpful for address data where
the country code is stored instead of the country name.

```liquid
{{ "gb" | country }}
-
United Kingdom
```

Note that country names are only returned in english despite the stores locale.

### Template Sections

We have limited support template sections with the `section` tag. The available section templates are documented above
under [templates](docId\:gBzZmVUZJ71DAA0OneNVw), and we do not support custom sections outside of these.

```liquid
<main>
    {% section email-header %}
    <p>Content</p>
    {% section email-footer %}
</main>
-
<main>
    <header>
        <h1>Hello World</h1>
    </header>
    <p>Content</p>
    <footer>Copyright Year</footer>
</main>
```

## Internationalisation & Translations

Language JSON files can be added to themes for internationalisation in templates. The language file must be named using
a language code (i.e. `en`, `fr`, etc.) and should match the locale used by your store. The translations in these files
are available through the [translate](docId\:gBzZmVUZJ71DAA0OneNVw) liquid filter.

By default, the filter will use the stores locale, falling back on SparkLayers own core language files if no translations
in your custom language files are found, with `en` being the final fall back.

## Available Data

Templates have a range of data available to them via the `data` liquid variable, for example `data.merchant.store_name`.

| Template                                                 | Top Level Objects                                                                                                                              |
| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| invoice.liquid                                           | [merchant](docId\:EirrSj-kT1YSHixnHKcfc), [purchase](docId\:EirrSj-kT1YSHixnHKcfc), [settings](docId\:EirrSj-kT1YSHixnHKcfc)                   |
| quote.liquid                                             | [merchant](docId\:EirrSj-kT1YSHixnHKcfc), [purchase](docId\:EirrSj-kT1YSHixnHKcfc)                                                             |
| limited-user-purchase-review\.liquid                     | [merchant](docId\:EirrSj-kT1YSHixnHKcfc), [purchase](docId\:EirrSj-kT1YSHixnHKcfc)                                                             |
| limited-user-purchase-approve.liquid                     | [merchant](docId\:EirrSj-kT1YSHixnHKcfc), [purchase](docId\:EirrSj-kT1YSHixnHKcfc)                                                             |
| new-quote-notification-to-merchant.liquid                | [merchant](docId\:EirrSj-kT1YSHixnHKcfc), [purchase](docId\:EirrSj-kT1YSHixnHKcfc)                                                             |
| quote-assigned-notification-to-agent.liquid              | [merchant](docId\:EirrSj-kT1YSHixnHKcfc), [purchase](docId\:EirrSj-kT1YSHixnHKcfc), [assignment\_details](docId\:EirrSj-kT1YSHixnHKcfc)        |
| purchase-history-message-notification-to-agent.liquid    | [merchant](docId\:EirrSj-kT1YSHixnHKcfc), [purchase](docId\:EirrSj-kT1YSHixnHKcfc), [purchase\_history\_message](docId\:EirrSj-kT1YSHixnHKcfc) |
| purchase-history-message-notification-to-customer.liquid | [merchant](docId\:EirrSj-kT1YSHixnHKcfc), [purchase](docId\:EirrSj-kT1YSHixnHKcfc), [purchase\_history\_message](docId\:EirrSj-kT1YSHixnHKcfc) |
| email-header.liquid                                      | [merchant](docId\:EirrSj-kT1YSHixnHKcfc)                                                                                                       |
| email-footer.liquid                                      | [merchant](docId\:EirrSj-kT1YSHixnHKcfc)                                                                                                       |

While this data can vary from template to template, they all have access to the store details (`data.merchant`). [This object](docId\:EirrSj-kT1YSHixnHKcfc) contains the stores general information, and can be changed via the SparkLayer dashboard. Learn more [here](https://docs.sparklayer.io/dashboard-configurations#_SOYD)

More information about the objects and their properties can be found in the [Template Object](docId\:EirrSj-kT1YSHixnHKcfc) documentation.

[title] Template Objects
[path] Untitled/

Listed below are the SparkLayer objects available to use in templates and content zones. The objects available will depend on the themes template, refer to this documentation to see which objects are available for specific templates.

## Address

### Properties

| Key             | Type          | Description | Example(s) |
| --------------- | ------------- | ----------- | ---------- |
| `name`          | `string`      | -           | *-*        |
| `company`       | `string`      | -           | *-*        |
| `address_line1` | `string`      | -           | *-*        |
| `address_line2` | `string,null` | -           | *-*        |
| `city`          | `string`      | -           | *-*        |
| `region_code`   | `string,null` | -           | *-*        |
| `postal_code`   | `string,null` | -           | *-*        |
| `country_code`  | `string`      | -           | *-*        |
| `phone`         | `string,null` | -           | *-*        |

## Customer

### Properties

| Key             | Type          | Description | Example(s) |
| --------------- | ------------- | ----------- | ---------- |
| `id`            | `string`      | -           | *-*        |
| `title`         | `string`      | -           | *-*        |
| `first_name`    | `string`      | -           | *-*        |
| `last_name`     | `string`      | -           | *-*        |
| `email`         | `string`      | -           | *-*        |
| `company_name`  | `string,null` | -           | *-*        |
| `external_id`   | `string`      | -           | *-*        |
| `accounting_id` | `string`      | -           | *-*        |

## ContentZone

Content zones can be configured as part of the invoicing feature

**Note:** *Content zones may be configured to contain liquid variables and should be handled in templates accordingly*

### Properties

| Key       | Type          | Description | Example(s) |
| --------- | ------------- | ----------- | ---------- |
| `title`   | `string,null` | -           | *-*        |
| `content` | `string,null` | -           | *-*        |

## InvoiceSettings

### Properties

| Key                    | Type                                        | Description | Example(s) |
| ---------------------- | ------------------------------------------- | ----------- | ---------- |
| `content_zones.zone_1` | [ContentZone](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |
| `content_zones.zone_2` | [ContentZone](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |
| `content_zones.zone_3` | [ContentZone](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |

## LineItem

### Properties

| Key                          | Type          | Description | Example(s) |
| ---------------------------- | ------------- | ----------- | ---------- |
| `custom_attributes.[].key`   | `string`      | -           | *-*        |
| `custom_attributes.[].value` | `string`      | -           | *-*        |
| `identifiers.sku`            | `string,null` | -           | *-*        |
| `name_child`                 | `string,null` | -           | *-*        |
| `name_parent`                | `string`      | -           | *-*        |
| `quantity`                   | `integer`     | -           | *-*        |
| `line_total`                 | `unknown`     | -           | *-*        |
| `unit_total`                 | `unknown`     | -           | *-*        |
| `image_url`                  | `string,null` | -           | *-*        |
| `product_slug`               | `string,null` | -           | *-*        |
| `rrp`                        | `unknown`     | -           | *-*        |
| `barcode`                    | `string,null` | -           | *-*        |

## LineTotal

### Properties

| Key            | Type                                  | Description | Example(s) |
| -------------- | ------------------------------------- | ----------- | ---------- |
| `total_net`    | [Money](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |
| `discount_net` | [Money](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |
| `tax_rate`     | `number`                              | -           | *-*        |

## Merchant

Merchant details

### Properties

| Key             | Type          | Description                                                  | Example(s) |
| --------------- | ------------- | ------------------------------------------------------------ | ---------- |
| `address1`      | `string,null` | The address line 1 associated to the merchants store address | *-*        |
| `address2`      | `string,null` | The address line 2 associated to the merchants store address | *-*        |
| `base_currency` | `string,null` | The base currency used by the store                          | *USD,GBP*  |
| `city`          | `string,null` | The city associated to the merchants store address           | *-*        |
| `region`        | `string,null` | The region code associated to the merchants store address    | *-*        |
| `country`       | `string,null` | The country code associated to the merchants store address   | *GB*       |
| `email`         | `string,null` | The email associated to the merchant                         | *-*        |
| `phone`         | `string,null` | The phone number associated to the merchants store           | *-*        |
| `postcode`      | `string,null` | The postcode associated to the merchants store address       | *-*        |
| `store_name`    | `string,null` | The connected platforms store name                           | *-*        |
| `timezone`      | `string,null` | -                                                            | *-*        |
| `url`           | `string,null` | -                                                            | *-*        |
| `locale`        | `string,null` | The default locale of the store                              | *en,fr*    |

## Money

Represents a monetary value

### Properties

| Key        | Type     | Description | Example(s) |
| ---------- | -------- | ----------- | ---------- |
| `amount`   | `string` | -           | *-*        |
| `currency` | `string` | -           | *GBP,USD*  |

## Package

### Properties

| Key                | Type                                                | Description | Example(s) |
| ------------------ | --------------------------------------------------- | ----------- | ---------- |
| `line_items`       | `array of` [LineItem](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |
| `shipping_address` | [Address](docId\:EirrSj-kT1YSHixnHKcfc)             | -           | *-*        |

## Purchase

### Properties

| Key                             | Type                                                | Description | Example(s) |
| ------------------------------- | --------------------------------------------------- | ----------- | ---------- |
| `currency_code`                 | `string`                                            | -           | *-*        |
| `billing_address`               | [Address](docId\:EirrSj-kT1YSHixnHKcfc)             | -           | *-*        |
| `customers.sparklayer`          | [Customer](docId\:EirrSj-kT1YSHixnHKcfc)            | -           | *-*        |
| `custom_fields.[].name`         | `string`                                            | -           | *-*        |
| `custom_fields.[].value`        | `string,null`                                       | -           | *-*        |
| `customer_reference`            | `string,null`                                       | -           | *-*        |
| `dates.created_at`              | `string`                                            | -           | *-*        |
| `dates.updated_at`              | `string`                                            | -           | *-*        |
| `dates.placed_at`               | `string,null`                                       | -           | *-*        |
| `dates.calculated_submitted_at` | `string,null`                                       | -           | *-*        |
| `identifiers.visible`           | `string`                                            | -           | *-*        |
| `packages`                      | `array of` [Package](docId\:EirrSj-kT1YSHixnHKcfc)  | -           | *-*        |
| `line_items`                    | `array of` [LineItem](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |
| `subtotal`                      | [Money](docId\:EirrSj-kT1YSHixnHKcfc)               | -           | *-*        |
| `tax`                           | [Money](docId\:EirrSj-kT1YSHixnHKcfc)               | -           | *-*        |
| `shipping_cost`                 | [Money](docId\:EirrSj-kT1YSHixnHKcfc)               | -           | *-*        |
| `calculated_total`              | [Money](docId\:EirrSj-kT1YSHixnHKcfc)               | -           | *-*        |
| `tax_lines`                     | `array of` [TaxLine](docId\:EirrSj-kT1YSHixnHKcfc)  | -           | *-*        |

## UnitTotal

### Properties

| Key           | Type                                  | Description | Example(s) |
| ------------- | ------------------------------------- | ----------- | ---------- |
| `total_net`   | [Money](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |
| `total_gross` | [Money](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |
| `total_tax`   | [Money](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |
| `tax_rate`    | `number`                              | -           | *-*        |

## TaxLine

### Properties

| Key               | Type     | Description | Example(s) |
| ----------------- | -------- | ----------- | ---------- |
| `title`           | `string` | -           | *-*        |
| `rate`            | `number` | -           | *-*        |
| `amount.number`   | `string` | -           | *-*        |
| `amount.currency` | `string` | -           | *-*        |

## PurchaseHistoryMessage

### Properties

| Key          | Type                                     | Description | Example(s) |
| ------------ | ---------------------------------------- | ----------- | ---------- |
| `body`       | `string`                                 | -           | *-*        |
| `created_at` | `string`                                 | -           | *-*        |
| `customer`   | [Customer](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |

## AssignmentDetails

### Properties

| Key           | Type                                     | Description | Example(s) |
| ------------- | ---------------------------------------- | ----------- | ---------- |
| `assigned_by` | [Customer](docId\:EirrSj-kT1YSHixnHKcfc) | -           | *-*        |
| `assigned_on` | `string`                                 | -           | *-*        |

**Note:** *This documentation is in beta and may not be accurate, please contact support if you have any issues or questions*

[title] Headless
[path] Untitled/

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/Tt16IUM0I8D966ULW879y-20260922-084854.jpg)

This document provides a comprehensive guide on leveraging SparkLayer in conjunction with a Shopify-powered headless storefront. At the present moment, SparkLayer's exclusive support for Shopify is due to the need for a synchronisation mechanism However, in the near future, we plan expand its capabilities, enabling the development of custom integrations that can be compatible with many other platforms.

## Requirements

- A Shopify store
- [The SparkLayer App](https://apps.shopify.com/sparklayer) installed on the store
- A metafield definition set up for the SparkLayer Authentication metafield
- Enable storefronts access for this metafield definition

SparkLayer uses a customer metafield to store authentication data, which allows the SparkLayer front-end to authenticate the user with the SparkLayer API.

## Overview

This is a high level overview of how SparkLayer runs on a headless site.

- Get the customer data for the logged in user
- Check if the customer is a b2b customer (has the tag "b2b") and has the sparklayer.authentication metafield set. If they do, continue.
- Load the SparkLayer javascript by injecting a script tag such as: `<script src="https://sparkcdn.io/sparkjs/*SITE_ID*/live"></script>`
- When the script has loaded call `window.sparkInit({ ...options }})`, passing in options like siteId. More details on configuration can be found here.
- Inject a style element into the  document which sets CSS variables to customise the look and behaviour of the SparkLayer components. More details here.

Additional code changes are required to: show SparkLayer components, hide elements that should not be seen by b2b customers and integrate SparkLayer with controls on your site.

## Elements to hide

The following elements should be hidden for b2c customers on all pages:

- Prices
- Add to cart button
- Quantity selector

By adding the following data attribute to the element `data-spark="b2c-only"`, the element will be hidden when SparkLayer loads. You can [learn more here](https://docs.sparklayer.io/frontend-integration#aHYmA).

## Include SparkLayer components

You'll want to include SparkLayer's components in place of the elements that were just hidden.

### Product list

```html
<spark-card parent-id="{{ parentProductId }}"></spark-card>
```

`{{ parentProductId }}` the syntax for setting parent-id will vary depending on the template system used. [Learn more here](https://docs.sparklayer.io/product-card-interface)

### Product details page

```html
<spark-pdp parent-id="{{ parentProductId }}"></spark-pdp>
```

[Learn more here](https://docs.sparklayer.io/product-detail-interface)

# Code to load SparkLayer

An example react component to load SparkLayer in a nextjs project:

```javascript
// SparkLayer.jsx
import { useState, useEffect } from 'react';
import Script from 'next/script';

const defaultStyles = `
// Style Spark web components to fit your design
spark-product-card {
  width: 100%;
}
spark-pdp {
  margin: 0.5em 0 1.25em;
  display: block;
}

// Set CSS vars to customise styling of elements within SparkLayer web components
:root {
  /* Set the brand styling */
  --b2b-brand-color: var(--primary);             /* Main brand colour*/
  --b2b-brand-color-hover: var(--secondary);     /* Main brand colour hover */
  --b2b-brand-font: Poppins, sans-serif;         /* Main brand font */
  --b2b-brand-font-heading: Poppins, sans-serif; /* Main brand heading font */

  /* See https://docs.sparklayer.io/sparklayer-frontend/customising-the-design
     for more variables */
}`;

const defaultOptions = {
  platform: 'shopify',
  shopify: {
    useAppProxy: false,
  },
  cartButtonSelectors: '', // CSS selector for cart button usually located in header
  accountButtonSelectors: '', // CSS selector for account button usually located in header
};

export function SparkLayer(props) {
  const {
    customer,
    authenticationMetafield,
    options,
    onLogout,
    styles = defaultStyles,
  } = props;

  const _options = { ...defaultOptions, ...options };

  const [sparkInitialised, setSparkInitialised] = useState(false);
  const [sparkLoaded, setSparkLoaded] = useState(false);

  useEffect(() => {
    if (
      !sparkInitialised &&
      customer !== null &&
      authenticationMetafield.finished &&
      sparkLoaded &&
      !window.spark
    ) {
      const s = document.createElement('style');
      s.innerHTML = styles;
      document.head.appendChild(s);
      window.spark = window.initSpark({
        ..._options,
        onLogout,
        auth: {
          user: customer?.email,
          token: authenticationMetafield.metafield?.value,
        },
      });
      setSparkInitialised(true);
    }
  }, [customer, authenticationMetafield, sparkLoaded]);

  return customer !== null && customer.tags.includes('b2b') ? (
    <Script
      id="spark-script"
      src={`https://sparkcdn.io/sparkjs/${_options.siteId}/live`}
      onLoad={() => {
        setSparkLoaded(true);
      }}
    />
  ) : null;
}
```

You can see an example usage of this component:

```javascript
// Layout.jsx
import { SparkLayer } from '../snippets/Integrations/SparkLayer';

function Layout({ ...props }) {
  // Your app should provide a way to get data for the logged in customer
  const customer = getCustomer(); 
  
  // Your app should provide a way to get Shopify metafields for the logged in customer
  const authenticationMetafield = getCustomerMetafield('sparklayer.authentication');

  return (
    <div>
      <SparkLayer
        options={{
          siteId: '',
        }}
        onLogout={() => {
          // Call function to log customer out - provided by your app
          logout();
        }}
        authenticationMetafield={authenticationMetafield}
        customer={customer}
      />
      {/* Components to render your site here */}
    </div>
  );
}

export default Layout;
```

For more information, please feel free to [get in touch](https://docs.sparklayer.io/support) and we'd be happy to discuss our Headless solution in more detail.

[title] Spark JS
[path] Untitled/

**spark-js**

***

## Type Aliases

### AccountSectionId

```typescript
type AccountSectionId = 
  | "spark-slot-my-account"
  | "recent-activity"
  | "shopping-lists"
  | "favourites"
  | "financials"
  | "my-details"
  | "reports"
  | "address-book"
  | "company-users";
```

***

### CustomAccountDetailLinkType

```typescript
type CustomAccountDetailLinkType = "email" | "phone" | "sms" | "website";
```

***

### SparkLayerOptions

```typescript
type SparkLayerOptions = {
  sparkDomain: "app.sparklayer.io" | "test.app.sparklayer.io";
  platform: "base" | "bigcommerce" | "shopify" | "wix" | "woocommerce" | "magento";
  siteId: string;
  rootUrl: string;
  accountRedirect: {
     urlRegex?: RegExp;
     goTo?: string;
  };
  cartRedirect: {
     urlRegex?: RegExp;
     goTo?: string;
  };
  wordpressSiteUrl?: string;
  accountButtonSelectors: string;
  logoutButtonSelectors: string;
  cartButtonSelectors: string;
  loginButtonSelectors: string;
  display: DisplayOptions;
  termsAndConditionsLink: string;
  language: string;
  locale: string | null;
  translations: Translations;
  showTranslations: boolean;
  checkoutCustomElements: CheckoutElementConfig[];
  paymentMethodsOrder: PaymentMethodName[];
  saveToAddressBookDefault: boolean;
  productLink: string;
  customAccountDetails: {
     title: string;
     value: string | number;
     displayText?: string;
     type?: CustomAccountDetailLinkType;
  }[];
  onCheckoutValidation: Promise<
     | {
     message: string;
   }[]
    | null>;
  onCartUpdate: Promise<void>;
  onCartLoad: Promise<void>;
  preCartUpdateListener: Promise<Partial<UpdateCart>>;
  onReady?: Promise<void>;
  onLoad?: Promise<void>;
  onLogout?: Promise<void>;
  shopify?: {
     useAppProxy?: boolean;
  };
  bigcommerce?: {
     appClientId?: string;
  };
  auth: {
     user?: string;
     token?: string;
  };
  authLogoutUri: string | null;
  analytics?: AnalyticsOptions;
  igniteCheckoutContext?: Record<string, unknown>;
};
```

### Properties

| Property                           | Type                                                                                                                                                      | Description                                                                                                                                                                              |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   `sparkDomain`<br />              | `"app.sparklayer.io"` \| `"test.app.sparklayer.io"`                                                                                                       | The domain of the SparkLayer API (defaults to app.sparklayer.io)                                                                                                                         |
|   `platform`<br />                 | `"base"` \| `"bigcommerce"` \| `"shopify"` \| `"wix"` \| `"woocommerce"` \| `"magento"`                                                                   | Sets the default options for the platform                                                                                                                                                |
|   `siteId`<br />                   | `string`                                                                                                                                                  | The client specific site id                                                                                                                                                              |
|   `rootUrl`<br />                  | `string`                                                                                                                                                  | The root URL used to pre-fix any created URLs - generally used for i18n                                                                                                                  |
|   `accountRedirect`<br />          | \{ `urlRegex?`: `RegExp`; `goTo?`: `string`; }                                                                                                            | The account redirect options                                                                                                                                                             |
| `accountRedirect.urlRegex?`        | `RegExp`                                                                                                                                                  | -                                                                                                                                                                                        |
| `accountRedirect.goTo?`            | `string`                                                                                                                                                  | -                                                                                                                                                                                        |
|   `cartRedirect`<br />             | \{ `urlRegex?`: `RegExp`; `goTo?`: `string`; }                                                                                                            | The cart redirect options                                                                                                                                                                |
| `cartRedirect.urlRegex?`           | `RegExp`                                                                                                                                                  | -                                                                                                                                                                                        |
| `cartRedirect.goTo?`               | `string`                                                                                                                                                  | -                                                                                                                                                                                        |
|   `wordpressSiteUrl?`<br />        | `string`                                                                                                                                                  | The URL of the WordPress site when using the WooCommerce platform                                                                                                                        |
|   `accountButtonSelectors`<br />   | `string`                                                                                                                                                  | The selectors for the account button (defaults to `[href="/account"], [data-spark-link=account]`)                                                                                        |
|   `logoutButtonSelectors`<br />    | `string`                                                                                                                                                  | The selectors for the logout button (defaults to `[href="/account/logout"], [data-spark-link=logout]`)                                                                                   |
|   `cartButtonSelectors`<br />      | `string`                                                                                                                                                  | The selectors for the cart button (defaults to `[href="/cart"], [data-spark-link=cart]`)                                                                                                 |
|   `loginButtonSelectors`<br />     | `string`                                                                                                                                                  | The selectors for the login button (defaults to `[href="/spark-b2b-login"], [data-spark-link=login]`)                                                                                    |
|   `display`<br />                  | `DisplayOptions`                                                                                                                                          | The display options for the SparkLayer                                                                                                                                                   |
|   `termsAndConditionsLink`<br />   | `string`                                                                                                                                                  | Terms and conditions link (defaults to `/terms-and-conditions`)                                                                                                                          |
|   `language`<br />                 | `string`                                                                                                                                                  | The language to use for the SparkLayer (defaults to `en`)                                                                                                                                |
|   `locale`<br />                   | `string` \| `null`                                                                                                                                        | The locale to use for formatting, currently only used for dates (defaults to the user's browser locale) - examples: `en-GB`, `en-US`, `de-DE`                                            |
|   `translations`<br />             | `Translations`                                                                                                                                            | Override internal translations, keyed by language code                                                                                                                                   |
|   `showTranslations`<br />         | `boolean`                                                                                                                                                 | Useful to debug translations, shows the translation key                                                                                                                                  |
|   `checkoutCustomElements`<br />   | `CheckoutElementConfig`\[]                                                                                                                                | A list of elements to display in checkout: our standard fields (by `id`) or custom ones                                                                                                  |
|   `paymentMethodsOrder`<br />      | `PaymentMethodName`\[]                                                                                                                                    | The order of payment methods                                                                                                                                                             |
|   `saveToAddressBookDefault`<br /> | `boolean`                                                                                                                                                 | Whether to save the address to the user's address book by default (defaults to `true`)                                                                                                   |
|   `productLink`<br />              | `string`                                                                                                                                                  | The link to the product page (defaults to `/:product-slug:`)                                                                                                                             |
|   `customAccountDetails`<br />     | \{ `title`: `string`; `value`: `string` \| `number`; `displayText?`: `string`; `type?`: [CustomAccountDetailLinkType](docId\:fui0C-tBIzxq2bZvtZ0PM); }\[] | An array of objects containing title, value pairs of data to show on the My Details panel for a customer. Optionally can contain a type field to identify special formatting for values. |
|   `shopify?`<br />                 | \{ `useAppProxy?`: `boolean`; }                                                                                                                           | Shopify specific options                                                                                                                                                                 |
| `shopify.useAppProxy?`             | `boolean`                                                                                                                                                 | -                                                                                                                                                                                        |
|   `bigcommerce?`<br />             | \{ `appClientId?`: `string`; }                                                                                                                            | BigCommerce specific options                                                                                                                                                             |
| `bigcommerce.appClientId?`         | `string`                                                                                                                                                  | -                                                                                                                                                                                        |
|   `auth`<br />                     | \{ `user?`: `string`; `token?`: `string`; }                                                                                                               | Use SparkLayer auth                                                                                                                                                                      |
| `auth.user?`                       | `string`                                                                                                                                                  | -                                                                                                                                                                                        |
| `auth.token?`                      | `string`                                                                                                                                                  | -                                                                                                                                                                                        |
|   `authLogoutUri`<br />            | `string` \| `null`                                                                                                                                        | The logout URI for SparkLayer auth                                                                                                                                                       |
|   `analytics?`<br />               | `AnalyticsOptions`                                                                                                                                        | Analytics options                                                                                                                                                                        |
|   `igniteCheckoutContext?`<br />   | `Record`\<`string`, `unknown`>                                                                                                                            | Optional JSON object to pass checkout context data to Ignite                                                                                                                             |

### Methods

### onCheckoutValidation()

```typescript
onCheckoutValidation(cart, cartUiState): Promise<
  | {
  message: string;
}[]
| null>;
```

An asynchronous function to validate whether the user is allowed to checkout with their current cart contents.
Receives the current cart and the current checkout step (`cartUiState`) so validation can vary by step.
Returns an array of error objects or null if no errors.

Note: this function must be asynchronous.

### Parameters

| Parameter     | Type          |
| ------------- | ------------- |
| `cart`        | `Cart`        |
| `cartUiState` | `CartUIState` |

### Returns

`Promise`\<
\| \{
`message`: `string`;
}\[]
\| `null`>

### onCartUpdate()

```typescript
onCartUpdate(cart, results): Promise<void>;
```

A function called when the cart is updated, can be used to trigger analytics

### Parameters

| Parameter | Type             |
| --------- | ---------------- |
| `cart`    | `Cart`           |
| `results` | `CartResults`\[] |

### Returns

`Promise`\<`void`>

### onCartLoad()

```typescript
onCartLoad(cart): Promise<void>;
```

A function called when the cart is loaded, can be used to trigger analytics

### Parameters

| Parameter | Type   |
| --------- | ------ |
| `cart`    | `Cart` |

### Returns

`Promise`\<`void`>

### preCartUpdateListener()

```typescript
preCartUpdateListener(input): Promise<Partial<UpdateCart>>;
```

A function called before the cart is updated, can be used to modify the products before completing checkout.

### Parameters

| Parameter | Type                     |
| --------- | ------------------------ |
| `input`   | `Partial`\<`UpdateCart`> |

### Returns

`Promise`\<`Partial`\<`UpdateCart`>>

### onReady()?

```typescript
optional onReady(spark): Promise<void>;
```

A function called when the SparkLayer is ready

### Parameters

| Parameter | Type                                  |
| --------- | ------------------------------------- |
| `spark`   | [Spark](docId\:fui0C-tBIzxq2bZvtZ0PM) |

### Returns

`Promise`\<`void`>

### onLoad()?

```typescript
optional onLoad(spark): Promise<void>;
```

A function called when the user logs in

### Parameters

| Parameter | Type                                  |
| --------- | ------------------------------------- |
| `spark`   | [Spark](docId\:fui0C-tBIzxq2bZvtZ0PM) |

### Returns

`Promise`\<`void`>

### onLogout()?

```typescript
optional onLogout(): Promise<void>;
```

A function called when the user logs out

### Returns

`Promise`\<`void`>

***

### Spark

```typescript
type Spark = {
  options: SparkLayerOptions;
  switchImpersonatingCustomer: Promise<UserData | null>;
  refreshGlobalData: Promise<UserData | null>;
  getActiveCustomerVerificationToken: Promise<string | null>;
  getProduct: Promise<Product>;
  getProductBySlug: Promise<Product>;
  getVariant: Promise<ProductVariant>;
  getPriceForProduct: Promise<SimplifiedProductPrice>;
  calculatePricingForVariantData: ProductVariantPricing;
  isLoggedIn: Promise<boolean>;
  updateCart: Promise<CartResults[] | null>;
  externalClearBasket: Promise<void>;
  getPackSizeForVariant: Promise<number>;
  getRrpPriceForVariant: Promise<{
     rrp: number | null;
     currencyCode: string | null;
  }>;
  getPricingForVariant: Promise<{
     price: number | null;
     rrp: number | null;
     rrpCurrencyCode: string | null;
     priceBreaks: VariantPriceBreak[];
     currencyCode: string;
  }>;
  calculatePricingForVariant: Promise<ProductVariantPricing>;
  getCart: Promise<Cart | null>;
  uploadFile: Promise<string>;
  fetch: Promise<FetchResponse<ResponseOf<Q>, ErrorOf<Q>>>;
  getCartCache: Cart | null;
  openDrawer: void;
  closeDrawer: void;
};
```

### Properties

| Property          | Type                                              |
| ----------------- | ------------------------------------------------- |
|   `options`<br /> | [SparkLayerOptions](docId\:fui0C-tBIzxq2bZvtZ0PM) |

### Methods

### switchImpersonatingCustomer()

```typescript
switchImpersonatingCustomer(customerId): Promise<UserData | null>;
```

Switch impersonating customer or end impersonation with null

### Parameters

| Parameter    | Type               |
| ------------ | ------------------ |
| `customerId` | `string` \| `null` |

### Returns

`Promise`\<`UserData` | `null`>

### refreshGlobalData()

```typescript
refreshGlobalData(): Promise<UserData | null>;
```

Refetches the current active customer and site configuration, updating the cached copy both are read from

### Returns

`Promise`\<`UserData` | `null`>

### getActiveCustomerVerificationToken()

```typescript
getActiveCustomerVerificationToken(): Promise<string | null>;
```

Refetches the current active customer and returns a fresh form customer verification token.
Uses the impersonated customer when a sales agent is impersonating, otherwise the logged-in customer.

### Returns

`Promise`\<`string` | `null`>

### getProduct()

```typescript
getProduct(parentProductId): Promise<Product>;
```

Fetch the graphql product object for a given parent product id

### Parameters

| Parameter         | Type     |
| ----------------- | -------- |
| `parentProductId` | `string` |

### Returns

`Promise`\<`Product`>

### Throws

If product not found or error occurred fetching product

### getProductBySlug()

```typescript
getProductBySlug(slug): Promise<Product>;
```

Fetch the graphql product object for a given product slug

### Parameters

| Parameter | Type     |
| --------- | -------- |
| `slug`    | `string` |

### Returns

`Promise`\<`Product`>

### Throws

If product not found or error occurred fetching product

### getVariant()

```typescript
getVariant(parentProductId, variantSku): Promise<ProductVariant>;
```

Fetch the graphql variant object for a given parent product id and variant sku

### Parameters

| Parameter         | Type     |
| ----------------- | -------- |
| `parentProductId` | `string` |
| `variantSku`      | `string` |

### Returns

`Promise`\<`ProductVariant`>

### Throws

If product/variant not found or error occurred fetching product

### getPriceForProduct()

```typescript
getPriceForProduct(parentProductId): Promise<SimplifiedProductPrice>;
```

Fetch the pricing for a parent product includes price breaks, lowest price and the number of prices (used to note if from is needed to be shown)

### Parameters

| Parameter         | Type     | Description |
| ----------------- | -------- | ----------- |
| `parentProductId` | `string` | -           |

### Returns

`Promise`\<`SimplifiedProductPrice`>

All price related data for parent product, including price breaks, lowest price and number of prices. Number of prices can be used to note if from is needed to be shown.

### Throws

If product not found or error occurred fetching product

### calculatePricingForVariantData()

```typescript
calculatePricingForVariantData(
   variant, 
   qty, 
   qtyAcrossVariants?
): ProductVariantPricing;
```

Calculate the pricing for a variant given the variant data and quantity

### Parameters

| Parameter            | Type                        | Description                                                                   |
| -------------------- | --------------------------- | ----------------------------------------------------------------------------- |
| `variant`            | `ProductVariantDataPricing` | Variant data including price, rrp, and price breaks                           |
| `qty`                | `number`                    | Quantity to calculate pricing for                                             |
| `qtyAcrossVariants?` | `number` \| `null`          | For tiered pricing, this is calculated by qty across variants (if configured) |

### Returns

`ProductVariantPricing`

Total price (qty \* unit price) and unit price

### isLoggedIn()

```typescript
isLoggedIn(): Promise<boolean>;
```

Check if user is logged in

### Returns

`Promise`\<`boolean`>

### updateCart()

```typescript
updateCart(
   input, 
   cartSuccessHandledLocally?, 
   cartErrorsHandledLocally?
): Promise<CartResults[] | null>;
```

Run an update cart mutation, shows appropriate toasts and returns result

### Parameters

| Parameter                    | Type                     | Description                                                                                                                   |
| ---------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| `input`                      | `Partial`\<`UpdateCart`> | Follows the GraphQL UpdateCart Mutation Object                                                                                |
| `cartSuccessHandledLocally?` | `boolean`                | Do not show any success toasts, ask result will be handled locally (useful in the cart, as the change is shown by the update) |
| `cartErrorsHandledLocally?`  | `boolean`                | Do not show any error toasts, ask result will be handled locally                                                              |

### Returns

`Promise`\<`CartResults`\[] | `null`>

Returns CartResults or null if error (check console for error)

### Throws

Error If request fails

### externalClearBasket()

```typescript
externalClearBasket(): Promise<void>;
```

Call SparkLayer to clear the basket, designed to be used on the thanks page

### Returns

`Promise`\<`void`>

### getPackSizeForVariant()

```typescript
getPackSizeForVariant(parentProductId, variantSku): Promise<number>;
```

Fetch the pack size for a variant given parent product id and variant sku

### Parameters

| Parameter         | Type     | Description |
| ----------------- | -------- | ----------- |
| `parentProductId` | `string` | -           |
| `variantSku`      | `string` | -           |

### Returns

`Promise`\<`number`>

Pack Size for Variant

### Throws

If product/variant not found or error occurred fetching product

### getRrpPriceForVariant()

```typescript
getRrpPriceForVariant(parentProductId, variantSku): Promise<{
  rrp: number | null;
  currencyCode: string | null;
}>;
```

Fetch the RRP price for a variant given parent product id and variant sku

### Parameters

| Parameter         | Type     | Description |
| ----------------- | -------- | ----------- |
| `parentProductId` | `string` | -           |
| `variantSku`      | `string` | -           |

### Returns

`Promise`\<\{
`rrp`: `number` | `null`;
`currencyCode`: `string` | `null`;
}>

RRP price (null if not set for currency) and currency code

### Throws

If product/variant not found or error occurred fetching product

### getPricingForVariant()

```typescript
getPricingForVariant(parentProductId, variantSku): Promise<{
  price: number | null;
  rrp: number | null;
  rrpCurrencyCode: string | null;
  priceBreaks: VariantPriceBreak[];
  currencyCode: string;
}>;
```

Fetch the pricing for a variant given parent product id and variant sku

### Parameters

| Parameter         | Type     | Description |
| ----------------- | -------- | ----------- |
| `parentProductId` | `string` | -           |
| `variantSku`      | `string` | -           |

### Returns

`Promise`\<\{
`price`: `number` | `null`;
`rrp`: `number` | `null`;
`rrpCurrencyCode`: `string` | `null`;
`priceBreaks`: `VariantPriceBreak`\[];
`currencyCode`: `string`;
}>

All price related data for variant

### Throws

If product/variant not found or error occurred fetching product

### calculatePricingForVariant()

```typescript
calculatePricingForVariant(
   parentProductId, 
   variantSku, 
   qty, 
   qtyAcrossVariants
): Promise<ProductVariantPricing>;
```

Given a product id, sku and quantity, return the price for the product

### Parameters

| Parameter           | Type               | Description                                                                   |
| ------------------- | ------------------ | ----------------------------------------------------------------------------- |
| `parentProductId`   | `string`           | -                                                                             |
| `variantSku`        | `string`           | -                                                                             |
| `qty`               | `number`           | -                                                                             |
| `qtyAcrossVariants` | `number` \| `null` | For tiered pricing, this is calculated by qty across variants (if configured) |

### Returns

`Promise`\<`ProductVariantPricing`>

Total price (qty \* unit price) and unit price

### Throws

If product/variant not found or error occurred fetching product

### getCart()

```typescript
getCart(): Promise<Cart | null>;
```

Fetch the cart from GraphQL

### Returns

`Promise`\<`Cart` | `null`>

### uploadFile()

```typescript
uploadFile(fileName, fileData): Promise<string>;
```

Upload a file to the SparkLayer file store

### Parameters

| Parameter  | Type     | Description                          |
| ---------- | -------- | ------------------------------------ |
| `fileName` | `string` | Name of the file including extension |
| `fileData` | `Blob`   | File data as a Blob                  |

### Returns

`Promise`\<`string`>

Returns a promise which resolves to the uploaded file URL

### fetch()

```typescript
fetch<Q>(
   query, 
   variables?, 
   useImpersonatingCustomer?, 
   bypassAppProxy?
): Promise<FetchResponse<ResponseOf<Q>, ErrorOf<Q>>>;
```

Run a GraphQL query (with the user authenticated)

### Type Parameters

| Type Parameter                                                                                                                |
| ----------------------------------------------------------------------------------------------------------------------------- |
| `Q` *extends* `GraphqlQueryOrMutation`\<`unknown`, `Record`\<`string`, `unknown`>, `GraphqlError` \| `GraphqlExtensionError`> |

### Parameters

| Parameter                   | Type                | Description                                                                                  |
| --------------------------- | ------------------- | -------------------------------------------------------------------------------------------- |
| `query`                     | `Q`                 | GraphQL query string                                                                         |
| `variables?`                | `VariablesOf`\<`Q`> | GraphQL variables                                                                            |
| `useImpersonatingCustomer?` | `boolean`           | Whether to make the request as the customer that is being impersonated or as the sales agent |
| `bypassAppProxy?`           | `boolean`           | -                                                                                            |

### Returns

`Promise`\<`FetchResponse`\<`ResponseOf`\<`Q`>, `ErrorOf`\<`Q`>>>

Returns a promise which resolves to standard JS response object (use status and data)

### getCartCache()

```typescript
getCartCache(): Cart | null;
```

Get the cached cart if available

### Returns

`Cart` | `null`

Returns the cached cart or null if not available

### openDrawer()

```typescript
openDrawer(initialTab?): void;
```

Open the cart drawer, optionally with an initial tab

### Parameters

| Parameter     | Type            | Description                                                                    |
| ------------- | --------------- | ------------------------------------------------------------------------------ |
| `initialTab?` | `DrawerUIState` | The initial tab to open ('cart', 'sales-agent', 'account', defaults to 'cart') |

### Returns

`void`

### closeDrawer()

```typescript
closeDrawer(): void;
```

Close the cart drawer

### Returns

`void`

[title] Customizing Add to Cart
[path] Untitled/

`preCartUpdateListener` is a hook you provide that runs immediately before SparkLayer's own built-in add-to-cart UI calls `updateCart` - giving you a chance to modify the payload it's about to send.

```typescript
window.sparkOptions = {
  preCartUpdateListener(input: Partial<UpdateCart>): Promise<Partial<UpdateCart>>,
};
```

`input` is the payload about to be sent to `updateCart` - it's not the live `Cart` (no `items`, `totals`, etc.), just whatever that widget is about to add. Return the (optionally modified) payload - SparkLayer sends whatever you return.

:::hint{type="info"}
If you're calling `updateCart` yourself (e.g. a custom add-to-cart button) you don't need this hook at all - just set `customAttributes` directly on the products you send. See [Modifying Cart Contents](docId:1nctQXIhRYueptnOWkOl7).
:::

## Collecting customizations from the page

The most common use case is collecting values from form fields on the product page and attaching them as `customAttributes` to whatever's being added to the cart. To achieve this, we recommend tagging every relevant input/select with `data-spark-custom-attributes` for use in the `preCartUpdateListener`:

```html
<label for="shirt-length">Shirt Length</label>
<input id="shirt-length" name="Shirt Length" data-spark-custom-attributes />

<label for="shirt-fabric">Shirt Fabric</label>
<select id="shirt-fabric" name="Shirt Fabric" data-spark-custom-attributes>
  <option value="cotton">Cotton</option>
  <option value="polyester">Polyester</option>
</select>
```

```javascript
window.sparkOptions = {
  preCartUpdateListener: (input) => {
    if (!input.products?.length) {
      return input;
    }

    const nodes = document.querySelectorAll(
      'input[data-spark-custom-attributes], select[data-spark-custom-attributes]',
    );

    const handledRadioGroups = new Set();
    const attrs = [];

    nodes.forEach((el) => {
      const type = (el.type || '').toLowerCase();

      if (type === 'radio') {
        if (handledRadioGroups.has(el.name)) return;
        handledRadioGroups.add(el.name);
        el = document.querySelector(
          `input[name="${CSS.escape(el.name)}"][data-spark-custom-attributes]:checked`,
        );
        if (!el) return; // nothing selected in this radio group
      } else if (type === 'checkbox' && !el.checked) {
        return;
      }

      const labelEl = el.id ? document.querySelector(`label[for="${CSS.escape(el.id)}"]`) : null;
      const key =
        labelEl?.textContent.trim().replace(/:$/, '') ||
        el.name;
      const value =
        el.tagName === 'SELECT'
          ? el.options[el.selectedIndex]?.textContent.trim()
          : el.value.trim();

      if (key && value) {
        attrs.push({ key, value });
      }
    });

    if (!attrs.length) {
      return input;
    }

    input.products.forEach((item) => {
      item.customAttributes = [...(item.customAttributes ?? []), ...attrs];
    });

    return input;
  },
};
```

For just one or two fixed fields, it's often simpler to look them up directly rather than tagging + scraping:

```javascript
window.sparkOptions = {
  preCartUpdateListener: (input) => {
    if (!input.products?.length) {
      return input;
    }

    const shirtLength = document.querySelector('#shirt-length')?.value;
    const shirtFabric = document.querySelector('#shirt-fabric')?.value;
    if (!shirtLength && !shirtFabric) {
      return input;
    }

    const customShirt = input.products.find((p) => p.sku === 'SHIRT-CUSTOM');
    if (!customShirt) {
      return input;
    }

    customShirt.customAttributes = customShirt.customAttributes ?? [];
    if (shirtLength) {
      customShirt.customAttributes.push({ key: 'Shirt Length', value: shirtLength });
    }
    if (shirtFabric) {
      customShirt.customAttributes.push({ key: 'Shirt Fabric', value: shirtFabric });
    }

    return input;
  },
};
```

## Attaching a file

Use the `spark-file-upload-field` component to let customers upload a file (e.g. an image or design) on the product page, then attach it via the same hook.

```html
<spark-file-upload-field
  id="shirt-design-upload"
  allowed-extensions='["png", "jpg", "jpeg"]'
></spark-file-upload-field>
```

| Property             | Description                                                                                   |
| -------------------- | --------------------------------------------------------------------------------------------- |
| `allowed-extensions` | A list of file extensions to allow, as a JSON array. Defaults to most common file extensions. |
| `max-file-size`      | Maximum file size, in bytes.                                                                  |
| `max-files`          | Maximum number of files.                                                                      |
| `required`           | Whether a file must be uploaded.                                                              |

It dispatches:

- `spark-file-attachment-changed` - fired whenever the file list changes, with `event.detail` as an array of `{ fileSize, fileName, gid }` (or `null` if all files were removed).
- `spark-file-attachment-failed` - fired when a file fails to upload

You can add listeners for these events with the following JavaScript:

```javascript
window.addEventListener('spark-file-attachment-changed', (e) => {
  // e.detail is an array of the file details in the following format:
  // {
  //   fileSize: number,
  //   fileName: string,
  //   gid: string,
  // }

  // Handle files
});

window.addEventListener('spark-file-attachment-failed', (e) => {
  // e.detail format:
  // {
  //   fileSize: number,
  //   fileName: string,
  //   errorCode: string,
  // }
  //
  // errorCode can be one of the following:
  // - "unsupported-file-type"
  // - "file-too-large"
  // - "default"

  // Handle failed file...
});
```

`preCartUpdateListener` and the upload field are usually defined in separate parts of your theme (e.g. `sparkOptions` in a layout file, the upload field in a product template) with no shared JS scope between them. A hidden input is a simple way to hand the uploaded file data from one to the other - it doesn't have to be a hidden input specifically, `preCartUpdateListener` just needs some way to read whatever you used to store it, whenever it runs.

Store the event detail there, then pull just the `gid`s out of it for the custom attribute's `value`:

```html
<!-- holds the uploaded file data, written to and read back below -->
<input id="shirt-design" type="hidden" />

<script>
  const uploadEl = document.querySelector('#shirt-design-upload'); // <-- id of the spark-file-upload-field above
  const inputEl = document.querySelector('#shirt-design');
  if (uploadEl && inputEl) {
    uploadEl.addEventListener('spark-file-attachment-changed', (e) => {
      inputEl.value = e.detail ? JSON.stringify(e.detail) : '';
    });
  }
</script>
```

```javascript
window.sparkOptions = {
  preCartUpdateListener: (input) => {
    if (!input.products?.length) {
      return input;
    }

    const filesJson = document.querySelector('#shirt-design')?.value; // <-- read back the hidden input from above
    if (!filesJson) {
      return input;
    }

    const gids = JSON.parse(filesJson).map((file) => file.gid);

    const customShirt = input.products.find((p) => p.sku === 'SHIRT-CUSTOM'); // <-- match your own custom-line-item SKU
    if (!customShirt) {
      return input;
    }

    customShirt.customAttributes = [
      ...(customShirt.customAttributes ?? []),
      { key: 'Front Design', value: JSON.stringify(gids) }, // <-- key is shown to the customer/staff as the attachment's label
    ];

    return input;
  },
};
```

See [Modifying Cart Contents](docId:1nctQXIhRYueptnOWkOl7) for the full shape of `customAttributes`, including this same file `value` format when building `updateCart` calls manually.

[title] JavaScript SDK
[path] /

![](https://archbee-image-uploads.s3.amazonaws.com/kxppJrvFK15E9wXbMKaTP/NkaRla7kkyo_iSxYad5CD-20260922-084855.jpg)

With the SparkLayer SDK, you can enhance your frontend development and create more customised experiences for your users. The SDK provides a range of straightforward functions to access data stored within SparkLayer, as well as granting access to the GraphQL API and a cart update function. These features empower developers to build more advanced and dynamic applications on top of the SparkLayer platform.

### Example use-cases

The SparkLayer SDK empowers developers to build more advanced and dynamic applications on top of the SparkLayer platform. Use-cases can include:

| Area                                   | Details                                                                                                                                                                                                         |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Accessing Data and APIs                | Provides functions to access data within SparkLayer and utilize the GraphQL API, enabling the development of advanced and dynamic applications.                                                                 |
| Manual Initialization                  | Allows manual initialization of the SDK, useful in headless commerce implementations.                                                                                                                           |
| Customizing User Experiences           | Allows calculation of pricing data, updating the shopping cart and retrieving updated cart information, customisation of the look and feel.                                                                     |
| Product Variant Image Updating         | Custom code can be added to update product images when a variant is selected, enhancing user shopping experience by providing visual feedback.                                                                  |
| Custom Checkout Validation             | Enables custom validation logic at checkout for personalized API calls to verify cart contents and manage checkout permissions based on custom rules (e.g., managing one-time discounts, product quota limits). |
| Adding Custom Attributes to Cart Items | Offers a method to include custom attributes with cart items, ensuring customizations are visible under the product SKU and persist through to past orders.                                                     |

:::hint{type="info"}
**Please note:**
The SparkLayer SDK must not be used to modify the HTML and CSS we provide via our components within your storefront. These components may be subject to update by SparkLayer which may impact any changes you make, however we do ensure our SDK is always backwards compatible. If you're unsure of the recommended use cases, our team will be happy to advise.
:::

### Manual initialisation

If you don't want SparkLayer to initialise automatically useful in headless situations, instead of setting `window.sparkOptions` you can manually call `window.initSpark()` once the script has loaded like so (requires at least version 1.0.21):

```html
<script src="https://cdn.sparklayer.io/spark.1.0.21.js"></script>
<script>
window.spark = window.initSpark({ /* options */ })
<script>
```

### Example customisation

The following code snippet illustrates how to use the SparkLayer library. In this example, we're using the calculatePricingForVariant function, which takes in the parent ID, SKU, and quantity as parameters to calculate pricing data.

```html
<script>
  window.sparkOptions = {
    siteId: "b2bshopifydemostore",
    platform: "shopify",
    // etc...
  };
</script>
<script async src="https://cdn.sparklayer.io/spark.1.0.1.js"></script>
<script>
  // Prints the following to the console: {totalPrice: 8.32, unitPrice: 4.16, currencyCode: 'gbp'}
  console.log(await window.spark.calculatePricingForVariant('6660191387839', 'MUG-MOM', 2));
  // Below is an example of updating the cart
  const products = {
    products: [
        {
            sku: 'BRACE-COLOURED',
            adjustQuantity: 3,
        },
    ],
    clearCart: false, // can be set to true to clear the cart!
  };
  console.log(await window.spark.updateCart(products)); // Returns the result of the cart changes
  // Below is an example of how to change a custom field on the cart
  console.log(await window.spark.updateCart({
    customFields: [
        {
            name: 'season',
            value: 'in-season',
        },
    ],
  }));
  console.log(await window.spark.getCart()); // Returns the updated cart
  await window.spark.updateCart({clearCart:true}); // Clears the basket
</script>
```

See [Modifying Cart Contents](docId:1nctQXIhRYueptnOWkOl7) for the full `updateCart` reference - adding/removing items, custom attributes, and handling the result.

By viewing the [spark module](docId\:fui0C-tBIzxq2bZvtZ0PM), you can see the functions available.

### Updating the product image when a variant is selected

When using either the spark-product-card or spark-pdp widget to select a variant, the product image is not updated by default to match the selected variant. Fortunately, this behavior can be easily customised using some theme code. Here's an example of how to accomplish this with the spark-product-card widget - the process is virtually the same for spark-pdp.

Broadly, the following code changes are necessary:

1. Add an event listener to the `spark-pdp` or the `spark-product-card` elements for the `spark-variant-change` event
2. Within the event listener callback, show / hide product images as appropriate

### Listen for the event

When the variant selector is changed, a `spark-variant-change` event is dispatched on the `spark-product-card` element. Use the following code to listen for the event.

```javascript
window.addEventListener("DOMContentLoaded", (event) => {
    const productCards = document.querySelectorAll("spark-product-card");
    for (productCard of productCards) {
        productCard.addEventListener("spark-variant-change", (e) => {
            console.log("spark-variant-change", e.data)
        });
    }
  },
};
```

:::hint{type="info"}
**Please note:**
Note: the event listeners can only be registered once the `spark-product-card` has been added to the page, which is why we suggest using the `onReady` option.
:::

### Show the product image

Choosing the best approach for updating variant images depends on the site's theme and markup. We've tested the following process using Shopify's Dawn theme.

The first step is to ensure that all variant images are present within the Document Object Model (DOM). If you're using Shopify, this can be done by iterating through product variants within the Liquid template that renders the product card images. You'll want to hide images for all but one variant (the first variant, which is selected by default). For the Shopify Dawn theme, the easiest way to do this is by setting the opacity to 0 (`style="opacity: 0"`).

Next, add the `data-variant-id` data attribute to all variant image tags, setting it to the variant ID.

When the user selects a variant, the following properties on the event object indicate which variant was chosen:

- `event.detail.product.externalId` - Platform (e.g., Shopify) ID of the product.
- `event.detail.variant.externalId` - Platform (e.g., Shopify) ID of the variant.

In order to display the correct image, the callback function needs to locate the image elements for the product card within the DOM.

Here's a full working example:

```javascript
window.sparkOptions = {
  onReady() {
    const productCards = document.querySelectorAll("spark-product-card");
    for (productCard of productCards) {
      productCard.addEventListener("spark-variant-change", (e) => {
        const cardEl = e.target.closest(".card-wrapper");
        const variantId = e.detail.variant.externalId;

        if (!cardEl) {
          return;
        }

        // hide all variant images
        cardEl
          .querySelectorAll(`img[data-variant-id]`)
          .forEach((el) => (el.style.opacity = "0"));

        // show appropriate image
        const variantImgEl = cardEl.querySelector(
          `img[data-variant-id="${variantId}"]`,
        );

        variantImgEl && (variantImgEl.style.opacity = "1");
      });
    }
  },
};
```

### Adding custom checkout validation

Implementing custom checkout validation enables the client to create personalized calls to any API to verify the contents of the customer's cart and accordingly permit or restrict them from completing the checkout. A potential use case could be managing one-time discounts for unique customers, and utilizing an API to check if the customer has already exhausted their quota.

To set this up, assign an asynchronous function to the `onCheckoutValidation` spark option. The function must be asynchronous to prevent the user interface from being blocked while the API call is taking place. This function should return an array of error objects or null if there are no errors.

Here is an example of how this might work:

```javascript
window.sparkOptions = {
  onCheckoutValidation: async (cart) => {
    // Do API call to validate
    res = await fetch("example.com/cart-validation", {
      method: "POST",
      body: JSON.stringify(cart),
    });
    // If valid, return null.
    if (res.json().valid) {
      return null;
    }
    // If not valid, return array of error objects.
    return [
      {
        message:
          "Unable to checkout with item due to it hit product quota ordering limits.",
      },
    ];
  },
};
```

In the above example, the asynchronous function onCheckoutValidation receives a cart object as a parameter. This object is then passed as a POST request to the 'cart-validation' endpoint of the example.com API. If the response from the API call is valid, the function returns null, indicating that the checkout can proceed. If the response from the API call is not valid, the function returns an array of error messages, which can then be handled by your front-end to alert the user that they cannot proceed with checkout."

### Opening the Cart when adding a product

SparkLayer provides an `onCartUpdate` callback function that triggers whenever the cart is modified. This function can be used to automatically open the cart drawer:

```javascript
window.sparkOptions = {
  onCartUpdate: async function (cart, results) {
    /* if the drawer hasn't been loaded yet, add it */
    if (!document.querySelector('spark-drawer')) {
      const el = document.createElement('spark-drawer');
      el.setAttribute('initial-tab', 'cart');
      document.body.appendChild(el);
    }

    /* switch the drawer to the Cart tab */
    window.dispatchEvent(
      new CustomEvent('view-update', {
        bubbles: true,
        composed: true,
        detail: { view: 'cart' },
      }),
    );
   return cart
  },
};
```

### Adding custom attributes or file attachments to a cart item

See [Modifying Cart Contents](docId:1nctQXIhRYueptnOWkOl7) and [Customizing Add to Cart](docId\:dqn6YkfT1nH2i_0QZaywX) for adding custom attributes - including file attachments - to cart items.

### Integrating Google Analytics with SparkLayer SDK

### Enabling Google Analytics or GTM

To enable GA4 or GTM within your SparkLayer setup, configure the `analytics` option in your `sparkOptions`. You can specify multiple analytics providers, each with their respective event handlers and the events you wish to track.

```javascript
window.sparkOptions = {
  // ... other SparkLayer options ...

  analytics: {
    providers: [
      {
        handler: 'ga', // Use 'ga' for Google Analytics
        events: {
          addToCart: true,
          cartUpdate: true,
          shoppingListSave: true,
          shoppingListLoad: true,
          shoppingListDelete: true,
          csvUpload: true,
          quickAdd: true,
          finalStageCheckout: true,
          shippingUpdate: true,
          beginCheckout: true,
          purchase: true,
          viewCart: true
        }
      },
      {
        handler: 'gtm', // Use 'gtm' for Google Tag Manager
        events: {
          addToCart: true,
          cartUpdate: true,
          shoppingListSave: true,
          shoppingListLoad: true,
          shoppingListDelete: true,
          csvUpload: true,
          quickAdd: true,
          finalStageCheckout: true,
          shippingUpdate: true,
          beginCheckout: true,
          purchase: true,
          viewCart: true
        }
      },
      {
        handler: function(eventName, eventParam) {
          console.log('Event fired to custom provider:', eventName, eventParam);
          // Implement your custom analytics logic here
        },
        events: {
          addToCart: true,
          cartUpdate: true,
          shoppingListSave: true,
          shoppingListLoad: true,
          shoppingListDelete: true,
          csvUpload: true,
          quickAdd: true,
          finalStageCheckout: true,
          shippingUpdate: true,
          beginCheckout: true,
          purchase: true,
          viewCart: true
        }
      }
    ]
  }
};
```

### Configuration details

- providers: An array of analytics providers you wish to integrate. Each provider object can define a `handler` and the specific `events` to track.

### Provider Options

| Provider Type | Description                                                                                                                                                                                    |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 'ga'          | Integrates with Google Analytics (GA4). This works best when using [Shopify's GA4 solution](https://help.shopify.com/en/manual/reports-and-analytics/google-analytics/google-analytics-setup). |
| 'gtm'         | Integrates with Google Tag Manager.                                                                                                                                                            |
| function      | Allows for a custom analytics handler. Use this to integrate with other analytics platforms or to implement bespoke tracking logic.                                                            |

### Available Events

| Event Name           | Description                                                             |
| -------------------- | ----------------------------------------------------------------------- |
| `addToCart`          | Triggered when a product is added to the cart.                          |
| `cartUpdate`         | Fired when the cart is updated (e.g., quantity changes, item removals). |
| `shoppingListSave`   | Occurs when a shopping list is saved.                                   |
| `shoppingListLoad`   | Occurs when a shopping list is loaded.                                  |
| `shoppingListDelete` | Occurs when a shopping list is deleted.                                 |
| `csvUpload`          | Triggered when a CSV file is uploaded.                                  |
| `quickAdd`           | Fired during quick add actions.                                         |
| `finalStageCheckout` | Occurs at the final stage of the checkout process.                      |
| `shippingUpdate`     | Fired when shipping details are updated during the checkout.            |
| `beginCheckout`      | Triggered when the checkout process begins.                             |
| `purchase`           | Occurs upon successful purchase completion.                             |
| `viewCart`           | Fired when the cart is viewed.                                          |

### Custom Analytics Provider

If you need to integrate with an analytics service not natively supported by SparkLayer, you can define a custom handler function. This function receives the event name and parameters, allowing you to implement any tracking logic as needed.

```javascript
{
  handler: function(eventName, eventParam) {
    // Example: Send event data to a custom analytics service
    fetch('https://your-analytics-endpoint.com/track', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        event: eventName,
        parameters: eventParam
      })
    })
    .then(response => response.json())
    .then(data => {
      console.log('Custom analytics event tracked:', data);
    })
    .catch(error => {
      console.error('Error tracking custom analytics event:', error);
    });
  },
  events: {
    addToCart: true,
    cartUpdate: true,
    // ... other events ...
  }
}
```

## Configuring redirect on login

To configure redirection within SparkLayer, you need to include the spark-redirect.js script in your HTML. This script should be placed outside of the `{%- if customer.metafields.sparklayer.authentication -%}` conditional block in order for it to be picked up even if the user isn't authenticated.

```html
<script async src="https://cdn.sparklayer.io/spark-redirect.js"></script>
```

By default, if a user is not authenticated, they will be redirected to the `/account/login` page. You can customize this login path by setting the `window.sparkRedirectLoginPath` variable before including the script:

```html
<script>
    window.sparkRedirectLoginPath = "/account/login";
</script>
<script async src="https://cdn.sparklayer.io/spark-redirect.js"></script>
```

Some links (for example, the 'View Order' button in certain emails) will trigger specific functionality on sparklayer once the user has logged in. In order for this to work, you need to add the spark-redirect.js script above in addition to the core spark script.
