{
  "openapi": "3.1.1",
  "info": {
    "title": "Stockisto Public API",
    "description": "Programmatic access to Stockisto. Authenticate with a tenant API key (created on the Developers page) via the X-API-Key header or \"Authorization: Bearer sk_…\". List endpoints use cursor pagination: ?limit= (default 50, max 200) and the opaque ?cursor= from the previous page's nextCursor. Errors are application/problem+json; 402 (plan upgrade required) and 429 (rate limit / monthly quota) carry documented JSON extension shapes.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://stockisto-test-api.azurewebsites.net/"
    }
  ],
  "paths": {
    "/api/public/v1/leads": {
      "get": {
        "tags": [
          "PublicLeads"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/public/v1/analytics/funnel": {
      "get": {
        "tags": [
          "PublicAnalytics"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/public/v1/analytics/attribution": {
      "get": {
        "tags": [
          "PublicAnalytics"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/public/v1/imports": {
      "post": {
        "tags": [
          "PublicImports"
        ],
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "NDJSON market-data bundle.",
          "content": {
            "application/x-ndjson": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Import accepted; poll the returned statusUrl."
          }
        }
      }
    },
    "/api/public/v1/imports/{importId}": {
      "get": {
        "tags": [
          "PublicImports"
        ],
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/public/v1/ping": {
      "get": {
        "tags": [
          "PublicApiPing"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/public/v1/intake/batches": {
      "post": {
        "tags": [
          "PublicIntake"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestionBatchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestionBatchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IngestionBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "get": {
        "tags": [
          "PublicIntake"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/public/v1/intake/batches/{id}": {
      "get": {
        "tags": [
          "PublicIntake"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/public/v1/locations": {
      "get": {
        "tags": [
          "PublicLocations"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/public/v1/retailers": {
      "get": {
        "tags": [
          "PublicRetailers"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/public/v1/stock": {
      "get": {
        "tags": [
          "PublicStock"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/public/v1/stock/{stockId}": {
      "patch": {
        "tags": [
          "PublicStockWrite"
        ],
        "parameters": [
          {
            "name": "stockId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicStockPatchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicStockPatchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublicStockPatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/public/v1/stock:batch": {
      "post": {
        "tags": [
          "PublicStockWrite"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicStockBatchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicStockBatchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublicStockBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "IngestionBatchRequest": {
        "type": "object",
        "properties": {
          "contractVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "idempotencyKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "metadata": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IngestionRecordRequest"
            }
          }
        }
      },
      "IngestionProvenanceRequest": {
        "type": "object",
        "properties": {
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "fetchedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "confidence": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "sourceRef": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "IngestionRecordRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": [
              "null",
              "string"
            ]
          },
          "naturalKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "payload": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "provenance": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IngestionProvenanceRequest"
              }
            ]
          }
        }
      },
      "JsonElement": { },
      "PublicStockBatchRequest": {
        "required": [
          "rows"
        ],
        "type": "object",
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicStockBatchRowRequest"
            }
          }
        }
      },
      "PublicStockBatchRowRequest": {
        "required": [
          "locationId",
          "skuId"
        ],
        "type": "object",
        "properties": {
          "locationId": {
            "type": "string",
            "format": "uuid"
          },
          "skuId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "isOnDisplayInShowroom": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "retailPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "priceCurrency": {
            "type": [
              "null",
              "string"
            ]
          },
          "promoText": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PublicStockPatchRequest": {
        "type": "object",
        "properties": {
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "isOnDisplayInShowroom": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "retailPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "priceCurrency": {
            "type": [
              "null",
              "string"
            ]
          },
          "promoText": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "description": "Tenant API key. Send as X-API-Key: sk_…; Authorization: Bearer sk_… is also accepted.",
        "name": "X-API-Key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": [ ]
    }
  ],
  "tags": [
    {
      "name": "PublicLeads"
    },
    {
      "name": "PublicAnalytics"
    },
    {
      "name": "PublicImports"
    },
    {
      "name": "PublicApiPing"
    },
    {
      "name": "PublicIntake"
    },
    {
      "name": "PublicLocations"
    },
    {
      "name": "PublicRetailers"
    },
    {
      "name": "PublicStock"
    },
    {
      "name": "PublicStockWrite"
    }
  ]
}