Add Bill of Materials Item for Product
POST
products/{productId}/bill-of-materials-items:batch-create
Adds one or more items to the Bill of Materials of the specified Product. Each request body may contain at most 100 items; larger payloads must be split across multiple requests.
Resource Information
| Method and URI | POST https://api.aps.autodesk.com/fusion-operations/v2/products/{productId}/bill-of-materials-items:batch-create |
| Authentication Context | No security required |
| Required OAuth Scopes | data:read data:write |
| Data Format | JSON |
Request
Headers
| Authorization* string | JWT Access Token |
| Content-Type* string | Must be application/json |
* Required
Request
URI Parameters
| productId int | The unique identifier of the Product. |
Request
Body Structure
Array of bill of materials items to add. At most 100 items are accepted per request.
Expand all
| product* | |
| id int | Unique identifier of the referenced entity. |
| code string | Code of the referenced entity.
Max length: 255 |
| anyOf* | |
| 0* | |
| 1* | |
| operation* | The operation where the material is used. The operation must belong to the product. |
| id int | Unique identifier of the referenced entity. |
| code string | Code of the referenced entity.
Max length: 255 |
| anyOf* | The operation where the material is used. The operation must belong to the product. |
| 0* | |
| 1* | |
| quantity* number | |
| fixedQuantity boolean | Indicates if the consumption is fixed, regardless of produced quantity. The default value is false. |
* Required
Response
HTTP Status Code Summary
| 201 Created | Components added to Bill of Materials |
| 207 | Partial success. The request was processed but one or more bill of materials items were not created. |
| 400 Bad Request | Bad request due to invalid data. |
| 401 Unauthorized | The access token is invalid. It may have either expired or may not be a three-legged access token. Please verify the token and retry the request. |
| 403 Forbidden | The request was successfully validated but lacked required permission. Please verify your token permissions and retry the request. |
| 404 Not Found | The resource in the path does not exist. |
| 429 Too Many Requests | Rate limit exceeded; wait some time before retrying. |
| 500 Internal Server Error | An unknown server-side error occurred. Please try again later. If the problem persists, please contact support. |
Response
Header (429)
| Retry-After integer | The number of seconds to wait before retrying the request. |
Response
Body Structure (201)
Expand all
| id int | The unique identifier of the Bill of Materials Item to retrieve. |
| product | |
| id int | Unique identifier of the referenced entity. |
| code string | Code of the referenced entity.
Max length: 255 |
| name string | Name of the referenced entity.
Max length: 255 |
| anyOf | |
| 0 | |
| 1 | |
| operation | The operation where the material is used. The operation must belong to the product. |
| id int | Unique identifier of the referenced entity. |
| code string | Code of the referenced entity.
Max length: 255 |
| name string | Name of the referenced entity.
Max length: 255 |
| anyOf | The operation where the material is used. The operation must belong to the product. |
| 0 | |
| 1 | |
| quantity number | |
| fixedQuantity boolean | Indicates if the consumption is fixed, regardless of produced quantity. The default value is false. |
Response
Body Structure (207)
Expand all
| results array: object | |
| id int | The unique identifier of the Bill of Materials Item to retrieve. |
| product | |
| id int | Unique identifier of the referenced entity. |
| code string | Code of the referenced entity.
Max length: 255 |
| name string | Name of the referenced entity.
Max length: 255 |
| anyOf | |
| 0 | |
| 1 | |
| operation | The operation where the material is used. The operation must belong to the product. |
| id int | Unique identifier of the referenced entity. |
| code string | Code of the referenced entity.
Max length: 255 |
| name string | Name of the referenced entity.
Max length: 255 |
| anyOf | The operation where the material is used. The operation must belong to the product. |
| 0 | |
| 1 | |
| quantity number | |
| fixedQuantity boolean | Indicates if the consumption is fixed, regardless of produced quantity. The default value is false. |
| errors array: object | |
| title string | |
| detail string | |
| field string |
Example
Components added to Bill of Materials
Request
curl -v 'https://developer.api.autodesk.com/fusion-operations/v2/products/:productId/bill-of-materials-items:batch-create' \
-X 'POST' \
-H 'Authorization: ' \
-H 'Content-Type: application/json' \
-d '[
{
"product": {
"code": "Consumed product 1"
},
"operation": {
"code": "Operation of XPTO product"
},
"quantity": 52.6,
"fixedQuantity": false
},
{
"product": {
"code": "Consumed product 2"
},
"operation": {
"code": "Operation of XPTO product"
},
"quantity": 6
}
]'
Show More
Response
[
{
"id": 68,
"product": {
"id": 24,
"code": "Consumed product 1",
"name": "Consumed product 1"
},
"operation": {
"id": 44,
"code": "Operation of XPTO product",
"name": "Operation of XPTO product"
},
"quantity": 52.6,
"fixedQuantity": false
},
{
"id": 69,
"product": {
"id": 27,
"code": "Consumed product 2",
"name": "Consumed product 2"
},
"operation": {
"id": 46,
"code": "Operation of XPTO product",
"name": "Operation of XPTO product"
},
"quantity": 6
}
]
Show More