For the complete documentation index, see llms.txt. This page is also available as Markdown.

Migrating from Legacy Endpoints

How the legacy Claret API differs from the current REST API, and how to migrate.

Claret's original API is still available, but the current REST API is the recommended way to integrate. This page explains the differences and how to move across.

If you are building a new integration, start with the current API and ignore the legacy column below. This page is for existing integrations and for understanding older code.

What changed

Area
Legacy API
Current API

Authentication

POST /tokens/create with email + password, returns a session-style token (1|...)

Tokens created in API Access UI with scopes; begin with clrt_. See Authentication.

Authorization

Implicit (the user's session)

Two gates: token scope + creator's permissions

Pagination

current_index / next_index index walking

Offset for reference data, cursor for transactional data

Response shape

Flat JSON with pagination keys mixed in

Envelope: data, meta, links

Errors

Ad-hoc JSON

RFC 9457 application/problem+json

Metering

None

Endpoint mapping

Legacy endpoint
Current endpoint
Notes

POST /tokens/create (email + password)

Create a token in API Access → Tokens

The new flow is UI-driven and scoped. See Authentication.

GET /sales

GET /sales-data

Cursor pagination; filter[...], sort, include. See Sales Data.

GET /supply-plan/get/process

GET /supply-plans

Cursor pagination and structured filters.

POST /inventory/import/process

POST /workflows/sync-inventory (JSON) or POST /workflows/sync-inventory/import (CSV)

Async with job_id polling, dry_run, idempotency.

Migrating authentication

The legacy flow exchanged credentials for a token on every run:

Replace it with a token created once in the API Access UI, stored as a secret, and sent on each request:

This removes passwords from your integration, scopes access to only what's needed, and lets you revoke a single token without rotating credentials.

Migrating pagination

Legacy endpoints returned an index to carry forward:

The current API replaces this with two clearer models:

  • Reference data uses page numbers: increment page until current_page == last_page.

  • Transactional data uses cursors: follow meta.pagination.next_cursor until has_more is false.

See Pagination for full examples.

Why the new endpoints use distinct paths

The new REST endpoints were deliberately given distinct paths (for example, /sales-data rather than /sales) so that existing integrations against the legacy paths keep working unchanged. There is no forced cut-over date for the data endpoints — only the legacy authentication endpoint has a dated sunset (above).

If clean paths are reclaimed for the REST API in the future, it will be communicated in advance. Any permanent redirect introduced at that time would use HTTP 308 (which preserves the request method and body) rather than 301 (which historically allowed clients to downgrade POST to GET), so automated POST clients would continue to work across the redirect.

Last updated

Was this helpful?