SparkLayer MCP by usefulapi

v1.2.1
io.usefulapi/sparklayer Checked 3 days ago Published 12 hours ago

Read customers, prices, stock and orders, and update customers and stock in SparkLayer.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

sparklayer_list_customer_roles List customer roles

List the customer roles of the site. Good first call before creating or updating customers. SparkLayer API: GET /api/v2/customer-roles.

sparklayer_get_customer Get a customer

Get one customer by SparkLayer id, platform id or email: group, role, price lists, status and default addresses. SparkLayer API: GET /api/v2/customers/{lookupBy}/{identifier}.

ParameterTypeDescription
identifier *stringThe customer identifier, of the kind set by lookupBy.
lookupBy *stringWhich identifier you pass: the SparkLayer id, the platform (store) id, or the email address.

sparklayer_upsert_customer Create or update a customer

WRITE: create a customer, or replace an existing one. The body must hold the identifier from the URL (external_id for platform, email for email, id for a SparkLayer UUID) and the required fields external_id, email, first_name, last_name, status, group and role. Replacing a customer can change its prices and access. SparkLayer API: PUT /api/v2/customers/{lookupBy}/{identifier}.

ParameterTypeDescription
customer *objectThe customer body, as the SparkLayer CustomerPutRequest schema defines it.
identifier *stringThe customer identifier, of the kind set by lookupBy.
lookupBy *stringWhich identifier you pass: the SparkLayer id, the platform (store) id, or the email address.

sparklayer_list_customer_addresses List a customer's addresses

List the delivery and billing addresses of one customer. SparkLayer API: GET /api/v2/customers/{lookupBy}/{identifier}/addresses.

ParameterTypeDescription
identifier *stringThe customer identifier, of the kind set by lookupBy.
lookupBy *stringWhich identifier you pass: the SparkLayer id, the platform (store) id, or the email address.

sparklayer_list_shopping_lists List shopping lists

List the shopping lists of one customer, optionally for one section. SparkLayer API: GET /api/v2/customers/{lookupBy}/{identifier}/shopping-lists.

ParameterTypeDescription
identifier *stringThe customer identifier, of the kind set by lookupBy.
lookupBy *stringWhich identifier you pass: the SparkLayer id, the platform (store) id, or the email address.
section_idstringWith a section, also returns the customer's own lists that belong to no location.

sparklayer_list_companies List companies

List the B2B companies of the site, with search and a sales-agent filter. Paged: use page and page_size. SparkLayer API: GET /api/v2/companies.

ParameterTypeDescription
pageintegerPage number (starts at 1).
page_sizeintegerItems per page (up to 250).
sales_agent_groupstringOnly companies of this sales-agent group.
search_termstringFree text to search company names.

sparklayer_get_company Get a company

Get one company by SparkLayer id, platform id or integration id, with its settings. SparkLayer API: GET /api/v2/companies/{lookupBy}/{identifier}.

ParameterTypeDescription
identifier *stringThe company identifier, of the kind set by lookupBy.
lookupBy *stringWhich identifier you pass: the SparkLayer id, the platform id, or the integration id.
include_archivedbooleantrue = include archived companies.

sparklayer_list_company_sections List a company's sections

List the sections (sub-accounts, buying departments) of one company. SparkLayer API: GET /api/v2/companies/{lookupBy}/{identifier}/sections.

ParameterTypeDescription
identifier *stringThe company identifier, of the kind set by lookupBy.
lookupBy *stringWhich identifier you pass: the SparkLayer id, the platform id, or the integration id.
include_archivedbooleantrue = include archived sections.
leafOnlybooleantrue = only the sections that have no child sections.

sparklayer_list_customer_groups List customer groups

List every customer group of the site, with its parent group. SparkLayer API: GET /api/v1/customer-groups.

sparklayer_list_discounts List discounts

List the discounts of the site that are not deleted: rules, priorities and the customer groups they apply to. SparkLayer API: GET /api/v1/discounts.

sparklayer_get_discount Get a discount

Get one discount by its UUID, with its rules and customer groups. SparkLayer API: GET /api/v1/discounts/{id}.

ParameterTypeDescription
discount_id *stringA SparkLayer UUID.

sparklayer_list_global_settings List global settings

List the global settings of the site as key and value pairs (for example minimum order rules). SparkLayer API: GET /api/v1/settings.

