> For the complete documentation index, see [llms.txt](https://docs.hotwax.co/documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hotwax.co/documents/integrate-with-hotwax/components/order-routing/orders.md).

# Orders

orders

## POST /orders/{orderId}/reject

> reject OrderItems

```json
{"openapi":"3.1.1","info":{"title":"Commerce order routing REST API","version":"3.2.0"},"tags":[{"name":"orders","description":"orders"}],"servers":[{"url":"https://dev-maarg.hotwax.io/rest/s1/order-routing"}],"security":[{"basicAuth":[]},{"api_key":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"api_key":{"type":"apiKey","name":"api_key","in":"header","description":"HTTP Header api_key"}},"schemas":{"co.hotwax.order.routing.OrderRoutingServices.rejectOrderItems.Out":{"type":"object","properties":{"rejectedItemsList":{"type":"array","items":{"type":"object","properties":{"orderId":{"type":"string"},"orderItemSeqId":{"type":"string"},"shipGroupSeqId":{"type":"string"},"shipmentMethodTypeId":{"type":"string"},"quantity":{"type":"string"}}}}}},"co.hotwax.order.routing.OrderRoutingServices.rejectOrderItems.In":{"type":"object","properties":{"orderId":{"type":"string"},"notify":{"type":"boolean","description":"If set to true, an email notification will be sent on rejection, provided it is configured.","default":"false"},"items":{"type":"array","items":{"type":"object","description":"A map containing details of the items to be rejected or moved.","properties":{"facilityId":{"type":"string","description":"The facility ID of the order item's ship group."},"shipmentMethodTypeId":{"type":"string","description":"The shipment method of the order item's ship group."},"quantity":{"type":"string","description":"The quantity of the order item to be rejected. Defaults to 1.","default":"1"},"orderItemSeqId":{"type":"string","description":"The sequence ID of the order item."},"toFacilityId":{"type":"string","description":"The destination facility ID where the item will be moved after rejection."},"recordVariance":{"type":"string","description":"Set to true if a variance record needs to be created."},"rejectReason":{"type":"string","description":"The reason for rejecting the item."}}}}},"required":["orderId","items"]}}},"paths":{"/orders/{orderId}/reject":{"post":{"tags":["orders"],"summary":"reject OrderItems","description":null,"parameters":[{"schema":{"type":"string"},"name":"orderId","in":"path","required":true,"description":null}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/co.hotwax.order.routing.OrderRoutingServices.rejectOrderItems.Out"}}}},"401":{"description":"Authentication required"},"403":{"description":"Access Forbidden (no authz)"},"429":{"description":"Too Many Requests (tarpit)"},"500":{"description":"General Error"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/co.hotwax.order.routing.OrderRoutingServices.rejectOrderItems.In"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/co.hotwax.order.routing.OrderRoutingServices.rejectOrderItems.In"}}},"required":true}}}}}
```

## GET /orders/{orderId}/routing-history/recent

> get RecentRoutingHistory

```json
{"openapi":"3.1.1","info":{"title":"Commerce order routing REST API","version":"3.2.0"},"tags":[{"name":"orders","description":"orders"}],"servers":[{"url":"https://dev-maarg.hotwax.io/rest/s1/order-routing"}],"security":[{"basicAuth":[]},{"api_key":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"api_key":{"type":"apiKey","name":"api_key","in":"header","description":"HTTP Header api_key"}},"schemas":{"co.hotwax.order.routing.OrderRoutingServices.getRecentRoutingHistory.Out":{"type":"object","properties":{"routingHistoryList":{"type":"array","items":{"type":"string"}}}}}},"paths":{"/orders/{orderId}/routing-history/recent":{"get":{"tags":["orders"],"summary":"get RecentRoutingHistory","description":null,"parameters":[{"schema":{"type":"string"},"name":"orderId","in":"path","required":true,"description":null}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/co.hotwax.order.routing.OrderRoutingServices.getRecentRoutingHistory.Out"}}}},"401":{"description":"Authentication required"},"403":{"description":"Access Forbidden (no authz)"},"429":{"description":"Too Many Requests (tarpit)"},"500":{"description":"General Error"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.hotwax.co/documents/integrate-with-hotwax/components/order-routing/orders.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
