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 '
{
"lineItems": [
{
"productOptionId": 1899,
"quantity": 3
}
],
"type": "delivery",
"address": {
"street1": "123 Main St",
"city": "San Francisco",
"state": "California",
"postalCode": "94103"
},
"customer": {
"firstName": "Perrin",
"lastName": "Aybara",
"email": "perrin@getmeadow.com"
}
}
'import requests
url = "https://api-staging.getmeadow.com/api/v1/orders"
payload = {
"lineItems": [
{
"productOptionId": 1899,
"quantity": 3
}
],
"type": "delivery",
"address": {
"street1": "123 Main St",
"city": "San Francisco",
"state": "California",
"postalCode": "94103"
},
"customer": {
"firstName": "Perrin",
"lastName": "Aybara",
"email": "perrin@getmeadow.com"
}
}
headers = {
"X-Consumer-Key": "<api-key>",
"X-Client-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Consumer-Key': '<api-key>',
'X-Client-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
lineItems: [{productOptionId: 1899, quantity: 3}],
type: 'delivery',
address: {
street1: '123 Main St',
city: 'San Francisco',
state: 'California',
postalCode: '94103'
},
customer: {firstName: 'Perrin', lastName: 'Aybara', email: 'perrin@getmeadow.com'}
})
};
fetch('https://api-staging.getmeadow.com/api/v1/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.getmeadow.com/api/v1/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lineItems' => [
[
'productOptionId' => 1899,
'quantity' => 3
]
],
'type' => 'delivery',
'address' => [
'street1' => '123 Main St',
'city' => 'San Francisco',
'state' => 'California',
'postalCode' => '94103'
],
'customer' => [
'firstName' => 'Perrin',
'lastName' => 'Aybara',
'email' => 'perrin@getmeadow.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Client-Key: <api-key>",
"X-Consumer-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-staging.getmeadow.com/api/v1/orders"
payload := strings.NewReader("{\n \"lineItems\": [\n {\n \"productOptionId\": 1899,\n \"quantity\": 3\n }\n ],\n \"type\": \"delivery\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"California\",\n \"postalCode\": \"94103\"\n },\n \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Consumer-Key", "<api-key>")
req.Header.Add("X-Client-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-staging.getmeadow.com/api/v1/orders")
.header("X-Consumer-Key", "<api-key>")
.header("X-Client-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lineItems\": [\n {\n \"productOptionId\": 1899,\n \"quantity\": 3\n }\n ],\n \"type\": \"delivery\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"California\",\n \"postalCode\": \"94103\"\n },\n \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.getmeadow.com/api/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Consumer-Key"] = '<api-key>'
request["X-Client-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lineItems\": [\n {\n \"productOptionId\": 1899,\n \"quantity\": 3\n }\n ],\n \"type\": \"delivery\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"California\",\n \"postalCode\": \"94103\"\n },\n \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "176099362",
"organizationId": 1,
"totalPrice": 22650,
"netPrice": 21191,
"deliveryNotes": null,
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"customerGrandTotal": 21191,
"type": "delivery",
"source": "open-api",
"status": "draft",
"taxExempt": true,
"isMedical": false,
"idempotencyKey": null,
"deliveryFee": null,
"deliveryFeeDescription": null,
"apiConsumerName": "Meadow Integrator",
"credits": [
{
"id": 342,
"creditId": 360,
"orderId": "176099362",
"type": "store-credit",
"amountUsed": 500,
"description": "Store Credit",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"percent": null
}
],
"lineItems": [
{
"id": 15258,
"orderId": "176099362",
"productOptionId": 1899,
"quantity": 3,
"productId": 758,
"productName": "Kush Minntz",
"productUnit": "gram",
"productStrainType": "hybrid",
"optionName": "Eighth",
"optionAmount": 3.54,
"optionPrice": 6500,
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"productIsFeatured": true,
"productCategoryId": 1,
"productSubCategoryIds": [],
"productBrand": "Minntz",
"deletedAt": null,
"productUnitPlural": "grams",
"unitPrice": 6500,
"subtotalPrice": 19500,
"finalPrice": 19500,
"productBrandId": 226,
"optionSalesPrice": null,
"discounts": []
},
{
"id": 15259,
"orderId": "176099362",
"productOptionId": 2307,
"quantity": 1,
"productId": 994,
"productName": "Blue Dream",
"productUnit": "gram",
"productStrainType": "none",
"optionName": "Eighth",
"optionAmount": 3.5,
"optionPrice": 4000,
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"productIsFeatured": false,
"productCategoryId": 1,
"productSubCategoryIds": [],
"productBrand": "Angora Heirloom",
"deletedAt": null,
"productUnitPlural": "grams",
"unitPrice": 3500,
"subtotalPrice": 3500,
"finalPrice": 3150,
"productBrandId": 330,
"optionSalesPrice": 3500,
"discounts": [
{
"id": 1448,
"orderId": "176099362",
"orderLineItemId": 15259,
"discountId": 166,
"type": "percent",
"amount": 10,
"amountUsed": 350,
"description": "10% Off Tuesday Heirloom's",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"adminId": null
}
]
}
],
"taxes": [
{
"id": 15140,
"orderId": "176099362",
"amount": 0,
"description": "State Sales Tax",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"taxId": 59,
"rate": "9.5",
"amountBeforeExemption": 2061,
"amountExempted": 2061,
"included": false,
"exemptable": true,
"encompass": true,
"excludedProductCategoryIds": [],
"nonExemptableProductCategoryIds": [
7
],
"normalRate": "9.5",
"type": "standard"
},
{
"id": 15141,
"orderId": "176099362",
"amount": 1555,
"description": "Excise Tax",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"taxId": 133,
"rate": "15",
"amountBeforeExemption": 1555,
"amountExempted": 0,
"included": false,
"exemptable": false,
"encompass": false,
"excludedProductCategoryIds": [
7
],
"nonExemptableProductCategoryIds": [],
"normalRate": "15",
"type": "excise"
},
{
"id": 15142,
"orderId": "176099362",
"amount": 0,
"description": "City Tax (Included)",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"taxId": 134,
"rate": "10",
"amountBeforeExemption": 2014,
"amountExempted": 2014,
"included": true,
"exemptable": true,
"encompass": false,
"excludedProductCategoryIds": [],
"nonExemptableProductCategoryIds": [],
"normalRate": "10",
"type": "standard"
}
],
"discounts": [
{
"id": 4586,
"discountId": 165,
"orderId": "176099362",
"type": "flat",
"amount": 500,
"amountUsed": 500,
"description": "Tuesday $5",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"adminId": null
}
],
"adjustments": [
{
"id": 1722,
"orderId": "176099362",
"amount": -2014,
"description": "City Tax Exemption",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"isTaxExemption": true,
"taxId": 134,
"adminId": null
}
],
"customer": {
"id": 18273,
"fullName": "Perrin Aybara"
}
}
}{
"error": {
"message": "A description of the error code",
"code": "CODE_OF_ERROR_WILL_BE_HERE"
}
}Create an order
Create an order for a customer
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 '
{
"lineItems": [
{
"productOptionId": 1899,
"quantity": 3
}
],
"type": "delivery",
"address": {
"street1": "123 Main St",
"city": "San Francisco",
"state": "California",
"postalCode": "94103"
},
"customer": {
"firstName": "Perrin",
"lastName": "Aybara",
"email": "perrin@getmeadow.com"
}
}
'import requests
url = "https://api-staging.getmeadow.com/api/v1/orders"
payload = {
"lineItems": [
{
"productOptionId": 1899,
"quantity": 3
}
],
"type": "delivery",
"address": {
"street1": "123 Main St",
"city": "San Francisco",
"state": "California",
"postalCode": "94103"
},
"customer": {
"firstName": "Perrin",
"lastName": "Aybara",
"email": "perrin@getmeadow.com"
}
}
headers = {
"X-Consumer-Key": "<api-key>",
"X-Client-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Consumer-Key': '<api-key>',
'X-Client-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
lineItems: [{productOptionId: 1899, quantity: 3}],
type: 'delivery',
address: {
street1: '123 Main St',
city: 'San Francisco',
state: 'California',
postalCode: '94103'
},
customer: {firstName: 'Perrin', lastName: 'Aybara', email: 'perrin@getmeadow.com'}
})
};
fetch('https://api-staging.getmeadow.com/api/v1/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.getmeadow.com/api/v1/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lineItems' => [
[
'productOptionId' => 1899,
'quantity' => 3
]
],
'type' => 'delivery',
'address' => [
'street1' => '123 Main St',
'city' => 'San Francisco',
'state' => 'California',
'postalCode' => '94103'
],
'customer' => [
'firstName' => 'Perrin',
'lastName' => 'Aybara',
'email' => 'perrin@getmeadow.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Client-Key: <api-key>",
"X-Consumer-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-staging.getmeadow.com/api/v1/orders"
payload := strings.NewReader("{\n \"lineItems\": [\n {\n \"productOptionId\": 1899,\n \"quantity\": 3\n }\n ],\n \"type\": \"delivery\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"California\",\n \"postalCode\": \"94103\"\n },\n \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Consumer-Key", "<api-key>")
req.Header.Add("X-Client-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-staging.getmeadow.com/api/v1/orders")
.header("X-Consumer-Key", "<api-key>")
.header("X-Client-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lineItems\": [\n {\n \"productOptionId\": 1899,\n \"quantity\": 3\n }\n ],\n \"type\": \"delivery\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"California\",\n \"postalCode\": \"94103\"\n },\n \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.getmeadow.com/api/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Consumer-Key"] = '<api-key>'
request["X-Client-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lineItems\": [\n {\n \"productOptionId\": 1899,\n \"quantity\": 3\n }\n ],\n \"type\": \"delivery\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"California\",\n \"postalCode\": \"94103\"\n },\n \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "176099362",
"organizationId": 1,
"totalPrice": 22650,
"netPrice": 21191,
"deliveryNotes": null,
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"customerGrandTotal": 21191,
"type": "delivery",
"source": "open-api",
"status": "draft",
"taxExempt": true,
"isMedical": false,
"idempotencyKey": null,
"deliveryFee": null,
"deliveryFeeDescription": null,
"apiConsumerName": "Meadow Integrator",
"credits": [
{
"id": 342,
"creditId": 360,
"orderId": "176099362",
"type": "store-credit",
"amountUsed": 500,
"description": "Store Credit",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"percent": null
}
],
"lineItems": [
{
"id": 15258,
"orderId": "176099362",
"productOptionId": 1899,
"quantity": 3,
"productId": 758,
"productName": "Kush Minntz",
"productUnit": "gram",
"productStrainType": "hybrid",
"optionName": "Eighth",
"optionAmount": 3.54,
"optionPrice": 6500,
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"productIsFeatured": true,
"productCategoryId": 1,
"productSubCategoryIds": [],
"productBrand": "Minntz",
"deletedAt": null,
"productUnitPlural": "grams",
"unitPrice": 6500,
"subtotalPrice": 19500,
"finalPrice": 19500,
"productBrandId": 226,
"optionSalesPrice": null,
"discounts": []
},
{
"id": 15259,
"orderId": "176099362",
"productOptionId": 2307,
"quantity": 1,
"productId": 994,
"productName": "Blue Dream",
"productUnit": "gram",
"productStrainType": "none",
"optionName": "Eighth",
"optionAmount": 3.5,
"optionPrice": 4000,
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"productIsFeatured": false,
"productCategoryId": 1,
"productSubCategoryIds": [],
"productBrand": "Angora Heirloom",
"deletedAt": null,
"productUnitPlural": "grams",
"unitPrice": 3500,
"subtotalPrice": 3500,
"finalPrice": 3150,
"productBrandId": 330,
"optionSalesPrice": 3500,
"discounts": [
{
"id": 1448,
"orderId": "176099362",
"orderLineItemId": 15259,
"discountId": 166,
"type": "percent",
"amount": 10,
"amountUsed": 350,
"description": "10% Off Tuesday Heirloom's",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"adminId": null
}
]
}
],
"taxes": [
{
"id": 15140,
"orderId": "176099362",
"amount": 0,
"description": "State Sales Tax",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"taxId": 59,
"rate": "9.5",
"amountBeforeExemption": 2061,
"amountExempted": 2061,
"included": false,
"exemptable": true,
"encompass": true,
"excludedProductCategoryIds": [],
"nonExemptableProductCategoryIds": [
7
],
"normalRate": "9.5",
"type": "standard"
},
{
"id": 15141,
"orderId": "176099362",
"amount": 1555,
"description": "Excise Tax",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"taxId": 133,
"rate": "15",
"amountBeforeExemption": 1555,
"amountExempted": 0,
"included": false,
"exemptable": false,
"encompass": false,
"excludedProductCategoryIds": [
7
],
"nonExemptableProductCategoryIds": [],
"normalRate": "15",
"type": "excise"
},
{
"id": 15142,
"orderId": "176099362",
"amount": 0,
"description": "City Tax (Included)",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"taxId": 134,
"rate": "10",
"amountBeforeExemption": 2014,
"amountExempted": 2014,
"included": true,
"exemptable": true,
"encompass": false,
"excludedProductCategoryIds": [],
"nonExemptableProductCategoryIds": [],
"normalRate": "10",
"type": "standard"
}
],
"discounts": [
{
"id": 4586,
"discountId": 165,
"orderId": "176099362",
"type": "flat",
"amount": 500,
"amountUsed": 500,
"description": "Tuesday $5",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"adminId": null
}
],
"adjustments": [
{
"id": 1722,
"orderId": "176099362",
"amount": -2014,
"description": "City Tax Exemption",
"createdAt": "2022-05-03T20:56:27.830Z",
"updatedAt": "2022-05-03T20:56:27.830Z",
"deletedAt": null,
"isTaxExemption": true,
"taxId": 134,
"adminId": null
}
],
"customer": {
"id": 18273,
"fullName": "Perrin Aybara"
}
}
}{
"error": {
"message": "A description of the error code",
"code": "CODE_OF_ERROR_WILL_BE_HERE"
}
}Idempotency
In order to prevent accidental double orders from being placed from issues such as network failures, Meadow uses anidempotencyKey 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
The key assigned to your company and provided via Meadow
The key generated and provided by our mutual client
Body
Order type - must be either delivery or pickup
An array of products to buy
Hide child attributes
Hide child attributes
The ID from the menu api response data[].options[].id
The quantity of this product option to purchase
The customer for this order.
Hide child attributes
Hide child attributes
The first name of the customer
The last name of the customer. Multiple last names may be separated by a space.
The email of the customer. At least one of email, phone must be provided.
The phone of the customer. At least one of email, phone must be provided.
The birthday submitted as YYYY-MM-DD
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.
Optional notes field to help fulfill the order (Example: please call on delivery)
A fee that will be passed through and added onto the customerGrandTotal
A passthrough title for the delivery fee
An array of promo codes to redeem. These codes must already exist in the Meadow backend.
Response
Create order response
The ID for the order. Used to fetch status updates
The status of the order. Will be set to draft or new depending on the organization's settings.
The subtotal price before discounts, credits, adjustments are taken into account.
The final price of the order before payment & delivery fees.
The cost of the order that the customer will pay
The line items with pricing information attached
Hide child attributes
Hide child attributes
The product option ID for this line item
The quantity of this line item
The unit price for a single quantity of this line item
The total cost of all quantities of this line item before discounts
The final cost of this line item after discounts