sparklayer_get_cart Get a cart

Get one cart by its UUID: line items, addresses, totals and status. SparkLayer API: GET /api/v1/carts/{id}.

ParameterTypeDescription
cart_id *stringA SparkLayer UUID.

sparklayer_list_shipping_methods List shipping methods

List the shipping methods of the site, with their locations, groups and price bands. SparkLayer API: GET /api/v2/shipping-methods.

sparklayer_list_price_lists List price lists

List the price lists of the site (custom, platform or integration), with currency and adjustment rules. Paged: use page and page_size. SparkLayer API: GET /api/v2/price-lists.

ParameterTypeDescription
order_bystringField to sort by, as the SparkLayer API defines it.
pageintegerPage number (starts at 1).
page_sizeintegerItems per page (up to 250).
sourcestringOnly price lists from this source.

sparklayer_get_price_list Get a price list

Get one price list by its slug: currency, source and adjustment rules. SparkLayer API: GET /api/v1/price-lists/{slug}.

ParameterTypeDescription
slug *stringThe price list slug, for example b2b_gb_gbp_123.

sparklayer_list_price_list_prices List prices in a price list

List the prices stored on one price list (one entry per SKU and quantity break), in pages. Prices that the list's rules derive are not included. Returns total and the rows at offset; use offset to page through a long list. SparkLayer API: GET /api/v1/price-lists/{slug}/pricing.

ParameterTypeDescription
slug *stringThe price list slug.
limitintegerRows to return (default 200, up to 500).
offsetintegerRows to skip (default 0).

sparklayer_get_sku_prices Get prices for a SKU

Get the prices of one product SKU in every price list that holds it. SparkLayer API: GET /api/v1/pricing/{sku}.

ParameterTypeDescription
sku *stringThe product SKU (products are matched by SKU). A slash is allowed.

sparklayer_list_purchases List purchases

List orders, quotes and carts of the site, with filters for status, customer and last-updated dates. Paged by limit and offset: stop when a page has fewer results than limit. SparkLayer API: GET /api/v1/purchases.

ParameterTypeDescription
customer_sparklayer_idstringOnly purchases of this customer (SparkLayer customer id).
limitintegerResults per page (up to 500).
offsetintegerResults to skip.
order_bystring
order_directionstring
searchstringFree text search.
statusstringOnly purchases in this status.
updated_fromstringOnly purchases last updated on or after this date (yyyy-mm-dd or ISO 8601).
updated_tostringOnly purchases last updated on or before this date (yyyy-mm-dd or ISO 8601).

sparklayer_get_purchase Get a purchase

Get one purchase (order, quote or cart) by one of its identifiers: lines, addresses, totals and status. SparkLayer API: GET /api/v1/purchases/{lookupBy}/{identifier}.

ParameterTypeDescription
identifier *stringThe purchase identifier, of the kind set by lookupBy.
lookupBy *stringWhich purchase identifier you pass.

sparklayer_get_store_currency Get the store currency

Get the currency code of the store. SparkLayer API: GET /api/v1/store-currency.

sparklayer_get_stock_levels Get stock levels for SKUs

Read the stock levels of up to many SKUs, in all stock locations or in the given ones. Uses POST only to send the SKU list; it changes nothing. SparkLayer API: POST /api/v1/batch-fetch-stock.

ParameterTypeDescription
skus *arrayThe product SKUs to read (up to 200).
all_stock_locationsbooleantrue = all stock locations (default when no location is given).
stock_location_idsarrayOnly these stock locations.

sparklayer_list_stock_locations List stock locations

List the stock locations (warehouses, shops) of the site. SparkLayer API: GET /api/v1/stock-locations.

sparklayer_update_stock_levels Update stock levels

WRITE: set the stock level of SKUs in stock locations. Each level replaces the current value, so a repeat call with the same values changes nothing more. SparkLayer API: POST /api/v1/batch-update-stock.

ParameterTypeDescription
updates *arrayThe stock levels to set (up to 500 per call).

sparklayer_get_sync_status Get a sync status

Get the last full and partial sync times, success flag and error count of one integration and data type. SparkLayer API: GET /api/v1/sync-log/{integration}/{data_type}.

ParameterTypeDescription
data_type *string
integration *stringThe integration name, as the integration registered it.