{
  "openapi": "3.1.0",
  "info": {
    "title": "Let’s Dough It Product API",
    "version": "1.0.0",
    "description": "Lees openbare productinformatie uit de Shopify-webshop. Zoek het product in https://letsdoughit.nl/collections/all of via de productsitemaps in https://letsdoughit.nl/sitemap.xml. Gebruik de handle uit de gevonden productpagina."
  },
  "servers": [
    {
      "url": "https://letsdoughit.nl"
    }
  ],
  "paths": {
    "/products/{handle}.js": {
      "get": {
        "operationId": "getProductByHandle",
        "summary": "Vraag een product op",
        "description": "Gebruik de handle uit de productlink om de naam, varianten en beschikbaarheid op te vragen. Prijzen worden weergegeven in de kleinste prijseenheid volgens de Shopify Ajax API.",
        "security": [],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "description": "Het gedeelte na /products/ in de productlink.",
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "vegan-speculoos-cookie-dough"
          }
        ],
        "responses": {
          "200": {
            "description": "Openbaar product en de bijbehorende varianten.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "title": {
                      "type": "string"
                    },
                    "handle": {
                      "type": "string"
                    },
                    "available": {
                      "type": "boolean"
                    },
                    "variants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "title": {
                            "type": "string"
                          },
                          "available": {
                            "type": "boolean"
                          },
                          "price": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "url": {
                      "type": "string",
                      "format": "uri-reference",
                      "description": "Relatief pad naar de productpagina voor de klant. Combineer met de winkel-URL.",
                      "example": "/products/vegan-speculoos-cookie-dough"
                    }
                  },
                  "required": [
                    "handle",
                    "title",
                    "variants"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Product niet gevonden. Het antwoord kan leeg zijn. Controleer eerst de HTTP-status voordat je JSON leest. Zoek de actuele productlink via /collections/all."
          }
        }
      }
    }
  }
}
