xclade
Store APIProduct categories

Get a Product Category

Retrieve a product category by its ID. You can expand the product category's relations or select the fields that should be returned.

GET
/store/product-categories/{id}

Path Parameters

id*string

The product category's ID.

Query Parameters

fields?string

Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

include_ancestors_tree?boolean

Whether to retrieve the category's parent. If you enable this, add to the fields query parameter parent_category to set the parent of a category in this field. You can either pass *parent_category to retreieve the fields of all parent categories, or select specific fields to make the response size smaller. For example, fields=parent_category.id,parent_category.name.

include_descendants_tree?boolean

Whether to retrieve a list of child categories. If you enable this, add to the fields query parameter category_children to set the children of a category in this field. You can either pass *category_children to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example, fields=category_children.id,category_children.name.

Header Parameters

x-publishable-api-key*string

Publishable API Key created in the Medusa Admin.

Response Body

application/json

application/json

text/plain

application/json

application/json

application/json

application/json

curl -X GET "https://{tenant}.api.myxclade.com/store/product-categories/string" \  -H "x-publishable-api-key: string"
{
  "product_category": {
    "id": "string",
    "name": "string",
    "description": "string",
    "handle": "string",
    "rank": 0,
    "parent_category_id": "string",
    "parent_category": {},
    "category_children": [
      {}
    ],
    "metadata": {},
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "deleted_at": "2019-08-24T14:15:22Z",
    "products": [
      {
        "categories": [
          {}
        ],
        "type": {
          "id": "string",
          "metadata": {},
          "created_at": "2019-08-24T14:15:22Z",
          "updated_at": "2019-08-24T14:15:22Z",
          "deleted_at": "2019-08-24T14:15:22Z",
          "value": "string"
        },
        "length": 0,
        "title": "string",
        "status": "draft",
        "options": [
          {
            "id": "string",
            "title": "string",
            "product": {},
            "product_id": "string",
            "values": [
              {
                "id": "string",
                "value": "string",
                "option": {},
                "option_id": "string",
                "metadata": {},
                "created_at": "2019-08-24T14:15:22Z",
                "updated_at": "2019-08-24T14:15:22Z",
                "deleted_at": "2019-08-24T14:15:22Z"
              }
            ],
            "metadata": {},
            "created_at": "2019-08-24T14:15:22Z",
            "updated_at": "2019-08-24T14:15:22Z",
            "deleted_at": "2019-08-24T14:15:22Z"
          }
        ],
        "description": "string",
        "id": "string",
        "metadata": {},
        "created_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z",
        "variants": [
          {
            "options": [
              {
                "id": "string",
                "value": "string",
                "option": {},
                "option_id": "string",
                "metadata": {},
                "created_at": "2019-08-24T14:15:22Z",
                "updated_at": "2019-08-24T14:15:22Z",
                "deleted_at": "2019-08-24T14:15:22Z"
              }
            ],
            "product": {},
            "length": 0,
            "title": "string",
            "metadata": {},
            "id": "string",
            "width": 0,
            "weight": 0,
            "height": 0,
            "origin_country": "string",
            "hs_code": "string",
            "mid_code": "string",
            "material": "string",
            "created_at": "2019-08-24T14:15:22Z",
            "updated_at": "2019-08-24T14:15:22Z",
            "deleted_at": "2019-08-24T14:15:22Z",
            "product_id": "string",
            "sku": "string",
            "barcode": "string",
            "ean": "string",
            "upc": "string",
            "allow_backorder": true,
            "manage_inventory": true,
            "inventory_quantity": 0,
            "variant_rank": 0,
            "calculated_price": {
              "id": "string",
              "is_calculated_price_price_list": true,
              "is_calculated_price_tax_inclusive": true,
              "calculated_amount": 0,
              "calculated_amount_with_tax": 0,
              "calculated_amount_without_tax": 0,
              "is_original_price_price_list": true,
              "is_original_price_tax_inclusive": true,
              "original_amount": 0,
              "currency_code": "usd",
              "calculated_price": {},
              "original_price": {},
              "original_amount_with_tax": 0,
              "original_amount_without_tax": 0
            }
          }
        ],
        "handle": "string",
        "subtitle": "string",
        "is_giftcard": true,
        "thumbnail": "string",
        "width": 0,
        "weight": 0,
        "height": 0,
        "origin_country": "string",
        "hs_code": "string",
        "mid_code": "string",
        "material": "string",
        "collection": {
          "id": "string",
          "title": "string",
          "handle": "string",
          "created_at": "2019-08-24T14:15:22Z",
          "updated_at": "2019-08-24T14:15:22Z",
          "deleted_at": "2019-08-24T14:15:22Z",
          "products": [
            {}
          ],
          "metadata": {}
        },
        "collection_id": "string",
        "type_id": "string",
        "tags": [
          {
            "id": "string",
            "value": "string",
            "created_at": "2019-08-24T14:15:22Z",
            "updated_at": "2019-08-24T14:15:22Z",
            "deleted_at": "2019-08-24T14:15:22Z",
            "metadata": {}
          }
        ],
        "images": [
          {
            "id": "string",
            "url": "string",
            "created_at": "2019-08-24T14:15:22Z",
            "updated_at": "2019-08-24T14:15:22Z",
            "deleted_at": "2019-08-24T14:15:22Z",
            "metadata": {},
            "rank": 0
          }
        ],
        "discountable": true,
        "external_id": "string",
        "deleted_at": "2019-08-24T14:15:22Z"
      }
    ]
  }
}

{
  "message": "Discount must be set to dynamic",
  "type": "not_allowed"
}

"Unauthorized"
{
  "message": "Entity with id 1 was not found",
  "type": "not_found"
}
{
  "code": "unknown_error",
  "message": "The request conflicted with another request. You may retry the request with the provided Idempotency-Key.",
  "type": "QueryRunnerAlreadyReleasedError"
}
{
  "code": "invalid_request_error",
  "message": "Discount with code TEST already exists.",
  "type": "duplicate_error"
}

{
  "code": "api_error",
  "message": "An error occured while hashing password",
  "type": "database_error"
}