shipping.selected
The shipping method changed, right after the change's cart.updated, without prices; they come with cart.calculated as shipping_method. A bundle card can set it on the landing page too.
CODE
next.on('shipping.selected', (data, event) => {});Data
Present: always; optional when it may be missing; campaign once the campaign is loaded; priced once the server priced the cart.
| Field | Type | Present | |
|---|---|---|---|
id | number | always | The method's ref_id. |
code | string | campaign | Such as standard. |
name | string | priced | The method's name. |
price | number | priced | What shipping costs after discounts; 0 is free shipping. |
original_price | number | priced | What shipping costs before discounts. |
discounts | Discount[] | priced | The discounts on shipping, such as a free-shipping offer. |
Discount
A discount on the cart's products or on its shipping. Amounts are in the cart's currency.
| Field | Type | Present | |
|---|---|---|---|
name | string | always | The offer's name. |
amount | number | always | The amount taken off. |
source | "offer" | "coupon" | always | coupon for a code the shopper entered (it is in coupons); offer for an automatic offer or a bundle card's own code. |
code | string | optional | The code, for a coupon. |
offer_id | number | always | The offer that gave it. |
percentage | number | optional | The percentage the offer is set to take off, as the API reports it, such as 20. Its configured value, for a label such as “20% off”; the amount actually taken off is amount. |
Example
The second argument, with data inside. See Events for the envelope's fields.
CODE
{
"event_id": "3f2b8c1d9e7a4b6c8d5e2f1a0b9c8d7e",
"event_type": "shipping.selected",
"object": "shipping",
"data": {
"id": 1,
"code": "standard"
},
"created_at": "2026-11-04T08:30:00.000Z",
"session_id": "0b8f3c2d1e4a4f6b9c7d5e3f2a1b0c9d",
"sdk_version": "0.5.0"
}