Core API

Core API Docs

openapi: 3.0.1 info: version: 0.1.0 title: SparkLayer API Reference x-logo: url: https://www.sparklayer.io/assets/images/logo-dark.png backgroundColor: '' altText: SparkLayer logo servers:

  • url: https://app.sparklayer.io description: Live
  • url: https://test.app.sparklayer.io description: Test paths: /api/v1/products: post: tags: - Products summary: Create a Product operationId: createProduct parameters: - $ref: '#/components/parameters/Header.SiteId' requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/ProductWrite' - required: - title - slug required: true responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Product' default: $ref: '#/components/responses/Default' /api/v1/products/{id}: get: tags: - Products parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' summary: Get a Product operationId: getProduct responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Product' default: $ref: '#/components/responses/Default' patch: tags: - Products summary: Update a Product parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' operationId: updateProduct requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/ProductWrite' required: true responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Product' '409': $ref: '#/components/responses/Conflict' default: $ref: '#/components/responses/Default' /api/v1/variants/{id}: get: tags: - Products parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' summary: Get Product Variant operationId: getProductVariant responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/ProductVariant' default: $ref: '#/components/responses/Default' patch: tags: - Products summary: Update a Product Variant operationId: updateProductVariant parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' requestBody: content: application/json: schema: $ref: '#/components/schemas/ProductVariant' required: true responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/ProductVariant' '409': $ref: '#/components/responses/Conflict' default: $ref: '#/components/responses/Default' /api/v1/customers: post: tags: - Customers summary: Create a Customer operationId: createCustomer parameters: - $ref: '#/components/parameters/Header.SiteId' requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/CustomerRequest' - required: - email - first_name - last_name required: true responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/CustomerResponse' default: $ref: '#/components/responses/Default' /api/v1/customers/{id}: get: tags: - Customers summary: Get a Customer operationId: getCustomer parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/CustomerResponse' default: $ref: '#/components/responses/Default' patch: tags: - Customers summary: Update a Customer operationId: updateCustomer parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerRequest' required: true responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/CustomerResponse' default: $ref: '#/components/responses/Default' delete: tags: - Customers summary: Delete a Customer operationId: deleteCustomer parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' responses: '204': $ref: '#/components/responses/Empty' default: $ref: '#/components/responses/Default' /api/v1/customers/{id}/addresses: get: tags: - Customers parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' summary: List Customer Addresses operationId: listCustomerAddresses responses: '200': description: Successful response content: application/json: schema: type: array items: $ref: '#/components/schemas/Address' default: $ref: '#/components/responses/Default' post: tags: - Customers parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' summary: Create a Customer Address operationId: createCustomerAddress requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/Address' required: true responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Address' default: $ref: '#/components/responses/Default' /api/v1/customers/{id}/addresses/{id2}: delete: tags: - Customers parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Path.Id2' - $ref: '#/components/parameters/Header.SiteId' summary: Delete Customer Address operationId: deleteCustomerAddress responses: '204': $ref: '#/components/responses/Empty' default: $ref: '#/components/responses/Default' /api/v1/discounts: get: tags: - Discounts summary: List of Discounts operationId: listOfDiscounts parameters: - $ref: '#/components/parameters/Header.SiteId' responses: '200': description: Successful response content: application/json: schema: type: array items: $ref: '#/components/schemas/Discount' default: $ref: '#/components/responses/Default' post: tags: - Discounts summary: Create a Discount operationId: createDiscount parameters: - $ref: '#/components/parameters/Header.SiteId' requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/Discount' required: true responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Discount' default: $ref: '#/components/responses/Default' /api/v1/set-discount-priorities: patch: tags: - Discounts summary: Update discount priorities operationId: updateDiscountPriorities parameters: - $ref: '#/components/parameters/Header.SiteId' requestBody: content: application/json: schema: type: array items: type: object additionalProperties: false required: - id - priority properties: id: description: Discount ID (uuid) type: string format: uuid example: 942651af-f950-4716-9916-16170fe0645f priority: description: Discount priority type: integer responses: '200': description: Successful response content: application/json: schema: type: array items: $ref: '#/components/schemas/Discount' default: $ref: '#/components/responses/Default' /api/v1/discounts/{id}: get: tags: - Discounts summary: Get a Discount operationId: getDiscount parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Discount' default: $ref: '#/components/responses/Default' patch: tags: - Discounts summary: Update a Discount operationId: updateDiscount parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' requestBody: content: application/json: schema: $ref: '#/components/schemas/Discount' required: true responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Discount' default: $ref: '#/components/responses/Default' delete: tags: - Discounts summary: Delete a Discount operationId: deleteDiscount parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' responses: '204': $ref: '#/components/responses/Empty' default: $ref: '#/components/responses/Default' /api/v1/shipping-methods: get: tags: - Shipping summary: List of Shipping Methods operationId: listOfShippingMethods parameters: - $ref: '#/components/parameters/Header.SiteId' responses: '200': description: Successful response content: application/json: schema: type: array items: $ref: '#/components/schemas/ShippingMethod' default: $ref: '#/components/responses/Default' post: tags: - Shipping summary: Create a Shipping Method operationId: createShippingMethod parameters: - $ref: '#/components/parameters/Header.SiteId' requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/ShippingMethod' - required: - sku - title - countries required: true responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/ShippingMethod' default: $ref: '#/components/responses/Default' /api/v1/shipping-methods/{id}: get: tags: - Shipping summary: Get a Shipping Method operationId: getShippingMethod parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/ShippingMethod' default: $ref: '#/components/responses/Default' patch: tags: - Shipping summary: Update a Shipping Method operationId: updateShippingMethod parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' requestBody: content: application/json: schema: $ref: '#/components/schemas/ShippingMethod' required: true responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/ShippingMethod' default: $ref: '#/components/responses/Default' delete: tags: - Shipping summary: Delete a Shipping Method operationId: deleteShippingMethod parameters: - $ref: '#/components/parameters/Path.Id' - $ref: '#/components/parameters/Header.SiteId' responses: '204': $ref: '#/components/responses/Empty' default: $ref: '#/components/responses/Default' /api/v1/settings: get: tags: - Settings parameters: - $ref: '#/components/parameters/Header.SiteId' summary: List Global Settings description: Lists Global settings (minus settings which include authentication details) operationId: listGlobal Settings responses: '200': description: Successful response content: application/json: schema: type: array items: $ref: '#/components/schemas/SettingGlobal' default: $ref: '#/components/responses/Default' patch: tags: - Settings parameters: - $ref: '#/components/parameters/Header.SiteId' summary: Update Global Setting operationId: patchGlobalSetting requestBody: content: application/json: schema: type: array items: $ref: '#/components/schemas/SettingGlobal' required: true responses: '204': $ref: '#/components/responses/Empty' default: $ref: '#/components/responses/Default' /api/v1/settings/{slug}: get: tags: - Settings parameters: - $ref: '#/components/parameters/Header.SiteId' - $ref: '#/components/parameters/Path.Slug' summary: List Customer Group Settings description: Lists Customer Group settings by Customer Group operationId: listSettings responses: '200': description: Successful response content: application/json: schema: type: array items: $ref: '#/components/schemas/SettingCustomerGroup' default: $ref: '#/components/responses/Default' patch: tags: - Settings parameters: - $ref: '#/components/parameters/Header.SiteId' - $ref: '#/components/parameters/Path.Slug' summary: Update Customer Group Setting operationId: patchCustomerGroupSetting requestBody: content: application/json: schema: type: array items: $ref: '#/components/schemas/SettingCustomerGroup' required: true responses: '204': $ref: '#/components/responses/Empty' default: $ref: '#/components/responses/Default' /api/v1/customer-groups: get: tags: - Customer Groups parameters: - $ref: '#/components/parameters/Header.SiteId' summary: List Customer Groups operationId: listCustomerGroups responses: '200': description: Successful response content: application/json: schema: type: array items: $ref: '#/components/schemas/CustomerGroupRequest' default: $ref: '#/components/responses/Default' post: tags: - Customer Groups parameters: - $ref: '#/components/parameters/Header.SiteId' summary: New Customer Group operationId: createCustomerGroup requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/CustomerGroupRequest' responses: '200': description: Successful response content: application/json: schema: type: array items: $ref: '#/components/schemas/CustomerGroupResponse' default: $ref: '#/components/responses/Default' /api/v1/customer-groups/{slug}: patch: tags: - Customer Groups parameters: - $ref: '#/components/parameters/Header.SiteId' - $ref: '#/components/parameters/Path.Slug' summary: Update Customer Group operationId: updateCustomerGroup requestBody: content: application/json: schema: title: Customer Group type: object additionalProperties: false required: - name properties: name: type: string example: Europe (GBP) Customers maxLength: 256 parent_slug: type: string example: base maxLength: 128 responses: '200': description: Successful response content: application/json: schema: type: array items: $ref: '#/components/schemas/CustomerGroupResponse' default: $ref: '#/components/responses/Default' delete: tags: - Customer Groups parameters: - $ref: '#/components/parameters/Header.SiteId' - $ref: '#/components/parameters/Path.Slug' summary: Delete Customer Group operationId: deleteCustomerGroup responses: '204': $ref: '#/components/responses/Empty' default: $ref: '#/components/responses/Default' components: parameters: Path.Slug: name: slug in: path required: true schema: type: string style: simple Path.Id: name: id description: Either the Internal or External ID in: path required: true schema: type: string style: simple Path.Id2: name: id2 description: Spark Layer ID of record (or external ID of the entity) in: path required: true schema: type: string style: simple Path.PackageId: name: packageId description: Spark Layer Package ID in: path required: true schema: type: string style: simple Path.SKU: name: SKU description: Product Variant SKU in: path required: true schema: type: string style: simple Header.SiteId: name: Site-Id description: Spark Layer Site ID in: header required: true schema: type: string example: jones-climbing responses: Default: description: Error Response content: application/problem+json: schema: $ref: '#/components/schemas/Error' Empty: description: Empty Response Conflict: description: Conflict Response content: application/problem+json: schema: $ref: '#/components/schemas/Error' schemas: Address: type: object additionalProperties: false required: - address_line1 - city - country_code properties: id: description: Address ID (always prefixed with ca_) type: string readOnly: true example: ca_123 title: description: Title maxLength: 30 type: string example: Mr first_name: description: First Name maxLength: 50 type: string example: Bob last_name: description: Last Name maxLength: 50 type: string example: Jones company: description: Company maxLength: 128 type: string example: Tom Jones Climbing Ltd address_line1: description: Address Line 1 maxLength: 255 type: string example: Example Industrial Estate address_line2: description: Address Line 2 maxLength: 255 type: string example: North Country city: description: City maxLength: 128 type: string example: Cityland region_name: maxLength: 128 type: string example: California nullable: true region_code: description: Region maxLength: 10 nullable: true type: string example: CA postal_code: description: Postal Code maxLength: 20 type: string example: '12345' country_code: description: Country Code maxLength: 3 type: string example: USA phone: description: Phone maxLength: 20 type: string example: +44 (0) 123456789 mobile: description: Phone - Mobile maxLength: 20 type: string example: +44 (0) 723456789 external_id: description: External ID (cannot start with ca_ and must be unique) maxLength: 50 type: string example: ADD1234567 nullable: true nickname: description: Nickname maxLength: 50 type: string example: Warehouse - Cityland CustomerGroupRequest: title: Customer Group Request type: object additionalProperties: false required: - slug - name properties: slug: type: string example: eu_gbp maxLength: 128 pattern: ^(?!^null$)(?!^default$)a-z name: type: string example: Europe (GBP) Customers maxLength: 256 parent_slug: type: string example: base maxLength: 30 CustomerGroupResponse: title: Customer Group Response type: object additionalProperties: false required: - slug - name properties: slug: type: string example: eu_gbp maxLength: 128 name: type: string example: Europe (GBP) Customers maxLength: 256 parent_slug: type: string example: base maxLength: 128 CustomerBase: type: object properties: id: description: SparkLayer Customer ID (always prefixed with cu_) type: string maxLength: 17 readOnly: true example: cu_123 created_at: type: string readOnly: true format: date-time updated_at: type: string readOnly: true format: date-time addresses: readOnly: true type: array items: $ref: '#/components/schemas/Address' title: description: Title maxLength: 30 type: string example: Mr first_name: description: First Name maxLength: 128 type: string example: Tom last_name: description: Last Name maxLength: 128 type: string example: Jones email: description: Email Address (Unique) maxLength: 255 type: string example: [email protected] company_name: description: Company Name maxLength: 255 type: string example: Tom Jones Climbing Ltd external_id: description: External Id (cannot start with cu_ and must be unique) maxLength: 255 type: string example: XXXX00123 accounting_id: description: Accounting Id maxLength: 255 type: string example: XXXX00123 status: description: Status - login is allowed only via the active status default: active enum: - pending - active - inactive - rejected group: description: Customer Group maxLength: 128 type: string default: base example: base role: description: A role that represents the users permissions maxLength: 64 type: string default: main example: limited-customer enum: - main - limited-customer - sales-agent - sales-admin default_billing_address_id: description: Default Billing Address ID (returned as ID but can be provided by the external ID) type: string example: ca_1234 nullable: true default_shipping_address_id: description: Default Billing Address ID (returned as ID but can be provided by the external ID) type: string example: ca_1234 nullable: true available_shipping_addresses: description: Limit the shipping addresses to be selected type: array nullable: true items: type: string description: SparkLayer Address ID example: ca_12345 currency_code: description: 'ISO 4217 currency code, not required if price_lists is specified' type: string minLength: 3 maxLength: 3 example: gbp nullable: true sales_agent_groups: description: | 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. type: array items: type: string description: Freeform Text Field example: south-west-uk minLength: 1 maxLength: 64 pattern: ^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$ price_lists: description: Customer specifc price lists (overrides customer group settings) type: array items: type: string description: Price List Slug example: b2b_gb_gbp_123 vatin_numbers: description: Validated against VAT identification numbers type: array items: type: string example: GB999999973 discount_percentage: description: Customer specific percentage discount type: number format: float minimum: 0 maximum: 100 nullable: true tax_exempt: description: Tax Exempt (overrides vatin_numbers and not recommended) type: boolean example: false default: false payment_by_invoice: description: Allow payments via invoice (overrides customer group settings) default: null nullable: true type: boolean payment_on_account: description: Allow payments on account when the order total meets available credit (overrides customer group settings) default: null nullable: true type: object properties: credit_limit: type: number nullable: true format: float balance: type: number nullable: true format: float net_terms: type: string nullable: true enum: - 7_days - 15_days - 30_days - 45_days - 60_days - 90_days metadata: description: Metadata type: object nullable: true example: null CustomerRequest: allOf: - $ref: '#/components/schemas/CustomerBase' - type: object properties: parent_customer_id: description: External Id (cannot start with cu_ and must be unique) maxLength: 255 nullable: true type: string example: XXXX00123 CustomerResponse: allOf: - $ref: '#/components/schemas/CustomerBase' - type: object properties: parent_customer: nullable: true type: object properties: id: description: SparkLayer Customer ID (always prefixed with cu_) type: string maxLength: 17 example: cu_123 external_id: description: External Id (cannot start with cu_ and must be unique) maxLength: 255 type: string example: XXXX00123 Discount: type: object additionalProperties: false required: - internal_name - internal_slug - calculation_group - priority - times_applicable_per_order - groups - requirement_selection_type - reward_selection_type - currency_code - start_date - end_date - active - requirements - other_requirements properties: id: description: Discount ID (uuid) type: string format: uuid example: 942651af-f950-4716-9916-16170fe0645f readOnly: true created_at: type: string readOnly: true format: date-time deleted_at: type: string readOnly: true format: date-time nullable: true updated_at: type: string readOnly: true format: date-time name: type: string maxLength: 256 description: A user friendly name for the discount internal_name: type: string maxLength: 45 internal_slug: type: string maxLength: 45 calculation_group: description: 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. type: number minimum: 0 maximum: 127 priority: description: The sequence to apply the discounts (within each discount 'dependency level') type: number minimum: 0 maximum: 127 times_applicable_per_order: description: Per order application limits. If -1 allow unlimited applications, otherwise limited type: number minimum: 1 maximum: 127 max_rewards: description: Used when rewardSelectionType is cheapest or expensive to determine the number of rewards available type: number nullable: true minimum: 1 maximum: 127 default: 1 groups: type: array description: Customer groups covered by this discount (use default to cover all groups) items: type: string example: default simultaneity: type: array description: Other discounts which can be applied simultaneous, if null no limitation nullable: true items: type: string example: default format: uuid requirement_selection_type: description: Products which must be in the cart must match all or any one of the combo groups type: string enum: - any - all reward_selection_type: type: string enum: - all - cheapest - expensive currency_code: type: string minLength: 3 maxLength: 3 example: gbp nullable: true start_date: description: Start Date type: string format: date-time nullable: true end_date: description: End Date type: string nullable: true format: date-time active: type: boolean requirements: type: array items: $ref: '#/components/schemas/Discount.Requirement' rewards: type: array items: $ref: '#/components/schemas/Discount.Reward' other_requirements: type: array items: description: Describe any specific requirements for this discount to be applied such as coupon codes, num items or spend amount. oneOf: - $ref: '#/components/schemas/Discount.OtherRequirements.Coupons' - $ref: '#/components/schemas/Discount.OtherRequirements.NumItems' - $ref: '#/components/schemas/Discount.OtherRequirements.SpendAmount' - $ref: '#/components/schemas/Discount.OtherRequirements.MaxUsesPerCustomer' discriminator: propertyName: requirement_type mapping: coupons: '#/components/schemas/Discount.OtherRequirements.Coupons' numItems: '#/components/schemas/Discount.OtherRequirements.NumItems' spendAmount: '#/components/schemas/Discount.OtherRequirements.SpendAmount' maxUsesPerCustomer: '#/components/schemas/Discount.OtherRequirements.MaxUsesPerCustomer' Discount.Requirement: type: object additionalProperties: false required: - items - max_rewards - min_spend - max_spend - spend_tax_type - selection_type - min_points properties: items: type: array items: type: object additionalProperties: false required: - restrictions - points_type - points - quantity - selection_type properties: restrictions: type: array items: type: object additionalProperties: false required: - type - ref properties: type: type: string enum: - productSKU - excludeProductSKU ref: type: string points_type: description: Add X point(s) for each matching product OR Add X point(s) for once only type: string enum: - line - item points: type: integer default: 1 quantity: type: integer selection_type: description: At least X quantity of product(s) must match OR Exactly X quantity of product(s) type: string enum: - minimum - exact max_rewards: description: Limit the number of rewards when this requirement applies type: integer nullable: true min_spend: description: The cart must contain between min_spend and max_spend based on spend_tax_type of the requirement. type: number nullable: true max_spend: type: number nullable: true spend_tax_type: type: string enum: - net selection_type: description: Apply only if 'all' items matched in the cart OR if cart worth minimum of min_points requirement items(s) using requirements type: string enum: - minimum - all min_points: description: Only applies when selection_type is minimum type: integer nullable: true Discount.Reward: type: object additionalProperties: false required: - type - amount_type - item_id - amount properties: type: type: string enum: - requirements|all - requirements|cheapest - cart|productSKU - cart|cheapestProductSKU - product - shipping - order amount_type: type: string enum: - percent - percentPreDiscount - priceAllGross - priceAllNet - priceLineGross - priceLineNet - fixedAllGross - fixedAllNet - fixedLineGross - fixedLineNet - none item_id: type: string maxLength: 100 amount: type: number Discount.OtherRequirements.Coupons: type: object properties: requirement_type: type: string enum: - coupons coupons: type: array minItems: 1 items: type: object properties: code: type: string Discount.OtherRequirements.NumItems: type: object properties: requirement_type: type: string enum: - numItems min: type: number nullable: true max: type: number nullable: true type: type: string enum: - productsTotalItems - productsTotalQuantity Discount.OtherRequirements.SpendAmount: type: object properties: requirement_type: type: string enum: - spendAmount tax_type: type: string enum: - net min: type: number nullable: true max: type: number nullable: true Discount.OtherRequirements.MaxUsesPerCustomer: type: object properties: requirement_type: type: string enum: - maxUsesPerCustomer number: type: number Error: title: Error Message Response description: Structure for returning RFC-7807 errors from API type: object additionalProperties: false properties: detail: description: Human-readable summary of the error type: string example: Data Validation Failed status: description: HTTP Status code returned from API type: integer example: 400 title: description: Machine-readable error code type: string example: invalid-api-request-contents type: type: string example: https://docs.sparklayer.io/api/errors#invalid-api-request-contents nullable: true errors: description: A list of errors related to the call type: array nullable: true items: type: object properties: code: type: string description: Machine-readable error code example: resource-not-found property: type: string description: The property the error relates to example: stock_location_id message: type: string description: Human readable summary of the error example: stock_location_id not found Price: title: Price type: object additionalProperties: false properties: tax_rate: nullable: true type: number example: 20 net: type: number example: 4 gross: type: number example: 4.8 currency_code: description: 'ISO 4217 currency code.' minLength: 3 maxLength: 3 type: string example: gbp Product: allOf: - $ref: '#/components/schemas/Product-2' - type: object required: - variants properties: variants: type: array items: $ref: '#/components/schemas/ProductVariant' ProductWrite: allOf: - $ref: '#/components/schemas/Product-2' - type: object required: - variants properties: variants: type: array items: $ref: '#/components/schemas/ProductVariantWrite' ProductVariant: type: object additionalProperties: false properties: product_id: description: SparkLayer Parent Product ID readOnly: true maxLength: 15 type: string example: pp_123 id: description: SparkLayer Variant Product ID (always prefixed with pv_) readOnly: true maxLength: 15 type: string example: pv_234 created_at: type: string readOnly: true format: date-time updated_at: type: string readOnly: true format: date-time external_id: description: External ID (cannot start with pv_ and must be unique) maxLength: 100 type: string example: IDV001 sku: description: SKU maxLength: 100 type: string example: IDV001 barcode: description: Barcode minLength: 1 maxLength: 100 nullable: true type: string example: 837493612362 weight_in_grams: description: Product weight in grams type: number minimum: 0 maximum: 2147483647 tax_type: description: Tax type ID - to be replaced with a more permanent solution deprecated: true type: number default: 1 position: description: Position type: number default: 1 nullable: true cart_image_url: description: to be replaced with a more permanent solution deprecated: true nullable: true maxLength: 512 type: string example: null rrp: description: RRP price (single item per currency_code) type: array items: $ref: '#/components/schemas/ProductVariantRRP' options: description: Product Options (item per group) type: array items: $ref: '#/components/schemas/ProductVariantOptions' status: description: Status - only live products are available frontend type: string enum: - pending - discontinued - suspended - live default: pending example: live settings: description: Variant Settings (item per customer_group) type: array items: $ref: '#/components/schemas/ProductVariantSettings' stock_management: description: Track stock inventory solution for this variant type: string enum: - sparklayer - none default: sparklayer example: none ProductVariantWrite: type: object additionalProperties: false properties: product_id: description: SparkLayer Parent Product ID readOnly: true maxLength: 15 type: string example: pp_123 id: description: SparkLayer Variant Product ID (always prefixed with pv_) readOnly: true maxLength: 15 type: string example: pv_234 created_at: type: string readOnly: true format: date-time updated_at: type: string readOnly: true format: date-time external_id: description: External ID (cannot start with pv_ and must be unique) maxLength: 100 type: string example: IDV001 sku: description: SKU minLength: 1 maxLength: 100 type: string example: IDV001 barcode: description: Barcode minLength: 1 maxLength: 100 nullable: true type: string example: 837493612362 weight_in_grams: description: Product weight in grams type: number minimum: 0 maximum: 2147483647 tax_type: description: Tax type ID - to be replaced with a more permanent solution deprecated: true type: number default: 1 position: description: Position type: number default: 1 nullable: true cart_image_url: description: to be replaced with a more permanent solution deprecated: true nullable: true maxLength: 512 type: string example: null rrp: description: RRP price (single item per currency_code) type: array items: $ref: '#/components/schemas/ProductVariantRRP' options: description: Product Options (item per group) type: array items: $ref: '#/components/schemas/ProductVariantOptions' status: description: Status - only live products are available frontend type: string enum: - pending - discontinued - suspended - live default: pending example: live settings: description: Variant Settings (item per customer_group) type: array items: $ref: '#/components/schemas/ProductVariantSettings' stock_management: description: Track stock inventory solution for this variant type: string enum: - sparklayer - none default: sparklayer example: none SettingGlobal: type: object required: - key - value properties: key: type: string value: nullable: true allOf: - {} SettingCustomerGroup: oneOf: - $ref: '#/components/schemas/Settings.orderTotalsValidation' - $ref: '#/components/schemas/Settings.orderItemQuantityValidation' - $ref: '#/components/schemas/Settings.priceListSelection' - $ref: '#/components/schemas/Settings.allowedPaymentMethods' - $ref: '#/components/schemas/Settings.allowUnavailableItemsIntoCart' - $ref: '#/components/schemas/Settings.allowAddressEditing' - $ref: '#/components/schemas/Settings.allowDefaultBillingModification' - $ref: '#/components/schemas/Settings.paymentOnAccountEnforceCreditLimit' - $ref: '#/components/schemas/Settings.useMultiLocationStock' - $ref: '#/components/schemas/Settings.multiLocationStockConfig' - $ref: '#/components/schemas/Settings.stockDisplay' ShippingMethod: type: object properties: id: description: Shipping Method ID (always prefixed with sm_) maxLength: 15 type: string example: sm_123 readOnly: true created_at: description: Created At type: string readOnly: true format: date-time updated_at: description: Updated At type: string readOnly: true format: date-time sku: type: string description: Shipping SKU maxLength: 50 example: SKU001 title: type: string description: Shiping Method Name shown at checkout example: Standard Shipping maxLength: 50 prority: description: Shown by order (lower first) type: number default: 0 minimum: 0 maximum: 127 countries: type: array description: Countries covered by this shipping method items: type: string example: GB groups: type: array description: Customer groups covered by this shipping method (use default to cover all groups) items: type: string example: default bands: type: array items: type: object properties: name: type: string description: Internal Band Name example: Band 1 maxLength: 50 priority: description: Filtered by first found by percentage_charge order (lower first) type: number default: 0 minimum: 0 maximum: 127 sku: description: Shipping SKU (Leave null to use the Shipping Method SKU) maxLength: 15 type: string example: ship_123 nullable: true requirement: description: The band is selected based on the requirement. oneOf: - $ref: '#/components/schemas/ShippingMethod.Requirement.Weight' - $ref: '#/components/schemas/ShippingMethod.Requirement.GrossTotal' - $ref: '#/components/schemas/ShippingMethod.Requirement.NetTotal' - $ref: '#/components/schemas/ShippingMethod.Requirement.None' 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' cost: oneOf: - $ref: '#/components/schemas/ShippingMethod.Cost.Free' - $ref: '#/components/schemas/ShippingMethod.Cost.FixedCost' - $ref: '#/components/schemas/ShippingMethod.Cost.PercentNetTotal' - $ref: '#/components/schemas/ShippingMethod.Cost.Custom' 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' ShippingMethod.Requirement.None: type: object properties: type: type: string enum: - none ShippingMethod.Requirement.Weight: type: object properties: type: type: string enum: - weight min: type: number nullable: true max: type: number nullable: true ShippingMethod.Requirement.NetTotal: type: object properties: type: type: string enum: - net_total min: type: number nullable: true max: type: number nullable: true ShippingMethod.Requirement.GrossTotal: type: object properties: type: type: string enum: - gross_total min_total: type: number nullable: true max_total: type: number nullable: true ShippingMethod.Cost.FixedCost: type: object properties: type: type: string enum: - fixed_price price: type: number ShippingMethod.Cost.Free: type: object properties: type: type: string enum: - free ShippingMethod.Cost.PercentNetTotal: type: object properties: type: type: string enum: - percent_net_total percentage_charge: type: number format: float minimum: 0 maximum: 100 ShippingMethod.Cost.Custom: type: object properties: type: type: string enum: - custom cost_language_string: type: string Product-2: type: object properties: id: description: SparkLayer Parent Product ID (always prefixed with pp_) maxLength: 15 type: string example: pp_123 readOnly: true created_at: description: Created At type: string readOnly: true format: date-time updated_at: description: Updated At type: string readOnly: true format: date-time external_id: description: External ID (cannot start with pp_ and must be unique) maxLength: 100 type: string example: ID001 title: description: Product Title maxLength: 255 type: string example: Striped Jumper slug: description: Product Slug (Used as the link identifier) maxLength: 255 type: string example: striped-jumper ProductVariantRRP: additionalProperties: false properties: value: type: number format: float example: 10.49 currency_code: description: 'ISO 4217 currency code.' type: string minLength: 3 maxLength: 3 example: gbp ProductVariantOptions: properties: group: type: string example: Color maxLength: 128 value: type: string example: Blue maxLength: 128 ProductVariantSettings: type: object additionalProperties: false properties: customer_group: type: string description: Customer Group - settings will be inplace for this customer group example: default pack_size: type: integer nullable: true description: Only allow the product to be purchased in multiples of x default: 1 reserve_stock_quantity: type: integer nullable: true description: Reserve stock quantity - always ensure x amount of stock is left (generally used to ensure b2c has availability) default: null min_order_quantity: type: integer nullable: true description: Only allow the product to be bought in a minmum of x default: null max_order_quantity: type: integer nullable: true description: Only allow the product to be bought in a maximum of x default: null min_order_parent_quantity: type: integer nullable: true description: Only allow the product to be bought in a minmum of x across all variants default: null max_order_parent_quantity: type: integer nullable: true description: Only allow the product to be bought in a maximum of x across all variants default: null display: type: boolean nullable: true description: Allow the product to display on the frontend default: null sell: type: boolean nullable: true description: Allow the product to be added to the cart default: null Settings.orderTotalsValidation: type: object required: - key - value properties: key: type: string enum: - orderTotalsValidation value: nullable: true type: array items: type: object required: - currency_code - minimum_value - compare_type properties: currency_code: description: 'ISO 4217 currency code' type: string minLength: 3 maxLength: 3 example: gbp minimum_value: type: number minimum: 0 maximum_value: nullable: true type: number minimum: 0 compare_type: type: string enum: - gross - net Settings.orderItemQuantityValidation: type: object required: - key - value properties: key: type: string enum: - orderItemQuantityValidation value: nullable: true type: object properties: minimum_quantity: type: number minimum: 1 nullable: true maximum_quantity: type: number minimum: 1 nullable: true Settings.priceListSelection: type: object required: - key - value properties: key: type: string enum: - priceListSelection value: nullable: true type: array items: type: object required: - price_list_slug properties: price_list_slug: description: Price List Slug type: string example: base-list Settings.allowedPaymentMethods: type: object required: - key - value properties: key: type: string enum: - allowedPaymentMethods value: nullable: true type: object properties: payment_by_invoice: type: boolean payment_on_account: type: boolean upfront_payment: type: boolean Settings.allowUnavailableItemsIntoCart: type: object required: - key - value properties: key: type: string enum: - allowUnavailableItemsIntoCart value: nullable: true type: boolean Settings.allowAddressEditing: type: object required: - key - value properties: key: type: string enum: - allowAddressEditing value: nullable: true type: boolean Settings.allowDefaultBillingModification: type: object required: - key - value properties: key: type: string enum: - allowDefaultBillingModification value: nullable: true type: boolean Settings.paymentOnAccountEnforceCreditLimit: type: object required: - key - value properties: key: type: string enum: - paymentOnAccountEnforceCreditLimit value: nullable: true type: boolean Settings.useMultiLocationStock: type: object required: - key - value properties: key: type: string enum: - useMultiLocationStock value: nullable: true type: boolean Settings.multiLocationStockConfig: type: object required: - key - value properties: key: type: string enum: - multiLocationStockConfig value: nullable: true type: object properties: useDefault: type: boolean allowedStockLocationIds: type: array items: type: string format: uuid Settings.stockDisplay: type: object required: - key - value properties: key: type: string enum: - stockDisplay value: nullable: true type: object properties: show_status: type: boolean show_units: type: boolean max: type: integer low: type: integer last: type: integer