Skip to content

docs: add Clients API reference - #15

Merged
0xSagaCity merged 1 commit into
mainfrom
docs/clients-api
Aug 13, 2026
Merged

docs: add Clients API reference#15
0xSagaCity merged 1 commit into
mainfrom
docs/clients-api

Conversation

@vaidik2412

Copy link
Copy Markdown
Contributor

Adds the public API reference for the two Clients operations shipped by REF-23846 (serana#4761, talos#849), following the house style established by docs/leads.mdx.

  • POST /api/v1/businesses/:urlKey/clients — create with full billing identity, address, tax ids, shipping addresses, bank accounts and custom fields in one call
  • GET /api/v1/businesses/:urlKey/clients/:clientId — read one back by your own reference

How this was written

Documented against the merged implementation, not the task description. Vocabularies (client types, bank account types, additionalIds codes and formats, tax payer types) are taken from @refrens/fence, so the page cannot drift from what the product's own client form offers.

Four places where the shipped behaviour differs from the original spec are reflected here rather than the spec's version:

Documented behaviour
Internal record id Absent from every response, at every depth
Create success 201, not 200
isClient Caller-settable; both it and isVendor false is refused
405 Carries the status alone, with no error.code

A logged-in user session is also documented as 401, not 403, matching the service test.

Deliberate omissions

  • The record-id fetch fallback is left out — it ships unpublished. Consequently Visibility states that GET reaches only clients created through this API, and clientId is not documented as nullable, since that value is unreachable through any published endpoint.
  • Refrens-owned fields are described under Response shape rather than enumerated as a request-side denylist.

Review

Two independent reader-effort editorial passes were applied. The second caught a real defect: the request sample sent clientType while the 201 admonition claimed it was derived from the absent field. Fixed by removing it from the sample, so the gstin now legitimately demonstrates the derivation.

Verification

  • npm run build passes — with onBrokenLinks: 'throw' this is the broken-link and anchor check
  • prettier clean

Not verified

The 201 create status is inferred from the Feathers REST default plus the leads staging test report. It has not been confirmed against a live staging call with a real token.

🤖 Generated with Claude Code

Documents the two operations shipped by REF-23846 (serana#4761, talos#849):

- POST /api/v1/businesses/:urlKey/clients — create with full detail
- GET  /api/v1/businesses/:urlKey/clients/:clientId — read one back

Written against the merged implementation rather than the task description,
and the vocabularies are taken from @refrens/fence so they cannot drift from
what the product's own client form offers. Four points where the shipped
behaviour differs from the original spec are reflected here: no internal
record id in any response, create answers 201, isClient is caller-settable,
and 405 carries the status alone with no error code.

The record-id fetch fallback is deliberately left out — it ships unpublished.
Refrens-owned fields are described under the response shape rather than
enumerated as a request-side denylist.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@0xSagaCity
0xSagaCity merged commit 05d530f into main Aug 13, 2026
1 check passed
@0xSagaCity
0xSagaCity deleted the docs/clients-api branch August 13, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants