Order management API¶
Order management REST API
To learn how to manage orders with the REST API, see the REST API reference.
To get orders and manage them, use the Ibexa\Contracts\OrderManagement\OrderServiceInterface interface.
Get single order¶
Get single order by identifier¶
To access a single order by using its string identifier, use the OrderServiceInterface::getOrderByIdentifier method:
1 2 3 4 | |
Use the returned OrderInterface value object to access details about the order.
See the Discounts API to learn how to retrieve applied discount details from the order's context.
Get single order by ID¶
To access a single order by using its numerical ID, use the OrderServiceInterface::getOrder method:
1 2 3 4 | |
Get multiple orders¶
To fetch multiple orders, use the OrderServiceInterface::findOrders method.
It follows the same search query pattern as other APIs:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Create order¶
To create an order, use the OrderServiceInterface::createOrder method and provide it with the Ibexa\Contracts\OrderManagement\Value\Struct\OrderCreateStruct object that contains a list of products, purchased quantities, product, total prices, and tax amounts.
1 2 3 4 5 6 7 8 9 10 11 | |
Update order¶
You can update the order after it's created.
You could do it to support a scenario when, for example, the order is processed manually and its status has to be changed in the system.
To update order information, use the OrderServiceInterface::updateOrder method:
1 2 3 4 | |