Create Product
Add a product
createProduct
Creates a new product. Returns the created Product object.
Method
POST
Path
/graphql
Authentication
Bearer Token
Request Body Schema
Content-type: application/json
Variables
| Name | Type | Required | Description |
|---|---|---|---|
input.partnumber | String | Required | Unique part number identifier |
input.description | String | Optional | Product description |
input.model | String | Optional | Model identifier |
input.list_price | Float | Optional | List price |
input.msrp | Float | Optional | Manufacturer suggested retail price |
input.moq | Int | Optional | Minimum order quantity |
input.tariff_surcharge | Float | Optional | Tariff surcharge amount |
input.allow_tariff | Boolean | Optional | Whether a tariff surcharge applies |
input.other_details | JSON | Optional | Arbitrary additional data |
Example Payload
{
"query": "mutation ($input: CreateProductInput!) { createProduct(input: $input) { id partnumber description model list_price msrp moq tariff_surcharge allow_tariff created_at } }",
"variables": {
"input": {
"partnumber": "WIDGET-001",
"description": "Standard Widget",
"model": "W1",
"list_price": 99.99,
"msrp": 129.99,
"moq": 10,
"tariff_surcharge": 5.0,
"allow_tariff": true
}
}
}
Response
Returns the newly created Product object.
Example Response
{
"data": {
"createProduct": {
"id": "2",
"partnumber": "WIDGET-001",
"description": "Standard Widget",
"model": "W1",
"list_price": 99.99,
"msrp": 129.99,
"moq": 10,
"tariff_surcharge": 5.0,
"allow_tariff": true,
"created_at": "2026-06-03 08:00:00"
}
}
}
Errors
Validation errors are returned when required fields are missing.
Example Response
{
"errors": [
{
"message": "Validation failed for the field [createProduct].",
"extensions": {
"validation": {
"input.partnumber": ["The input.partnumber field is required."]
}
}
}
]
}
Method
POSTPath
/graphql