Fumadocs

Create Order

MUTATIONcreateOrder(input: OrderCreateInput!): Order!

Create a new order.

Arguments

input*

Returns

  1. createOrder

A customer's order.

id*ID!
status*OrderStatus!

The status of an order.

Value inPENDINGDELIVEREDREFUNDED
createdAt*DateTime!

Time at which the order was created.

total*Float!
customer*

A registered customer.

Place Order

Place an order for a customer.

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

fragment OrderSummary on Order {
  id
  status
  total
  createdAt
}
Variables
{
  "input": {
    "customerId": "cus_42",
    "total": 129.99
  }
}
Example Response
{
  "data": {
    "createOrder": {
      "id": "1",
      "status": "PENDING",
      "total": 10.5,
      "createdAt": "<DateTime>"
    }
  }
}