curl --request POST \
--url https://api-staging.getmeadow.com/api/v1/purchase-orders \
--header 'Content-Type: application/json' \
--header 'X-Client-Key: <api-key>' \
--header 'X-Consumer-Key: <api-key>' \
--data '
{
"lineItems": [
{
"productId": 11867,
"productOptionId": 15472,
"amount": "35",
"costPerUnit": "20.35"
}
],
"inventoryVendor": {
"name": "Awesome Distribution, Inc."
},
"expectedAt": "2024-12-25"
}
'import requests
url = "https://api-staging.getmeadow.com/api/v1/purchase-orders"
payload = {
"lineItems": [
{
"productId": 11867,
"productOptionId": 15472,
"amount": "35",
"costPerUnit": "20.35"
}
],
"inventoryVendor": { "name": "Awesome Distribution, Inc." },
"expectedAt": "2024-12-25"
}
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: [{productId: 11867, productOptionId: 15472, amount: '35', costPerUnit: '20.35'}],
inventoryVendor: {name: 'Awesome Distribution, Inc.'},
expectedAt: '2024-12-25'
})
};
fetch('https://api-staging.getmeadow.com/api/v1/purchase-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/purchase-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' => [
[
'productId' => 11867,
'productOptionId' => 15472,
'amount' => '35',
'costPerUnit' => '20.35'
]
],
'inventoryVendor' => [
'name' => 'Awesome Distribution, Inc.'
],
'expectedAt' => '2024-12-25'
]),
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/purchase-orders"
payload := strings.NewReader("{\n \"lineItems\": [\n {\n \"productId\": 11867,\n \"productOptionId\": 15472,\n \"amount\": \"35\",\n \"costPerUnit\": \"20.35\"\n }\n ],\n \"inventoryVendor\": {\n \"name\": \"Awesome Distribution, Inc.\"\n },\n \"expectedAt\": \"2024-12-25\"\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/purchase-orders")
.header("X-Consumer-Key", "<api-key>")
.header("X-Client-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lineItems\": [\n {\n \"productId\": 11867,\n \"productOptionId\": 15472,\n \"amount\": \"35\",\n \"costPerUnit\": \"20.35\"\n }\n ],\n \"inventoryVendor\": {\n \"name\": \"Awesome Distribution, Inc.\"\n },\n \"expectedAt\": \"2024-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.getmeadow.com/api/v1/purchase-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 \"productId\": 11867,\n \"productOptionId\": 15472,\n \"amount\": \"35\",\n \"costPerUnit\": \"20.35\"\n }\n ],\n \"inventoryVendor\": {\n \"name\": \"Awesome Distribution, Inc.\"\n },\n \"expectedAt\": \"2024-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"createdAt": "2024-12-12T07:53:37.793Z",
"expectedAt": "2024-12-25",
"finalTotal": 71225,
"id": 6741,
"inventoryVendor": {
"id": 308,
"organizationId": 25,
"name": "Awesome Distribution, Inc.",
"phone": null,
"notes": null,
"createdAt": "2024-12-12T07:53:37.776Z",
"updatedAt": "2024-12-12T07:53:37.776Z",
"archivedAt": null,
"email": null,
"sellerPermitNumber": null,
"street1": null,
"street2": null,
"city": null,
"state": null,
"postalCode": null
},
"inventoryVendorId": 308,
"lineItems": [
{
"amount": "35",
"caExcisePerUnit": "0",
"costPerUnit": "20.35",
"createdAt": "2024-12-12T07:53:37.797Z",
"finalTotal": 71225,
"id": 33555,
"product": {
"id": 11867,
"organizationId": 25,
"brand": {
"id": 2238,
"name": "Awesome Cannabis",
"createdAt": "2024-12-12T03:08:58.012Z",
"updatedAt": "2024-12-12T03:08:58.012Z",
"description": null
},
"inventoryType": "option",
"createdAt": "2024-12-12T04:08:00.429Z",
"updatedAt": "2024-12-12T05:06:35.447Z",
"deletedAt": null,
"description": null,
"isActive": false,
"isFeatured": false,
"name": "Blue Dream",
"strainType": "hybrid-sativa",
"isCompliant": false,
"unit": "gram"
},
"productId": 11867,
"productOption": {
"id": 15472,
"name": "Eighth",
"amount": 3.5,
"price": 4700,
"salesPrice": null,
"createdAt": "2024-12-12T04:08:00.433Z",
"updatedAt": "2024-12-12T07:09:11.770Z",
"upc": null,
"content": "3.5"
},
"productOptionId": 15472,
"subtotal": 71225,
"updatedAt": "2024-12-12T07:53:37.797Z"
}
],
"organizationId": 25,
"paymentTermsDueDate": null,
"shippingHandlingFee": 0,
"status": "open",
"subtotal": 71225,
"totalAmount": "35",
"updatedAt": "2024-12-12T07:53:37.812Z"
}
}{
"error": {
"message": "A description of the error code",
"code": "CODE_OF_ERROR_WILL_BE_HERE"
}
}Create purchase order
Create a purchase order in order to receive inventory
curl --request POST \
--url https://api-staging.getmeadow.com/api/v1/purchase-orders \
--header 'Content-Type: application/json' \
--header 'X-Client-Key: <api-key>' \
--header 'X-Consumer-Key: <api-key>' \
--data '
{
"lineItems": [
{
"productId": 11867,
"productOptionId": 15472,
"amount": "35",
"costPerUnit": "20.35"
}
],
"inventoryVendor": {
"name": "Awesome Distribution, Inc."
},
"expectedAt": "2024-12-25"
}
'import requests
url = "https://api-staging.getmeadow.com/api/v1/purchase-orders"
payload = {
"lineItems": [
{
"productId": 11867,
"productOptionId": 15472,
"amount": "35",
"costPerUnit": "20.35"
}
],
"inventoryVendor": { "name": "Awesome Distribution, Inc." },
"expectedAt": "2024-12-25"
}
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: [{productId: 11867, productOptionId: 15472, amount: '35', costPerUnit: '20.35'}],
inventoryVendor: {name: 'Awesome Distribution, Inc.'},
expectedAt: '2024-12-25'
})
};
fetch('https://api-staging.getmeadow.com/api/v1/purchase-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/purchase-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' => [
[
'productId' => 11867,
'productOptionId' => 15472,
'amount' => '35',
'costPerUnit' => '20.35'
]
],
'inventoryVendor' => [
'name' => 'Awesome Distribution, Inc.'
],
'expectedAt' => '2024-12-25'
]),
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/purchase-orders"
payload := strings.NewReader("{\n \"lineItems\": [\n {\n \"productId\": 11867,\n \"productOptionId\": 15472,\n \"amount\": \"35\",\n \"costPerUnit\": \"20.35\"\n }\n ],\n \"inventoryVendor\": {\n \"name\": \"Awesome Distribution, Inc.\"\n },\n \"expectedAt\": \"2024-12-25\"\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/purchase-orders")
.header("X-Consumer-Key", "<api-key>")
.header("X-Client-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lineItems\": [\n {\n \"productId\": 11867,\n \"productOptionId\": 15472,\n \"amount\": \"35\",\n \"costPerUnit\": \"20.35\"\n }\n ],\n \"inventoryVendor\": {\n \"name\": \"Awesome Distribution, Inc.\"\n },\n \"expectedAt\": \"2024-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.getmeadow.com/api/v1/purchase-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 \"productId\": 11867,\n \"productOptionId\": 15472,\n \"amount\": \"35\",\n \"costPerUnit\": \"20.35\"\n }\n ],\n \"inventoryVendor\": {\n \"name\": \"Awesome Distribution, Inc.\"\n },\n \"expectedAt\": \"2024-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"createdAt": "2024-12-12T07:53:37.793Z",
"expectedAt": "2024-12-25",
"finalTotal": 71225,
"id": 6741,
"inventoryVendor": {
"id": 308,
"organizationId": 25,
"name": "Awesome Distribution, Inc.",
"phone": null,
"notes": null,
"createdAt": "2024-12-12T07:53:37.776Z",
"updatedAt": "2024-12-12T07:53:37.776Z",
"archivedAt": null,
"email": null,
"sellerPermitNumber": null,
"street1": null,
"street2": null,
"city": null,
"state": null,
"postalCode": null
},
"inventoryVendorId": 308,
"lineItems": [
{
"amount": "35",
"caExcisePerUnit": "0",
"costPerUnit": "20.35",
"createdAt": "2024-12-12T07:53:37.797Z",
"finalTotal": 71225,
"id": 33555,
"product": {
"id": 11867,
"organizationId": 25,
"brand": {
"id": 2238,
"name": "Awesome Cannabis",
"createdAt": "2024-12-12T03:08:58.012Z",
"updatedAt": "2024-12-12T03:08:58.012Z",
"description": null
},
"inventoryType": "option",
"createdAt": "2024-12-12T04:08:00.429Z",
"updatedAt": "2024-12-12T05:06:35.447Z",
"deletedAt": null,
"description": null,
"isActive": false,
"isFeatured": false,
"name": "Blue Dream",
"strainType": "hybrid-sativa",
"isCompliant": false,
"unit": "gram"
},
"productId": 11867,
"productOption": {
"id": 15472,
"name": "Eighth",
"amount": 3.5,
"price": 4700,
"salesPrice": null,
"createdAt": "2024-12-12T04:08:00.433Z",
"updatedAt": "2024-12-12T07:09:11.770Z",
"upc": null,
"content": "3.5"
},
"productOptionId": 15472,
"subtotal": 71225,
"updatedAt": "2024-12-12T07:53:37.797Z"
}
],
"organizationId": 25,
"paymentTermsDueDate": null,
"shippingHandlingFee": 0,
"status": "open",
"subtotal": 71225,
"totalAmount": "35",
"updatedAt": "2024-12-12T07:53:37.812Z"
}
}{
"error": {
"message": "A description of the error code",
"code": "CODE_OF_ERROR_WILL_BE_HERE"
}
}Authorizations
The key assigned to your company and provided via Meadow
The key generated and provided by our mutual client
Body
The products for this purchase order
Hide child attributes
Hide child attributes
The ID of the product to add to the purchase order
The number of units purchased. Submit as string to avoid floating point errors.
The cost per unit in dollars. Submit as string to avoid floating point errors.
The ID of the option that belongs to the product submitted as productId. This property is required if the product's inventoryType is set to option.
View more information in our Inventory Guide
Any relevant notes
net15, net30, net60, cod, custom If payment terms is custom then this field is required. Date formatted as YYYY-MM-DD for when payment is due.
Expected delivery date formatted as YYYY-MM-DD
Use this to store a 3rd party ID for the PO
The inventory vendor ID obtained from list or create PO. Alternatively you can use inventoryVendor.name
Hide child attributes
Hide child attributes
name of the vendor. We will match to an existing vendor or create with the below properties if it does not exist.
The email for this vendor
The phone for this vendor
Response
Create product response
The ID of the purchase order
The client organization ID
If closed no more edits can be made to this PO.
open, closed Total in cents for the PO
Total in cents for the PO minus any shipping & handling
The ID of the inventory vendor

