{
  "openapi": "3.1.0",
  "info": {
    "title": "fish.bg public catalogue API",
    "version": "1.0.0",
    "description": "Read-only public catalogue of fish.bg (fishing tackle). Backed by the WooCommerce Store API, which is reachable without authentication. Write operations (cart, checkout, orders) exist on this host but require a human browser session and are intentionally NOT described here.",
    "contact": {
      "url": "https://fish.bg/"
    }
  },
  "servers": [
    {
      "url": "https://fish.bg/wp-json/wc/store/v1"
    }
  ],
  "x-service-info": {
    "categories": [
      "retail",
      "sporting-goods",
      "fishing-tackle"
    ],
    "description": "Online fishing tackle shop, catalogue of.",
    "language": [
      "bg"
    ],
    "authentication": {
      "public_read": true,
      "description": "Няма. Всички описани тук операции са публични и не приемат нито токен, нито ключ."
    }
  },
  "paths": {
    "/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "List catalogue products",
        "description": "Public, unauthenticated. Returns paginated products. Total count is in the X-WP-Total response header.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Category id or comma-separated ids."
          },
          {
            "name": "min_price",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_price",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stock_status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "instock",
                "outofstock",
                "onbackorder"
              ]
            }
          },
          {
            "name": "orderby",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "price",
                "popularity",
                "rating",
                "date",
                "title",
                "menu_order",
                "include"
              ]
            },
            "description": "Подредба на резултатите. Приемат се само изброените стойности. relevance и none връщат HTTP 400 със и без параметъра search."
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of products.",
            "headers": {
              "X-WP-Total": {
                "schema": {
                  "type": "integer"
                },
                "description": "Total matching products."
              },
              "X-WP-TotalPages": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Product"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/products/{id}": {
      "get": {
        "operationId": "getProduct",
        "summary": "Get one product by id",
        "description": "Public, unauthenticated.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One product.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "404": {
            "description": "No such product."
          }
        }
      }
    },
    "/products/categories": {
      "get": {
        "operationId": "listProductCategories",
        "summary": "List product categories",
        "description": "Public, unauthenticated.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 100,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of categories.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Term"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/products/brands": {
      "get": {
        "operationId": "listProductBrands",
        "summary": "List product brands",
        "description": "Public, unauthenticated. NOTE: this shop does not use the WooCommerce brands taxonomy - the endpoint exists but always returns an empty array. Brands are stored as the product attribute pa_marka; read them from /products/attributes/4/terms instead.",
        "responses": {
          "200": {
            "description": "Array of brands.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Term"
                  }
                }
              }
            }
          }
        },
        "deprecated": true
      }
    },
    "/products/attributes": {
      "get": {
        "operationId": "listProductAttributes",
        "summary": "List product attributes",
        "description": "Public, unauthenticated. Returns the five attributes this shop uses: pa_marka (Марка, id 4), pa_czvyat (Цвят, id 18), pa_vid-riba (Вид риба, id 6), pa_vid-ribolov (Вид риболов, id 5), pa_aromat (Аромат, id 23). Terms are read from /products/attributes/{id}/terms.",
        "responses": {
          "200": {
            "description": "Array of attributes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Term": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "permalink": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Product": {
        "type": "object",
        "description": "Subset of the WooCommerce Store API product object, limited to fields this endpoint really returns.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "permalink": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string"
          },
          "short_description": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "on_sale": {
            "type": "boolean"
          },
          "is_in_stock": {
            "type": "boolean"
          },
          "is_purchasable": {
            "type": "boolean"
          },
          "is_on_backorder": {
            "type": "boolean"
          },
          "low_stock_remaining": {
            "type": [
              "integer",
              "null"
            ]
          },
          "average_rating": {
            "type": "string"
          },
          "review_count": {
            "type": "integer"
          },
          "prices": {
            "type": "object",
            "properties": {
              "price": {
                "type": "string"
              },
              "regular_price": {
                "type": "string"
              },
              "sale_price": {
                "type": "string"
              },
              "currency_code": {
                "type": "string"
              },
              "currency_minor_unit": {
                "type": "integer"
              }
            }
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "src": {
                  "type": "string",
                  "format": "uri"
                },
                "alt": {
                  "type": "string"
                }
              }
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Term"
            }
          },
          "brands": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Term"
            }
          },
          "attributes": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}