---
title: Function: useOrder
slug: chord-ui/function-useorder
docTags: 
createdAt: 2023-11-06T15:03:31.904Z
---

[react-autonomy](docId\:zoZ6W56ubpPACr0PO0GLS).useOrder

▸ **useOrder**(`props`): [`UseOrder`](docId\:RFbYl3J5zpIuZHhxmMUNK)

The `useOrder` hook returns the current loaded order.

This function has a side effect that will automatically start loading the
subscription, if needed, upon initialization.



```javascript
import { useOrder } from '@chordcommerce/react-autonomy'

export default () => {
  const { order, isFetching } = useOrder({ orderNumber: PLANT-10000 })

  if (isFetching) {
    return (
      <p>Loading…</p>
    )
  }

  return (
    <p>Current state of Order # {order.orderNumber} is {order.state}</p>
  )
}
```

### Parameters

| Name                | Type     | Description                            |
| ------------------- | -------- | -------------------------------------- |
| `props`             | `Object` |                                        |
| `props.orderNumber` | `string` | The order number of the order to load. |

### Returns

[`UseOrder`](docId\:RFbYl3J5zpIuZHhxmMUNK)

### Defined in

[packages/react-autonomy/src/hooks/use-order.ts:39](https://github.com/chordcommerce/chord-ui/blob/2b105e1/packages/react-autonomy/src/hooks/use-order.ts#L39)
