Skip to main content
POST
/
api
/
v1
/
orders
cURL
curl --request POST \
  --url https://api-staging.getmeadow.com/api/v1/orders \
  --header 'Content-Type: application/json' \
  --header 'X-Client-Key: <api-key>' \
  --header 'X-Consumer-Key: <api-key>' \
  --data '
{
  "type": "<string>",
  "lineItems": [
    {
      "productOptionId": 123,
      "quantity": 123
    }
  ],
  "customer": {
    "firstName": "<string>",
    "lastName": "<string>",
    "email": "<string>",
    "phone": "<string>",
    "birthday": "<string>"
  },
  "idempotencyKey": "<string>",
  "address": {
    "street1": "<string>",
    "city": "<string>",
    "state": "<string>",
    "postalCode": "<string>",
    "street2": "<string>"
  },
  "deliveryNotes": "<string>",
  "deliveryFee": 123,
  "deliveryFeeDescription": "<string>",
  "discountCodes": [
    "<string>"
  ]
}
'
{
  "id": "<string>",
  "status": "<string>",
  "totalPrice": 123,
  "netPrice": 123,
  "customerGrandTotal": 123,
  "lineItems": [
    {
      "productOptionId": 123,
      "quantity": 123,
      "unitPrice": 123,
      "subtotalPrice": 123,
      "finalPrice": 123,
      "discounts": [
        {
          "amountUsed": 123,
          "description": "<string>"
        }
      ]
    }
  ],
  "discounts": [
    {
      "amountUsed": 123,
      "description": "<string>"
    }
  ],
  "credits": [
    {
      "amountUsed": 123,
      "description": "<string>"
    }
  ],
  "adjustments": [
    {
      "amount": 123,
      "description": "<string>"
    }
  ],
  "taxes": [
    {
      "amount": 123,
      "description": "<string>"
    }
  ],
  "customer": {
    "id": 123,
    "fullName": "<string>"
  }
}

Idempotency

In order to prevent accidental double orders from being placed from issues such as network failures, Meadow uses an idempotencyKey strategy. For every request to create an order, the request body must include an idempotencyKey which is a unique UUID v4 string. If an order for this key has already been placed, it will be returned as the data instead of placing a duplicate order. In order to simplify this process for integrators, an idempotencyKey is returned from the pricing request (POST /api/v1/orders/pricing). Please save the key from the last pricing request you use and submit it along with the order. Please reach out if you have any questions about this.

Authorizations

X-Consumer-Key
string
header
required

The key assigned to your company and provided via Meadow

X-Client-Key
string
header
required

The key generated and provided by our mutual client

Body

application/json
type
string
required

Order type - must be either delivery or pickup

lineItems
object[]
required

An array of products to buy

customer
object
required

The customer for this order.

idempotencyKey
string
required

Key to help avoid double orders due to server miscommunication. Please see "Idempotent Requests" section. Please use the string provided to you by the pricing endpoint. This value must be a v4 UUID.

address
object

The address of the customer. Required if type is set to delivery

deliveryNotes
string

Optional notes field to help fulfill the order (Example: please call on delivery)

deliveryFee
number

A fee that will be passed through and added onto the customerGrandTotal

deliveryFeeDescription
string

A passthrough title for the delivery fee

discountCodes
string[]

An array of promo codes to redeem. These codes must already exist in the Meadow backend.

Response

Create order response

id
string

The ID for the order. Used to fetch status updates

status
string

The status of the order. Will be set to draft or new depending on the organization's settings.

totalPrice
number

The subtotal price before discounts, credits, adjustments are taken into account.

netPrice
number

The final price of the order before payment & delivery fees.

customerGrandTotal
number

The cost of the order that the customer will pay

lineItems
object[]

The line items with pricing information attached

discounts
object[]

An array of order level discounts

credits
object[]

An array of credits applied. May be store credit or promo codes attached to the customers account.

adjustments
object[]

An array of adjustments made to the order. May be a tax exemption or other future Meadow POS behavior.

taxes
object[]

All of the taxes applied to this order

customer
object

The matched customer for this order