Skip to main content

Order Submission

Order submission is a highly environment specific process. For E-commerce platforms that we support we can simplify the process. For custom integrations you will need to do some work yourself.

E-commerce Platforms​

For E-commerce platforms that we support we have a number of plugins that will automatically handle the order submission process for you.

Shopify​

The shopify plugin will automatically submit orders to our platform when they are placed. This is the recommended way to integrate with shopify. You can continue to manage orders within Shopify as you normally would, you just need to make sure that you have annotated the line items representing the products with the IDs returned when the customer's bundle is finished.

When the customer is done, call bundle.finish(). The returned BundleDesignCreationMessage contains one entry in items per design, each with a transactionId. Inside a theme, pass the message to SpiffThemeLoader.addToEcommerceCart() and the platform will add the line items for you according to the message's cartAddMode.

When submitting a line item to Shopify you'll want to include the following property to a line item add.js call:

{
...
"properties": {
"spiffTransactionId": "1234-5678-9012-3456"
}
...
}

Many partners don't like this ID showing up in the cart. You can usually hide it with most themes by prefixing an underscore to the property name as follows.

{
...
"properties": {
"_spiffTransactionId": "1234-5678-9012-3456"
}
...
}

You can obtain each transaction ID from the finished bundle.

const message = await bundle.finish();
const transactionIds = message.items.map((item) => item.transactionId);

You have two options. You can either submit one line item for each product in the bundle, or one line item with the bundle ID. The former is the recommended approach as it allows you to track each product individually. To submit a line item with a bundle ID see the following example

const bundleId = bundle.getId();
{
...
"properties": {
"spiffBundleId": "1234-5678-9012-3456"
}
...
}

The property may be hidden in the same way as the transaction ID.

Once an order is placed containing a line item we will handle the rest, firing off any automation associated to the contained products and posting information about the order within our hub for you to manage.