> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create Order

> Creates a new [order](entity:Order) that can include information about products for purchase and settings to apply to the purchase.

`square.createOrder` creates a new [order](entity:Order) that can include information about products for purchase and settings to apply to the purchase.

## Example

```ts automations/square-create-order.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { square } from "automate.ax/square"

export default automation("Create Square Order", () => {
  onDashboardRun({ title: "Create Square Order" })

  square.createOrder({})
})
```

## Inputs

Every input accepts a compatible signal. It requires `ORDERS_WRITE`.

| Field            | Type           | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                   |
| ---------------- | -------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `order`          | `Square.Order` | No       | —       | The order to create. If this field is set, the only other top-level field that can be set is the `idempotency_key`.                                                                                                                                                                                                                                                                           |
| `idempotencyKey` | `string`       | No       | —       | A value you specify that uniquely identifies this order among orders you have created. If you are unsure whether a particular order was created successfully, you can try it again with the same idempotency key without worrying about creating duplicate orders. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). |

Use the official [CreateOrder reference](https://developer.squareup.com/reference/square/orders-api/create-order) for provider field semantics and limits.

## Output

Returns the official `Square.CreateOrderResponse` response as a codec-safe object. Square integer money amounts remain `bigint` values.
