addOrderItem
Add an item to an order.
**Arguments**
Name | Type | Description | Required | Default |
---|---|---|---|---|
order_id | ID | The ID of the order to add the item to | Yes | |
product_id | ID | The ID of the product to add to the order | Yes | |
quantity | Integer | The quantity of the product to add | Yes | |
price | Decimal | The price of the product to add | Yes | 0.0 |
**Returns**
An OrderItem
object if the operation is successful.
**Errors**
Name | Description |
---|---|
NotFoundError | Returns if the order or product is not found |
ValidationError | Returns if the product does not belong to the same brand |
as the order, is not active, or if the quantity or price is not a positive | |
value. Also returns if the order is in a disallowed status (fulfilled, | |
canceled, shipped, completed) |
addOrderItem(
input: AddOrderItemInput!
): OrderItem!
Arguments
addOrderItem.input
● AddOrderItemInput!
non-null input
Parameters for AddOrderItem
Type
OrderItem
object
The order item type. This type represents an order item in the system.