Endpoints Reference
openapi: 3.0.3 info: title: SparkLayer Ignite Integration Docs contact: email: [email protected] version: 0.0.1 tags:
- name: Platform Connection
- name: Customer Address
- name: Checkout
- name: Customer Sub-Accounts paths: /v1/{siteEnv}/{siteId}: post: tags: - Platform Connection summary: New Platform Connection description: The SparkLayer Ignite platform will call this endpoint when the merchant connects SparkLayer on the specific platform. Please note that this endpoint must be idempotent as it may be called multiple times. operationId: createPlatformConnection parameters: - $ref: '#/components/parameters/siteEnv' - $ref: '#/components/parameters/siteId' requestBody: content: application/json: schema: type: object required: - store_id - spark_api_client_id - spark_api_client_secret properties: store_id: type: string example: "1234" description: The ID of the store on the 3rd party platform spark_api_client_id: type: string example: ca7cf4ac-51cb-4836-9a79-d425afc6e280 spark_api_client_secret: type: string example: puwUwJZRfsnpB7nENulMW67prs94QYbu2DXHL3Sh responses: '201': description: Successful operation - App install pending content: application/json: schema: type: object required: - redirect_url properties: redirect_url: description: Platform store app install URL to redirect the merchant to in order to complete the connection type: string example: https://store-1234.example.io/install '204': description: Successful operation - App already installed - Platform connection is now active '401': description: Auth Failure '500': description: System Exception delete: tags: - Platform Connection summary: Remove Platform Connection description: SparkLayer Ignite platform will call this endpoint when the merchant disconnects SparkLayer on the specific platform. operationId: removePlatformConnection parameters: - $ref: '#/components/parameters/siteEnv' - $ref: '#/components/parameters/siteId' responses: '204': description: Successful operation '401': description: Auth Failure '500': description: System Exception /v1/{siteEnv}/{siteId}/customers: put: tags: - Customer summary: Create/update a customer description: >- Create or update a "customer" on the eCommerce platform
components: parameters: siteId: name: siteId in: path required: true schema: type: string example: bobs-store minLength: 1 siteEnv: name: siteEnv in: path required: true schema: type: string example: live syncDataType: name: syncDataType in: path required: true schema: type: string enum: [ customers, products ] example: products description: > Either products or customers customerExternalId: name: customer_external_id in: path description: Platform ID of Customer required: true schema: type: string minLength: 1 requestBodies: Address: description: Address content: application/json: schema: $ref: '#/components/schemas/Address' responses: Default: description: Error Response content: application/problem+json: schema: $ref: '#/components/schemas/Error' Address: description: Successful Address content: application/json: schema: $ref: '#/components/schemas/AddressWithId' Calculate: description: Returns tax and shipping information content: application/json: schema: type: object properties: available_shipping_methods: type: array items: type: object properties: id: type: string example: next-day name: type: string example: Next day delivery price: description: Net of tax type: number example: 4.80 platform_shipping_line: description: |- When using eCommerce platform shipping, return the currently set shipping method data. This is needed in the case where the eCommerce platform or the ignite integration rejects the suplied shipping method and automatically selects another available shipping method. nullable: true $ref: '#/components/schemas/ShippingLinePlatform' totals: type: object properties: line_items: description: Sub-total of line items (Nett of tax) type: number example: 14.80 shipping_price: description: Shipping cost (Nett of tax) type: number example: 4.80 tax: description: Tax for the order type: number example: 2.20 total_price: description: Order total (Gross of tax) type: number example: 21.80 ignite_state: type: object description: > Context which will be provided in subsequent requests to /checkout/complete Complete: description: Checkout complete success content: application/json: schema: allOf: - type: object properties: line_items: type: array items: type: object required: - spark_item_key - tax_lines properties: spark_item_key: type: string tax_lines: type: array items: type: object properties: rate: type: number example: 0.2 description: Tax rate price: type: number example: 1.0 description: Tax amount platform_shipping_line: description: |- When using eCommerce platform shipping, return the currently set shipping method data. This is needed in the case where the eCommerce platform or the ignite integration rejects the supplied shipping method and automatically selects another available shipping method. nullable: true $ref: '#/components/schemas/ShippingLinePlatform' - oneOf: - type: object properties: checkout_url: description: URL to send the customer to complete payment, leave null if not required type: string nullable: true format: url example: https://checkout-bobs-store.com/checkout/1234/payment - type: object properties: order_id: description: The platform's unique order ID type: string example: "5342456" schemas: ShippingLineSparkLayer: type: object description: Shipping Line provided from SparkLayer properties: type: type: string enum: [ sparklayer ] id: type: string name: type: string price: description: Net of tax type: number example: 4.80 ShippingLinePlatform: type: object description: Shipping Line provided from Platform properties: type: type: string enum: [ platform ] id: type: string name: type: string price: description: Net of tax type: number example: 4.80 ShippingLinePlatformIdOnly: type: object description: Shipping Line provided from Platform - ID only properties: type: type: string enum: [ platform ] id: type: string Error: title: Error Message Response description: "Structure for returning RFC-7807 errors from API" type: object properties: detail: description: Human-readable detail of the error type: string example: Data Validation Failed status: description: HTTP Status code returned from API type: integer example: 400 title: description: Human-readable summary of the error type: string example: "invalid-api-request-contents" type: type: string example: "invalid-api-request-contents" 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" Address: type: object properties: title: maxLength: 30 type: string example: Mr nullable: true first_name: maxLength: 50 type: string example: Bob nullable: true last_name: maxLength: 50 type: string example: Jones nullable: true company: maxLength: 128 type: string example: Tom Jones Climbing Ltd nullable: true address_line1: maxLength: 255 type: string example: Example Industrial Estate nullable: false address_line2: maxLength: 255 type: string example: North Country nullable: true city: maxLength: 128 type: string example: Cityland nullable: false region_name: maxLength: 128 type: string example: California nullable: true region_code: maxLength: 10 nullable: true type: string example: CA postal_code: maxLength: 20 type: string example: "12345" nullable: true country_code: description: Two letter country code as defined by ISO 3166-2 maxLength: 2 type: string example: US nullable: false phone: maxLength: 20 type: string example: +44 (0) 123456789 is_default_shipping: type: boolean nullable: false is_default_billing: type: boolean nullable: false AddressWithId: type: object properties: title: maxLength: 30 type: string example: Mr nullable: true first_name: maxLength: 50 type: string example: Bob nullable: true last_name: maxLength: 50 type: string example: Jones nullable: true company: maxLength: 128 type: string example: Tom Jones Climbing Ltd nullable: true address_line1: maxLength: 255 type: string example: Example Industrial Estate nullable: false address_line2: maxLength: 255 type: string example: North Country nullable: true city: maxLength: 128 type: string example: Cityland nullable: false region_name: maxLength: 128 type: string example: California nullable: true region_code: maxLength: 10 nullable: true type: string example: CA postal_code: maxLength: 20 type: string example: "12345" nullable: true country_code: description: Two letter country code as defined by ISO 3166-2 maxLength: 2 type: string example: US nullable: false phone: maxLength: 20 type: string example: +44 (0) 123456789 is_default_shipping: type: boolean nullable: false is_default_billing: type: boolean nullable: false customer_address_external_id: description: eCommerce platform ID for the Customer Address maxLength: 50 type: string Shop: type: object properties: base_currency_code: description: "ISO 4217 currency code" minLength: 3 maxLength: 3 type: string example: gbp Checkout: type: object properties: cart_id: description: SparkLayer Cart ID type: string format: uuid example: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 nullable: false customer: allOf: - $ref: '#/components/schemas/Customer' - type: object properties: default_billing_address_id: description: eCommerce platform ID of default billing address type: string nullable: true default_shipping_address_id: description: eCommerce platform ID of default shipping address type: string nullable: true temporary_external_address_ids: description: | List of temporary (drop shipping) address IDs associated with the customer to be deleted once the order has been completed. Should be the external (platform) address ID type: array items: type: string payment_on_account: type: object nullable: true 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' currency_code: description: "ISO 4217 currency code" minLength: 3 maxLength: 3 type: string example: gbp billing_address: $ref: '#/components/schemas/Address' shipping_address: $ref: '#/components/schemas/Address' shipping_line: description: |- If using platform shipping, on the first load of the final checkout screen, this will be null, after it will be an ID from a method from the response of available_shipping_methods If using SparkLayer shipping, this can be null if none found or will be the method. nullable: true discriminator: propertyName: type mapping: sparklayer: '#/components/schemas/ShippingLineSparkLayer' platform: '#/components/schemas/ShippingLinePlatformIdOnly' anyOf: - $ref: '#/components/schemas/ShippingLineSparkLayer' - $ref: '#/components/schemas/ShippingLinePlatformIdOnly' shop: $ref: '#/components/schemas/Shop' line_items: type: array nullable: false items: type: object properties: spark_item_key: type: string maxLength: 32 example: 00a0c91e6bf600a0c91e6bf spark_variant_id: type: string maxLength: 32 example: pv_134 sku: type: string example: EXAMPLE-SKU product_variant_external_id: description: eCommerce platform ID of Product Variant type: string example: PROD123456 product_external_id: description: eCommerce platform ID of Product type: string example: PROD1234 quantity: type: integer example: 10 unit_price: description: Net price of a unit type: number example: 4.80 custom_attributes: description: Custom attributes allow arbitrary data to be attached to a line item type: array items: type: object properties: key: type: string value: type: string options: type: array nullable: true items: type: object properties: group: type: string value: type: string ignite_state: type: object description: > Context which was set by a previous response from /checkout/calculate Customer: type: object required: - id - external_id - email properties: id: description: SparkLayer ID of Customer type: string example: cu_1 email: type: string format: email external_id: description: eCommerce platform ID of Customer type: string example: CUS1234 accounting_id: type: string nullable: true SalesAgent: type: object required: - id - email properties: id: description: SparkLayer ID of Sales Agent type: string example: cu_1 email: type: string format: email accounting_id: type: string nullable: true DiscountData: type: object nullable: true properties: sub_total_pre_discount: $ref: '#/components/schemas/CurrencyTotal' sub_total_discount: $ref: '#/components/schemas/CurrencyTotal' line_item_discounts: type: array items: $ref: '#/components/schemas/LineItemDiscount' discount_slugs: type: array items: type: string required: - sub_total_pre_discount - sub_total_discount - line_item_discounts - discount_slugs CurrencyTotal: type: object properties: net: type: number format: float required: - net LineItemDiscount: type: object properties: pre_discount: $ref: '#/components/schemas/CurrencyTotal' discount: $ref: '#/components/schemas/CurrencyTotal' sku: type: string item_key: type: string required: - pre_discount - discount - sku - item_key