Spectrum Integration
  • Introduction
  • Ecommerce
    • Front End Integration
    • Load Design
    • Add to Cart
    • Save Design
    • Generate Cart Item
    • Pricing & Availability
    • Order Acknowledgement
    • Shipment Notification
    • Update Order Status
    • Order Search
    • Integration Driver
    • Production Related File Delivery
    • Spectrum + Shopify Integration
      • Overall Flow
      • Product Set Up: "Add-ons"
      • Line Item Properties
      • Shopify Cart
      • Order Processing
  • API
    • Environments
    • Image QueryString API
      • Image Transforms
      • Image Filters
      • Image Encoding
    • Rendering
    • WebToPrint (W2P)
    • Assets
    • Rate Limiting
  • Marketing
    • Share
  • General
    • Glossary
Powered by GitBook
On this page
  • Item Prices and Availability
  • Total Price

Was this helpful?

  1. Ecommerce

Pricing & Availability

Item Prices and Availability

Pricing and availability for individual items and services are displayed in the Spectrum UI, with data provided by the spectrumItemPricesAndAvailabilityCallback function. This function has one argument in the signature: skus.

window.spectrumItemPricesAndAvailabilityCallback = function(itemsBySkuOrName) { 
  // itemsBySkuOrName: array of strings that can refer to SKUs, parts, or decoration services
}

This callback should return a promise that resolves to an array of objects with the following properties:

[
  {
    sku: 'exampleSku',
    name: 'Example',
    type: 'baseProduct',
    price: 99.99,
    listPrice: null,     // nullable list price to distinguish from sale price
    isoCurrency: 'USD',  // must be a valid ISO 4217 currency code
    inStock: true,
    options: null        // nullable options object with string values
  }
]

Total Price

Displaying the total price for a customized product at runtime can be supported by exposing a global spectrumTotalPriceCallback function. This ensures that ecommerce systems are the single source of truth pricing calculations and ensures that discounts, upcharges are accurate and consistent with how they appear at checkout.

window.spectrumTotalPriceCallback = function(items) {
  // items[n].sku: string | null
  // items[n].name: string | null
  // items[n].quantity: number (unsigned int)
}

This callback should return a promise that resolves into an object with the following properties:

{
  price: 999.99,
  isoCurrency: 'USD',  // must be a valid ISO 4217 currency code
  options: null        // nullable options object with string values
}
PreviousGenerate Cart ItemNextOrder Acknowledgement

Last updated 2 years ago

Was this helpful?