Download OpenAPI specification:Download
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 B2B ordering system.
The SparkLayer API is designed to be as extensive as you need it to be and you can control which data you send. It's important to note that if you use one of the ready made connectors your integration can be streamlined and we advise reading our guide before you begin.
The SparkLayer API follows REST principles with predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. The API expects incoming data to be valid JSON objects with requests containing the header Content-Type: application/json
. All responses of the API, including errors, are in JSON.
All endpoints of the API are version 1 and this is part of the URL. For Cross-Origin Resource Sharing, all responses have a wildcard same-origin which makes them completely public.
Within your SparkLayer Dashboard, you can generate API keys from the Configuration section. Each time you generate an API key, you'll be given a Client ID and Client Secret used for authentication. You'll also need your unique site-id
and this can be found within the My Account section of the SparkLayer Dashboard (this typically follows the format of your Company Name e.g. Test Store would teststore
). If you would like a site-id
to be created on our staging system, please email contact@sparklayer.io.
The base URL of the API for available environments are as follows:
Environment | Base URL |
---|---|
Live | https://app.sparklayer.io |
Test | https://test.app.sparklayer.io |
Backwards compatible changes are made regularly to improve the API and there is a changelog within our support documentation. Please email contact@sparklayer.io if you require any technical support and we'll be happy to help!
Authentication with SparkLayer works by creating an application and authenticating with an OAuth2 flow so that every user that uses the application gets assigned an individualised token.
The access_token
retrieved, is then sent with the requests as so "Authorization: Bearer bza87*example_token*aksdn"
.
Scope | Description |
---|---|
customers.read | read customer data |
customers | read/write customer data |
orders.read | read order data |
orders | read/write order data |
products.read | read core product data |
products | read/write core product data |
products.pricing.read | read product pricing data |
products.pricing | read/write product pricing data |
products.stock.read | read product stock data |
products.stock | read/write product stock data |
setup.read | read setup data* |
setup | read/write setup data* |
You can use the route POST /api/auth/token
with the parameters client_id
, client_secret
and grant_type=client_credentials
to get the user access token. This is the token that is used in the Authorization header for all requests in the SparkLayer API.
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
grant_type | string Enum: "client_credentials" "refresh_token" "password" |
client_id | string |
client_secret | string |
username | string |
password | string |
refresh_token | string |
{- "grant_type": "client_credentials",
- "client_id": "c466d1fb-1af1-4437-a25c-03e8f94814bf",
- "client_secret": "7zA5ltJNkiI2WzhU90fTmYJANRcXYJPXsB8SnIEM3x37B2genuwqyv5tVdfLkUWV"
}
{- "token_type": "string",
- "expires_in": 0,
- "access_token": "string",
- "refresh_token": "string"
}
The API uses the following error status codes:
Code | Status | |
---|---|---|
400 | Bad Request | Unable to validate the request body |
401 | Unauthorized | Authorisation header was invalid or if posting to /auth/token, the details were incorrect |
403 | Forbidden | Permission denied, the required permissions not available for your access token |
404 | Not Found | The requested object could not be found |
405 | Method Not Allowed | An invalid method was used for the endpoint |
409 | Conflict | The requested action conflicts with the current state of the object |
500 | Internal Server Error | A problem occurred server side, try again later or contact support |
503 | Service Unavailable | Temporary issue with infrastructure, try again later |
The API uses the following error response object which follows RFC-7807. This may not always be the case for 5xx errors.
detail | string Human-readable summary of the error |
status | integer HTTP Status code returned from API |
title | string Machine-readable error code |
type | string |
Array of objects or null A list of errors related to the call |
{- "detail": "Data Validation Failed",
- "status": 400,
- "title": "invalid-api-request-contents",
- "errors": [
- {
- "code": "resource-not-found",
- "property": "stock_location_id",
- "message": "stock_location_id not found"
}
]
}
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
Array of objects (ProductVariant-2) | |
external_id | string <= 100 characters External ID (cannot start with pp_ and must be unique) |
title required | string <= 255 characters Product Title |
slug required | string <= 255 characters Product Slug (Used as the link identifier) |
{- "variants": [
- {
- "external_id": "IDV001",
- "sku": "IDV001",
- "weight_in_grams": 0,
- "tax_type": 1,
- "position": 1,
- "cart_image_url": null,
- "rrp": [
- {
- "value": 10.49,
- "currency_code": "gbp"
}
], - "options": [
- {
- "group": "Color",
- "value": "Blue"
}
], - "status": "live",
- "settings": [
- {
- "customer_group": "default",
- "pack_size": 1,
- "reserve_stock_quantity": null,
- "min_order_quantity": null,
- "max_order_quantity": null,
- "min_order_parent_quantity": null,
- "max_order_parent_quantity": null,
- "display": null,
- "sell": null
}
], - "stock": [
- {
- "stock_location_id": "sl_123",
- "stock_level": 9,
- "restock_date": "2020-01-01",
- "min_stock_level": -9
}
]
}
], - "external_id": "ID001",
- "title": "Striped Jumper",
- "slug": "striped-jumper"
}
{- "id": "pp_123",
- "variants": [
- {
- "product_id": "pp_123",
- "id": "pv_234",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "external_id": "IDV001",
- "sku": "IDV001",
- "weight_in_grams": 0,
- "tax_type": 1,
- "position": 1,
- "cart_image_url": null,
- "rrp": [
- {
- "value": 10.49,
- "currency_code": "gbp"
}
], - "options": [
- {
- "group": "Color",
- "value": "Blue"
}
], - "status": "live",
- "settings": [
- {
- "customer_group": "default",
- "pack_size": 1,
- "reserve_stock_quantity": null,
- "min_order_quantity": null,
- "max_order_quantity": null,
- "min_order_parent_quantity": null,
- "max_order_parent_quantity": null,
- "display": null,
- "sell": null
}
], - "stock": [
- {
- "stock_location_id": "sl_123",
- "stock_level": 9,
- "restock_date": "2020-01-01",
- "min_stock_level": -9
}
]
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "external_id": "ID001",
- "title": "Striped Jumper",
- "slug": "striped-jumper"
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
{- "id": "pp_123",
- "variants": [
- {
- "product_id": "pp_123",
- "id": "pv_234",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "external_id": "IDV001",
- "sku": "IDV001",
- "weight_in_grams": 0,
- "tax_type": 1,
- "position": 1,
- "cart_image_url": null,
- "rrp": [
- {
- "value": 10.49,
- "currency_code": "gbp"
}
], - "options": [
- {
- "group": "Color",
- "value": "Blue"
}
], - "status": "live",
- "settings": [
- {
- "customer_group": "default",
- "pack_size": 1,
- "reserve_stock_quantity": null,
- "min_order_quantity": null,
- "max_order_quantity": null,
- "min_order_parent_quantity": null,
- "max_order_parent_quantity": null,
- "display": null,
- "sell": null
}
], - "stock": [
- {
- "stock_location_id": "sl_123",
- "stock_level": 9,
- "restock_date": "2020-01-01",
- "min_stock_level": -9
}
]
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "external_id": "ID001",
- "title": "Striped Jumper",
- "slug": "striped-jumper"
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
Array of objects (ProductVariant-2) | |
external_id | string <= 100 characters External ID (cannot start with pp_ and must be unique) |
title | string <= 255 characters Product Title |
slug | string <= 255 characters Product Slug (Used as the link identifier) |
{- "variants": [
- {
- "external_id": "IDV001",
- "sku": "IDV001",
- "weight_in_grams": 0,
- "tax_type": 1,
- "position": 1,
- "cart_image_url": null,
- "rrp": [
- {
- "value": 10.49,
- "currency_code": "gbp"
}
], - "options": [
- {
- "group": "Color",
- "value": "Blue"
}
], - "status": "live",
- "settings": [
- {
- "customer_group": "default",
- "pack_size": 1,
- "reserve_stock_quantity": null,
- "min_order_quantity": null,
- "max_order_quantity": null,
- "min_order_parent_quantity": null,
- "max_order_parent_quantity": null,
- "display": null,
- "sell": null
}
], - "stock": [
- {
- "stock_location_id": "sl_123",
- "stock_level": 9,
- "restock_date": "2020-01-01",
- "min_stock_level": -9
}
]
}
], - "external_id": "ID001",
- "title": "Striped Jumper",
- "slug": "striped-jumper"
}
{- "id": "pp_123",
- "variants": [
- {
- "product_id": "pp_123",
- "id": "pv_234",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "external_id": "IDV001",
- "sku": "IDV001",
- "weight_in_grams": 0,
- "tax_type": 1,
- "position": 1,
- "cart_image_url": null,
- "rrp": [
- {
- "value": 10.49,
- "currency_code": "gbp"
}
], - "options": [
- {
- "group": "Color",
- "value": "Blue"
}
], - "status": "live",
- "settings": [
- {
- "customer_group": "default",
- "pack_size": 1,
- "reserve_stock_quantity": null,
- "min_order_quantity": null,
- "max_order_quantity": null,
- "min_order_parent_quantity": null,
- "max_order_parent_quantity": null,
- "display": null,
- "sell": null
}
], - "stock": [
- {
- "stock_location_id": "sl_123",
- "stock_level": 9,
- "restock_date": "2020-01-01",
- "min_stock_level": -9
}
]
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "external_id": "ID001",
- "title": "Striped Jumper",
- "slug": "striped-jumper"
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
{- "product_id": "pp_123",
- "id": "pv_234",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "external_id": "IDV001",
- "sku": "IDV001",
- "weight_in_grams": 0,
- "tax_type": 1,
- "position": 1,
- "cart_image_url": null,
- "rrp": [
- {
- "value": 10.49,
- "currency_code": "gbp"
}
], - "options": [
- {
- "group": "Color",
- "value": "Blue"
}
], - "status": "live",
- "settings": [
- {
- "customer_group": "default",
- "pack_size": 1,
- "reserve_stock_quantity": null,
- "min_order_quantity": null,
- "max_order_quantity": null,
- "min_order_parent_quantity": null,
- "max_order_parent_quantity": null,
- "display": null,
- "sell": null
}
], - "stock": [
- {
- "stock_location_id": "sl_123",
- "stock_level": 9,
- "restock_date": "2020-01-01",
- "min_stock_level": -9
}
]
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
external_id | string <= 100 characters External ID (cannot start with pv_ and must be unique) |
sku | string [ 1 .. 100 ] characters SKU |
weight_in_grams | number Product weight in grams |
tax_type | number Deprecated Default: 1 Tax type ID - to be replaced with a more permanent solution |
position | number or null Default: 1 Position |
cart_image_url | string or null <= 512 characters Deprecated to be replaced with a more permanent solution |
Array of objects (ProductVariantRRP) RRP price (single item per | |
Array of objects (ProductVariantOptions) Product Options (item per | |
status | string Default: "pending" Enum: "pending" "discontinued" "suspended" "live" Status - only |
Array of objects (ProductVariantSettings) Variant Settings (item per | |
Array of objects (ProductStock-2) |
{- "external_id": "IDV001",
- "sku": "IDV001",
- "weight_in_grams": 0,
- "tax_type": 1,
- "position": 1,
- "cart_image_url": null,
- "rrp": [
- {
- "value": 10.49,
- "currency_code": "gbp"
}
], - "options": [
- {
- "group": "Color",
- "value": "Blue"
}
], - "status": "live",
- "settings": [
- {
- "customer_group": "default",
- "pack_size": 1,
- "reserve_stock_quantity": null,
- "min_order_quantity": null,
- "max_order_quantity": null,
- "min_order_parent_quantity": null,
- "max_order_parent_quantity": null,
- "display": null,
- "sell": null
}
], - "stock": [
- {
- "stock_location_id": "sl_123",
- "stock_level": 9,
- "restock_date": "2020-01-01",
- "min_stock_level": -9
}
]
}
{- "product_id": "pp_123",
- "id": "pv_234",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "external_id": "IDV001",
- "sku": "IDV001",
- "weight_in_grams": 0,
- "tax_type": 1,
- "position": 1,
- "cart_image_url": null,
- "rrp": [
- {
- "value": 10.49,
- "currency_code": "gbp"
}
], - "options": [
- {
- "group": "Color",
- "value": "Blue"
}
], - "status": "live",
- "settings": [
- {
- "customer_group": "default",
- "pack_size": 1,
- "reserve_stock_quantity": null,
- "min_order_quantity": null,
- "max_order_quantity": null,
- "min_order_parent_quantity": null,
- "max_order_parent_quantity": null,
- "display": null,
- "sell": null
}
], - "stock": [
- {
- "stock_location_id": "sl_123",
- "stock_level": 9,
- "restock_date": "2020-01-01",
- "min_stock_level": -9
}
]
}
SKU required | string Product Variant SKU |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
[- {
- "stock_location_id": "sl_123",
- "stock_level": 9,
- "restock_date": "2020-01-01",
- "min_stock_level": -9
}
]
SKU required | string Product Variant SKU |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
stock_location_id required | string Stock Location ID (internal or external ID) |
stock_level required | integer <int32> Default: 0 Quantity of stock held at the location |
restock_date | string or null <date> Restock Date |
min_stock_level | integer <int32> Default: 0 Allow pre-ordering / overselling up to this qty. For example, if set to -9 and stock level was 0, 9 units could be sold. |
[- {
- "stock_location_id": "sl_123",
- "stock_level": 9,
- "restock_date": "2020-01-01",
- "min_stock_level": -9
}
]
{- "detail": "Data Validation Failed",
- "status": 400,
- "title": "invalid-api-request-contents",
- "errors": [
- {
- "code": "resource-not-found",
- "property": "stock_location_id",
- "message": "stock_location_id not found"
}
]
}
SKU required | string Product Variant SKU |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
[- {
- "price_list_slug": "base-list",
- "pricing": [
- {
- "quantity": 1,
- "price": 10.49,
- "tax_type": "net"
}
]
}
]
This patch endpoint will remove all pricing for the price list slugs 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.
SKU required | string Product Variant SKU |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
price_list_slug required | string Price List Slug |
required | Array of objects |
[- {
- "price_list_slug": "base-list",
- "pricing": [
- {
- "quantity": 1,
- "price": 10.49,
- "tax_type": "net"
}
]
}
]
[- {
- "price_list_slug": "base-list",
- "pricing": [
- {
- "quantity": 1,
- "price": 10.49,
- "tax_type": "net"
}
]
}
]
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
title | string <= 30 characters Title |
first_name required | string <= 128 characters First Name |
last_name required | string <= 128 characters Last Name |
email required | string <= 255 characters Email Address (Unique) |
company_name | string <= 255 characters Company Name |
external_id | string <= 255 characters External Id (cannot start with cu_ and must be unique) |
accounting_id | string <= 255 characters Accounting Id |
status | any Default: "active" Enum: "pending" "active" "inactive" "rejected" Status - login is allowed only via the |
group | string <= 30 characters Default: "default" Customer Group |
default_billing_address_id | string or null Default Billing Address ID (returned as ID but can be provided by the external ID) |
default_shipping_address_id | string or null Default Billing Address ID (returned as ID but can be provided by the external ID) |
currency_code | string or null = 3 characters ISO 4217 currency code, not required if |
sales_agent_groups | Array of strings[ items [ 1 .. 64 ] characters ^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$ ] Sales Agent Groups If a sales agent/customer, access is only given to other sales agents/customers with one of the groups specified. If a customer, access is only given to other sales agents with one of the groups specified. If empty for a customer, only sales agents with an empty list can access the customer. If empty for a sales agent, any customer is accessible. |
price_lists | Array of strings Customer specifc price lists (overrides customer group settings) |
vatin_numbers | Array of strings Validated against VAT identification numbers |
discount_percentage | number or null <float> [ 0 .. 100 ] Customer specific percentage discount |
tax_exempt | boolean Default: false Tax Exempt (overrides |
payment_by_invoice | boolean or null Default: null Allow payments via invoice (overrides customer group settings) |
object or null Default: null Allow payments on account when the order total meets available credit (overrides customer group settings) | |
metadata | object or null Metadata |
parent_customer_id | string or null Either SparkLayer Customer ID or External ID |
{- "title": "Mr",
- "first_name": "Tom",
- "last_name": "Jones",
- "email": "Tom.jones@climbing.com",
- "company_name": "Tom Jones Climbing Ltd",
- "external_id": "XXXX00123",
- "accounting_id": "XXXX00123",
- "status": "pending",
- "group": "default",
- "default_billing_address_id": "ca_1234",
- "default_shipping_address_id": "ca_1234",
- "currency_code": "gbp",
- "sales_agent_groups": [
- "south-west-uk"
], - "price_lists": [
- "b2b_gb_gbp_123"
], - "vatin_numbers": [
- "GB999999973"
], - "discount_percentage": 100,
- "tax_exempt": false,
- "payment_by_invoice": null,
- "payment_on_account": null,
- "metadata": null,
- "parent_customer_id": "string"
}
{- "id": "cu_123",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "addresses": [
- {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}
], - "title": "Mr",
- "first_name": "Tom",
- "last_name": "Jones",
- "email": "Tom.jones@climbing.com",
- "company_name": "Tom Jones Climbing Ltd",
- "external_id": "XXXX00123",
- "accounting_id": "XXXX00123",
- "status": "pending",
- "group": "default",
- "default_billing_address_id": "ca_1234",
- "default_shipping_address_id": "ca_1234",
- "currency_code": "gbp",
- "sales_agent_groups": [
- "south-west-uk"
], - "price_lists": [
- "b2b_gb_gbp_123"
], - "vatin_numbers": [
- "GB999999973"
], - "discount_percentage": 100,
- "tax_exempt": false,
- "payment_by_invoice": null,
- "payment_on_account": null,
- "metadata": null,
- "parent_customer": {
- "id": "cu_123",
- "external_id": "XXXX00123"
}
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
{- "id": "cu_123",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "addresses": [
- {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}
], - "title": "Mr",
- "first_name": "Tom",
- "last_name": "Jones",
- "email": "Tom.jones@climbing.com",
- "company_name": "Tom Jones Climbing Ltd",
- "external_id": "XXXX00123",
- "accounting_id": "XXXX00123",
- "status": "pending",
- "group": "default",
- "default_billing_address_id": "ca_1234",
- "default_shipping_address_id": "ca_1234",
- "currency_code": "gbp",
- "sales_agent_groups": [
- "south-west-uk"
], - "price_lists": [
- "b2b_gb_gbp_123"
], - "vatin_numbers": [
- "GB999999973"
], - "discount_percentage": 100,
- "tax_exempt": false,
- "payment_by_invoice": null,
- "payment_on_account": null,
- "metadata": null,
- "parent_customer": {
- "id": "cu_123",
- "external_id": "XXXX00123"
}
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
title | string <= 30 characters Title |
first_name | string <= 128 characters First Name |
last_name | string <= 128 characters Last Name |
string <= 255 characters Email Address (Unique) | |
company_name | string <= 255 characters Company Name |
external_id | string <= 255 characters External Id (cannot start with cu_ and must be unique) |
accounting_id | string <= 255 characters Accounting Id |
status | any Default: "active" Enum: "pending" "active" "inactive" "rejected" Status - login is allowed only via the |
group | string <= 30 characters Default: "default" Customer Group |
default_billing_address_id | string or null Default Billing Address ID (returned as ID but can be provided by the external ID) |
default_shipping_address_id | string or null Default Billing Address ID (returned as ID but can be provided by the external ID) |
currency_code | string or null = 3 characters ISO 4217 currency code, not required if |
sales_agent_groups | Array of strings[ items [ 1 .. 64 ] characters ^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$ ] Sales Agent Groups If a sales agent/customer, access is only given to other sales agents/customers with one of the groups specified. If a customer, access is only given to other sales agents with one of the groups specified. If empty for a customer, only sales agents with an empty list can access the customer. If empty for a sales agent, any customer is accessible. |
price_lists | Array of strings Customer specifc price lists (overrides customer group settings) |
vatin_numbers | Array of strings Validated against VAT identification numbers |
discount_percentage | number or null <float> [ 0 .. 100 ] Customer specific percentage discount |
tax_exempt | boolean Default: false Tax Exempt (overrides |
payment_by_invoice | boolean or null Default: null Allow payments via invoice (overrides customer group settings) |
object or null Default: null Allow payments on account when the order total meets available credit (overrides customer group settings) | |
metadata | object or null Metadata |
parent_customer_id | string or null Either SparkLayer Customer ID or External ID |
{- "title": "Mr",
- "first_name": "Tom",
- "last_name": "Jones",
- "email": "Tom.jones@climbing.com",
- "company_name": "Tom Jones Climbing Ltd",
- "external_id": "XXXX00123",
- "accounting_id": "XXXX00123",
- "status": "pending",
- "group": "default",
- "default_billing_address_id": "ca_1234",
- "default_shipping_address_id": "ca_1234",
- "currency_code": "gbp",
- "sales_agent_groups": [
- "south-west-uk"
], - "price_lists": [
- "b2b_gb_gbp_123"
], - "vatin_numbers": [
- "GB999999973"
], - "discount_percentage": 100,
- "tax_exempt": false,
- "payment_by_invoice": null,
- "payment_on_account": null,
- "metadata": null,
- "parent_customer_id": "string"
}
{- "id": "cu_123",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "addresses": [
- {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}
], - "title": "Mr",
- "first_name": "Tom",
- "last_name": "Jones",
- "email": "Tom.jones@climbing.com",
- "company_name": "Tom Jones Climbing Ltd",
- "external_id": "XXXX00123",
- "accounting_id": "XXXX00123",
- "status": "pending",
- "group": "default",
- "default_billing_address_id": "ca_1234",
- "default_shipping_address_id": "ca_1234",
- "currency_code": "gbp",
- "sales_agent_groups": [
- "south-west-uk"
], - "price_lists": [
- "b2b_gb_gbp_123"
], - "vatin_numbers": [
- "GB999999973"
], - "discount_percentage": 100,
- "tax_exempt": false,
- "payment_by_invoice": null,
- "payment_on_account": null,
- "metadata": null,
- "parent_customer": {
- "id": "cu_123",
- "external_id": "XXXX00123"
}
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
{- "detail": "Data Validation Failed",
- "status": 400,
- "title": "invalid-api-request-contents",
- "errors": [
- {
- "code": "resource-not-found",
- "property": "stock_location_id",
- "message": "stock_location_id not found"
}
]
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
[- {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}
]
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
title | string <= 30 characters Title |
first_name | string <= 50 characters First Name |
last_name | string <= 50 characters Last Name |
company | string <= 128 characters Company |
address_line1 required | string <= 255 characters Address Line 1 |
address_line2 | string <= 255 characters Address Line 2 |
city required | string <= 128 characters City |
region_code | string or null <= 10 characters Region |
postal_code | string <= 20 characters Postal Code |
country_code required | string <= 3 characters Country Code |
phone | string <= 20 characters Phone |
mobile | string <= 20 characters Phone - Mobile |
external_id | string or null <= 50 characters External ID (cannot start with ca_ and must be unique) |
nickname | string <= 50 characters Nickname |
{- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}
{- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}
id required | string Either the Internal or External ID |
id2 required | string Spark Layer ID of record (or external ID of the entity) |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
{- "detail": "Data Validation Failed",
- "status": 400,
- "title": "invalid-api-request-contents",
- "errors": [
- {
- "code": "resource-not-found",
- "property": "stock_location_id",
- "message": "stock_location_id not found"
}
]
}
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
created_at required | string <date-time> Checkout Completed At |
spark_billing_chargeable | boolean Deprecated Default: true Spark Billing Chargable Order - set to false for imported orders from other systems |
external_id | string or null External Id |
payment_method required | string Enum: "upfrontPayment" "paymentByInvoice" "paymentOnAccount" "hokodoPayment" "other" Payment Method |
visible_id | string or null Visible Id (shown in the My A/c Section) |
customer_id required | string Customer Id (internal/external ID accepted) |
customer_reference | string or null <= 512 characters Customer Reference |
currency_code required | string ISO 4217 currency code. |
object or null Either pass a | |
billing_address_id | string or null Address Id (internal/external ID accepted) |
required | Array of objects (OrderPackageCreate-2) non-empty |
metadata | object or null Metadata |
invoice_url | string or null Invoice URL |
{- "created_at": "2021-01-30T08:30:00Z",
- "spark_billing_chargeable": true,
- "external_id": "ORD21231231",
- "payment_method": "upfrontPayment",
- "visible_id": "B2B00123",
- "customer_id": "cu_123",
- "customer_reference": "PO123",
- "currency_code": "gbp",
- "billing_address": {
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "billing_address_id": "ca_123",
- "packages": [
- {
- "created_at": "2021-01-30T08:30:00Z",
- "external_id": "Pack00123",
- "visible_id": "Ship01",
- "shipped_at": null,
- "cancelled_at": null,
- "returned_at": null,
- "items": [
- {
- "variant_id": "string",
- "sku": "string",
- "name": "string",
- "quantity": 3,
- "line_total": {
- "gross": 6,
- "net": 4
}
}
], - "shipping_address": {
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "shipping_address_id": "ca_123",
- "shipping_name": "string",
- "shipping_sku": "string",
- "total_shipping": {
- "gross": 6,
- "net": 4
}
}
], - "metadata": null,
- "invoice_url": "string"
}
{- "id": "o_123",
- "customer_id": "cu_123",
- "spark_billing_chargeable": true,
- "payment_method": "upfrontPayment",
- "status": "processing",
- "currency_code": "string",
- "external_id": "B2B00123",
- "visible_id": "B2B00123",
- "customer_reference": "PO123",
- "created_at": "2021-01-30T08:30:00Z",
- "billing_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "packages": [
- {
- "id": "orp_123",
- "created_at": "2021-01-30T08:30:00Z",
- "external_id": "SHIP00123",
- "visible_id": "Ship01",
- "status": "processing",
- "shipped_at": null,
- "shipment_tracking": [
- {
- "company": "string",
- "url": "string",
- "reference": "string"
}
], - "cancelled_at": null,
- "returned_at": null,
- "items": [
- {
- "id": "orp_123",
- "external_id": "pv_123",
- "variant_id": "string",
- "sku": "string",
- "name": "string",
- "child_name": "string",
- "image_url": "string",
- "slug": "string",
- "quantity": 3,
- "unit_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "line_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "shipping_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "shipping_address_id": "ca_123",
- "shipping_name": "string",
- "shipping_sku": "string",
- "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "invoice_url": "string",
- "metadata": null,
- "custom_fields": [
- {
- "name": "string",
- "value": "string"
}
]
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
{- "id": "o_123",
- "customer_id": "cu_123",
- "spark_billing_chargeable": true,
- "payment_method": "upfrontPayment",
- "status": "processing",
- "currency_code": "string",
- "external_id": "B2B00123",
- "visible_id": "B2B00123",
- "customer_reference": "PO123",
- "created_at": "2021-01-30T08:30:00Z",
- "billing_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "packages": [
- {
- "id": "orp_123",
- "created_at": "2021-01-30T08:30:00Z",
- "external_id": "SHIP00123",
- "visible_id": "Ship01",
- "status": "processing",
- "shipped_at": null,
- "shipment_tracking": [
- {
- "company": "string",
- "url": "string",
- "reference": "string"
}
], - "cancelled_at": null,
- "returned_at": null,
- "items": [
- {
- "id": "orp_123",
- "external_id": "pv_123",
- "variant_id": "string",
- "sku": "string",
- "name": "string",
- "child_name": "string",
- "image_url": "string",
- "slug": "string",
- "quantity": 3,
- "unit_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "line_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "shipping_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "shipping_address_id": "ca_123",
- "shipping_name": "string",
- "shipping_sku": "string",
- "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "invoice_url": "string",
- "metadata": null,
- "custom_fields": [
- {
- "name": "string",
- "value": "string"
}
]
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
invoice_url | string or null Invoice URL |
{- "invoice_url": "string"
}
{- "id": "o_123",
- "customer_id": "cu_123",
- "spark_billing_chargeable": true,
- "payment_method": "upfrontPayment",
- "status": "processing",
- "currency_code": "string",
- "external_id": "B2B00123",
- "visible_id": "B2B00123",
- "customer_reference": "PO123",
- "created_at": "2021-01-30T08:30:00Z",
- "billing_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "packages": [
- {
- "id": "orp_123",
- "created_at": "2021-01-30T08:30:00Z",
- "external_id": "SHIP00123",
- "visible_id": "Ship01",
- "status": "processing",
- "shipped_at": null,
- "shipment_tracking": [
- {
- "company": "string",
- "url": "string",
- "reference": "string"
}
], - "cancelled_at": null,
- "returned_at": null,
- "items": [
- {
- "id": "orp_123",
- "external_id": "pv_123",
- "variant_id": "string",
- "sku": "string",
- "name": "string",
- "child_name": "string",
- "image_url": "string",
- "slug": "string",
- "quantity": 3,
- "unit_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "line_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "shipping_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "shipping_address_id": "ca_123",
- "shipping_name": "string",
- "shipping_sku": "string",
- "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "invoice_url": "string",
- "metadata": null,
- "custom_fields": [
- {
- "name": "string",
- "value": "string"
}
]
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
external_id | string or null External Id |
visible_id | string or null Visible Id (shown in the My A/c Section) |
shipped_at required | string <date-time> |
Array of objects (OrderPackageItemShipmentTracking-2) | |
object or null Either pass a | |
shipping_address_id | string or null Customer Address Id (can be supplied as internal or external) |
object Total price for shipping | |
required | Array of objects non-empty Items will be matched on variant internal / external ID and then fall back to SKU. |
{- "external_id": "Pkg123",
- "visible_id": "Ship01",
- "shipped_at": "2019-08-24T14:15:22Z",
- "shipment_tracking": [
- {
- "company": "string",
- "url": "string",
- "reference": "string"
}
], - "shipping_address": {
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "shipping_address_id": "ca_123",
- "total_shipping": {
- "gross": 6,
- "net": 4
}, - "items": [
- {
- "variant_id": "string",
- "sku": "string",
- "quantity": 3
}
]
}
{- "id": "o_123",
- "customer_id": "cu_123",
- "spark_billing_chargeable": true,
- "payment_method": "upfrontPayment",
- "status": "processing",
- "currency_code": "string",
- "external_id": "B2B00123",
- "visible_id": "B2B00123",
- "customer_reference": "PO123",
- "created_at": "2021-01-30T08:30:00Z",
- "billing_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "packages": [
- {
- "id": "orp_123",
- "created_at": "2021-01-30T08:30:00Z",
- "external_id": "SHIP00123",
- "visible_id": "Ship01",
- "status": "processing",
- "shipped_at": null,
- "shipment_tracking": [
- {
- "company": "string",
- "url": "string",
- "reference": "string"
}
], - "cancelled_at": null,
- "returned_at": null,
- "items": [
- {
- "id": "orp_123",
- "external_id": "pv_123",
- "variant_id": "string",
- "sku": "string",
- "name": "string",
- "child_name": "string",
- "image_url": "string",
- "slug": "string",
- "quantity": 3,
- "unit_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "line_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "shipping_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "shipping_address_id": "ca_123",
- "shipping_name": "string",
- "shipping_sku": "string",
- "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "invoice_url": "string",
- "metadata": null,
- "custom_fields": [
- {
- "name": "string",
- "value": "string"
}
]
}
The items must not be shipped
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
external_id | string or null External Id |
visible_id | string or null Visible Id (shown in the My A/c Section) |
cancelled_at required | string or null <date-time> |
required | Array of objects non-empty Items will be matched on variant internal / external ID and then fall back to SKU. |
{- "external_id": "Pkg123",
- "visible_id": "Cancel01",
- "cancelled_at": null,
- "items": [
- {
- "variant_id": "string",
- "sku": "string",
- "quantity": 3
}
]
}
{- "id": "o_123",
- "customer_id": "cu_123",
- "spark_billing_chargeable": true,
- "payment_method": "upfrontPayment",
- "status": "processing",
- "currency_code": "string",
- "external_id": "B2B00123",
- "visible_id": "B2B00123",
- "customer_reference": "PO123",
- "created_at": "2021-01-30T08:30:00Z",
- "billing_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "packages": [
- {
- "id": "orp_123",
- "created_at": "2021-01-30T08:30:00Z",
- "external_id": "SHIP00123",
- "visible_id": "Ship01",
- "status": "processing",
- "shipped_at": null,
- "shipment_tracking": [
- {
- "company": "string",
- "url": "string",
- "reference": "string"
}
], - "cancelled_at": null,
- "returned_at": null,
- "items": [
- {
- "id": "orp_123",
- "external_id": "pv_123",
- "variant_id": "string",
- "sku": "string",
- "name": "string",
- "child_name": "string",
- "image_url": "string",
- "slug": "string",
- "quantity": 3,
- "unit_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "line_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "shipping_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "shipping_address_id": "ca_123",
- "shipping_name": "string",
- "shipping_sku": "string",
- "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "invoice_url": "string",
- "metadata": null,
- "custom_fields": [
- {
- "name": "string",
- "value": "string"
}
]
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
external_id | string or null External Id |
visible_id | string or null Visible Id (shown in the My A/c Section) |
returned_at required | string or null <date-time> |
required | Array of objects non-empty Items will be matched on variant internal / external ID and then fall back to SKU. |
object Returned Shipping Cost |
{- "external_id": "Pkg123",
- "visible_id": "Retun01",
- "returned_at": null,
- "items": [
- {
- "variant_id": "string",
- "sku": "string",
- "quantity": 3,
- "refund_total": {
- "gross": 6,
- "net": 4
}
}
], - "refund_shipping": {
- "gross": 6,
- "net": 4
}
}
{- "id": "o_123",
- "customer_id": "cu_123",
- "spark_billing_chargeable": true,
- "payment_method": "upfrontPayment",
- "status": "processing",
- "currency_code": "string",
- "external_id": "B2B00123",
- "visible_id": "B2B00123",
- "customer_reference": "PO123",
- "created_at": "2021-01-30T08:30:00Z",
- "billing_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "packages": [
- {
- "id": "orp_123",
- "created_at": "2021-01-30T08:30:00Z",
- "external_id": "SHIP00123",
- "visible_id": "Ship01",
- "status": "processing",
- "shipped_at": null,
- "shipment_tracking": [
- {
- "company": "string",
- "url": "string",
- "reference": "string"
}
], - "cancelled_at": null,
- "returned_at": null,
- "items": [
- {
- "id": "orp_123",
- "external_id": "pv_123",
- "variant_id": "string",
- "sku": "string",
- "name": "string",
- "child_name": "string",
- "image_url": "string",
- "slug": "string",
- "quantity": 3,
- "unit_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "line_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "shipping_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "shipping_address_id": "ca_123",
- "shipping_name": "string",
- "shipping_sku": "string",
- "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "invoice_url": "string",
- "metadata": null,
- "custom_fields": [
- {
- "name": "string",
- "value": "string"
}
]
}
id required | string Either the Internal or External ID |
packageId required | string Spark Layer Package ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
object Total price for shipping | |
required | Array of objects non-empty |
{- "total_shipping": {
- "gross": 6,
- "net": 4
}, - "items": [
- {
- "variant_id": "string",
- "sku": "string",
- "name": "string",
- "quantity": 3,
- "line_total": {
- "gross": 6,
- "net": 4
}
}
]
}
{- "id": "o_123",
- "customer_id": "cu_123",
- "spark_billing_chargeable": true,
- "payment_method": "upfrontPayment",
- "status": "processing",
- "currency_code": "string",
- "external_id": "B2B00123",
- "visible_id": "B2B00123",
- "customer_reference": "PO123",
- "created_at": "2021-01-30T08:30:00Z",
- "billing_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "packages": [
- {
- "id": "orp_123",
- "created_at": "2021-01-30T08:30:00Z",
- "external_id": "SHIP00123",
- "visible_id": "Ship01",
- "status": "processing",
- "shipped_at": null,
- "shipment_tracking": [
- {
- "company": "string",
- "url": "string",
- "reference": "string"
}
], - "cancelled_at": null,
- "returned_at": null,
- "items": [
- {
- "id": "orp_123",
- "external_id": "pv_123",
- "variant_id": "string",
- "sku": "string",
- "name": "string",
- "child_name": "string",
- "image_url": "string",
- "slug": "string",
- "quantity": 3,
- "unit_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "line_total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "shipping_address": {
- "id": "ca_123",
- "title": "Mr",
- "first_name": "Bob",
- "last_name": "Jones",
- "company": "Tom Jones Climbing Ltd",
- "address_line1": "Example Industrial Estate",
- "address_line2": "North Country",
- "city": "Cityland",
- "region_code": "CA",
- "postal_code": "12345",
- "country_code": "USA",
- "phone": "+44 (0) 123456789",
- "mobile": "+44 (0) 723456789",
- "external_id": "ADD1234567",
- "nickname": "Warehouse - Cityland"
}, - "shipping_address_id": "ca_123",
- "shipping_name": "string",
- "shipping_sku": "string",
- "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}
}
], - "total_sub": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total_shipping": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "total": {
- "tax_rate": 20,
- "net": 4,
- "gross": 4.8,
- "currency_code": "gbp"
}, - "invoice_url": "string",
- "metadata": null,
- "custom_fields": [
- {
- "name": "string",
- "value": "string"
}
]
}
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
slug required | string <= 30 characters ^(?!^\d+$)^.+$ |
name required | string <= 256 characters |
{- "slug": "eu_gbp",
- "name": "Europe (GBP) Customers"
}
[- {
- "slug": "eu_gbp",
- "name": "Europe (GBP) Customers"
}
]
slug required | string |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
name required | string <= 256 characters |
{- "name": "Europe (GBP) Customers"
}
[- {
- "slug": "eu_gbp",
- "name": "Europe (GBP) Customers"
}
]
slug required | string |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
{- "detail": "Data Validation Failed",
- "status": 400,
- "title": "invalid-api-request-contents",
- "errors": [
- {
- "code": "resource-not-found",
- "property": "stock_location_id",
- "message": "stock_location_id not found"
}
]
}
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
[- {
- "id": "sm_123",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "sku": "SKU001",
- "title": "Standard Shipping",
- "prority": 0,
- "countries": [
- "GB"
], - "groups": [
- "default"
], - "bands": [
- {
- "name": "Band 1",
- "priority": 0,
- "sku": "ship_123",
- "requirement": {
- "type": "weight",
- "min": 0,
- "max": 0
}, - "cost": {
- "type": "free"
}
}
]
}
]
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
sku required | string <= 50 characters Shipping SKU |
title required | string <= 50 characters Shiping Method Name shown at checkout |
prority | number [ 0 .. 127 ] Default: 0 Shown by order (lower first) |
countries required | Array of strings Countries covered by this shipping method |
groups | Array of strings Customer groups covered by this shipping method (use default to cover all groups) |
Array of objects |
{- "sku": "SKU001",
- "title": "Standard Shipping",
- "prority": 0,
- "countries": [
- "GB"
], - "groups": [
- "default"
], - "bands": [
- {
- "name": "Band 1",
- "priority": 0,
- "sku": "ship_123",
- "requirement": {
- "type": "weight",
- "min": 0,
- "max": 0
}, - "cost": {
- "type": "free"
}
}
]
}
{- "id": "sm_123",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "sku": "SKU001",
- "title": "Standard Shipping",
- "prority": 0,
- "countries": [
- "GB"
], - "groups": [
- "default"
], - "bands": [
- {
- "name": "Band 1",
- "priority": 0,
- "sku": "ship_123",
- "requirement": {
- "type": "weight",
- "min": 0,
- "max": 0
}, - "cost": {
- "type": "free"
}
}
]
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
{- "id": "sm_123",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "sku": "SKU001",
- "title": "Standard Shipping",
- "prority": 0,
- "countries": [
- "GB"
], - "groups": [
- "default"
], - "bands": [
- {
- "name": "Band 1",
- "priority": 0,
- "sku": "ship_123",
- "requirement": {
- "type": "weight",
- "min": 0,
- "max": 0
}, - "cost": {
- "type": "free"
}
}
]
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
sku | string <= 50 characters Shipping SKU |
title | string <= 50 characters Shiping Method Name shown at checkout |
prority | number [ 0 .. 127 ] Default: 0 Shown by order (lower first) |
countries | Array of strings Countries covered by this shipping method |
groups | Array of strings Customer groups covered by this shipping method (use default to cover all groups) |
Array of objects |
{- "sku": "SKU001",
- "title": "Standard Shipping",
- "prority": 0,
- "countries": [
- "GB"
], - "groups": [
- "default"
], - "bands": [
- {
- "name": "Band 1",
- "priority": 0,
- "sku": "ship_123",
- "requirement": {
- "type": "weight",
- "min": 0,
- "max": 0
}, - "cost": {
- "type": "free"
}
}
]
}
{- "id": "sm_123",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "sku": "SKU001",
- "title": "Standard Shipping",
- "prority": 0,
- "countries": [
- "GB"
], - "groups": [
- "default"
], - "bands": [
- {
- "name": "Band 1",
- "priority": 0,
- "sku": "ship_123",
- "requirement": {
- "type": "weight",
- "min": 0,
- "max": 0
}, - "cost": {
- "type": "free"
}
}
]
}
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
name required | string <= 255 characters Name |
external_id required | string <= 255 characters External ID (cannot start with sl_ and must be unique) |
{- "name": "Stock Warehouse 1",
- "external_id": "warehouse-1"
}
{- "id": "sl_2",
- "name": "Stock Warehouse 1",
- "external_id": "warehouse-1"
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
{- "id": "sl_2",
- "name": "Stock Warehouse 1",
- "external_id": "warehouse-1"
}
id required | string Either the Internal or External ID |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
name | string <= 255 characters Name |
external_id | string <= 255 characters External ID (cannot start with sl_ and must be unique) |
{- "name": "Stock Warehouse 1",
- "external_id": "warehouse-1"
}
{- "id": "sl_2",
- "name": "Stock Warehouse 1",
- "external_id": "warehouse-1"
}
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
key required | string |
value required | any or null |
[- {
- "key": "string",
- "value": null
}
]
{- "detail": "Data Validation Failed",
- "status": 400,
- "title": "invalid-api-request-contents",
- "errors": [
- {
- "code": "resource-not-found",
- "property": "stock_location_id",
- "message": "stock_location_id not found"
}
]
}
Lists Customer Group settings by Customer Group
slug required | string |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
[- {
- "key": "orderTotalsValidation",
- "value": [
- {
- "currency_code": "gbp",
- "minimum_value": 0,
- "compare_type": "gross"
}
]
}
]
slug required | string |
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
key required | string Value: "orderTotalsValidation" |
required | Array of objects |
[- {
- "key": "orderTotalsValidation",
- "value": [
- {
- "currency_code": "gbp",
- "minimum_value": 0,
- "compare_type": "gross"
}
]
}
]
{- "detail": "Data Validation Failed",
- "status": 400,
- "title": "invalid-api-request-contents",
- "errors": [
- {
- "code": "resource-not-found",
- "property": "stock_location_id",
- "message": "stock_location_id not found"
}
]
}
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
slug required | string [ 1 .. 64 ] characters Slug |
name required | string [ 1 .. 64 ] characters Name |
currency_code required | string = 3 characters ISO 4217 currency code. |
{- "slug": "base-list",
- "name": "Base Price List",
- "currency_code": "gbp"
}
{- "slug": "base-list",
- "name": "Base Price List",
- "currency_code": "gbp"
}
Site-Id required | string Example: jones-climbing Spark Layer Site ID |
{- "detail": "Data Validation Failed",
- "status": 400,
- "title": "invalid-api-request-contents",
- "errors": [
- {
- "code": "resource-not-found",
- "property": "stock_location_id",
- "message": "stock_location_id not found"
}
]
}