Skip to main content

Shipping Events

Shipping callback URI

When an order has been finalized, a callback will be fired to notify the merchant about the shipment. In order to listen to this callback event a 'WebhookUri' through Merchant Settings needs to be provided. This is required to be setup in advance for a merchant to be utilized.

caution

You have to provide WebhookUri explicitly while creating an order!

JSON
{
"type": "shipping.created",
"description": "{\r\n \"tmsReference\": \"9184632\",\r\n \"selectedShippingOption\": {\r\n \"id\": \"BUDBEESTD\",\r\n \"carrier\": \"Budbee\"\r\n },\r\n \"shipmentSession\": {\r\n \"id\": \"3b78a322-ae63-499f-b0e8-b7c4de229c0b\",\r\n \"name\": \"Budbee\",\r\n \"description\": \"\",\r\n \"carrier\": \"budbee-home\",\r\n \"shippingFee\": 1000,\r\n \"totalShippingFee\": 1000,\r\n \"location\": null,\r\n \"fields\": [\r\n {\r\n \"id\": \"FCRECEIVERPHONE\",\r\n \"value\": \"123\\u2022\\u2022\\u2022\\u2022\\u202290\"\r\n }\r\n ],\r\n \"addons\": [],\r\n \"timeslot\": \"\",\r\n \"postalCode\": \"11251\"\r\n }\r\n}",
"orderId": 9184632
}
NameDescriptionTypeAdditional Information
typeThe type of actual webhookStringValue would be either "shipping.created" or "shipping.failed"
descriptionMore information related to success or failure creating ShippingStringPlease refer to Response - Description Success/Failure tab for details
orderIdCheckout orderIdlong

Shipping Confirmed

Subscribing to sveaCheckout:shippingConfirmed event allows you to receive shippingConfirmation notification, when end customer choose a shipping provider in checkout delivery options.

Subscribe

Javascript
var handler = function (data) {
console.log('Shipping confirmed');
console.log(data);
}
document.addEventListener("sveaCheckout:shippingConfirmed", handler);

Shipping Options Retrieved

Subscribing to sveaCheckout:onDeliveryOptionsRetrieved event allows you to receive a notification whenever Shipping module has a successful or unsuccessful attempt to display the delivery options, Merchant website can use this notification to display its own fallback solution in case of unsuccessful attempts.

info

If you are already providing the shipping module with a set of fallback delivery options, checkout will still display those options after an unsuccessful attempt.

Subscribe

Javascript
var handler = function (data) {
console.log('Shipping Options Loaded');
}
document.addEventListener("sveaCheckout:onDeliveryOptionsRetrieved", handler);