# Managing Order Line Items
Each product added to an order results in an OrderLineItem
. To create, list, modify or delete order line items, you have to use the following endpoints:
Endpoint | Description |
---|---|
POST /orders/{order_id}/order_line_items (opens new window) | Add an OrderLineItem to the order with the provided order_id |
PATCH /order_line_items/{order_line_item_id} (opens new window) | Modifies the OrderLineItem with the provided order_line_Item_id |
DELETE /order_line_items/{order_line_item_id} (opens new window) | Deletes the OrderLineItem with the provided order_line_Item_id |
GET /orders/{order_id}/order_line_items (opens new window) | Returns all OrderLineItems of the order with the provided order_id |
GET /order_line_items/{order_line_item_id} (opens new window) | Return the OrderLineItem with the provided order_line_Item_id |
# Order Line Item Attributes
Attribute | Required | Description |
---|---|---|
sku_id | ✅ | The sku_id of the SKU that you want to add to the Order |
amount | ✅ | The amount of the SKU with the provided sku_id that you want to add to the order |
# Example: Listing all order line items of an order
The following request will list all order line items of the order with the id: ab3a75a5-330e-5070-addf-bcd3f225e12e
# Request
GET /orders/ab3a75a5-330e-5070-addf-bcd3f225e12e/order_line_items
# Response
[
{
"id": "6ccb8497-bcf8-5474-bd13-03c2e268f7d6",
"order_id": "ab3a75a5-330e-5070-addf-bcd3f225e12e",
"sku_id": "0c9af85b-1cab-590a-905e-038acd9bdfe3",
"references": [
"COL/XTRUAA"
],
"amount": 10000,
"amount_in_base_unit": 10000,
"base_unit": "sheet",
"confirmed_delivery_at": null,
"description": "Smith Papers Magno Volume",
"order_number": "BS-5041487395",
"tax_rate": null,
"taxes": null,
"total_gross_price": null,
"total_net_price": "224200.0",
"unit": "sheet",
"created_at": "2021-04-14T13:38:15.818Z",
"updated_at": "2021-04-14T13:38:15.818Z",
"catalog_price": "21.56",
"confirmed_price": "22.42",
"order": {
"id": "ab3a75a5-330e-5070-addf-bcd3f225e12e",
"references": [
"CO/JDPS01"
],
"links": [
{
"rel": "self",
"href": "/consumers/api/v1/orders/ab3a75a5-330e-5070-addf-bcd3f225e12e"
}
]
},
"sku": {
"id": "0c9af85b-1cab-590a-905e-038acd9bdfe3",
"order_number": "MAGVOL|115|92.0|65.0|0250|000000||S|SH||v1",
"links": [
{
"rel": "self",
"href": "/consumers/api/v1/skus/0c9af85b-1cab-590a-905e-038acd9bdfe3"
}
]
}
}
]
# Example: Adding an order line item
The following request will add an order line item to the order with the id ab3a75a5-330e-5070-addf-bcd3f225e12e
.
# Request
POST /orders/ab3a75a5-330e-5070-addf-bcd3f225e12e/order_line_items
Body:
{
"order_line_item": {
"sku_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"amount": 1
}
}
# Response
{
"id": "4e47465c-9d7a-4f58-8e83-3f8292a29542",
"order_id": "ab3a75a5-330e-5070-addf-bcd3f225e12e",
"sku_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"amount": 1,
"amount_in_base_unit": 127500,
"base_unit": "sheet",
"confirmed_delivery_at": null,
"description": "SMITH VOLUME PAPER – PS1 - Premium Coated, 920 × 650 mm, 115 g/㎡, short – 1 pallet, 584.545 kg",
"order_number": "MAGVOL|115|92.0|65.0|0250|008500||S|PL||v1",
"tax_rate": null,
"taxes": null,
"total_gross_price": null,
"total_net_price": "7545.3",
"unit": "pallet",
"created_at": "2021-04-14T13:39:02.162Z",
"updated_at": "2021-04-14T13:39:02.162Z",
"catalog_price": "503.02",
"confirmed_price": null,
"order": {
"id": "ab3a75a5-330e-5070-addf-bcd3f225e12e",
"references": [
"CO/JDPS01"
],
"links": [
{
"rel": "self",
"href": "/consumers/api/v1/orders/ab3a75a5-330e-5070-addf-bcd3f225e12e"
}
]
},
"sku": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"order_number": "MAGVOL|115|92.0|65.0|0250|008500||S|PL||v1",
"links": [
{
"rel": "self",
"href": "/consumers/api/v1/skus/3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
}
}
# Example: Modifying an order line item
The following request will change an order line item.
# Request
PATCH /order_line_items/4e47465c-9d7a-4f58-8e83-3f8292a29542
Body:
{
"order_line_item": {
"amount": 10
}
}
# Response
{
"id": "4e47465c-9d7a-4f58-8e83-3f8292a29542",
"order_id": "ab3a75a5-330e-5070-addf-bcd3f225e12e",
"sku_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"amount": 10,
"amount_in_base_unit": 127500,
"base_unit": "sheet",
"confirmed_delivery_at": null,
"description": "SMITH VOLUME PAPER – PS1 - Premium Coated, 920 × 650 mm, 115 g/㎡, short – 1 pallet, 584.545 kg",
"order_number": "MAGVOL|115|92.0|65.0|0250|008500||S|PL||v1",
"tax_rate": null,
"taxes": null,
"total_gross_price": null,
"total_net_price": "75453.0",
"unit": "pallet",
"created_at": "2021-04-14T13:39:02.162Z",
"updated_at": "2021-04-14T13:39:02.162Z",
"catalog_price": "503.02",
"confirmed_price": null,
"order": {
"id": "ab3a75a5-330e-5070-addf-bcd3f225e12e",
"references": [
"CO/JDPS01"
],
"links": [
{
"rel": "self",
"href": "/consumers/api/v1/orders/ab3a75a5-330e-5070-addf-bcd3f225e12e"
}
]
},
"sku": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"order_number": "MAGVOL|115|92.0|65.0|0250|008500||S|PL||v1",
"links": [
{
"rel": "self",
"href": "/consumers/api/v1/skus/3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
}
}