curl --request POST \
--url https://api-staging.getmeadow.com/api/v1/orders/pricing \
--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",
"customer": {
"firstName": "Perrin",
"lastName": "Aybara",
"email": "perrin@getmeadow.com",
"phone": "6285551234"
}
}
'import requests
url = "https://api-staging.getmeadow.com/api/v1/orders/pricing"
payload = {
"lineItems": [
{
"productOptionId": 1899,
"quantity": 3
}
],
"type": "delivery",
"customer": {
"firstName": "Perrin",
"lastName": "Aybara",
"email": "perrin@getmeadow.com",
"phone": "6285551234"
}
}
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',
customer: {
firstName: 'Perrin',
lastName: 'Aybara',
email: 'perrin@getmeadow.com',
phone: '6285551234'
}
})
};
fetch('https://api-staging.getmeadow.com/api/v1/orders/pricing', 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/pricing",
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',
'customer' => [
'firstName' => 'Perrin',
'lastName' => 'Aybara',
'email' => 'perrin@getmeadow.com',
'phone' => '6285551234'
]
]),
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/pricing"
payload := strings.NewReader("{\n \"lineItems\": [\n {\n \"productOptionId\": 1899,\n \"quantity\": 3\n }\n ],\n \"type\": \"delivery\",\n \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\",\n \"phone\": \"6285551234\"\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/pricing")
.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 \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\",\n \"phone\": \"6285551234\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.getmeadow.com/api/v1/orders/pricing")
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 \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\",\n \"phone\": \"6285551234\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"lineItems": [
{
"productOptionId": 1899,
"productCategoryId": 1,
"quantity": 3,
"unitPrice": 6500,
"subtotalPrice": 19500,
"finalPrice": 19500,
"discounts": []
},
{
"productOptionId": 2307,
"productCategoryId": 1,
"quantity": 1,
"unitPrice": 3500,
"subtotalPrice": 3500,
"finalPrice": 3150,
"discounts": [
{
"id": 166,
"type": "percent",
"amount": 10,
"amountUsed": 350,
"description": "10% Off Tuesday Heirloom's"
}
]
}
],
"totalPrice": 22650,
"netPrice": 21191,
"customerGrandTotal": 21191,
"discounts": [
{
"id": 165,
"type": "flat",
"amount": 500,
"amountUsed": 500,
"description": "Tuesday $5"
}
],
"credits": [
{
"id": 359,
"type": "store-credit",
"amountUsed": 500,
"description": "Store Credit"
}
],
"adjustments": [
{
"amount": -2014,
"description": "City Tax Exemption",
"isTaxExemption": true,
"taxId": 134
}
],
"taxes": [
{
"id": 59,
"amount": 0,
"amountBeforeExemption": 2061,
"amountExempted": 2061,
"description": "State Sales Tax",
"rate": "9.5",
"normalRate": "9.5",
"included": false,
"exemptable": true,
"encompass": true,
"excludedProductCategoryIds": [],
"nonExemptableProductCategoryIds": [
7
],
"type": "standard"
},
{
"id": 133,
"amount": 1555,
"amountBeforeExemption": 1555,
"amountExempted": 0,
"description": "Excise Tax",
"rate": "15",
"normalRate": "15",
"included": false,
"exemptable": false,
"encompass": false,
"excludedProductCategoryIds": [
7
],
"nonExemptableProductCategoryIds": [],
"type": "excise"
},
{
"id": 134,
"amount": 0,
"amountBeforeExemption": 2014,
"amountExempted": 2014,
"description": "City Tax (Included)",
"rate": "10",
"normalRate": "10",
"included": true,
"exemptable": true,
"encompass": false,
"excludedProductCategoryIds": [],
"nonExemptableProductCategoryIds": [],
"type": "standard"
}
],
"orderMinimum": 5000,
"metOrderMinimum": true,
"discountsTotal": 850,
"discountsOverBudtenderLimit": false,
"discountsOverManagerLimit": false,
"idempotencyKey": "ddf6cc42-d9b2-4b8c-97cf-47d454445453"
}
}{
"error": {
"message": "A description of the error code",
"code": "CODE_OF_ERROR_WILL_BE_HERE"
}
}Retrieve cart pricing
Retrieve pricing information for a cart (prices, discounts, taxes, etc.)
curl --request POST \
--url https://api-staging.getmeadow.com/api/v1/orders/pricing \
--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",
"customer": {
"firstName": "Perrin",
"lastName": "Aybara",
"email": "perrin@getmeadow.com",
"phone": "6285551234"
}
}
'import requests
url = "https://api-staging.getmeadow.com/api/v1/orders/pricing"
payload = {
"lineItems": [
{
"productOptionId": 1899,
"quantity": 3
}
],
"type": "delivery",
"customer": {
"firstName": "Perrin",
"lastName": "Aybara",
"email": "perrin@getmeadow.com",
"phone": "6285551234"
}
}
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',
customer: {
firstName: 'Perrin',
lastName: 'Aybara',
email: 'perrin@getmeadow.com',
phone: '6285551234'
}
})
};
fetch('https://api-staging.getmeadow.com/api/v1/orders/pricing', 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/pricing",
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',
'customer' => [
'firstName' => 'Perrin',
'lastName' => 'Aybara',
'email' => 'perrin@getmeadow.com',
'phone' => '6285551234'
]
]),
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/pricing"
payload := strings.NewReader("{\n \"lineItems\": [\n {\n \"productOptionId\": 1899,\n \"quantity\": 3\n }\n ],\n \"type\": \"delivery\",\n \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\",\n \"phone\": \"6285551234\"\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/pricing")
.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 \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\",\n \"phone\": \"6285551234\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.getmeadow.com/api/v1/orders/pricing")
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 \"customer\": {\n \"firstName\": \"Perrin\",\n \"lastName\": \"Aybara\",\n \"email\": \"perrin@getmeadow.com\",\n \"phone\": \"6285551234\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"lineItems": [
{
"productOptionId": 1899,
"productCategoryId": 1,
"quantity": 3,
"unitPrice": 6500,
"subtotalPrice": 19500,
"finalPrice": 19500,
"discounts": []
},
{
"productOptionId": 2307,
"productCategoryId": 1,
"quantity": 1,
"unitPrice": 3500,
"subtotalPrice": 3500,
"finalPrice": 3150,
"discounts": [
{
"id": 166,
"type": "percent",
"amount": 10,
"amountUsed": 350,
"description": "10% Off Tuesday Heirloom's"
}
]
}
],
"totalPrice": 22650,
"netPrice": 21191,
"customerGrandTotal": 21191,
"discounts": [
{
"id": 165,
"type": "flat",
"amount": 500,
"amountUsed": 500,
"description": "Tuesday $5"
}
],
"credits": [
{
"id": 359,
"type": "store-credit",
"amountUsed": 500,
"description": "Store Credit"
}
],
"adjustments": [
{
"amount": -2014,
"description": "City Tax Exemption",
"isTaxExemption": true,
"taxId": 134
}
],
"taxes": [
{
"id": 59,
"amount": 0,
"amountBeforeExemption": 2061,
"amountExempted": 2061,
"description": "State Sales Tax",
"rate": "9.5",
"normalRate": "9.5",
"included": false,
"exemptable": true,
"encompass": true,
"excludedProductCategoryIds": [],
"nonExemptableProductCategoryIds": [
7
],
"type": "standard"
},
{
"id": 133,
"amount": 1555,
"amountBeforeExemption": 1555,
"amountExempted": 0,
"description": "Excise Tax",
"rate": "15",
"normalRate": "15",
"included": false,
"exemptable": false,
"encompass": false,
"excludedProductCategoryIds": [
7
],
"nonExemptableProductCategoryIds": [],
"type": "excise"
},
{
"id": 134,
"amount": 0,
"amountBeforeExemption": 2014,
"amountExempted": 2014,
"description": "City Tax (Included)",
"rate": "10",
"normalRate": "10",
"included": true,
"exemptable": true,
"encompass": false,
"excludedProductCategoryIds": [],
"nonExemptableProductCategoryIds": [],
"type": "standard"
}
],
"orderMinimum": 5000,
"metOrderMinimum": true,
"discountsTotal": 850,
"discountsOverBudtenderLimit": false,
"discountsOverManagerLimit": false,
"idempotencyKey": "ddf6cc42-d9b2-4b8c-97cf-47d454445453"
}
}{
"error": {
"message": "A description of the error code",
"code": "CODE_OF_ERROR_WILL_BE_HERE"
}
}How to display to a customer
When displaying the pricing information to a customer, here is how Meadow displays: Subtotal:totalPrice
credits[].description: credits[].amountUsed
discounts[].description: discounts[].amountUsed
adjustments[].description: adjustments[].amount
taxes[].description: taxes[].amount
Total: customerGrandTotal
Screenshot from our backend app:

Authorizations
The key assigned to your company and provided via Meadow
The key generated and provided by our mutual client
Body
The type of the order
delivery, 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. This object is optional, but if provided, must have a firstName, lastName and either an email or phone.
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
The postal code for this order. This will take into account an organization’s order minimums
A fee that will be passed through and added onto the customerGrandTotal
A passthrough title for the delivery fee
Response
Order cart pricing response
The line items of this cart
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
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 order minimum for this dispensary and postal code
Whether this cart has met the order minimum or not
A string that should be used when creating an order to ensure idempotency and avoid double orders due to server miscommunication.

