Skip to main content
@loyalty-interchange/sdk validates requests before network I/O, validates successful responses, creates protocol context automatically, and exposes stable typed errors.

Client

The client supplies protocol_version, profile, request_id, idempotency_key, occurred_at, and source on every operation.

Operations

Reads use bounded retries for network errors, HTTP 429, and server errors. Mutations are never silently retried. When retrying a mutation after losing the response, supply the same business identifier and idempotencyKey:
Render a member’s loyalty home in one round of parallel reads:

Idempotent retries

To retry a mutation safely, reuse the same idempotencyKey across attempts:
You do not need to pin request_id or occurred_at; the provider treats the business payload as the request identity and echoes your retry’s request_id on the replayed response. Reusing a key with a different business payload returns 409 idempotency_conflict.

Errors

Exact money

Decimal conversion rejects excess precision instead of silently rounding.

Restaurant order builder

FoodserviceOrderBuilder calculates line subtotals and order totals, allocates required zero values, and runs full foodservice reconciliation before returning an order. Invalid parent lines, currencies, quantities, and paid tenders fail locally. Run the complete example against a local sandbox:

Generated low-level client

Use the generated client when an adapter needs direct access to the OpenAPI operations and is prepared to construct complete protocol requests:
Most applications should prefer LipClient for context, validation, safe retries, and domain-oriented methods.

Webhook verification

Verify the raw body before calling JSON.parse:
Verification checks timestamp tolerance and all v1 signatures using constant-time comparison. See Webhooks for delivery semantics.