Skip to content
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ 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).

## [4.14.1] 2026-03-31
### Fixed
- Fix `organizations.checkDomainIsAvailable` to call `GET /organizations/domain-check` with query params (instead of an unsupported `PUT` payload flow).
- Align method input naming to query semantics for clearer usage (`query`).

## [4.14.0] 2026-03-04
### Added
- Add `facturapi.comercioExteriorCatalogs.searchTariffFractions` method for Fracción Arancelaria SAT catalog
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "facturapi",
"version": "4.14.0",
"version": "4.14.1",
"description": "Librería oficial de Facturapi. Crea CFDIs timbrados y enviados al SAT, XML y PDF",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down
2 changes: 1 addition & 1 deletion src/resources/organizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default class Organizations {
checkDomainIsAvailable(
data: Record<string, any>,
): Promise<{ available: boolean }> {
return this.client.put('/organizations/domain-check', { body: data });
return this.client.get('/organizations/domain-check', { params: data });
}

/**
Expand Down
25 changes: 25 additions & 0 deletions test/node/runtime-compat.node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,31 @@ describe('runtime compatibility (node)', () => {
expect(invoice.id).toBe('inv_123');
});

it('checks domain availability via GET query params', async () => {
const client = createClient();

globalThis.fetch = vi.fn(async (url, options) => {
expect(url).toBe(
'https://api.test.local/v2/organizations/domain-check?domain=empresa-demo',
);
expect(options?.method).toBe('GET');
expect(getHeader(options?.headers, 'Authorization')).toBe(
'Bearer sk_test_123',
);

return new Response(JSON.stringify({ available: true }), {
status: 200,
headers: { 'content-type': 'application/json' },
});
}) as typeof fetch;

const result = await client.organizations.checkDomainIsAvailable({
domain: 'empresa-demo',
});

expect(result.available).toBe(true);
});

it('surfaces API message from non-OK JSON responses', async () => {
const client = createClient();

Expand Down
Loading