Skip to content

Wildberries API TypeScript SDK / CustomsDeclarationIsRequiredError

Class: CustomsDeclarationIsRequiredError ​

Defined in: errors/customs-declaration-is-required-error.ts:38

Error thrown when WB returns HTTP 409 with body code: 'CustomsDeclarationIsRequired' — at least one assembly order in the request lacks a required customs-declaration (ДТ, декларация на товары) number.

Since 2026-08-18 (WB news):

  • A customs-declaration number can be attached only to assembly orders in confirm status (via sdk.ordersFBS.setCustomsDeclaration()).
  • Armenia sellers must attach a ДТ for items produced outside the EAEU when an order from Armenia is delivered to the Russian Federation.
  • POST /api/v3/orders/stickers (sdk.ordersFBS.createOrdersSticker()) returns this 409 when any requested order lacks a required ДТ — stickers cannot be obtained until it is attached.

The raw WB response body (including any data payload with order identifiers WB may include) is preserved on CustomsDeclarationIsRequiredError.response.

Since ​

4.3.0

See ​

https://dev.wildberries.ru/docs/openapi/orders-fbs — Orders FBS API

Example ​

typescript
import { CustomsDeclarationIsRequiredError } from 'daytona-wildberries-typescript-sdk';

try {
  await sdk.ordersFBS.createOrdersSticker({ type: 'png' }, { orders: [123456] });
} catch (err) {
  if (err instanceof CustomsDeclarationIsRequiredError) {
    console.log('Attach a customs declaration number before printing stickers');
    console.log('Raw body:', err.response);
    // err is still instanceof WBAPIError — existing catch-all blocks still work
  }
  throw err;
}

Extends ​

Constructors ​

Constructor ​

ts
new CustomsDeclarationIsRequiredError(
   message: string, 
   code: string, 
   response?: unknown, 
   requestId?: string, 
   origin?: string, 
   timestamp?: string): CustomsDeclarationIsRequiredError;

Defined in: errors/customs-declaration-is-required-error.ts:54

Creates a CustomsDeclarationIsRequiredError (HTTP 409)

Parameters ​

ParameterTypeDescription
messagestringHuman-readable error message from the API response
codestringWB error code string (e.g. 'CustomsDeclarationIsRequired')
response?unknownRaw API response body (may carry order identifiers in data)
requestId?stringCorrelation ID for debugging and tracing
origin?stringOrigin service identifier from RFC 7807 problem+json responses
timestamp?stringISO 8601 timestamp from RFC 7807 problem+json responses

Returns ​

CustomsDeclarationIsRequiredError

Overrides ​

WBAPIError.constructor

Properties ​

PropertyModifierTypeDescriptionInherited fromDefined in
statusCode?readonlynumberHTTP status code if applicableWBAPIError.statusCodeerrors/base-error.ts:25
response?readonlyunknownAPI response body if availableWBAPIError.responseerrors/base-error.ts:30
requestId?readonlystringCorrelation ID for debugging and tracing requestsWBAPIError.requestIderrors/base-error.ts:35
origin?readonlystringOrigin service identifier from RFC 7807 problem+json responses. Indicates which internal Wildberries service originated the error (e.g., "s2s-api-auth-catalog").WBAPIError.originerrors/base-error.ts:43
timestamp?readonlystringISO 8601 timestamp from RFC 7807 problem+json responses. Indicates when the error occurred on the server side (e.g., "2024-09-30T06:52:38Z").WBAPIError.timestamperrors/base-error.ts:51
codereadonlystringWB error code from the response body ('CustomsDeclarationIsRequired').-errors/customs-declaration-is-required-error.ts:42

Methods ​

getUserMessage() ​

ts
getUserMessage(): string;

Defined in: errors/customs-declaration-is-required-error.ts:72

Returns a user-friendly error message with recovery guidance.

Returns ​

string

Error message with recovery steps for the missing customs declaration

Overrides ​

WBAPIError.getUserMessage


toJSON() ​

ts
toJSON(): {
  name: string;
  message: string;
  statusCode?: number;
  code: string;
  response?: unknown;
  requestId?: string;
  origin?: string;
  timestamp?: string;
};

Defined in: errors/customs-declaration-is-required-error.ts:91

Custom JSON serialization to include the code property

Returns ​

ts
{
  name: string;
  message: string;
  statusCode?: number;
  code: string;
  response?: unknown;
  requestId?: string;
  origin?: string;
  timestamp?: string;
}

Object representation including code

NameTypeDefined in
namestringerrors/customs-declaration-is-required-error.ts:92
messagestringerrors/customs-declaration-is-required-error.ts:93
statusCode?numbererrors/customs-declaration-is-required-error.ts:94
codestringerrors/customs-declaration-is-required-error.ts:95
response?unknownerrors/customs-declaration-is-required-error.ts:96
requestId?stringerrors/customs-declaration-is-required-error.ts:97
origin?stringerrors/customs-declaration-is-required-error.ts:98
timestamp?stringerrors/customs-declaration-is-required-error.ts:99

Overrides ​

WBAPIError.toJSON

Made with ❤️ for the Wildberries developer community