Product Factory
Product factory provides builder methods to help you create Firework product objects from any third-party format. Firework product objects are required for Product Hydration and Cart Sync.
Create a product
Name | Description | Required |
---|---|---|
| External ID in a partner database. It is used to match and update products synced with Firework. | Yes |
| Product name | Yes |
| Product description. Markdown for rich formating is allowed. | Yes |
| Currency code. e.g. "USD". | Yes |
| Variant factory, see below. | Yes, at least one variant should exist in a product |
Sample Code
Create a variant (product unit)
Every product can have one or more variants. For example, a product may come in different sizes or colors. Please note each product needs at least one variant.
Name | Description | Required |
---|---|---|
| External variant ID in a partner database. It is used to match and update product variants synced with Firework. | Yes |
| URL to product/variant detail page. | Yes |
| Numeric value of current price | Yes |
| SKU identifier. | Optional |
| Variant name. | Optional |
| Numeric value of original price | Optional |
| Boolean indicating whether variant is currently available (out of stock). | Optional |
| Image factory, see below. | Optional |
| Variant option. Accepts | Optional |
| Numeric position amongst other variants. Variant options will also be sorted by this position. | Optional |
To update the default pricing, a variant must be hydrated that matches the existing unit_id
Create an image
Name | Description | Required |
---|---|---|
| External image ID in partner database. It is used to match images between the partner and the Firework database. | Yes |
| URL location of an image. | Yes |
| Alt title for an image. | Optional |
| Numeric value used to sort multiple images. | Optional |
| Boolean to set an image as primary | Optional |
Last updated