Skip to content

fix(organizations): use GET for domain availability check#95

Merged
javorosas merged 3 commits intomainfrom
fix/domain-check-get-query
Mar 31, 2026
Merged

fix(organizations): use GET for domain availability check#95
javorosas merged 3 commits intomainfrom
fix/domain-check-get-query

Conversation

@javorosas
Copy link
Copy Markdown
Member

Summary

  • fix organizations.checkDomainIsAvailable() to call GET /organizations/domain-check with query params
  • remove incorrect PUT /organizations/domain-check request body usage
  • add a node runtime compatibility test asserting URL, method, auth header, and response parsing

Why

The Facturapi API defines domain availability as GET /organizations/domain-check?domain=.... Using PUT can fail with 404/405 and does not match docs/spec.

Testing

  • npm run test:node

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the organizations.checkDomainIsAvailable() client method to match the Facturapi API contract by switching from an incorrect PUT with JSON body to a GET with query parameters, and adds a Node runtime compatibility test to lock in the expected request/response behavior.

Changes:

  • Update Organizations.checkDomainIsAvailable() to call GET /organizations/domain-check using params (query string) instead of a PUT request body.
  • Add a Node runtime compatibility test asserting URL construction, HTTP method, Authorization header, and JSON response parsing for the domain check endpoint.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/resources/organizations.ts Switch domain availability check to GET with query params via the wrapper client.
test/node/runtime-compat.node.test.ts Add runtime test validating the GET /organizations/domain-check?domain=... request and parsed { available: true } response.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@javorosas javorosas merged commit fad00ef into main Mar 31, 2026
8 checks passed
@javorosas javorosas deleted the fix/domain-check-get-query branch March 31, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants