Documentation Index
Fetch the complete documentation index at: https://docs.shopi.lk/llms.txt
Use this file to discover all available pages before exploring further.
ShopiError
All SDK errors are instances ofShopiError. Use instanceof to catch them cleanly.
Status codes
| Status | Meaning | What to do |
|---|---|---|
0 | Network error — offline, DNS failure | Check connectivity, retry |
401 | Invalid or missing API key | Check the key starts with shopi_pk_ |
403 | Key does not have required scope | Contact shop owner to regenerate key |
404 | Resource not found | Check slug or ID is correct |
408 | Request timed out | Increase timeoutMs or retry |
429 | Rate limit exceeded | Wait for Retry-After seconds |
500 | Server error | Retry with backoff |
502 | Upstream unavailable | Retry — transient infrastructure issue |
Automatic retries
The SDK automatically retries500, 502, 503, 504, and 429 responses up to 2 times with exponential backoff (300ms, then 600ms). You do not need to implement retry logic yourself.
For 429 responses, the SDK reads the Retry-After header and waits the correct amount of time before retrying.
Timeout
Every request times out after 10 seconds by default. A timed-out request throwsShopiError with status: 408.