Wildberries API TypeScript SDK / InvalidBidError
Class: InvalidBidError
Defined in: errors/promotion-errors.ts:107
Error thrown when bid amount is invalid or below minimum.
This error occurs when:
- Bid is below the minimum required amount
- Bid format is incorrect
- Bid exceeds maximum allowed amount
Example
typescript
import { InvalidBidError } from 'daytona-wildberries-typescript-sdk';
try {
await sdk.promotion.updateAuctionBids({
bids: [{ advert_id: 123, nm_bids: [{ nm_id: 456, bid: 50, placement: 'search' }] }]
});
} catch (error) {
if (error instanceof InvalidBidError) {
console.error(`Minimum bid is ${error.minBid}`);
// Increase bid amount and retry
}
}Extends
Constructors
Constructor
ts
new InvalidBidError(
message: string,
context?: {
field?: string;
minBid?: number;
maxBid?: number;
currentBid?: number;
},
response?: unknown,
requestId?: string): InvalidBidError;Defined in: errors/promotion-errors.ts:131
Creates an InvalidBidError
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | Error message describing the bid validation failure |
context? | { field?: string; minBid?: number; maxBid?: number; currentBid?: number; } | Additional context (minBid, maxBid, currentBid) |
context.field? | string | - |
context.minBid? | number | - |
context.maxBid? | number | - |
context.currentBid? | number | - |
response? | unknown | API response body if available |
requestId? | string | Correlation ID for debugging |
Returns
InvalidBidError
Overrides
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
<a id="statuscode"></a> statusCode? | readonly | number | HTTP status code if applicable | ValidationError.statusCode | errors/base-error.ts:25 |
<a id="response"></a> response? | readonly | unknown | API response body if available | ValidationError.response | errors/base-error.ts:30 |
<a id="requestid"></a> requestId? | readonly | string | Correlation ID for debugging and tracing requests | ValidationError.requestId | errors/base-error.ts:35 |
<a id="minbid"></a> minBid? | readonly | number | Minimum bid amount required (if available) | - | errors/promotion-errors.ts:111 |
<a id="maxbid"></a> maxBid? | readonly | number | Maximum bid amount allowed (if applicable) | - | errors/promotion-errors.ts:116 |
<a id="currentbid"></a> currentBid? | readonly | number | Current bid amount that was rejected | - | errors/promotion-errors.ts:121 |
<a id="fielderrors"></a> fieldErrors? | readonly | Record<string, string> | Map of field names to their validation error messages | ValidationError.fieldErrors | errors/validation-error.ts:39 |
Methods
getUserMessage()
ts
getUserMessage(): string;Defined in: errors/promotion-errors.ts:156
Returns user-friendly error message with bid requirements
Returns
string
Error message with specific bid constraints
Overrides
ValidationError.getUserMessage
toJSON()
ts
toJSON(): {
name: string;
message: string;
statusCode: number;
fieldErrors?: Record<string, string>;
minBid?: number;
maxBid?: number;
currentBid?: number;
response?: unknown;
requestId?: string;
};Defined in: errors/promotion-errors.ts:189
Custom JSON serialization
Returns
ts
{
name: string;
message: string;
statusCode: number;
fieldErrors?: Record<string, string>;
minBid?: number;
maxBid?: number;
currentBid?: number;
response?: unknown;
requestId?: string;
}| Name | Type | Defined in |
|---|---|---|
name | string | errors/promotion-errors.ts:190 |
message | string | errors/promotion-errors.ts:191 |
statusCode | number | errors/promotion-errors.ts:192 |
fieldErrors? | Record<string, string> | errors/promotion-errors.ts:193 |
minBid? | number | errors/promotion-errors.ts:194 |
maxBid? | number | errors/promotion-errors.ts:195 |
currentBid? | number | errors/promotion-errors.ts:196 |
response? | unknown | errors/promotion-errors.ts:197 |
requestId? | string | errors/promotion-errors.ts:198 |