Skip to content

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

ParameterTypeDescription
messagestringError 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?unknownAPI response body if available
requestId?stringCorrelation ID for debugging

Returns

InvalidBidError

Overrides

ValidationError.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
<a id="statuscode"></a> statusCode?readonlynumberHTTP status code if applicableValidationError.statusCodeerrors/base-error.ts:25
<a id="response"></a> response?readonlyunknownAPI response body if availableValidationError.responseerrors/base-error.ts:30
<a id="requestid"></a> requestId?readonlystringCorrelation ID for debugging and tracing requestsValidationError.requestIderrors/base-error.ts:35
<a id="minbid"></a> minBid?readonlynumberMinimum bid amount required (if available)-errors/promotion-errors.ts:111
<a id="maxbid"></a> maxBid?readonlynumberMaximum bid amount allowed (if applicable)-errors/promotion-errors.ts:116
<a id="currentbid"></a> currentBid?readonlynumberCurrent bid amount that was rejected-errors/promotion-errors.ts:121
<a id="fielderrors"></a> fieldErrors?readonlyRecord<string, string>Map of field names to their validation error messagesValidationError.fieldErrorserrors/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;
}
NameTypeDefined in
namestringerrors/promotion-errors.ts:190
messagestringerrors/promotion-errors.ts:191
statusCodenumbererrors/promotion-errors.ts:192
fieldErrors?Record<string, string>errors/promotion-errors.ts:193
minBid?numbererrors/promotion-errors.ts:194
maxBid?numbererrors/promotion-errors.ts:195
currentBid?numbererrors/promotion-errors.ts:196
response?unknownerrors/promotion-errors.ts:197
requestId?stringerrors/promotion-errors.ts:198

Overrides

ValidationError.toJSON

Made with ❤️ for the Wildberries developer community