Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Allow omitting search text for Carta Porte, Comercio Exterior, and payroll catalogs, matching the API contract. Empty queries return no matches.

### Added

- Search Mexican postal codes, countries, tax regimes, and CFDI uses through `catalogs`, and retrieve postal-code details including neighborhoods. Postal-code searches accept numeric prefixes or neighborhood, locality/city, municipality, and state names, ignore case and diacritics, and support page and cursor pagination. Every postal-code result includes all its neighborhoods.

## [6.0.0] Unreleased

### Breaking
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,31 @@ await facturapi.customers.createGeneric({

Los tres métodos usan la misma operación de la API. `create()` sigue disponible si decides el caso dinámicamente, o si quieres guardar datos incompletos con `{ createEditLink: true }`. Las validaciones siguen siendo responsabilidad de la API.

### Catálogos de domicilio y datos fiscales

```ts
const zips = await facturapi.catalogs.searchZipCodes({
q: 'Nápoles',
state: 'CMX',
pagination: 'cursor',
limit: 10,
});
if (zips.next_cursor) {
await facturapi.catalogs.searchZipCodes({
q: 'Nápoles',
state: 'CMX',
after: zips.next_cursor,
limit: 10,
});
}
const zip = await facturapi.catalogs.getZipCode('01000');
const countries = await facturapi.catalogs.searchCountries({ q: 'México' });
const taxSystems = await facturapi.catalogs.searchTaxSystems({ q: '601' });
const uses = await facturapi.catalogs.searchInvoiceUses({ q: 'gastos' });
```

La búsqueda postal acepta el código completo o un prefijo numérico, o el nombre de una colonia, localidad/ciudad, municipio o estado, y un filtro opcional `state` con la clave de tres letras. Las búsquedas por nombre ignoran mayúsculas y diacríticos, priorizan coincidencias exactas y devuelven cada código postal una sola vez. Cada resultado incluye todas sus colonias en `neighborhoods`, con clave y nombre; el detalle devuelve el mismo objeto. Los códigos postales admiten páginas o cursores (`pagination`, `after`, `before`); conserva los filtros al avanzar. Países, regímenes y usos usan `page` y `limit` (1–100); las claves de catálogo permanecen como strings para conservar ceros iniciales. El régimen y el uso CFDI deben ser declarados por el receptor; consultar el catálogo no los determina.

## Qué puedes integrar

| Necesitas… | Recurso o guía |
Expand Down
2 changes: 1 addition & 1 deletion openapi/source.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"repository": "FacturAPI/facturapi-docs",
"revision": "fbcd72e8cf2b1d1b38d3fd5889ecde6545434c61",
"revision": "9e0fdd689647a1d60f8d9181038225dd04c12732",
"path": "website/openapi_v2.yaml"
}
12 changes: 11 additions & 1 deletion scripts/sdk/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,17 @@
"optional": {
"params": false
}
}
},
"searchZipCodes": "searchZipCodes",
"getZipCode": {
"operation": "getZipCode",
"argumentNames": {
"code": "code"
}
},
"searchCountries": "searchCountries",
"searchTaxSystems": "searchTaxSystems",
"searchInvoiceUses": "searchInvoiceUses"
}
},
"comercioExteriorCatalogs": {
Expand Down
10 changes: 10 additions & 0 deletions src/generated/dates.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading