- API reference
- Shipping Service Callback API
Select shipping option
https://api.kustom.co/shipment
This operation reserves the user selected shipping option so that the merchant is able to query and find the data and create a shipment of it.
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. A HTTP 201 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 saved successfully.
A HTTP 4xx error code will interrupt the purchase flow and restart the shipping selection process. See failure_reason.
If the purchase is successfully completed, KSS will call POST /shipment/{id}/confirm to confirm the reservation. See the /confirm call.
KSS will occasionally update a created shipment. This can happen because of a failure to finalize the order or for other reasons, which will restart the shipping selection process. See the PUT /shipment call. If the TMS is not able to return a shipment_id in the response, identifying the reserved shipment, then KSS is forced to invoke POST on succeeding updates instead of PUT.
Authorization token on format
Bearer <token>
No field here matches the current filters.
ISO 4217 alphabetic currency code
IETF BCP-47 locale definition
Order definition
21 fields in order
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"]Kustom order id, will be known at time of purchase and only provided in the
/shipmentcall. No assumption should be made about the format.15 fields in lines
6 fields in attributes
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"]Dimensions of this item
Weight of this item in grams
Merchant provided item reference
Tax rate of shipping option in percent. Non-negative, two implicit decimals. I.e 2500 = 25.00%.
Total discount amount in cents
Total price of items, including tax, given in cents
Total tax amount in cents
Order line type.
- physical
- discount
- shipping_fee
- sales_tax
- digital
- gift_card
- store_credit
- surcharge
Unit price in cents
Total order amount including tax in cents.
Total tax of the order amount in cents.
Total weight in grams
Information about the recipient
13 fields in recipient
Applicable only if recipient is a company
2 character ISO 3166 country format
B2C or B2B customer type. Note: does only indicate the type of customer, not if the address is residential or business.
- person
- organization
E.164 international format
Normalized to country specifications
Country specific region
33 fields in selected_shipping_option
9 fields in addons
Input from the user.
2 fields in data
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.
User input with the following meaning depending on add-on type:
- sms: Contains the phone number (non-empty if
selectedis true). - email: Contains the email address (non-empty if
selectedis 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.
- sms: Contains the phone number (non-empty if
The
idvalue from thePOST /shippingoptionsresponse.The
max_lengthvalue from thePOST /shippingoptionsresponse.The
preselectedvalue from thePOST /shippingoptionsresponse.The
pricevalue from thePOST /shippingoptionsresponse.The
requiredvalue from thePOST /shippingoptionsresponse.The
typevalue from thePOST /shippingoptionsresponse. Type is one of:- sms
- floor-number
- apartment-number
- entry-code
- locker-code
- additional-instructions
- contactless-delivery
- leave-outside-door
- evening-delivery
- daytime-delivery
- expedited-packing
- +5 more
The carrier for this option
The shipping class for this option
Optional TMS provided identifier
12 fields in location
Geographical position in decimal degrees
Optional TMS provided identifier
Name of location
Total price for this option in cents, including extras and tax
Tax rate of shipping option.
The type of shipping option
Information about the sender. Should indicate from where the goods are dispatched. This object is optional and can be empty.
8 fields in sender
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.
Unique Kustom shipping session id.
No field here matches the current filters.
Shipment reservation created and saved successfully
Any additional information that should be passed to a merchant from TMS can be provided here. Limit is 256 characters.
5 fields in selected_shipping_option
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.
- acs-courier
- airmee
- an-post
- asendia
- australia-post
- austrian-post
- bartolini
- best
- bpost
- bring
- bring-green
- budbee
- +94 more
The id of the (reserved) shipment
3 fields in shipments
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.
- acs-courier
- airmee
- an-post
- asendia
- australia-post
- austrian-post
- bartolini
- best
- bpost
- bring
- bring-green
- budbee
- +94 more
Carrier-specific tracking id.
Carrier-specific URL to a web page where the consumer can see and make changes to their delivery.
No field here matches the current filters.
Shipment reservation created and saved successfully
Any additional information that should be passed to a merchant from TMS can be provided here. Limit is 256 characters.
5 fields in selected_shipping_option
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.
- acs-courier
- airmee
- an-post
- asendia
- australia-post
- austrian-post
- bartolini
- best
- bpost
- bring
- bring-green
- budbee
- +94 more
The id of the (reserved) shipment
3 fields in shipments
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.
- acs-courier
- airmee
- an-post
- asendia
- australia-post
- austrian-post
- bartolini
- best
- bpost
- bring
- bring-green
- budbee
- +94 more
Carrier-specific tracking id.
Carrier-specific URL to a web page where the consumer can see and make changes to their delivery.
No field here matches the current filters.
The shipment reservation could not be created, for example if the recipient data is invalid or the selected shipping option is no longer available. The field failure_reason should be one of shipping_option_not_available, cutoff_time_expired or shipping_address_invalid, or if neither is applicable, a text describing the failure reason to simplify debugging.
No field here matches the current filters.
Invalid or expired token. A new token will be obtained.
No response body — this status returns headers only.
No field here matches the current filters.
This page is also available as Markdown — append .md to its URL — and is indexed in llms.txt.