# Create Order

Create a new order.

```graphql
type Mutation {
  createOrder(input: OrderCreateInput!): Order!
}
```

## Arguments

- `input` (`OrderCreateInput!`, required)

## Returns

`Order!`: A customer's order.

## Types

```graphql
"A customer's order."
type Order implements Node @auth(requires: USER) {
  id: ID!
  status: OrderStatus!
  "Time at which the order was created."
  createdAt: DateTime!
  total: Float!
  customer: Customer!
}

input OrderCreateInput {
  customerId: ID!
  "Total amount of the order."
  total: Float!
}
```

## Example

### Place Order

Place an order for a customer.

```graphql
mutation PlaceOrder($input: OrderCreateInput!) {
  createOrder(input: $input) {
    ...OrderSummary
  }
}

fragment OrderSummary on Order {
  id
  status
  total
  createdAt
}
```

Variables:

```json
{
  "input": {
    "customerId": "cus_42",
    "total": 129.99
  }
}
```

Response:

```json
{
  "data": {
    "createOrder": {
      "id": "1",
      "status": "PENDING",
      "total": 10.5,
      "createdAt": "<DateTime>"
    }
  }
}
```
