Green Bits API V1
Authentication ¶
Get API Token ¶
Green Bits primarily uses token based authentication.
To retrieve your API token, send a GET request to /api/v1/me
using basic authentication and the email and password of any valid user in the API application’s database.
Limiting API Response Data to a Specific Location
If a user has access to multiple locations, you can constrain the API to a
specific location by setting the X-GB-CompanyId
in the header of all API
requests with the specific location’s ID.
Note that without the X-GB-CompanyId
header, API responses will
automatically constrain to the token owner’s first accessible location.
Authorization: Token token="{your_token}"
X-GB-CompanyId: {company_id}
View Your DetailsGET/me
Example URI
Headers
Authorization: Basic {basic_auth_token}
200
Headers
Content-Type: application/json
Body
{
"user": {
"id": "5d44d604-81b5-4b16-ade4-f204f3d494dc",
"username": "janedoe",
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Doe",
"name": "Jane Doe",
"token": "53MdJBaKnKMUWEfXDparpQ",
"budtender": false,
"created_at": "2015-07-10T10:59:26-07:00",
"company_id": "407fa200-0108-4b30-8fa1-7699442538b2"
}
}
401
Headers
Content-Type: application/json
Body
{
"error": "Invalid email or password."
}
Authenticate with Token ¶
Now that you have your API token, you can test it out by retrieving your company’s details. Using the company id from the previous request, fetch your company’s details with the following request.
View Company DetailsGET/companies/{company_id}
Example URI
- company_id
string
(required)ID of your company
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"company": {
"id": "407fa200-0108-4b30-8fa1-7699442538b2",
"name": "Jane's Pot Shop",
"street": "1234 Rad Street",
"city": "San Jose",
"state": "CA",
"zip_code": "95124"
}
}
Customer ¶
- Attributes
- id (string)
- company_id (required, string) - The company to attach this customer to.
- first_name (optional, string)
- last_name (optional, string)
- email (required, string) - Either phone or email is required.
- phone (required, string) - Either phone or email is required. Must be a valid phone number, but don’t worry about formatting. The API will format the phone number in the response.
Customers Collection ¶
Customers CollectionGET/customers{?by_query}
Example URI
- by_query
string
(optional)Filters the customers by this query string. It returns any customers whose first name, last name, email, or phone contain the provided string.
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"customers": [
{
"id": "520aa7d7-a25e-48c4-811f-d2454eb03467",
"first_name": "John",
"last_name": "Smith",
"email": "john@example.com",
"phone": "888-555-1111",
"birth_date": "1976-04-03T00:00:00.000Z",
"company_id": "a73e4ad0-d48b-4981-b764-1418e04d9ce4"
}
]
}
Create Customer ¶
Create CustomerPOST/customers
Example URI
Headers
Content-Type: application/json
Body
{
"customer": {
"first_name": "John",
"last_name": "Smith",
"email": "john@example.com",
"phone": "8885551111",
"birth_date": "1976-04-03T00:00:00.000Z",
"company_id": "a73e4ad0-d48b-4981-b764-1418e04d9ce4"
}
}
200
Headers
Content-Type: application/json
Body
{
"customer": {
"id": "520aa7d7-a25e-48c4-811f-d2454eb03467",
"first_name": "John",
"last_name": "Smith",
"email": "john@example.com",
"phone": "888-555-1111",
"birth_date": "1976-04-03T00:00:00.000Z",
"company_id": "a73e4ad0-d48b-4981-b764-1418e04d9ce4"
}
}
422
Headers
Content-Type: application/json
Body
{
"errors": {
"email": [
"is not a valid email"
],
"phone": [
"is not a valid phone number"
]
}
}
Inventory Item ¶
The Inventory Item endpoint only provides you with information about the inventory item. It does not contain product-level information. Use this endpoint if you need to modify the inventory item or use the inventory item metadata field.
- Attributes
- id (string) - The inventory item ID.
- product_id (string) - The ID of the product to which this item belongs.
- sku (string)
- lot_number (string)
- quantity (number) - Quantity left on hand.
- weight (string) - Weight in grams.
- sell_type (number) - An Enum indicating this item’s sell type. The valid options are:
- 0: Sellable
- 1: Unsellable
- 2: Locked - This means it was locked by Green Bits, either because it’s a sample jar or it has been transferred out.
- sample (boolean) - A boolean indicating whether this item is a sample.
- transferred_out (boolean) - A boolean indicating whether this item has been transferred out.
- received_at (timestamp) - A timestamp indicating the first time this item was received.
- test_results_thc (string) - THC percentage (10% being represented at 0.10) indicated by the latest test results.
- test_results_cbd (string) - CBD percentage (10% being represented at 0.10) indicated by the latest test results.
- metadata (json) - A JSON field that you can use to store metadata about this item.
Inventory Item ¶
View an Inventory Item's DetailGET/inventory_items/{inventory_item_id}
Example URI
- inventory_item_id
string
(required)ID of the inventory item
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"inventory_item": {
"id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca",
"sku": "1234567890123459",
"quantity": 5,
"weight": null,
"purchase_price": 666,
"lot_number": "1234567890123459",
"sell_type": 3,
"sample": false,
"transferred_out": false,
"received_at": "2020-09-07T09:40:59.000Z",
"metadata": null,
"test_results_thc": "0.13",
"test_results_cbd": "0.04",
"sellable_quantity": 0,
"product": {
"id": "1ee050d1-d08f-4bea-840e-f3a3a01d994a",
"sku": null,
"name": "AK-47",
"sell_price": 1400,
"collect_excise_tax": true,
"quantity": 107,
"pricing_type": 0,
"vendor": "Katz Kush Farms",
"active": true,
"latest_sku": "1234567890123455",
"weight": null,
"tags": [],
"description": null,
"internal_notes": null,
"metadata": null,
"test_results_thc": "0.35",
"test_results_cbd": "0.005",
"flower_type": 1,
"concentrate_type": null,
"category_id": "76f4b09d-a49a-4e83-bdc7-7424ffe6ee4f",
"brand_id": "774ef7ee-38ab-469a-9789-9b53aaeab229",
"strain_id": "abcdec1a-2020-42e8-adbe-621efb760000",
"product_type_id": "882d74f6-d0fa-4abb-a962-02c32f229fb0"
},
"inventory_item_places": [
{
"id": "d6eb5219-eac3-4e58-9dd7-0f2e5d070daf",
"quantity": {
"value": "0.0",
"unit": 0
},
"sellable_quantity": {
"value": "0.0",
"unit": 0
},
"inventory_status": 0,
"place_id": "d4668dd4-ea5f-49b2-8acf-6b1defc4db6e",
"inventory_item_id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca"
},
{
"id": "1d965dcf-f72c-4b4f-abfc-99551934c3f5",
"quantity": {
"value": "0.0",
"unit": 0
},
"sellable_quantity": {
"value": "0.0",
"unit": 0
},
"inventory_status": 1,
"place_id": "26f3b975-ac94-4810-9ad8-643a2b3aeb79",
"inventory_item_id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca"
},
{
"id": "45b10003-6137-4e6a-add5-9e5bc2e783a0",
"quantity": {
"value": "5.0",
"unit": 0
},
"sellable_quantity": {
"value": "0.0",
"unit": 0
},
"inventory_status": 3,
"place_id": "77755ba4-6437-4f75-a482-cbf7ee69b70a",
"inventory_item_id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca"
},
{
"id": "83f42262-63af-4fba-9d25-4babff6a157e",
"quantity": {
"value": "0.0",
"unit": 0
},
"sellable_quantity": {
"value": "0.0",
"unit": 0
},
"inventory_status": 2,
"place_id": "59cf8b9c-78c2-499d-aff1-8d21c022d3e4",
"inventory_item_id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca"
},
{
"id": "9010f610-8567-4f27-aace-bae582952aad",
"quantity": {
"value": "0.0",
"unit": 0
},
"sellable_quantity": {
"value": "0.0",
"unit": 0
},
"inventory_status": 4,
"place_id": "5327118e-4f44-4a62-9417-c9306159f5d6",
"inventory_item_id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca"
}
]
}
}
Update an Inventory ItemPUT/inventory_items/{inventory_item_id}
The request below only shows the fields that you are allowed to update.
Example URI
- inventory_item_id
string
(required)ID of the inventory item
{ “inventory_item”: { “id”: “c93e96f7-40a5-4225-a324-c9c80c3f14f8”, “product_id”: “4678c18a-5a5f-49a2-90ad-1908312e6235”, “sku”: “3156156207772758”, “sell_type”: 0, “metadata”: { “bin_id”: “R-23” } } }
Headers
Content-Type: application/json
Authorization: Token token="{your_token}"
204
Inventory Item Collection ¶
List All Inventory ItemsGET/inventory_items{?limit}{?offset}{?sellable}{?only_assigned}{?by_sku}{?by_lot_number}{?by_product_id}{?by_product_name}
Example URI
- limit
number
(optional) Example: 10The maximum number of inventory items to return.
- offset
number
(optional) Example: 0The number of inventory items to skip before returning inventory items.
- sellable
boolean
(optional) Example: trueOnly return sellable inventory items.
- only_assigned
boolean
(optional) Example: falseAlso include inventory items that haven’t been associated with products.
- by_sku
string
(optional) Example: 1234Filter results to only include items that match this SKU.
- by_lot_number
string
(optional) Example: 1234Filter results to only include items that match this lot number.
- by_product_id
string
(optional) Example: 4678c18a-5a5f-49a2-90ad-1908312e6235Filter results to only include items for this product.
- by_product_name
string
(optional) Example: BM: Bubba KushFilter results to only include items whose product name matches this string.
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"inventory_items": [
{
"id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca",
"sku": "1234567890123459",
"quantity": 5,
"weight": null,
"purchase_price": 666,
"lot_number": "1234567890123459",
"sell_type": 3,
"sample": false,
"transferred_out": false,
"received_at": "2020-09-07T09:40:59.000Z",
"metadata": null,
"test_results_thc": "0.13",
"test_results_cbd": "0.04",
"sellable_quantity": 0,
"product": {
"id": "1ee050d1-d08f-4bea-840e-f3a3a01d994a",
"sku": null,
"name": "AK-47",
"sell_price": 1400,
"collect_excise_tax": true,
"quantity": 107,
"pricing_type": 0,
"vendor": "Katz Kush Farms",
"active": true,
"latest_sku": "1234567890123455",
"weight": null,
"tags": [],
"description": null,
"internal_notes": null,
"metadata": null,
"test_results_thc": "0.35",
"test_results_cbd": "0.005",
"flower_type": 1,
"concentrate_type": null,
"category_id": "76f4b09d-a49a-4e83-bdc7-7424ffe6ee4f",
"brand_id": "774ef7ee-38ab-469a-9789-9b53aaeab229",
"strain_id": "abcdec1a-2020-42e8-adbe-621efb760000",
"product_type_id": "882d74f6-d0fa-4abb-a962-02c32f229fb0"
},
"inventory_item_places": [
{
"id": "d6eb5219-eac3-4e58-9dd7-0f2e5d070daf",
"quantity": {
"value": "0.0",
"unit": 0
},
"sellable_quantity": {
"value": "0.0",
"unit": 0
},
"inventory_status": 0,
"place_id": "d4668dd4-ea5f-49b2-8acf-6b1defc4db6e",
"inventory_item_id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca"
},
{
"id": "1d965dcf-f72c-4b4f-abfc-99551934c3f5",
"quantity": {
"value": "0.0",
"unit": 0
},
"sellable_quantity": {
"value": "0.0",
"unit": 0
},
"inventory_status": 1,
"place_id": "26f3b975-ac94-4810-9ad8-643a2b3aeb79",
"inventory_item_id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca"
},
{
"id": "45b10003-6137-4e6a-add5-9e5bc2e783a0",
"quantity": {
"value": "5.0",
"unit": 0
},
"sellable_quantity": {
"value": "0.0",
"unit": 0
},
"inventory_status": 3,
"place_id": "77755ba4-6437-4f75-a482-cbf7ee69b70a",
"inventory_item_id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca"
},
{
"id": "83f42262-63af-4fba-9d25-4babff6a157e",
"quantity": {
"value": "0.0",
"unit": 0
},
"sellable_quantity": {
"value": "0.0",
"unit": 0
},
"inventory_status": 2,
"place_id": "59cf8b9c-78c2-499d-aff1-8d21c022d3e4",
"inventory_item_id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca"
},
{
"id": "9010f610-8567-4f27-aace-bae582952aad",
"quantity": {
"value": "0.0",
"unit": 0
},
"sellable_quantity": {
"value": "0.0",
"unit": 0
},
"inventory_status": 4,
"place_id": "5327118e-4f44-4a62-9417-c9306159f5d6",
"inventory_item_id": "dc558fe9-7c1f-41c3-ba90-fe4d602e57ca"
}
]
}
],
"meta": {
"total": 1
}
}
Place ¶
- Attributes
- id (string) - The place ID.
- name (string)
- description (string)
- products_count (number) - An Integer representing the products amount associated with the place.
- inventory_status (number) - An Enum indicating the place’s inventory status. The valid options are:
- 0: For Sale
- 1: Not For Sale
- 2: Locked
- 3: Quarantined
- 4: On Hold
Place ¶
View a Place's DetailGET/places/{place_id}
Example URI
- place_id
string
(required)ID of the place
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"id": 91,
"uuid": "d4668dd4-ea5f-49b2-8acf-6b1defc4db6e",
"name": "Sales Floor",
"inventory_status": 0,
"description": "Inventory Items available for sale",
"deleted_at": null,
"is_deleted": false,
"location_id": 3662,
"account_id": 117,
"created_at": "2021-03-26T10:41:18.000Z",
"updated_at": "2021-03-26T10:41:18.000Z"
}
Places Collection ¶
Places CollectionGET/places{?limit}{?offset}{?by_inventory_status}
Example URI
- limit
number
(optional) Example: 10The maximum number of places to return.
- offset
number
(optional) Example: 0The number of places to skip before returning places.
- by_inventory_status
number
(optional)(number) - An Enum indicating the place’s Inventory status to filter.
-
0: For Sale
-
1: Not For Sale
-
2: Locked
-
3: Quarantined
-
4: On Hold
-
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"places": [
{
"id": 91,
"uuid": "d4668dd4-ea5f-49b2-8acf-6b1defc4db6e",
"name": "Sales Floor",
"inventory_status": 0,
"description": "Inventory Items available for sale",
"deleted_at": null,
"is_deleted": false,
"location_id": 3662,
"account_id": 117,
"created_at": "2021-03-26T10:41:18.000Z",
"updated_at": "2021-03-26T10:41:18.000Z"
}
}
Product ¶
- Attributes
- id (string) - The product ID.
- name (string)
- sell_price (number) - An Integer representing the sell price in cents.
- collect_excise_tax (boolean) - Indicates whether this item is reported to the state.
- quantity (number) - Quantity left on hand.
- pricing_type (number) - An Enum indicating how this product is priced. The valid options are:
- 0: Priced by unit
- 1: Priced by gram
- product_type_id (string)
- brand_id (string)
- strain_id (string)
- vendor (string)
- active (boolean) - A boolean indicating whether this product is active.
- latest_sku (string) - A string representing the last sku attached to this product.
- category_id (string)
- tags (array)
- description (string) - A string description of the product.
- internal_notes (string) - A string for internal notes. This value is never displayed to the customer.
- metadata (json) - A JSON field that you can use to store metadata about the product.
- weight (weight) - The weight of the product, to be used for compliance validation and display.
- value (string)
- unit (number) - An Enum indicating the weight unit. The valid options are:
- 0: Gram
- 1: Ounce
- test_results_thc (string) - THC percentage (10% being represented at 0.10) of this product.
- test_results_cbd (string) - CBD percentage (10% being represented at 0.10) of this product.
- flower_type (number) - An Enum indicating the product’s flower type. The valid options are:
- 0: Indica
- 1: Sativa
- 2: Hybrid
- 3: Indica Hybrid
- 4: Sativa Hybrid
- concentrate_type (number) - An Enum indicating the product’s concentrate type. The valid options are:
- 0: Wax
- 1: Shatter
- 2: Live Resin
- 3: Rosin
- 4: Hash
- 5: Cartridges
- 6: Tankers
- 7: Kief
- 8: RSO
- 9: Oil
- 10: Distillate
Product ¶
View a Product's DetailGET/products/{product_id}
Example URI
- product_id
string
(required)ID of the product
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"product": {
"id": "4678c18a-5a5f-49a2-90ad-1908312e6235",
"active": false,
"category_id": "0c006283-1cf1-4531-89cb-c0e64c7260e9",
"collect_excise_tax": true,
"id": "7f5b9dc6-962b-45d7-a749-fb1462096bad",
"latest_sku": "3156156207772758",
"name": "Girl Scout Cookies 3.5g",
"pricing_type": 0,
"product_type_id": "24516e82-e9d6-4695-890f-fa8b312b4163",
"quantity": 10,
"sell_price": 2500,
"vendor": "Blewett Pass Farms",
"brand_id": "bbd87743-73df-42d9-80b2-df1b6a645a2c",
"strain_id": "6fe59013-8b12-41a5-8a69-aa80896cad45",
"weight": "3.5",
"tags": ['expiring', 'on sale'],
"description": "Girl Scout Cookies, or GSC, is an OG Kush and Durban Poison hybrid cross whose reputation grew too large to stay within the borders of its California homeland",
"internal_notes": "3/7/15: We need to order more of these. -AK",
"test_results_thc": "0.1",
"test_results_cbd": "0.003",
"flower_type": 3,
"metadata": {
"external_id": "5"
}
}
}
Products Collection ¶
List All ProductsGET/products{?limit}{?offset}{?active}{?by_active}{?mj}{?para}{?by_name}{?by_vendor}{?by_category}{?by_sku}{?by_lot_number}{?by_product_type}{?by_brand}{?by_strain}{?by_discountable}
Example URI
- limit
number
(optional) Example: 10The maximum number of products to return.
- offset
number
(optional) Example: 0The number of products to skip before returning products.
- active
boolean
(optional) Example: trueOnly return active products. DEPRECATED
- by_active
boolean
(optional) Example: trueReturns products in the provided active state.
- mj
boolean
(optional) Example: trueOnly return products that are reported with the state.
- para
boolean
(optional) Example: falseOnly return products that are not reported with the state.
- by_discountable
boolean
(optional) Example: trueReturns products that can or cannot be discounted.
- by_name
string
(optional) Example: Bubba Kush, 1gFilter results by products matching this name.
- by_vendor
string
(optional) Example: BMFFilter results by products matching this vendor name.
- by_category
string
(optional) Example: 077dd560-0619-4559-8615-bde755c5a0f5Filter results by products matching this category ID.
- by_sku
string
(optional) Example: 1234Filter results by products that contain inventory items matching this SKU.
- by_lot_number
string
(optional) Example: 1234123412341234Filter results by products that contain inventory items matching this lot number.
- by_product_type
string
(optional) Example: 98f1bf43-4422-4f61-9ba9-5796e7a62edfFilter results by products matching this product type ID.
- by_brand
string
(optional) Example: AfgooFilter results by products that matching this brand name.
- by_strain
string
(optional) Example: Jack HererFilter results by products that matching this strain name.
- sort_by[field]
string
(optional) Example: vendorSorts results by the field specified.
Choices:
name
product_type
quantity
sell_price
vendor
- sort_by[direction]
string
(optional) Default: asc Example: descTakes the sorted results and arranges them in the specified direction.
This is only applied when the
sort_by[field]
params is provided.Choices:
asc
desc
- by_quantity[quantity]
string
(optional) Example: 0Filter results by products matching this quantity.
There are three options for this value:
-
Single number:
0
Filter results by comparing to a single value. -
Range:
0,10
Filter results by quantity included in this range. You must use thebetween
comparator in theby_quantity[comparator]
parameter. -
List:
0,10,20
Filter results by quantity that matches a number in this list. You must use thein
comparator in theby_quantity[comparator]
parameter.
In any case, you are required to specify the comparator in the
by_quantity[comparator]
parameter.-
- by_quantity[comparator]
string
(optional) Example: <Specifies the comparator to use when filtering by quantity.
Choices:
<
<=
=
>=
>
between
in
- by_sell_price[sell_price]
string
(optional) Example: 2000Filter results by products matching this sell price.
There are three options for this value:
-
Single price:
1000
Filter results by comparing to a single price. -
Range:
1000,2000
Filter results by sell price included in this range. You must use thebetween
comparator in theby_sell_price[comparator]
parameter. -
List:
0,1000,2000
Filter results by sell price that matches a price in this list. You must use thein
comparator in theby_sell_price[comparator]
parameter.
In any case, you are required to specify the comparator in the
by_sell_price[comparator]
parameter.-
- by_sell_price[comparator]
string
(optional) Example: <Specifies the comparator to use when filtering by sell price.
Choices:
<
<=
=
>=
>
between
in
- by_test_results_thc[test_results_thc]
string
(optional) Example: 0.1Filter results by products matching this THC test result.
There are three options for this value:
-
Single price:
0.1
Filter results by comparing to a single percentage. -
Range:
0.1,0.2
Filter results by test results included in this range. You must use thebetween
comparator in theby_test_results_thc[comparator]
parameter. -
List:
0,0.1,0.2
Filter results by test results that matches a price in this list. You must use thein
comparator in theby_test_results_thc[comparator]
parameter.
In any case, you are required to specify the comparator in the
by_test_results_thc[comparator]
parameter.-
- by_test_results_thc[comparator]
string
(optional) Example: <Specifies the comparator to use when filtering by THC test results.
Choices:
<
<=
=
>=
>
between
in
- by_test_results_cbd[test_results_cbd]
string
(optional) Example: 0.1Filter results by products matching this CBD test result.
There are three options for this value:
-
Single price:
0.1
Filter results by comparing to a single percentage. -
Range:
0.1,0.2
Filter results by test results included in this range. You must use thebetween
comparator in theby_test_results_cbd[comparator]
parameter. -
List:
0,0.1,0.2
Filter results by test results that matches a price in this list. You must use thein
comparator in theby_test_results_cbd[comparator]
parameter.
In any case, you are required to specify the comparator in the
by_test_results_cbd[comparator]
parameter.-
- by_test_results_cbd[comparator]
string
(optional) Example: <Specifies the comparator to use when filtering by CBD test results.
Choices:
<
<=
=
>=
>
between
in
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"products": [
{
"id": "4678c18a-5a5f-49a2-90ad-1908312e6235",
"active": false,
"category_id": "0c006283-1cf1-4531-89cb-c0e64c7260e9",
"collect_excise_tax": true,
"id": "7f5b9dc6-962b-45d7-a749-fb1462096bad",
"latest_sku": "3156156207772758",
"name": "Girl Scout Cookies 3.5g",
"pricing_type": 0,
"product_type_id": "24516e82-e9d6-4695-890f-fa8b312b4163",
"brand_id": "28ac6528-7c0d-48fc-a033-c403d636086f",
"strain_id": "6fe59013-8b12-41a5-8a69-aa80896cad45",
"quantity": 10,
"sell_price": 2500,
"vendor": "Blewett Pass Farms",
"weight": "3.5",
"tags": ['expiring', 'on sale'],
"description": "Girl Scout Cookies, or GSC, is an OG Kush and Durban Poison hybrid cross whose reputation grew too large to stay within the borders of its California homeland",
"internal_notes": "3/7/15: We need to order more of these. -AK",
"test_results_thc": "0.1",
"test_results_cbd": "0.003",
"flower_type": 3,
"metadata": {
"external_id": "5"
}
}
],
"meta": {
"total": 1
}
}
Product Type ¶
- Attributes
- id (string)
- name (string)
- traceability_type (number) - An Enum indicating the corresponding traceability type. The valid options are:
- 0: Other
- 1: Usable Marijuana
- 2: Solid Marijuana Infused Edible
- 3: Liquid Marijuana Infused Edible
- 4: Marijuana Extract for Inhalation
- 5: Marijuana Infused Topicals
- 6: Sample
- can_edit_weight (boolean) - Whether or not to track weight for products of this type.
- can_edit_strain (boolean) - Whether or not to track strain for products of this type.
- can_edit_test_results (boolean) - Whether or not to track test results for products of this type.
- can_edit_flower_type (boolean) - Whether or not to track flower type for products of this type.
- can_edit_concentrate_type (boolean) - Whether or not to track concentrate type for products of this type.
- is_marijuana (boolean) - Whether or not this product type is marijuana.
- tax_item_ids (array) - The tax items that apply to this product type.
- default (boolean) - Whether or not this is the default product type. The default type cannot be edited.
- test_results_unit (number) - An Enum indicating the corresponding test result unit type. The valid options are:
- 0: Percent
- 1: Milligrams
Product Types Collection ¶
Product Types CollectionGET/product_types
Example URI
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"product_types": [
{
"id": "bbd87743-73df-42d9-80b2-df1b6a645a2c",
"name": "Flower",
"traceability_type": 1,
"can_edit_weight": true,
"can_edit_strain": true,
"can_edit_test_results": true,
"can_edit_flower_type": true,
"can_edit_concentrate_type": false,
"is_marijuana": true,
"tax_item_ids": ["31a6f2ac-ba33-4b3e-ac96-df3fbe0b35ad"],
"default": false,
"test_results_unit": 0,
}
]
}
Brand ¶
- Attributes
- id (string)
- name (string)
Brands Collection ¶
Brands CollectionGET/brands{?limit}{?offset}{?by_name}
Example URI
- limit
number
(optional) Example: 10The maximum number of brands to return.
- offset
number
(optional) Example: 0The number of brands to skip before returning brands.
- by_name
string
(optional) Example: AfgooReturn Brands that contain this string in their name.
- sort_by[field]
string
(optional) Example: nameSorts results by the field specified.
Choices:
name
- sort_by[direction]
string
(optional) Default: asc Example: descTakes the sorted results and arranges them in the specified direction.
This is only applied when the
sort_by[field]
params is provided.Choices:
asc
desc
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"brands": [
{
"id": "bbd87743-73df-42d9-80b2-df1b6a645a2c",
"name": "Afgoo",
}
],
"meta": {
"total": 1
}
}
Create BrandPOST/brands
Example URI
Headers
Content-Type: application/json
Authorization: Token token="{your_token}"
Body
{
"brand": {
"id": "bbd87743-73df-42d9-80b2-df1b6a645a2c"
"name": "Afgoo",
}
}
201
Headers
Content-Type: application/json
Body
{
"brand": {
"id": "bbd87743-73df-42d9-80b2-df1b6a645a2c"
"name": "Afgoo",
}
}
Brand Item ¶
Show BrandGET/brands/{id}
Example URI
- id
string
(required) Example: bbd87743-73df-42d9-80b2-df1b6a645a2cThe ID of the brand to show.
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"brand": {
"id": "bbd87743-73df-42d9-80b2-df1b6a645a2c"
"name": "Afgoo",
}
}
Update BrandPUT/brands/{id}
Example URI
- id
string
(required) Example: bbd87743-73df-42d9-80b2-df1b6a645a2cThe ID of the brand to show.
Headers
Content-Type: application/json
Authorization: Token token="{your_token}"
Body
{
"brand": {
"id": "bbd87743-73df-42d9-80b2-df1b6a645a2c"
"name": "Afgoo",
}
}
204
Strain ¶
- Attributes
- id (string)
- name (string)
Strains Collection ¶
Strains CollectionGET/strains{?limit}{?offset}{?by_name}
Example URI
- limit
number
(optional) Example: 10The maximum number of strains to return.
- offset
number
(optional) Example: 0The number of strains to skip before returning strains.
- by_name
string
(optional) Example: Jack HererReturn Strains that contain this string in their name.
- sort_by[field]
string
(optional) Example: nameSorts results by the field specified.
Choices:
name
- sort_by[direction]
string
(optional) Default: asc Example: descTakes the sorted results and arranges them in the specified direction.
This is only applied when the
sort_by[field]
params is provided.Choices:
asc
desc
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"strains": [
{
"id": "bbd87743-73df-42d9-80b2-df1b6a645a2c",
"name": "Jack Herer"
}
],
"meta": {
"total": 1
}
}
Create StrainPOST/strains
Example URI
Headers
Content-Type: application/json
Authorization: Token token="{your_token}"
Body
{
"strain": {
"id": "bbd87743-73df-42d9-80b2-df1b6a645a2c"
"name": "Jack Herer"
}
}
201
Headers
Content-Type: application/json
Body
{
"strain": {
"id": "bbd87743-73df-42d9-80b2-df1b6a645a2c"
"name": "Jack Herer"
}
}
Strain Item ¶
Show StrainGET/strains/{id}
Example URI
- id
string
(required) Example: bbd87743-73df-42d9-80b2-df1b6a645a2cThe ID of the strain to show.
Headers
Authorization: Token token="{your_token}"
200
Headers
Content-Type: application/json
Body
{
"strain": {
"id": "bbd87743-73df-42d9-80b2-df1b6a645a2c"
"name": "Jack Herer"
}
}
Update StrainPUT/strains/{id}
Example URI
- id
string
(required) Example: bbd87743-73df-42d9-80b2-df1b6a645a2cThe ID of the strain to show.
Headers
Content-Type: application/json
Authorization: Token token="{your_token}"
Body
{
"strain": {
"id": "bbd87743-73df-42d9-80b2-df1b6a645a2c"
"name": "Afgoo"
}
}
204