{"openapi":"3.0.3","info":{"title":"API pública do Illo","version":"1.0.0","description":"REST com JSON. Autentique com `Authorization: Bearer <token>` (crie em Configurações → API e tokens). Dinheiro em centavos, datas ISO, limite de 120 chamadas por minuto por token."},"servers":[{"url":"https://demo.useillo.com.br/api/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"schemas":{"Contacts":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"personType":{"type":"string","enum":["pj","pf"],"description":"Tipo de pessoa"},"document":{"type":"string","description":"CPF / CNPJ"},"name":{"type":"string","description":"Nome / Razão social"},"tradeName":{"type":"string","description":"Nome fantasia"},"stateRegistration":{"type":"string","description":"Inscrição estadual"},"icmsIndicator":{"type":"string","enum":["contribuinte","isento","nao_contribuinte"],"description":"Indicador de IE"},"email":{"type":"string","format":"email","description":"E-mail"},"phone":{"type":"string","description":"Telefone"},"isCustomer":{"type":"boolean","description":"Cliente"},"isSupplier":{"type":"boolean","description":"Fornecedor"},"isCarrier":{"type":"boolean","description":"Transportadora"},"isEmployee":{"type":"boolean","description":"Funcionário"},"isSeller":{"type":"boolean","description":"Vendedor"},"bankCode":{"type":"string","description":"Banco do favorecido (código)"},"bankAgency":{"type":"string","description":"Agência do favorecido"},"bankAccount":{"type":"string","description":"Conta do favorecido"},"bankAccountDv":{"type":"string","description":"Dígito da conta"},"creditLimitCents":{"type":"integer","description":"Limite de crédito"},"leadTimeDays":{"type":"integer","description":"Prazo de entrega (dias)"},"defaultPaymentTermId":{"type":"string","format":"uuid","description":"Condição de pagamento padrão"},"defaultPriceTableId":{"type":"string","format":"uuid","description":"Tabela de preço padrão"},"sellerId":{"type":"string","format":"uuid","description":"Vendedor responsável"},"notes":{"type":"string","description":"Observações"}}},"Products":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sku":{"type":"string","description":"SKU / Código"},"name":{"type":"string","description":"Nome"},"kind":{"type":"string","enum":["simple","kit","raw_material","finished"],"description":"Tipo"},"unit":{"type":"string","description":"Unidade"},"gtin":{"type":"string","description":"GTIN / EAN"},"ncm":{"type":"string","description":"NCM"},"cest":{"type":"string","description":"CEST"},"origin":{"type":"string","enum":["0","1","2","3","4","5","6","7","8"],"description":"Origem"},"costCents":{"type":"integer","description":"Custo"},"priceCents":{"type":"integer","description":"Preço de venda"},"weightGrams":{"type":"integer","description":"Peso (g)"},"heightCm":{"type":"integer","description":"Altura (cm)"},"widthCm":{"type":"integer","description":"Largura (cm)"},"lengthCm":{"type":"integer","description":"Comprimento (cm)"},"minStock":{"type":"integer","description":"Estoque mínimo"},"maxStock":{"type":"integer","description":"Estoque máximo"},"location":{"type":"string","description":"Localização"},"lotControl":{"type":"boolean","description":"Controla lote e validade"},"serialControl":{"type":"boolean","description":"Controla nº de série"},"description":{"type":"string","description":"Descrição"}}},"Services":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","description":"Código"},"name":{"type":"string","description":"Nome"},"lc116":{"type":"string","description":"Item LC 116"},"municipalTaxCode":{"type":"string","description":"Cód. tributação municipal"},"nbs":{"type":"string","description":"NBS"},"issRateBp":{"type":"integer","description":"Alíquota ISS"},"retainIss":{"type":"boolean","description":"Retém ISS"},"priceCents":{"type":"integer","description":"Preço"},"description":{"type":"string","description":"Descrição"}}},"Warehouses":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","description":"Código"},"name":{"type":"string","description":"Nome"},"isDefault":{"type":"boolean","description":"Depósito padrão"}}},"Error":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/contacts":{"get":{"summary":"Lista Clientes e fornecedores","tags":["Clientes e fornecedores"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Lista paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contacts"}},"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"}}}}}},"401":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Cria Contato","tags":["Clientes e fornecedores"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contacts"}}}},"responses":{"201":{"description":"Criado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contacts"}}}},"400":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts/{id}":{"get":{"summary":"Busca Contato","tags":["Clientes e fornecedores"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Registro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contacts"}}}},"404":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Atualiza Contato","tags":["Clientes e fornecedores"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contacts"}}}},"responses":{"200":{"description":"Atualizado"},"400":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products":{"get":{"summary":"Lista Produtos","tags":["Produtos"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Lista paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Products"}},"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"}}}}}},"401":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Cria Produto","tags":["Produtos"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Products"}}}},"responses":{"201":{"description":"Criado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Products"}}}},"400":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products/{id}":{"get":{"summary":"Busca Produto","tags":["Produtos"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Registro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Products"}}}},"404":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Atualiza Produto","tags":["Produtos"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Products"}}}},"responses":{"200":{"description":"Atualizado"},"400":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services":{"get":{"summary":"Lista Serviços","tags":["Serviços"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Lista paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Services"}},"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"}}}}}},"401":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{id}":{"get":{"summary":"Busca Serviço","tags":["Serviços"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Registro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Services"}}}},"404":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/warehouses":{"get":{"summary":"Lista Depósitos","tags":["Depósitos"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Lista paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Warehouses"}},"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"}}}}}},"401":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/warehouses/{id}":{"get":{"summary":"Busca Depósito","tags":["Depósitos"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Registro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Warehouses"}}}},"404":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me":{"get":{"summary":"Empresa, permissão do token e plano","tags":["Conta"],"responses":{"200":{"description":"Dados do token"},"401":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders":{"get":{"summary":"Lista pedidos de venda","tags":["Vendas"],"parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Pedidos"},"403":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/stock":{"get":{"summary":"Posição de estoque por produto e depósito","tags":["Estoque"],"parameters":[{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Posições"},"403":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}