@loyalty-interchange/sdk validates requests before network I/O, validates successful responses, creates protocol context automatically, and exposes stable typed errors.
Client
protocol_version, profile, request_id, idempotency_key, occurred_at, and source on every operation.
Operations
idempotencyKey:
Idempotent retries
To retry a mutation safely, reuse the sameidempotencyKey across attempts:
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
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:LipClient for context, validation, safe retries, and domain-oriented methods.
Webhook verification
Verify the raw body before callingJSON.parse:
v1 signatures using constant-time comparison. See Webhooks for delivery semantics.