Is it possible to use the API to reorder an item's BOM, and if so, can you provide an example? Say we have a BOM which is currently sequenced like this, and we want to automatically reorder the sort numbers so the sequence matches the natural order of some attribute "Attr" (suppose this was the Item Type):
And I want to use the API to end up with this:
How would I do that?
So far I've found the endpoint that appears to be used to change the sort numbers: /api/bom/v2/items/children/{partPartId}/actions/reorder
So I think my app idea would need to first get the BOM with current sort numbers and attributes specified, figure out the new sort order based on 'Attr', and then make a call to the reorder endpoint for each child item (there's no way to do this in bulk, is there?).
Would this be the endpoint to use for getting the current sort numbers and attributes or is there a more appropriate one: /api/bom/v2/project/{projectId}/extended-items/{parentPartVersionId}
Solved! Go to Solution.
Solved by sanjin_vuckovic. Go to Solution.
Hi @imckenzieY7CGY , you are right that these 2 endpoints are used for reordering.
1) Call /api/bom/v2/project/{projectId}/extended-items/{parentPartVersionId} to get current eBom data. It returns a lot of data, but for re-ordering purposes, you are most interested in 2 fields, "partPartId" and "sortNumber", since you'll need to use them in re-order endpoint
2) Call /api/bom/v2/items/children/{partPartId}/actions/reorder to reorder a single item in ebom. Below is an example of my call for reordering, where I have 3 children items and I want to move one child (partPartId 13264546) to first place:
I hope this will help you to call reordering endpoint. It there will be additional questions, I'd be glad to answer them.
Can't find what you're looking for? Ask the community or share your knowledge.