cURL
curl --request PUT \
--url https://api-staging.getmeadow.com/api/v1/products/{productId}/options/upc \
--header 'Content-Type: application/json' \
--header 'X-Client-Key: <api-key>' \
--header 'X-Consumer-Key: <api-key>' \
--data '
{
"options": [
{
"id": 2307,
"upc": "TEST_UPC_1"
},
{
"id": 2325,
"upc": "TEST_UPC_2"
}
]
}
'import requests
url = "https://api-staging.getmeadow.com/api/v1/products/{productId}/options/upc"
payload = { "options": [
{
"id": 2307,
"upc": "TEST_UPC_1"
},
{
"id": 2325,
"upc": "TEST_UPC_2"
}
] }
headers = {
"X-Consumer-Key": "<api-key>",
"X-Client-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Consumer-Key': '<api-key>',
'X-Client-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({options: [{id: 2307, upc: 'TEST_UPC_1'}, {id: 2325, upc: 'TEST_UPC_2'}]})
};
fetch('https://api-staging.getmeadow.com/api/v1/products/{productId}/options/upc', 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/products/{productId}/options/upc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'options' => [
[
'id' => 2307,
'upc' => 'TEST_UPC_1'
],
[
'id' => 2325,
'upc' => 'TEST_UPC_2'
]
]
]),
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/products/{productId}/options/upc"
payload := strings.NewReader("{\n \"options\": [\n {\n \"id\": 2307,\n \"upc\": \"TEST_UPC_1\"\n },\n {\n \"id\": 2325,\n \"upc\": \"TEST_UPC_2\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-staging.getmeadow.com/api/v1/products/{productId}/options/upc")
.header("X-Consumer-Key", "<api-key>")
.header("X-Client-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"options\": [\n {\n \"id\": 2307,\n \"upc\": \"TEST_UPC_1\"\n },\n {\n \"id\": 2325,\n \"upc\": \"TEST_UPC_2\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.getmeadow.com/api/v1/products/{productId}/options/upc")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Consumer-Key"] = '<api-key>'
request["X-Client-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"options\": [\n {\n \"id\": 2307,\n \"upc\": \"TEST_UPC_1\"\n },\n {\n \"id\": 2325,\n \"upc\": \"TEST_UPC_2\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 994,
"organizationId": 1,
"name": "Blue Dream",
"unit": "gram",
"strainType": "none",
"percentThc": null,
"percentCbd": null,
"description": "",
"createdAt": "2022-05-03T20:07:46.098Z",
"updatedAt": "2022-08-08T18:16:17.477Z",
"isActive": true,
"isFeatured": false,
"archivedAt": null,
"subCategoryIds": [],
"categoryId": 1,
"inventoryType": "option",
"unitPlural": "grams",
"deletedAt": null,
"movingAverageCostPerUnit": null,
"defaultCostPerUnit": null,
"leaflyCategory": null,
"strainName": null,
"isCompliant": true,
"brandId": 330,
"thcAmount": null,
"thcAmountEach": null,
"thcUnit": null,
"cbdAmount": null,
"cbdAmountEach": null,
"cbdUnit": null,
"options": [
{
"id": 2307,
"productId": 994,
"name": "Eighth",
"amount": 3.5,
"price": 4000,
"createdAt": "2022-05-03T20:07:46.121Z",
"updatedAt": "2022-05-03T20:07:46.121Z",
"deletedAt": null,
"upc": "TEST_UPC_1",
"movingAverageCostPerUnit": null,
"content": null,
"defaultCostPerUnit": null,
"salesPrice": 3500
},
{
"id": 2308,
"productId": 994,
"name": "Quarter",
"amount": 7,
"price": 6500,
"createdAt": "2022-08-08T16:45:53.625Z",
"updatedAt": "2022-08-08T18:16:17.463Z",
"deletedAt": null,
"upc": "TEST_ZZ2",
"movingAverageCostPerUnit": null,
"content": null,
"defaultCostPerUnit": null,
"salesPrice": null
}
]
}
}{
"error": {
"message": "A description of the error code",
"code": "CODE_OF_ERROR_WILL_BE_HERE"
}
}Endpoints: Products & Inventory
Update UPCs
Update UPC fields for product options
PUT
/
api
/
v1
/
products
/
{productId}
/
options
/
upc
cURL
curl --request PUT \
--url https://api-staging.getmeadow.com/api/v1/products/{productId}/options/upc \
--header 'Content-Type: application/json' \
--header 'X-Client-Key: <api-key>' \
--header 'X-Consumer-Key: <api-key>' \
--data '
{
"options": [
{
"id": 2307,
"upc": "TEST_UPC_1"
},
{
"id": 2325,
"upc": "TEST_UPC_2"
}
]
}
'import requests
url = "https://api-staging.getmeadow.com/api/v1/products/{productId}/options/upc"
payload = { "options": [
{
"id": 2307,
"upc": "TEST_UPC_1"
},
{
"id": 2325,
"upc": "TEST_UPC_2"
}
] }
headers = {
"X-Consumer-Key": "<api-key>",
"X-Client-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Consumer-Key': '<api-key>',
'X-Client-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({options: [{id: 2307, upc: 'TEST_UPC_1'}, {id: 2325, upc: 'TEST_UPC_2'}]})
};
fetch('https://api-staging.getmeadow.com/api/v1/products/{productId}/options/upc', 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/products/{productId}/options/upc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'options' => [
[
'id' => 2307,
'upc' => 'TEST_UPC_1'
],
[
'id' => 2325,
'upc' => 'TEST_UPC_2'
]
]
]),
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/products/{productId}/options/upc"
payload := strings.NewReader("{\n \"options\": [\n {\n \"id\": 2307,\n \"upc\": \"TEST_UPC_1\"\n },\n {\n \"id\": 2325,\n \"upc\": \"TEST_UPC_2\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-staging.getmeadow.com/api/v1/products/{productId}/options/upc")
.header("X-Consumer-Key", "<api-key>")
.header("X-Client-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"options\": [\n {\n \"id\": 2307,\n \"upc\": \"TEST_UPC_1\"\n },\n {\n \"id\": 2325,\n \"upc\": \"TEST_UPC_2\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.getmeadow.com/api/v1/products/{productId}/options/upc")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Consumer-Key"] = '<api-key>'
request["X-Client-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"options\": [\n {\n \"id\": 2307,\n \"upc\": \"TEST_UPC_1\"\n },\n {\n \"id\": 2325,\n \"upc\": \"TEST_UPC_2\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 994,
"organizationId": 1,
"name": "Blue Dream",
"unit": "gram",
"strainType": "none",
"percentThc": null,
"percentCbd": null,
"description": "",
"createdAt": "2022-05-03T20:07:46.098Z",
"updatedAt": "2022-08-08T18:16:17.477Z",
"isActive": true,
"isFeatured": false,
"archivedAt": null,
"subCategoryIds": [],
"categoryId": 1,
"inventoryType": "option",
"unitPlural": "grams",
"deletedAt": null,
"movingAverageCostPerUnit": null,
"defaultCostPerUnit": null,
"leaflyCategory": null,
"strainName": null,
"isCompliant": true,
"brandId": 330,
"thcAmount": null,
"thcAmountEach": null,
"thcUnit": null,
"cbdAmount": null,
"cbdAmountEach": null,
"cbdUnit": null,
"options": [
{
"id": 2307,
"productId": 994,
"name": "Eighth",
"amount": 3.5,
"price": 4000,
"createdAt": "2022-05-03T20:07:46.121Z",
"updatedAt": "2022-05-03T20:07:46.121Z",
"deletedAt": null,
"upc": "TEST_UPC_1",
"movingAverageCostPerUnit": null,
"content": null,
"defaultCostPerUnit": null,
"salesPrice": 3500
},
{
"id": 2308,
"productId": 994,
"name": "Quarter",
"amount": 7,
"price": 6500,
"createdAt": "2022-08-08T16:45:53.625Z",
"updatedAt": "2022-08-08T18:16:17.463Z",
"deletedAt": null,
"upc": "TEST_ZZ2",
"movingAverageCostPerUnit": null,
"content": null,
"defaultCostPerUnit": null,
"salesPrice": null
}
]
}
}{
"error": {
"message": "A description of the error code",
"code": "CODE_OF_ERROR_WILL_BE_HERE"
}
}You may notice there are extra properties in the response than are dictated below. Generally speaking, you should only ever have to use the properties that we explicitly documented below. If you have any questions, please feel free to reach out.
Authorizations
The key assigned to your company and provided via Meadow
The key generated and provided by our mutual client
Path Parameters
ID of the product these options belong to
Body
application/json
Array of product options to update
Hide child attributes
Hide child attributes
The ID from the menu api response data[].options[].id
The new UPC for this option
Response
Update UPC response
The options for this product. Please note that all options will be returned, not just the ones you submitted.
⌘I

