Skip to navigation

Fold this supplier card into another

View as Markdown

Requires manage:contacts — supplier cards are address-book records. manage:company_profile is a different resource (the workspace’s own billing identity) and does not grant this.

The card in the path is absorbed into target_supplier_id, which survives. A group of three takes two calls.

Neither card is deleted and no expense is rewritten: the absorbed card is tombstoned with merged_into_id, its expenses stay booked against it, and both cards end up sharing a root_id. Neither card needs to be visible in index — the lookup applies no filter, so a card no expense points at can still be folded.

A Contact behind the absorbed card is not left alone. Where the surviving card already has a contact in the same workspace, the absorbed card’s contact is soft-deleted and everything hanging off it — managed realities, tenant rents, projects — is repointed onto the surviving card’s contact. Where the survivor has no contact there, the absorbed card’s contact is kept and re-pointed at the survivor instead. Either way the absorbed card’s contacts end up folded into the survivor’s, and that half of the merge is not undone by clearing merged_into_id.

Authentication

AuthorizationBearer

JWT issued via POST /api/v1/auth/sign_in. Used by mobile and SPA clients. Revoked tokens are rejected.

OR
AuthorizationBearer

Lucanto API key. Two prefixes:

  • lct_pat_<random><checksum> — personal access token (owner: User)
  • lct_live_<random><checksum> — workspace token, live data

Issue keys at /settings/api_keys (personal) or /:workspace_id/settings/api_keys (workspace). Plaintext token is shown once and never again.

Path parameters

workspace_idlongRequired>=1
Workspace ID. The numeric ID shown in your URLs.
idlongRequired
The supplier card to absorb.

Headers

Idempotency-KeystringOptional<=255 characters

Client-supplied unique key (recommended: UUID v4) for safe retries. Within 24 hours, repeating the same key with the same request (method, path, query, body) replays the original response instead of re-executing the action — once the action has run, a 5xx included; a request stopped before it ran is not stored. Reusing a key with a different request returns 422 idempotency_key_conflict (IETF draft §2.7).

Request

This endpoint expects an object.
target_supplier_idlongRequired
The card that survives the merge.

Response

Merged
absorbed_idlong
survivor_idlong
root_idlong

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error