{
  "openapi":"3.1.1",
  "info":{"title":"Catalog Mobile public webhook read API","version":"2026-09-05","description":"A partial reference for existing, read-only webhook operations. Derived from the public webhook documentation and the corresponding route/controller implementation. Write operations remain documented in the linked technical reference and are intentionally outside this read contract. Never infer a universal integration or function-calling compatibility claim from this document. Requests require authorisation from the integration owner. Production reads with deliberately nonexistent identifiers verified the documented error paths; authenticated successful product and order retrieval was not exercised in this site review."},
  "servers":[{"url":"https://sistema.catalogomobile.com.br/api/v2/integracao/webhook","description":"Existing public integration API"}],
  "externalDocs":{"url":"https://sistema.catalogomobile.com.br/api/v2/integracao/webhook/documentation.md","description":"Existing complete webhook guide, including writes and batch limits"},
  "tags":[{"name":"Reference","description":"Public documentation"},{"name":"Read operations","description":"Existing integration reads. Do not enumerate other accounts or request identifiers."}],
  "paths":{
    "/documentation.md":{"get":{"operationId":"getWebhookDocumentation","tags":["Reference"],"summary":"Read the existing webhook guide","description":"Returns the published Portuguese Markdown guide. No integration token is required. If the reference is unavailable the application returns a JSON error.","security":[],"responses":{"200":{"description":"Published Markdown guide","content":{"text/markdown":{"schema":{"type":"string"}}}},"404":{"description":"The documentation file is unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},
    "/status/{requestId}/":{"get":{"operationId":"getWebhookRequestStatus","tags":["Read operations"],"summary":"Read the processing status of a known request","description":"Use only a request_id returned by a request your integration is authorised to track. This existing route performs no bearer-token check in its controller; knowledge of a request identifier is not permission to inspect someone else's operation. Do not enumerate identifiers. A 202 acceptance from a write is not completion.","security":[],"parameters":[{"name":"requestId","in":"path","required":true,"description":"The opaque request_id returned by the authorised operation. Preserve it exactly.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Current processing record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestStatus"}}}},"404":{"description":"No record matches this request identifier","content":{"application/json":{"schema":{"type":"object","required":["request_id","status","message"],"properties":{"request_id":{"type":"string"},"status":{"type":"string","const":"not_found"},"message":{"type":"string"}}}}}}}}},
    "/detalharProduto/{integrationCode}/{field}/{value}/":{"get":{"operationId":"getIntegrationProduct","tags":["Read operations"],"summary":"Read one product using an authorised integration","description":"Requires an active integration, an unexpired company account and the integration's bearer token. Unknown or inactive integrations are checked before token validation and return 400, not necessarily 401. The English alias detailProduct is also supported by the existing API; this contract lists only the canonical Portuguese route.","security":[{"integrationBearer":[]}],"parameters":[{"$ref":"#/components/parameters/IntegrationCode"},{"name":"field","in":"path","required":true,"description":"Lookup field. skuMapeamento and idMapeamento values must contain digits only; code must be nonempty.","schema":{"type":"string","enum":["skuMapeamento","idMapeamento","code"]}},{"name":"value","in":"path","required":true,"description":"Product identifier for the selected field. Never guess identifiers belonging to another company.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Product response from the application's product representation, including configuration-dependent fields. This partial contract intentionally leaves those additional fields open; it does not assert a strict product model.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/InvalidIntegration"},"401":{"$ref":"#/components/responses/InvalidToken"},"404":{"$ref":"#/components/responses/ProductNotFound"},"500":{"description":"An application error, including an integration company without a usable user context. The application can return the webhook error array.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookErrors"}}}}}}},
    "/listarPedidos/{integrationCode}/":{"get":{"operationId":"listIntegrationOrders","tags":["Read operations"],"summary":"Read orders grouped by cart","description":"Requires an active integration, an unexpired company account and its bearer token. The optional date is interpreted in the application's configured timezone. If omitted, it defaults to today. The selected day must be today or within the previous seven days. Returns orders from the start of that day through today, grouped by cart. The English listOrders alias and date query alias are supported by the existing API; only one canonical form is listed here.","security":[{"integrationBearer":[]}],"parameters":[{"$ref":"#/components/parameters/IntegrationCode"},{"name":"data","in":"query","required":false,"description":"Start date in YYYY-MM-DD, today or at most seven days earlier. Future dates are invalid.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Orders grouped by cart, or an empty data array. Order fields vary with the existing transformer and configuration; this partial schema intentionally preserves additional fields.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"$ref":"#/components/responses/InvalidIntegration"},"401":{"$ref":"#/components/responses/InvalidToken"},"429":{"description":"Order lookup rate limit exceeded. Respect the server's Retry-After header when returned; do not retry in a tight loop.","headers":{"Retry-After":{"description":"Delay before retrying, as returned by the server.","schema":{"type":"string"}}}}}}}
  },
  "components":{
    "securitySchemes":{"integrationBearer":{"type":"http","scheme":"bearer","description":"The integration token configured for the authorised company. This is not documented as a JWT; preserve the token exactly and keep it secret."}},
    "parameters":{"IntegrationCode":{"name":"integrationCode","in":"path","required":true,"description":"The code shown in the authorised integration's configuration, not a product ID. Keep it separate from the integration bearer token.","schema":{"type":"string","minLength":1}}},
    "schemas":{
      "WebhookErrors":{"type":"array","description":"The existing webhook read error format; it is not a universal error envelope for every platform API.","items":{"type":"object","required":["error","client_ip"],"properties":{"error":{"type":"string"},"client_ip":{"type":"string","description":"Caller IP reported by the existing handler."}},"additionalProperties":true}},
      "RequestStatus":{"type":"object","required":["request_id","status","integration_code","company_id","action","queue","attempts","received_at","started_at","finished_at","error_message","duplicate","duplicate_of_request_id","result"],"properties":{"request_id":{"type":"string"},"status":{"type":"string","description":"Current server status. This schema deliberately does not freeze an incomplete enum."},"integration_code":{"type":"string"},"company_id":{"type":["integer","null"]},"action":{"type":"string"},"queue":{"type":"string"},"attempts":{"type":"integer"},"received_at":{"type":["string","null"],"format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"error_message":{"type":["string","null"]},"duplicate":{"type":"boolean"},"duplicate_of_request_id":{"type":["string","null"]},"result":{"type":["object","array","null"],"description":"The operation's existing result payload, not a universal data model."}}}
    },
    "responses":{
      "InvalidIntegration":{"description":"Integration missing/inactive, expired account, invalid lookup field or value, or invalid date for an order query. The exact applicable condition depends on the operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookErrors"}}}},
      "InvalidToken":{"description":"Integration bearer token missing or invalid after integration checks pass.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookErrors"}}}},
      "ProductNotFound":{"description":"No product matches the authorised lookup.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookErrors"}}}}
    }
  }
}
