# Update the shipping option This operation updates the previously created shipment reservation (POST -> /shipment). The shipment reservation should be unique per session_id provided in the request body. This call happens when the user clicks buy, but before the purchase has gone through. This request takes place if relevant data were updated or if the user was denied a preceding purchase after /shipment call took place. The user then has the potential to change his previous selections and retry the purchase. A HTTP 200 response with a location header to this call is interpreted as a confirmation that the selected option is reserved, that the provided recipient data is valid and that the data has been updated successfully. A HTTP 4xx error code will interrupt the purchase flow and restart the shipping selection process. See failure_reason. Endpoint: PUT /shipment/{shipment_id} Version: 1.3.0 Security: bearerAuth ## Path parameters: - `shipment_id` (string, required) Unique shipment ID ## Header parameters: - `Authorization` (string, required) Authorization token on format Bearer . ## Request fields (application/vdn.klarna.shipping.select_option-v1+json): - `currency` (string, required) ISO 4217 alphabetic currency code Example: "SEK" - `locale` (string, required) IETF BCP-47 locale definition Example: "sv-SE" - `order` (object) Order definition - `order.tags` (array) TMS defined order or order line attributes. The tags are passed in by the merchant during order creation and passed along as is. The TMS and Merchant use tags to direct custom business logic between themselves: (Note that these tags are examples and NOT required or related to KSS in any way) Pricing promo17 Option Configuration next_day_only sort_by_cost_asc limit_8 Customer Metadata member platinum Different tags are allowed on order and order line level. For example, a merchant can provide order line detail of signifcance to the TMS, i.e. ["age_restricted","bulky"] Example: ["member"] - `order.id` (string) Kustom order id, will be known at time of purchase and only provided in the /shipment call. No assumption should be made about the format. - `order.lines` (array, required) - `order.lines.attributes` (object) - `order.lines.attributes.dimensions` (object) Dimensions of this item - `order.lines.attributes.dimensions.height` (integer) height in mm Example: 5000 - `order.lines.attributes.dimensions.length` (integer) length in mm Example: 5000 - `order.lines.attributes.dimensions.width` (integer) width in mm Example: 5000 - `order.lines.attributes.weight` (integer) Weight of this item in grams Example: 1000 - `order.lines.quantity` (integer, required) Example: 2 - `order.lines.reference` (string) Merchant provided item reference Example: "sku-1234" - `order.lines.tax_rate` (integer, required) Tax rate of shipping option in percent. Non-negative, two implicit decimals. I.e 2500 = 25.00%. Example: 2500 - `order.lines.total_discount_amount` (integer) Total discount amount in cents Example: 1000 - `order.lines.total_price_including_tax` (integer, required) Total price of items, including tax, given in cents Example: 4000 - `order.lines.total_tax_amount` (integer, required) Total tax amount in cents Example: 1250 - `order.lines.type` (string) Order line type. Enum: "physical", "discount", "shipping_fee", "sales_tax", "digital", "gift_card", "store_credit", "surcharge" - `order.lines.unit_price` (integer, required) Unit price in cents Example: 2500 - `order.total_amount` (integer, required) Total order amount including tax in cents. Example: 10000 - `order.total_tax` (integer, required) Total tax of the order amount in cents. Example: 2500 - `order.total_weight` (integer) Total weight in grams Example: 2000 - `recipient` (object, required) Information about the recipient - `recipient.care_of` (string) - `recipient.city` (string, required) Example: "Stockholm" - `recipient.company_name` (string) Applicable only if recipient is a company Example: "Kustom AB" - `recipient.country` (string, required) 2 character ISO 3166 country format Example: "SE" - `recipient.customer_type` (string) B2C or B2B customer type. Note: does only indicate the type of customer, not if the address is residential or business. Enum: "person", "organization" - `recipient.email` (string) Example: "info@kustom.com" - `recipient.family_name` (string, required) Example: "Joyce" - `recipient.given_name` (string, required) Example: "Klara" - `recipient.phone` (string) E.164 international format Example: "+46812012010" - `recipient.postal_code` (string, required) Normalized to country specifications Example: "111 34" - `recipient.region` (string) Country specific region Example: "CA" - `recipient.street_address` (string, required) Example: "Sveavägen 46" - `recipient.street_address2` (string) - `selected_shipping_option` (object, required) - `selected_shipping_option.addons` (array) - `selected_shipping_option.addons.data` (object, required) Input from the user. - `selected_shipping_option.addons.data.selected` (boolean) User selection with the following meaning depending on add-on type: - sms: Indicates whether or not the user wants SMS notifications. - email: Indicates whether or not the user wants email notifications. - floor-number: Should be ignored. - apartment-number: Should be ignored. - entry-code: Should be ignored. - locker-code: Should be ignored. - additional-instructions: Should be ignored. - contactless-delivery: Indicates whether or not the user wants a contactless delivery. - leave-outside-door: Indicates whether or not the user wants the package to be left by their door if they are not home when it arrives. - evening-delivery: Indicates whether or not the user wants an evening delivery. - daytime-delivery: Indicates whether or not the user wants a daytime delivery. - expedited-packing: Indicates whether or not the user wants expedited packing. - sustainable-packaging: Indicates whether or not the user wants sustainable packaging. - carbon-compensated: Indicates whether or not the user wants the shipment to be carbon compensated to the extent that is priced. - indoor-home-delivery: Indicates whether or not the user wants an indoor delivery. - assembly-at-pickup: Indicates whether or not the user wants the goods to be assembled at the pickup location. - package-removal: Indicates whether or not the user wants the package to be removed by the merchant. - `selected_shipping_option.addons.data.text` (string) User input with the following meaning depending on add-on type: - sms: Contains the phone number (non-empty if selected is true). - email: Contains the email address (non-empty if selected is true). - floor-number: Contains the input given by the user (can be empty). - apartment-number: Contains the input given by the user (can be empty). - entry-code: Contains the input given by the user (can be empty). - locker-code: Contains the input given by the user (can be empty). - additional-instructions: Contains the input given by the user (can be empty). - contactless-delivery: Should be ignored. - leave-outside-door: Should be ignored. - evening-delivery: Should be ignored. - daytime-delivery: Should be ignored. - expedited-packing: Should be ignored. - sustainable-packaging: Should be ignored. - carbon-compensated: Should be ignored. - indoor-home-delivery: Should be ignored. - assembly-at-pickup: Should be ignored. - package-removal: Should be ignored. - `selected_shipping_option.addons.id` (string, required) The id value from the POST /shippingoptions response. Example: "sms-pickup-point-3" - `selected_shipping_option.addons.max_length` (integer) The max_length value from the POST /shippingoptions response. Example: 4 - `selected_shipping_option.addons.preselected` (boolean) The preselected value from the POST /shippingoptions response. - `selected_shipping_option.addons.price` (integer) The price value from the POST /shippingoptions response. Example: 400 - `selected_shipping_option.addons.required` (boolean) The required value from the POST /shippingoptions response. - `selected_shipping_option.addons.type` (string, required) The type value from the POST /shippingoptions response. Type is one of: Enum: "sms", "email", "floor-number", "apartment-number", "entry-code", "locker-code", "additional-instructions", "contactless-delivery", "leave-outside-door", "evening-delivery", "daytime-delivery", "expedited-packing", "sustainable-packaging", "carbon-compensated", "indoor-home-delivery", "assembly-at-pickup", "package-removal" - `selected_shipping_option.carrier` (string) The carrier for this option Example: "dhl" - `selected_shipping_option.class` (string) The shipping class for this option Example: "express" - `selected_shipping_option.id` (string, required) Optional TMS provided identifier Example: "option-1234" - `selected_shipping_option.location` (object) - `selected_shipping_option.location.address` (object) - `selected_shipping_option.location.coordinates` (object) Geographical position in decimal degrees - `selected_shipping_option.location.coordinates.lat` (number, required) Latitude in decimal degrees Example: 59.336946 - `selected_shipping_option.location.coordinates.lng` (number, required) Longitude in decimal degrees Example: 18.063095 - `selected_shipping_option.location.name` (string) Name of location Example: "ICA Supermarket" - `selected_shipping_option.price` (integer) Total price for this option in cents, including extras and tax Example: 2500 - `selected_shipping_option.tax_rate` (integer) Tax rate of shipping option. Example: 2500 - `selected_shipping_option.timeslot` (object) - `selected_shipping_option.timeslot.end` (string, required) End of timeslot in ISO 8601 format - `selected_shipping_option.timeslot.start` (string, required) Start of timeslot in ISO 8601 format - `selected_shipping_option.type` (string) The type of shipping option Example: "delivery-address" - `sender` (object) Information about the sender. Should indicate from where the goods are dispatched. This object is optional and can be empty. - `sender.sender_id` (string) Optional merchant provided sender identifier. Can be used to identify different warehouses within the same country or different dispatch routes that can affect delivery time. Example: "warehouse-13" - `session_id` (string, required) Unique Kustom shipping session id. Example: "201cda14-975f-4c4d-9c2f-12f3896b5156" ## Response 200 fields (application/vdn.klarna.shipping.get_shipment-v1+json): - `additional_info` (string) Any additional information that should be passed to a merchant from TMS can be provided here. Limit is 256 characters. - `selected_shipping_option` (object, required) - `selected_shipping_option.carrier` (string, required) Transportation carrier company used. merchant can be used for merchant self-hosted delivery methods (ex. instore pickup). generic-postal can be used to indicate a generic postal network. Additional carriers can be supported on request. Value should be one of: Enum: "acs-courier", "airmee", "an-post", "asendia", "australia-post", "austrian-post", "bartolini", "best", "bpost", "bring", "bring-green", "budbee", "budbee-box", "budcompaniett", "bussgods", "citymail", "colis-prive", "colissimo", "collicare", "correos", "correos-express", "crown-relocations", "czech-post", "dachser", "danske-fragt", "dao", "deutsche-post", "dhl", "dhl-express", "doorier", "dooris", "dpd", "dsv", "dynalogic", "e2y", "early-bird", "emily-company", "evri", "fedex", "fietskoeriers", "generic", "generic-postal", "gls", "gordon", "helthjem", "hoekstra", "hrvatska-posta", "in-time", "instabikes", "instabox", "instabox-green", "itella", "kaukokiito", "kiitolinja", "laposte", "leen-merken", "lgt", "magyar-posta", "mat-se", "matkahuolto", "merchant", "mioo-assembly-service", "mx-transport", "mondial-relay", "mtd", "netflux", "ntex", "oda", "omniva", "onroad", "paack", "packs", "porterbuddy", "post-it", "post-luxembourg", "posta-slovenija", "posten-norge", "posti", "postnl", "postnl-extra-home", "postnord", "professional-parcel-logistic", "quick-pac", "rapido", "red-je-pakketje", "relais-colis", "royal-mail", "safe-carrier-logistics", "sagawa", "schenker", "skargarda", "slovenska-posta", "stuart", "svosj", "svosj-trial", "swiss-post", "swoopin", "trunkrs", "ups", "urbit", "urgent-cargus", "van-spreuwel", "wideroe-smart", "wolt", "yunda", "zalando" - `selected_shipping_option.carrier_product` (object) - `selected_shipping_option.carrier_product.addon_identifiers` (array) Product addon identifiers Example: ["1"] - `selected_shipping_option.carrier_product.identifier` (string) Carrier identifier/product code Example: "19" - `selected_shipping_option.carrier_product.name` (string) Carrier product name Example: "MyPack" - `shipment_id` (string, required) The id of the (reserved) shipment Example: "c2059e35-58b1-4482-ad55-5e7ef541eae4" - `shipments` (array) - `shipments.tracking_id` (string) Carrier-specific tracking id. - `shipments.tracking_url` (string) Carrier-specific URL to a web page where the consumer can see and make changes to their delivery. ## Response 400 fields (application/vdn.klarna.shipping.get_shipment-v1+json): - `failure_reason` (string) Example: "shipping_option_not_available" ## Response 401 fields ## Response 404 fields