You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(inbound): migra os 20 métodos de inbound/CT-e para as rotas reais /inbound/… (#30)
Os dois resources do domínio de documentos de entrada nunca funcionaram na
v3: as rotas usadas (/productinvoices/received/…, /productinvoices/inbound,
/cte/…) não existem na API — 404 de rota ou colisão com /productinvoices/{id}
(sondado ao vivo 2026-07-29/30). Migra tudo para o contrato /inbound/… da
consulta-dfe-distribuicao-v2 (spec canônica), mantendo nomes e assinaturas
públicas dos 20 métodos:
- config NF-e/CT-e: POST|GET|DELETE …/inbound/{productinvoices|transportationinvoices}
(habilitar era PUT, agora POST conforme a spec)
- consultas: rotas genéricas …/inbound/{key}… e específicas
…/inbound/productinvoices/{key}…
- manifest(): POST …/inbound/{key}/manifest?tpEvent={código} — sondado: o
binder só aceita código numérico SEFAZ; literais legados do SDK são
mapeados (Confirmation→210200, Acknowledgement→210210, Unknown→210220,
Refused→210240)
- reprocessWebhook(): POST …/inbound/productinvoices/{key_or_nsu}/processwebhook,
aceitando NSU via novo IdValidator::accessKeyOrNsu()
Testes: verbo+path pinados por método (datasets), InboundSpecAlignmentTest
(paths↔spec DF-e v2, rotas mortas ausentes, tpEvent integer, assinaturas dos
20 métodos por reflexão). Revalidado ao vivo com o código novo: settings e
chaves falsas retornam erros de domínio, nunca 404 de rota.
OpenSpec: fix-inbound-routes
-**Does not use `dataApiKey`** — always the main `apiKey`.
98
+
- Routes live under `/v2/companies/{id}/inbound/transportationinvoices` (config) and the generic `/inbound/{accessKey}…` (queries); `enable` is a POST. Fixed in v3.4.0 — before that, the resource hit dead `/cte/…` routes and every method 404'd.
98
99
99
100
## `$nfe->inboundProductInvoices` (Inbound NF-e / DFe distribution — Company-scoped)
-`getXml`/`getEventXml`/`getPdf` return raw byte `string`. **Does not use `dataApiKey`** — always the main `apiKey`.
119
+
- Routes live under `/v2/companies/{id}/inbound/…` (fixed in v3.4.0; the old `/productinvoices/received/…` and `/productinvoices/inbound` routes never existed on the API — every method 404'd until then). `enableAutoFetch` is a POST.
120
+
-`manifest()` sends the SEFAZ numeric event code as query `tpEvent` (probed: the API rejects literals). Pass the code (`'210210'`) or a legacy literal, mapped as `Confirmation`→210200, `Acknowledgement`→210210, `Unknown`→210220, `Refused`→210240; anything else throws `InvalidRequestException` locally.
121
+
-`reprocessWebhook()` accepts a 44-digit access key **or** a 1–15 digit NSU (`IdValidator::accessKeyOrNsu`), hitting `POST …/inbound/productinvoices/{key_or_nsu}/processwebhook`.
0 commit comments