Require a small help in API updating the products
https://shopware.stoplight.io/docs/admin-api/faf8f8e4e13a0-bulk-payloads#performance
- We have products 1, 2, 3 .....upto 100 and we update quantity in BULK from our ERP (single operation)
- Due to some reason (suppose) instead of integer we send string to 80th product --- so the API response gives error (which is ok)
- But not only 80th product fails to update but the complete batch fails so 1 to 100 product fails - non of them are updated
Please help how to fix this or correct us if we are wrong??
Using the reference https://shopware.stoplight.io/docs/admin-api/faf8f8e4e13a0-bulk-payloads#performance
- We are updating "entity": "product", and "action": "upsert" with headers
// --header 'single-operation: 1'
// --header 'indexing-behavior: use-queue-indexing'
All working very good but as we are using the entity in bulk if any one of the entity fails the complete bulk gives error and non of the product from the bulk list gets updated
If we are sending 1 to 100 products and problem is only at 80th product, only that does not get updated -- but rest 99 products should get updated
The behavior you describe is the expected behavior when you use
single-operation: 1
, as it is described in the reference you linked.With
single-operation: 1
all operations you sent are executed inside a single database transaction, so when one of the operations fails, the others are also rollbacked.From what you describe you want to use
single-operation: 0
, which means that each operation you sent has it's own database transaction, so that when one operation fails the others still go through.