Bulk Operations
Saleor provides a set of bulk mutations that allow you to efficiently create or update multiple objects in a single API call. These operations are particularly useful for data migration, system integration, or initial store setup.
Available Bulk Mutations
Attributes
The bulk attribute mutations enable you to create and update multiple attributes and their values in a single operation. This is particularly useful when setting up or modifying your product attribute structure.
For detailed guidance and example payloads, see the bulk attributes documentation.
Customers
The customerBulkUpdate
mutation allows you to update multiple
customer accounts simultaneously. This is useful for updating customer information, or status in bulk.
Before updating customers, ensure you have:
- Valid customer IDs or external reference for all records being updated
- Address formats validated for your target regions
Orders
Saleor offers the orderBulkCreate
mutation to facilitate the import
of multiple orders simultaneously, which is particularly useful when
migrating data from external systems.
For detailed guidance and example payloads, see the bulk orders guide.
Products and Variants
Saleor provides three bulk mutations to help you manage products and variants at scale. These are ideal for initializing large catalogs, synchronizing data from external systems, or performing mass updates efficiently:
productBulkCreate
: Create multiple products along with their variants, attributes, and channel listings.productVariantBulkCreate
: Create multiple variants for existing products in a single mutation.productVariantBulkUpdate
: Update attributes, pricing, and inventory details for multiple variants at once.
For detailed guidance and example payloads, see the bulk products documentation.
Stock Management
The stockBulkUpdate
mutation enables you to update stock levels across
multiple warehouses in a single operation. This is useful for inventory
synchronization and bulk stock adjustments.
For detailed guidance and example payloads, see the bulk stock update documentation.
Translations
Bulk translation mutations allow you to manage translations for multiple products, variants, attributes, and values in a single operation. This is essential for maintaining multilingual catalogs.
productBulkTranslate
productVariantBulkTranslate
attributeBulkTranslate
attributeValueBulkTranslate
promotionRuleTranslate
Before using translation mutations, ensure the following:
- You are using proper and valid language codes for all translations.
- The objects you want to translate (products, variants, attributes, attribute values, or promotion rules) already exist in the system.
Best Practices
Performance Optimization
- Limit batch sizes to 100 objects per request
- Run operations during off-peak hours
- Monitor system resources during large imports
Error Handling
- Refer to the Error policy documentation to select the most appropriate error-handling strategy for your use case.
- Log all errors for troubleshooting
Data Validation
- Validate data structure before sending
- Check required fields and relationships
- Ensure data consistency across related objects
Monitoring
- Track progress of bulk operations
- Monitor API response times
- Set up alerts for failed operations