Data Sync
a key part of an ignite integration is the data syncronization tooling it brings data from the chosen platform (e g ecommerce platform) to sparklayer this data can then be viewed by the merchant users within the sparklayer dashboard https //docs sparklayer io/sparklayer dashboard/the sparklayer dashboard also, the data will be used in the sparklayer frontend https //docs sparklayer io/sparklayer frontend/overview of features to power the wholesale ordering experience, including which customers should sparklayer be enabled to, what pricing should be shown, as well as the customer's order history when data sync happens a full data sync is to be triggered in these scenarios on install of the application if any inconsistencies exist and data needs to be refreshed this will be actioned via the integration's trigger a data sync endpoint which is called by the sparklayer dashboard ( when the merchant clicks the manual syncronization buttons for products and customers) beyond this, data will be synced via partial data updates (based on webhooks or other event mechanisms from the ecommece platform) important considerations area notes queueing and retry to ensure the stability and reliability of the platform, partial sync events should be retried in case of issues performance this service should not be affected by heavy users of our api and should be designed to make as little updates as possible i e for a product update, fetch the product and stock levels and only run updates where required reporting to ensure visibility of the last updated date and the last full sync this should be logged via the sync log api detailed further down this page issue logging any issues encountered during the process should be handled and logged via the sync log api to be displayed to our merchants in the spark dashboard an example of this could be a sku not set on a product variant or a customer address missing data such as "line 1 is empty" types of data the data to be synced includes products, customers, orders and store settings products below are the key elements of data to be synced from the platform (see the api here https //docs sparklayer io/tech docs/create a product ) title slug external id > platform product id variants external id > platform variant id sku weight in grams position cart image url options status status should be set to live when the product is live and set to discontinued when the product is deleted stock levels must be set synced from inventory level to our stock api (see the api here) https //docs sparklayer io/tech docs/update product stock extending the product object with b2b attributes the below data would be useful if this is synced across from fields on the platform where the data could be stored, such as attributes (if possible, against the variant record) rrp settings restock date against the stock record but can be taken from variant pricing product pricing can be synced into the sparklayer pricing api https //docs sparklayer io/tech docs/pricing api we suggest that the ignite implementation create at least one price list containing the default price for every product in the underlying platform the price list should be named after the platform, eg "bigcommerce price" the price list should be created when the platform is connected and pricing should be updated whenever a product sync happens customers customer data to be synced (see the api here https //docs sparklayer io/tech docs/create a customer ) and associated customer addresses (see the api here https //docs sparklayer io/tech docs/create a customer address ) external id > platform id email first name last name company name extending the customer object with b2b attributes the below data would be useful if this is synced across from fields on the platform where the data could be stored, such as attributes group can be fed via other means i e if there's another field which makes sense to sync via such as if there's a group on the underlying platform group accounting id sales agent groups price lists discount percentage payment on account parent customer id orders order data to be synced (see the purchasing api here https //docs sparklayer io/tech docs/createupdate purchase ); this needs to include order creation, amends and shipments please note only b2b orders placed though the sparklayer frontend are required to be synced across store settings on platform connection, as well as when the relevant store settings are updated on the ecommerce platform, the following store settings should be synced across base currency (this should be syned to sparklayer using the settings api here https //docs sparklayer io/tech docs/update global setting and a setting key of basecurrency ) logging sync issues for optimal visibility of the data syncronization process, any customer and product sync timestamps and errors should be reported through the sync log api this ensures that our merchants can view this information on the sparklayer dashboard and take the necessary actions documentation pertaining to the sync log api endpoints is accessible here https //docs sparklayer io/tech docs/core api full data synchronization (including initial synchronization) during a full data synchronization a full sync log should be recorded using the put endpoint please be advised upon a full data sync log, errors from the preceding sync log are cleared it's crucial that the external id associated with each error remains unique this precaution prevents errors from being mistakenly overwritten or incorrectly resolved as full data sync might take a while and is often done asyncronously, it will not usually be possible to record all the errors in the inital sync log put request instead, the initial sync log put request can be used to record the start of the sync and the errors (as well as their potential resolutions) can be recorded in subsequent partial sync patch requests also, the sync log api needs to be notified when the full sync is complete this can be done by sending a partial sync patch request with the last full sync property once the ignite integration has finished syncing all the data in the case of a full sync where items are synced in separate application instances (i e though a use of a queue) it's important to ensure that the sync log last full sync property is only updated once all items have been synced for this you might need to keep track of the items synced and remaining in the integration as the sync log api does not handle this partial synchronization a partial synchronization log should be recorded any time an individual item is synced for instance, this would happen if a product or customer is updated on the store and the update is synced to sparklayer this can be done using the sync log api patch endpoint please be advised the patch endpoint retains pre existing errors incorporates any new errors additionally, errors can be resolved using an array of successfully synchronized platform ids protocol for sync log deletion the sync log api is responsible for sync log upkeep given that previous errors are cleared during a full data synchronization, there's typically no need to delete sync logs however, if a store decides to uninstall sparklayer, it's essential to delete the store's synchronization logs using the designated delete endpoint