# Orders

Manage pick-pack orders

## Finishing an order

> Finishes a specified order by:\
> \* Recalculating the current state\
> \* Changing the order status to \`packed\`\
> \* Deleting all assignees\
> \* Sending an order confirmation email<br>

```json
{"openapi":"3.0.0","info":{"title":"Pick-Pack Service","version":"0.0.1"},"tags":[{"name":"Orders","description":"Manage pick-pack orders"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["pickpack.pickpack_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"pickpack.pickpack_view":"Needed to retrieve information about resources in the service.","pickpack.pickpack_manage":"Needed to manage resources in the service."}}}}},"responses":{"successResponse":{"description":"Event creation response","content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"code":{"type":"integer"}}}}}},"BadRequest_400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"code":{"type":"integer"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}},"InternalServiceError_500":{"description":"Internal Service Error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}},"schemas":{"errorMessage":{"title":"errorMessage","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"message":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"detailInfo":{"description":"More detailed information about the error","type":"string"}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant name should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}},"trait_saas_token":{"name":"saas-token","in":"header","required":true,"description":"Token provided by the Emporix system, used to identify logged in customers. This token has an expiry date and is signed with a passphrase.\n","schema":{"type":"string"}},"orderId":{"name":"orderId","in":"path","required":true,"schema":{"type":"string"},"description":"Order's unique identifier."}}},"paths":{"/pick-pack/{tenant}/orders/{orderId}/finish":{"post":{"tags":["Orders"],"description":"Finishes a specified order by:\n* Recalculating the current state\n* Changing the order status to `packed`\n* Deleting all assignees\n* Sending an order confirmation email\n","responses":{"200":{"$ref":"#/components/responses/successResponse"},"400":{"$ref":"#/components/responses/BadRequest_400"},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"500":{"$ref":"#/components/responses/InternalServiceError_500"}},"parameters":[{"$ref":"#/components/parameters/trait_tenant"},{"$ref":"#/components/parameters/trait_saas_token"},{"$ref":"#/components/parameters/orderId"}],"operationId":"POST-pick-pack-finish-order","summary":"Finishing an order"}}}}
```

## Retrieving a packlist

> Retrieves a packlist for the specified delivery date.\
> \
> \*\*Note\*\*: If an order has the \`packingStatus\` set to \`CANCELLED\`, it will not be retrieved.<br>

```json
{"openapi":"3.0.0","info":{"title":"Pick-Pack Service","version":"0.0.1"},"tags":[{"name":"Orders","description":"Manage pick-pack orders"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["pickpack.pickpack_view"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"pickpack.pickpack_view":"Needed to retrieve information about resources in the service.","pickpack.pickpack_manage":"Needed to manage resources in the service."}}}}},"responses":{"ordersResponse":{"description":"Order list","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderList"}}}}},"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"code":{"type":"integer"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}},"InternalServiceError_500":{"description":"Internal Service Error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}},"schemas":{"OrderList":{"title":"OrderList","type":"object","properties":{"orderId":{"type":"string","description":"The id of the order"},"customerName":{"type":"string","description":"The name of the customer"},"packingStatus":{"description":"The current status of the order","type":"string","enum":["INITIAL","IN_PROGRESS","PRE_PACKED","PACKED","CANCELLED"]},"productsTotal":{"type":"integer"},"productsPacked":{"type":"integer"},"productsCanceled":{"type":"integer"},"assignees":{"type":"array","items":{"$ref":"#/components/schemas/Assignee"}},"packagingProducts":{"type":"array","items":{"$ref":"#/components/schemas/Entry"}},"entries":{"type":"array","items":{"$ref":"#/components/schemas/Entry"}},"holdingAreaNumber":{"description":"The serial number of the location where the packed order awaits transportation","type":"integer"},"deliveryWindow":{"$ref":"#/components/schemas/DeliveryWindow"}},"description":""},"Assignee":{"title":"Assignee","type":"object","properties":{"id":{"type":"string","description":"Identifier of an assignment"},"siteCode":{"type":"string","description":"Code of a site"},"firstName":{"type":"string","description":"First name of assignee"},"lastName":{"type":"string","description":"Last name of assignee"}},"required":["id","siteCode","firstName","lastName"]},"Entry":{"title":"Entry","type":"object","properties":{"entryId":{"type":"string","description":"The entry id"},"productName":{"type":"string","description":"The product name"},"productId":{"type":"string","description":"The id of the product"},"unitPrice":{"type":"number","format":"double","description":"The unit price of the product"},"totalPrice":{"type":"number","format":"double","description":"The overall price, which is the sum of the quantities of packed products."},"imageUrl":{"type":"string","description":"The link to product image"},"unitPricingMeasure":{"$ref":"#/components/schemas/PricingMeasure"},"pricingMeasure":{"$ref":"#/components/schemas/PricingMeasure"},"pricingMeasurePrice":{"type":"number","format":"double"},"orderUnit":{"type":"string"},"packedCount":{"type":"integer","description":"The currently packed count of the product"},"canceledCount":{"type":"integer","description":"The currently canceled count of the product"},"pickedCount":{"type":"integer","description":"The currently picked count of the product"},"packedAmountInPc":{"type":"integer","description":"The currently packed amount of the product packed in pieces"},"totalCount":{"type":"integer"},"location":{"type":"array","description":"The location of the product","items":{"$ref":"#/components/schemas/Location"}},"packingGroup":{"type":"string"},"packaging":{"type":"string"},"cutting":{"type":"string"},"customerComment":{"type":"string"},"barcodes":{"type":"array","items":{"type":"string"}},"weightDependent":{"type":"boolean"},"basePrice":{"$ref":"#/components/schemas/BasePrice"},"mhd":{"type":"string"}}},"PricingMeasure":{"title":"PricingMeasure","type":"object","properties":{"unitCode":{"type":"string"},"value":{"type":"string"}}},"Location":{"title":"Location","type":"object","properties":{"zone":{"type":"string"},"rack":{"type":"string"},"rackName":{"type":"string"},"shelf":{"type":"string"},"section":{"type":"string"},"bin":{"type":"string"}}},"BasePrice":{"title":"BasePrice","type":"object","properties":{"effectiveAmount":{"type":"string"},"originalAmount":{"type":"string"},"priceFactor":{"type":"string"},"basePriceFactor":{"type":"string"},"measurementUnit":{"$ref":"#/components/schemas/MeasurementUnit"}}},"MeasurementUnit":{"title":"MeasurementUnit","type":"object","properties":{"unitCode":{"type":"string","description":"The unit code of the measured quantity"},"quantity":{"type":"number","format":"double","description":"The measured amount"}}},"DeliveryWindow":{"title":"DeliveryWindow","type":"object","description":"This object contains attributes that are related to selected delivery window for a given order and allows to group orders by delivery cycle and sort by delivery time for a better and more efficient packing experience","properties":{"deliveryCycle":{"type":"string","description":"The selected delivery cycle for the current order for the given date"},"deliveryCycleName":{"type":"string","description":"The selected delivery cycle name"},"deliveryTimeTo":{"type":"string","format":"date-time","description":"The delivery time until the order should be delivered"}}},"errorMessage":{"title":"errorMessage","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"message":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"detailInfo":{"description":"More detailed information about the error","type":"string"}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant name should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}},"trait_site_code":{"name":"siteCode","in":"query","required":true,"schema":{"pattern":"[a-zA-Z0-9_-]+","minLength":3,"maxLength":16,"type":"string"},"description":"site code for the tenant"}}},"paths":{"/pick-pack/{tenant}/orders":{"get":{"tags":["Orders"],"responses":{"200":{"$ref":"#/components/responses/ordersResponse"},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"500":{"$ref":"#/components/responses/InternalServiceError_500"}},"description":"Retrieves a packlist for the specified delivery date.\n\n**Note**: If an order has the `packingStatus` set to `CANCELLED`, it will not be retrieved.\n","parameters":[{"$ref":"#/components/parameters/trait_tenant"},{"$ref":"#/components/parameters/trait_site_code"},{"name":"deliveryDate","in":"query","required":true,"schema":{"pattern":"YYYY-MM-DD","type":"string"},"description":"Date after which we want to filter the orders."}],"operationId":"GET-pick-pack-retrieve-packlist","summary":"Retrieving a packlist"}}}}
```

## Retrieving an order

> Retrieves a specified order's details.

```json
{"openapi":"3.0.0","info":{"title":"Pick-Pack Service","version":"0.0.1"},"tags":[{"name":"Orders","description":"Manage pick-pack orders"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["pickpack.pickpack_view"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"pickpack.pickpack_view":"Needed to retrieve information about resources in the service.","pickpack.pickpack_manage":"Needed to manage resources in the service."}}}}},"responses":{"orderResponse":{"description":"Order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"code":{"type":"integer"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}},"NotFound_404":{"description":"Resource has not been found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"InternalServiceError_500":{"description":"Internal Service Error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}},"schemas":{"Order":{"title":"Order","type":"object","properties":{"id":{"type":"string","description":"The id of the packed order"},"siteCode":{"type":"string","description":"The site code of the packed order"},"orderTotal":{"type":"number","format":"double","description":"The order total amount"},"valueOfGoods":{"type":"number","format":"double","description":"The order subtotal"},"deposit":{"type":"number","format":"double","description":"The order deposit amount"},"coupons":{"type":"number","format":"double","description":"The order coupons amount"},"currency":{"type":"string","description":"The order currency"},"entries":{"type":"array","description":"The order entries","items":{"$ref":"#/components/schemas/Entry"}},"customer":{"$ref":"#/components/schemas/Customer"},"delivery":{"$ref":"#/components/schemas/Delivery"},"payment":{"$ref":"#/components/schemas/Payment"},"packingStatus":{"type":"string","enum":["INITIAL","IN_PROGRESS","PRE_PACKED","PACKED","CANCELLED"],"description":"The current packing status of the order"},"assignees":{"type":"array","minItems":1,"description":"The user data of the person that is currently packing the order","items":{"$ref":"#/components/schemas/Assignee"}},"packagingProducts":{"type":"array","description":"The order packaging product","items":{"$ref":"#/components/schemas/Entry"}},"holdingAreaNumber":{"type":"integer","description":"The order holding area number"}}},"Entry":{"title":"Entry","type":"object","properties":{"entryId":{"type":"string","description":"The entry id"},"productName":{"type":"string","description":"The product name"},"productId":{"type":"string","description":"The id of the product"},"unitPrice":{"type":"number","format":"double","description":"The unit price of the product"},"totalPrice":{"type":"number","format":"double","description":"The overall price, which is the sum of the quantities of packed products."},"imageUrl":{"type":"string","description":"The link to product image"},"unitPricingMeasure":{"$ref":"#/components/schemas/PricingMeasure"},"pricingMeasure":{"$ref":"#/components/schemas/PricingMeasure"},"pricingMeasurePrice":{"type":"number","format":"double"},"orderUnit":{"type":"string"},"packedCount":{"type":"integer","description":"The currently packed count of the product"},"canceledCount":{"type":"integer","description":"The currently canceled count of the product"},"pickedCount":{"type":"integer","description":"The currently picked count of the product"},"packedAmountInPc":{"type":"integer","description":"The currently packed amount of the product packed in pieces"},"totalCount":{"type":"integer"},"location":{"type":"array","description":"The location of the product","items":{"$ref":"#/components/schemas/Location"}},"packingGroup":{"type":"string"},"packaging":{"type":"string"},"cutting":{"type":"string"},"customerComment":{"type":"string"},"barcodes":{"type":"array","items":{"type":"string"}},"weightDependent":{"type":"boolean"},"basePrice":{"$ref":"#/components/schemas/BasePrice"},"mhd":{"type":"string"}}},"PricingMeasure":{"title":"PricingMeasure","type":"object","properties":{"unitCode":{"type":"string"},"value":{"type":"string"}}},"Location":{"title":"Location","type":"object","properties":{"zone":{"type":"string"},"rack":{"type":"string"},"rackName":{"type":"string"},"shelf":{"type":"string"},"section":{"type":"string"},"bin":{"type":"string"}}},"BasePrice":{"title":"BasePrice","type":"object","properties":{"effectiveAmount":{"type":"string"},"originalAmount":{"type":"string"},"priceFactor":{"type":"string"},"basePriceFactor":{"type":"string"},"measurementUnit":{"$ref":"#/components/schemas/MeasurementUnit"}}},"MeasurementUnit":{"title":"MeasurementUnit","type":"object","properties":{"unitCode":{"type":"string","description":"The unit code of the measured quantity"},"quantity":{"type":"number","format":"double","description":"The measured amount"}}},"Customer":{"title":"Customer","type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"name":{"type":"string"},"companyName":{"type":"string"},"email":{"type":"string"},"phoneNumber":{"type":"string"}}},"Delivery":{"title":"Delivery","type":"object","properties":{"deliveryTimeModel":{"$ref":"#/components/schemas/DeliveryTime"},"deliveryAddressModel":{"$ref":"#/components/schemas/DeliveryAddress"},"deliveryCostModel":{"$ref":"#/components/schemas/DeliveryCost"},"deliveryOptionModel":{"$ref":"#/components/schemas/DeliveryOption"},"deliveryWindow":{"$ref":"#/components/schemas/DeliveryWindow"}},"description":""},"DeliveryTime":{"title":"DeliveryTime","type":"object","properties":{"deliveryDate":{"type":"string","format":"date"},"deliveryTimeFrom":{"type":"string","format":"time"},"deliveryTimeTo":{"type":"string","format":"time"},"deliveryChargeType":{"type":"string"}}},"DeliveryAddress":{"title":"DeliveryAddress","type":"object","properties":{"title":{"type":"string"},"contactName":{"type":"string"},"companyName":{"type":"string"},"street":{"type":"string"},"streetNumber":{"type":"string"},"streetAppendix":{"type":"string"},"zip":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"}}},"DeliveryCost":{"title":"DeliveryCost","type":"object","properties":{"amount":{"type":"number","format":"double"},"currency":{"type":"string"}}},"DeliveryOption":{"title":"DeliveryOption","type":"object","properties":{"packaging":{"type":"string"},"replacement":{"type":"boolean"},"pickup":{"type":"boolean"},"deliveryNote":{"type":"string"}},"description":""},"DeliveryWindow":{"title":"DeliveryWindow","type":"object","description":"This object contains attributes that are related to selected delivery window for a given order and allows to group orders by delivery cycle and sort by delivery time for a better and more efficient packing experience","properties":{"deliveryCycle":{"type":"string","description":"The selected delivery cycle for the current order for the given date"},"deliveryCycleName":{"type":"string","description":"The selected delivery cycle name"},"deliveryTimeTo":{"type":"string","format":"date-time","description":"The delivery time until the order should be delivered"}}},"Payment":{"title":"Payment","type":"object","properties":{"invoiceNumber":{"type":"string"},"invoiceAddress":{"$ref":"#/components/schemas/InvoiceAddress"},"methods":{"type":"array","items":{"type":"string"}}}},"InvoiceAddress":{"title":"InvoiceAddress","type":"object","properties":{"title":{"type":"string"},"contactName":{"type":"string"},"companyName":{"type":"string"},"street":{"type":"string"},"streetNumber":{"type":"string"},"streetAppendix":{"type":"string"},"zip":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"}}},"Assignee":{"title":"Assignee","type":"object","properties":{"id":{"type":"string","description":"Identifier of an assignment"},"siteCode":{"type":"string","description":"Code of a site"},"firstName":{"type":"string","description":"First name of assignee"},"lastName":{"type":"string","description":"Last name of assignee"}},"required":["id","siteCode","firstName","lastName"]},"errorMessage":{"title":"errorMessage","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"message":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"detailInfo":{"description":"More detailed information about the error","type":"string"}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant name should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}},"orderId":{"name":"orderId","in":"path","required":true,"schema":{"type":"string"},"description":"Order's unique identifier."}}},"paths":{"/pick-pack/{tenant}/orders/{orderId}":{"get":{"tags":["Orders"],"responses":{"200":{"$ref":"#/components/responses/orderResponse"},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"404":{"$ref":"#/components/responses/NotFound_404"},"500":{"$ref":"#/components/responses/InternalServiceError_500"}},"description":"Retrieves a specified order's details.","parameters":[{"$ref":"#/components/parameters/trait_tenant"},{"$ref":"#/components/parameters/orderId"}],"operationId":"GET-pick-pack-retrieve-order","summary":"Retrieving an order"}}}}
```

## Updating an order

> Updates a specified order's status.\
> \
> \*\*Note\*\*: If the order has the \`packingStatus\` set to \`CANCELLED\`, it is not possible to do any further operations on that order.<br>

```json
{"openapi":"3.0.0","info":{"title":"Pick-Pack Service","version":"0.0.1"},"tags":[{"name":"Orders","description":"Manage pick-pack orders"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["pickpack.pickpack_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"pickpack.pickpack_view":"Needed to retrieve information about resources in the service.","pickpack.pickpack_manage":"Needed to manage resources in the service."}}}}},"responses":{"successResponse":{"description":"Event creation response","content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"code":{"type":"integer"}}}}}},"BadRequest_400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"code":{"type":"integer"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}},"NotFound_404":{"description":"Resource has not been found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"InternalServiceError_500":{"description":"Internal Service Error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}},"schemas":{"errorMessage":{"title":"errorMessage","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"message":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"detailInfo":{"description":"More detailed information about the error","type":"string"}}},"OrderStatusChange":{"type":"object","properties":{"packingStatus":{"type":"string","enum":["INITIAL","IN_PROGRESS","PRE_PACKED","PACKED","CANCELLED"],"description":"The new status of the order"}},"required":["packingStatus"]}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant name should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}},"trait_saas_token":{"name":"saas-token","in":"header","required":true,"description":"Token provided by the Emporix system, used to identify logged in customers. This token has an expiry date and is signed with a passphrase.\n","schema":{"type":"string"}},"orderId":{"name":"orderId","in":"path","required":true,"schema":{"type":"string"},"description":"Order's unique identifier."}}},"paths":{"/pick-pack/{tenant}/orders/{orderId}":{"patch":{"tags":["Orders"],"responses":{"200":{"$ref":"#/components/responses/successResponse"},"400":{"$ref":"#/components/responses/BadRequest_400"},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"404":{"$ref":"#/components/responses/NotFound_404"},"500":{"$ref":"#/components/responses/InternalServiceError_500"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStatusChange"}}}},"description":"Updates a specified order's status.\n\n**Note**: If the order has the `packingStatus` set to `CANCELLED`, it is not possible to do any further operations on that order.\n","parameters":[{"$ref":"#/components/parameters/trait_tenant"},{"$ref":"#/components/parameters/trait_saas_token"},{"$ref":"#/components/parameters/orderId"}],"operationId":"PATCH-pick-pack-update-order-status","summary":"Updating an order"}}}}
```

## Updating packaging products for an order

> Updates packaging products for a specified order.<br>

```json
{"openapi":"3.0.0","info":{"title":"Pick-Pack Service","version":"0.0.1"},"tags":[{"name":"Orders","description":"Manage pick-pack orders"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["pickpack.pickpack_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"pickpack.pickpack_view":"Needed to retrieve information about resources in the service.","pickpack.pickpack_manage":"Needed to manage resources in the service."}}}}},"responses":{"successResponse":{"description":"Event creation response","content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"code":{"type":"integer"}}}}}},"BadRequest_400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"code":{"type":"integer"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}},"NotFound_404":{"description":"Resource has not been found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"InternalServiceError_500":{"description":"Internal Service Error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}},"schemas":{"errorMessage":{"title":"errorMessage","type":"object","properties":{"code":{"minimum":100,"maximum":599,"description":"original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"message":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"classification of the error type, lower case with underscore eg validation_failure","type":"string"},"detailInfo":{"description":"More detailed information about the error","type":"string"}}},"PackagingProductsChange":{"type":"object","properties":{"entryId":{"type":"string","description":"The id of the product that was packed"},"packedCount":{"type":"integer","description":"The amount of packed items"}},"required":["entryId","packedCount"]}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n\n**Note**: The tenant name should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}},"trait_saas_token":{"name":"saas-token","in":"header","required":true,"description":"Token provided by the Emporix system, used to identify logged in customers. This token has an expiry date and is signed with a passphrase.\n","schema":{"type":"string"}},"orderId":{"name":"orderId","in":"path","required":true,"schema":{"type":"string"},"description":"Order's unique identifier."}}},"paths":{"/pick-pack/{tenant}/orders/{orderId}/packaging":{"put":{"tags":["Orders"],"responses":{"200":{"$ref":"#/components/responses/successResponse"},"400":{"$ref":"#/components/responses/BadRequest_400"},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"404":{"$ref":"#/components/responses/NotFound_404"},"500":{"$ref":"#/components/responses/InternalServiceError_500"}},"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PackagingProductsChange"}}}}},"description":"Updates packaging products for a specified order.\n","parameters":[{"$ref":"#/components/parameters/trait_tenant"},{"$ref":"#/components/parameters/trait_saas_token"},{"$ref":"#/components/parameters/orderId"}],"operationId":"PUT-pick-pack-update-order-packaging","summary":"Updating packaging products for an order"}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/api-references-1/readme/api-reference-25/orders.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
