Skip to content

Wildberries API TypeScript SDK / RequestOptions

Interface: RequestOptions

Defined in: config/sdk-config.ts:181

Per-request options that can override SDK defaults

These options are passed to individual HTTP method calls to customize behavior for specific requests.

Examples

typescript
const options: RequestOptions = {
  headers: {
    'X-Custom-Header': 'custom-value'
  },
  rateLimitKey: 'products.create' // For rate limiter identification
};

await client.get<ProductResponse>(url, options);
typescript
// Override global timeout for a single slow request
await client.get<ReportResponse>(url, {
  timeout: 120000 // 2 minutes for report generation
});

Properties

PropertyTypeDescriptionDefined in
<a id="headers"></a> headers?Record<string, string>Custom HTTP headers to merge with defaults These headers are merged with the SDK's default headers (Authorization, Content-Type, User-Agent). Example headers: { 'X-Request-ID': '123e4567-e89b-12d3-a456-426614174000', 'Accept-Language': 'ru-RU' }config/sdk-config.ts:196
<a id="params"></a> params?Record<string, unknown>URL query parameters Query parameters to append to the request URL. These are automatically URL-encoded by axios. Example params: { from: '2024-01-01', limit: 10, filter: 'active' } // Results in: ?from=2024-01-01&limit=10&filter=activeconfig/sdk-config.ts:214
<a id="ratelimitkey"></a> rateLimitKey?stringRate limit key for endpoint identification Used by RateLimiter (Story 1.4) to enforce per-endpoint rate limits. Format: moduleName.methodName (e.g., 'products.create', 'orders.list') Remarks This is automatically set by API module methods. Manual override is rare.config/sdk-config.ts:225
<a id="timeout"></a> timeout?numberPer-request timeout in milliseconds Overrides the global SDKConfig.timeout for this single request. Useful for long-running operations (e.g., report generation, large data sync) that need more time than the default 30-second timeout. Each retry attempt uses this timeout individually (not cumulative). Example // 2-minute timeout for large order sync await sdk.ordersFBS.getOrders(params, { timeout: 120000 });config/sdk-config.ts:244
<a id="responsetype"></a> responseType?"json" | "blob" | "text" | "arraybuffer" | "document" | "stream"Response type for special handling Specifies the expected response data type for Axios. Used for downloading files as Blob (e.g., Excel reports). Example responseType: 'blob' // For file downloadsconfig/sdk-config.ts:257

Made with ❤️ for the Wildberries developer community