{
  "openapi": "3.1.0",
  "info": {
    "title": "ImpleoTV Product Catalog API",
    "version": "1.0.0",
    "description": "Search ImpleoTV software licenses and options and retrieve public product details. Both operations are read-only and require no credentials. Responses may include additional WooCommerce Store API fields."
  },
  "servers": [
    {
      "url": "https://impleotv.com/wp-json/wc/store/v1"
    }
  ],
  "externalDocs": {
    "url": "https://impleotv.com/developers/"
  },
  "security": [],
  "paths": {
    "/products": {
      "get": {
        "operationId": "listCatalogProducts",
        "summary": "List or search published products",
        "description": "Use search to find licenses and options. A search with no matches returns an empty array. Use the returned ID for product details.",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "description": "Search the public product catalog.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "StView"
          },
          {
            "name": "page",
            "in": "query",
            "description": "One-based page number.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "Results per page.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching products.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Product"
                  }
                }
              }
            },
            "headers": {
              "X-WP-Total": {
                "description": "Total matching products.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-WP-TotalPages": {
                "description": "Number of pages for this query and page size.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "rest_invalid_param",
                  "message": "Invalid parameter(s): per_page",
                  "data": {
                    "status": 400
                  }
                }
              }
            }
          }
        }
      }
    },
    "/products/{id}": {
      "get": {
        "operationId": "getCatalogProduct",
        "summary": "Get a published product by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID returned by the product collection.",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "example": 3207
          }
        ],
        "responses": {
          "200": {
            "description": "Public product details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                },
                "example": {
                  "id": 3207,
                  "name": "StView — Licenses &#038; Options",
                  "type": "grouped",
                  "permalink": "https://impleotv.com/product/stview-licenses-options/",
                  "prices": {
                    "price": "9900",
                    "regular_price": "9900",
                    "sale_price": "9900",
                    "price_range": {
                      "min_amount": "9900",
                      "max_amount": "39900"
                    },
                    "currency_code": "EUR",
                    "currency_symbol": "€",
                    "currency_minor_unit": 2,
                    "currency_decimal_separator": ".",
                    "currency_thousand_separator": ",",
                    "currency_prefix": "€",
                    "currency_suffix": ""
                  }
                }
              }
            }
          },
          "404": {
            "description": "The product ID does not identify a public product.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "woocommerce_rest_product_invalid_id",
                  "message": "Invalid product ID.",
                  "data": {
                    "status": 404
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "description": "Display name; may contain HTML entities."
          },
          "slug": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Product type, such as simple or grouped."
          },
          "permalink": {
            "type": "string",
            "format": "uri"
          },
          "short_description": {
            "type": "string",
            "description": "May contain HTML."
          },
          "description": {
            "type": "string",
            "description": "May contain HTML."
          },
          "sku": {
            "type": "string"
          },
          "prices": {
            "$ref": "#/components/schemas/Prices"
          },
          "is_in_stock": {
            "type": "boolean"
          },
          "is_purchasable": {
            "type": "boolean"
          },
          "grouped_products": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Child product IDs for a grouped product."
          }
        },
        "required": [
          "id",
          "name",
          "permalink",
          "prices"
        ]
      },
      "Prices": {
        "type": "object",
        "properties": {
          "price": {
            "type": "string",
            "description": "Amount in the smallest unit of the currency, encoded as a decimal string."
          },
          "regular_price": {
            "type": "string",
            "description": "Amount in the smallest unit of the currency, encoded as a decimal string."
          },
          "sale_price": {
            "type": "string",
            "description": "Amount in the smallest unit of the currency, encoded as a decimal string."
          },
          "currency_code": {
            "type": "string",
            "description": "ISO currency code."
          },
          "currency_minor_unit": {
            "type": "integer",
            "minimum": 0
          },
          "price_range": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "min_amount": {
                "type": "string",
                "description": "Amount in the smallest unit of the currency, encoded as a decimal string."
              },
              "max_amount": {
                "type": "string",
                "description": "Amount in the smallest unit of the currency, encoded as a decimal string."
              }
            }
          }
        },
        "required": [
          "price",
          "currency_code",
          "currency_minor_unit"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "status": {
                "type": "integer"
              }
            },
            "required": [
              "status"
            ]
          }
        },
        "required": [
          "code",
          "message",
          "data"
        ]
      }
    }
  }
}
