Variant Attribute

Information

The variant_attributes resource type is used to describe the way in which variant_values can be grouped together.

For example, customers/patients can browse different amounts of flower for purchase (gram, eighth, ounce, and so forth). Collectively, those weight amounts — or weight breakpoints — are an example of a variant_attribute. An organization is able to define its own custom variant_attributes which can be displayed alongside the variant_attributes defined by Weedmaps.

The weight breakpoints defined by Weedmaps are as follows:

  • 0.5 g
  • 1 g
  • 2 g
  • 1/8
  • 1/4
  • 1/2
  • 3/4
  • Ounce
  • 4g 1/8
  • CUSTOM

Below are variant_attribute examples:

  • Big Green Brand > 420 Shirt > Size > Large
  • Big Green Brand > Delicious Hybrid Flower > Weight Breakpoint > ⅛
    • In this example, Category Tags are used to indicate whether the product is a concentrate or flower.

API Requests

The request types and routes available for this resource as well as details on how to structure your requests are below. See API Reference - VariantAttribute for examples on how the requests might look in various languages and to test the requests in the browser.

RequestRouteDescription
POST/catalog/v1/variant_attributesCreate a new variant_attribute
GET/catalog/v1/variant_attributesRequest the information for all variant_attributes
GET/catalog/v1/variant_attributes/:idRequest the information for a particular variant_attribute
DELETE/catalog/v1/variant_attributes/:idDelete an existing variant_attribute

POST

To create a VariantAttribute, send a payload with the below structure to
/catalog/v1/variant_attributes?scope_by[organization_id]=ORGANIZATION_ID.

{
  "data": {
    "type":"variant_attributes",
    "attributes": {
      "name": "Size"
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "ORGANIZATION_ID"
          }
      }
    }
  }
}

Path

scope_by[organization_id] string
Required. Organization UUID.

Attributes

id string
Optional. UUID for the resource.


name string
Required. The name of the VariantAttribute.


type string
Required. Must be variant_attributes.

Relationships

Organization

organization_id string
Required. Related Organization UUID.


type string
Required. Must be organizations.

GET Index

To fetch all VariantAttributes, send a request to
/catalog/v1/variant_attributes?scope_by[organization_id]=ORGANIZATION_ID. By default, we only return the first 10 results from the request. You can adjust the number of returned results with page[size], or adjust the returned page with page[page].

Path

scope_by[organization_id] string
Required. Organization UUID.


page[size] int32
Optional. Number of elements per page.


page[page] int32
Optional. Number of the page.


filter[name] string
Optional. Filters by VariantAttribute name.


filter[organization_id] string
Optional. Filters by Organization UUID.


include string
Optional. Related resources to include in response. Currently only variant_values supported.

GET Show

To fetch a VariantAttribute, send a request to
/catalog/v1/variant_attributes/VARIANT_ATTRIBUTE_ID?scope_by[organization_id]=ORGANIZATION_ID.

Path

scope_by[organization_id] string
Required. Organization UUID.


variant_attribute_id string
Required. VariantAttribute UUID you want to fetch.

DELETE

To delete a VariantAttribute, send a request to
/catalog/v1/variant_attributes/VARIANT_ATTRIBUTE_ID?scope_by[organization_id]=ORGANIZATION_ID.

Path

scope_by[organization_id] string
Required. Organization UUID.


variant_attribute_id string
Required. VariantAttribute UUID you want to delete.