Drazen,
Thanks for reaching out. We are reviewing this and will be back in touch with a suggestion.
Hi Drazen,
Unfortunately, the API does not support this in a single request, and as a result, the Import API does not, either. However, the team is considering improving this.
We recommend that you use the following pattern when implementing the Import API.
-
New product , imported using Product draft with all values being provided in the same batch and import request.
-
Product updates have been handled by Products.
-
Variant addition and update handled by Product variants and Product variants patch.
This mitigates the issue mostly for new products; however, for existing products, you can run twice as you suggested (with all attributes) or have an application set new masters with the API directly after the import is complete.
Does that help?
Best Regards
Brian
For a quicker response, please use the Support portal for these types of questions.
Thank you for the answer, unfortunately this just confirmed my understanding/worries.
As a general feedback would say that the Import API is not an ideal approach for importing data as it brings many blockers, edge cases and very high complexity where we need to have many checks/if/else cases when to do what, and my understanding of an Import API would be that it removes that complexity of the native Commercetools API a not that we need to handle al this cases and thinking when and how to handle it.
Regards,
Drazen
Hi Drazen,
Thanks for the feedback. I have passed this on to the team.
If you have any more pain points, I would be interested in you sharing them here.
The team is constantly working to eliminate these blockers and edge cases and will seriously consider your feedback.
Best regards
Brian
With the current setup of Import SDK, I don’t see much value than just using the standard API and having control what we import.
I would look at the Import API as a layer that removes the need to think about each CRUD operation, e.g. ideally we send some data and its either created or updated.
ProductDraft → good only for initial load only, we also noticed some race conditions here when a source system sends multiple updates in very short time
Product Variant → kind makes sense so that you can import just one variant but again you need to use it in combination with ProductDraft as you can’t just import variants so again multiple different implementations wit different payloads, etc.
Thank you,
Regards