sdk.error

A step failed. The SDK lifecycle lists each action, what the SDK does next, and the event sent with it.

CODE
next.on('sdk.error', (data, event) => {});

Data

Present: always; optional when it may be missing; campaign once the campaign is loaded; priced once the server priced the cart.

FieldTypePresent
code"network" | "timeout" | "server" | "rejected" | "declined" | "payment_failed" | "auth" | "too_many_requests" | "unavailable"alwaysnetwork (no answer), timeout, server (5xx), rejected (4xx), declined (the card or the gateway), payment_failed (the gateway sent the shopper back unpaid), auth (401, 403), too_many_requests (429), or unavailable (storage blocked or full).
messagestringalwaysFor developers and logs, never for shoppers.
statusnumberoptionalThe HTTP status, when the API answered.
decline_codestringoptionalThe store's payment_response_code for a decline (3005). The shopper's sentence for it is payment.errors.<code> in the address service's texts: Payment errors.
action"campaign.load" | "cart.calculate" | "selector.price" | "coupon.check" | "user.save" | "address.load_rules" | "address.suggest" | "order.create" | "order.load" | "upsell.add" | "storage.write"alwaysThe step that failed, named like the events.

Example

The second argument, with data inside. See Events for the envelope's fields.

CODE
{
  "event_id": "3f2b8c1d9e7a4b6c8d5e2f1a0b9c8d7e",
  "event_type": "sdk.error",
  "object": "sdk",
  "data": {
    "action": "campaign.load",
    "code": "network",
    "message": "Failed to fetch"
  },
  "created_at": "2026-11-04T08:30:00.000Z",
  "session_id": "0b8f3c2d1e4a4f6b9c7d5e3f2a1b0c9d",
  "sdk_version": "0.5.0"
}