API Reference
Reference Conventions
How to read the API reference, including required fields and response contracts.
This reference follows a strict structure on every page:
- Method signature.
- Input fields with required/optional status.
- Return type with key fields.
- Known validation and API error cases.
- Request example.
Common request options
All methods accept RequestOptions as the final parameter.
| Field | Type | Required | Description |
|---|---|---|---|
retries | number | Optional | Override retry count for this request. |
timeout | number | Optional | Override timeout in milliseconds. |
cache | boolean | Optional | Enable or disable cache usage for this request. |
headers | Record<string, string> | Optional | Additional HTTP headers. |
signal | AbortSignal | Optional | Abort and cancellation signal. |
Common response shape
All methods return SazitoResponse<T>.
| Field | Type | Required | Description |
|---|---|---|---|
data | T | Optional | Present when request succeeds. |
error.status | number | Optional | HTTP status when available. |
error.message | string | Required if error | Human-readable error message. |
error.type | 'network' | 'api' | 'validation' | Required if error | Error category. |
error.details | any | Optional | Raw error payload/details. |
Required vs Optional
Requiredmeans the SDK method needs the field to execute correctly.Optionalmeans the field may be omitted.- Methods can still return
validationerrors if prerequisite client state is missing (cart/invoice/payment credentials).
Type Details
The following tables are generated from SDK TypeScript types and include nested object fields.
RequestOptions
Source: src/types/common.ts
| Field | Type | Required |
|---|---|---|
retries | number | Optional |
timeout | number | Optional |
cache | boolean | Optional |
headers | Record<string, string> | Optional |
signal | AbortSignal | Optional |
SazitoResponse
Source: src/types/common.ts
| Field | Type | Required |
|---|---|---|
data | T | Optional |
error | { status?: number; message: string; type: 'network' | 'api' | 'validation'; details?: any; } | Optional |
error.status | number | Optional |
error.message | string | Required |
error.type | 'network' | 'api' | 'validation' | Required |
error.details | any | Optional |
PaginatedResponse
Source: src/types/common.ts
| Field | Type | Required |
|---|---|---|
items | T[] | Required |
total | number | Required |
page | number | Required |
pageSize | number | Required |
CookieOptions
Source: src/types/common.ts
| Field | Type | Required |
|---|---|---|
httpOnly | boolean | Optional |
secure | boolean | Optional |
sameSite | 'Strict' | 'Lax' | 'None' | Optional |
maxAge | number | Optional |
path | string | Optional |
domain | string | Optional |