Skip to content

Build a TMS integration

Build the HTTP endpoints Kustom Shipping Assistant calls to authenticate, fetch delivery options and reserve shipments in your TMS.

On this page you'll

  • Understand the TMS provider's role in Shipping Assistant
  • See when Kustom calls your TMS during checkout
  • Identify required and optional endpoints

Build the API that lets Kustom Shipping Assistant fetch delivery options from your transport management system (TMS) and reserve shipments. Kustom requests options when the customer’s address or cart changes. Your TMS supplies carriers, pickup points, time slots and delivery extras, and holds the delivery data.

Setting up shipping for your store? Follow Shipping options in the checkout to configure your Portal profile and order fields. Your TMS provider implements the API described here.

This guide is for TMS providers, transport administrators and merchants building a direct TMS integration. Kustom calls your HTTP endpoints; this integration makes no Checkout API calls.

The diagram shows a successful purchase, from address entry to shipment confirmation. Each step links to its endpoint guide.

Other request behavior:

  • Authentication is reused. Kustom calls POST /auth before its first call to your TMS, and whenever you answer 401. The token is kept per merchant profile and reused across checkouts, so most checkouts never call /auth at all.
  • Options refresh. Kustom requests them again when the address or the cart changes, and the first request can carry only a country, before the customer has typed anything.
  • Reservations can change. If payment is declined, the customer may change the address, the cart or the delivery and press Buy again, and Kustom updates the reservation it already has with PUT instead of creating a second one. A reservation may be updated several times, or never confirmed at all.
  • Customers can search for pickup points near another postal code, which is another POST /shippingoptions.
  • You can refuse a reservation. The customer is asked to pick again.
  • A failed POST /shippingoptions shows no error. The checkout switches to the merchant’s own fixed list of options, and stays on it for that customer.

Kustom calls one base URL for each merchant profile and appends the paths below to it. There is no separate URL for authentication.

EndpointYou must build it?Kustom calls it whenWithout it
POST /authYesRight before a call to your TMS when Kustom has no token for the merchant profile, and after you answer 401Nothing else can be called. Every checkout falls back to the merchant’s options
POST /shippingoptionsYesThe address or cart changes, and on a pickup-point searchEvery checkout falls back to the merchant’s options
POST /shipmentYesThe customer presses Buy for the first timeEvery purchase is interrupted
PUT /shipment/{shipment_id}Yes, or answer 404The customer presses Buy again after a reservation existsAnswer 404 and Kustom creates a new reservation with POST /shipment, leaving the first one orphaned in your system
POST /shipment/{shipment_id}/confirmNoThe purchase completesReservations in your system are never confirmed. The purchase still goes through

The API reference also lists GET /shipment/{shipment_id}. Kustom doesn’t call it, so you don’t need to build it.

Each endpoint guide lists required fields, optional fields and defaults. It also identifies fields needed to use an option, such as locations for a pickup-point option.

TermWhat it means here
Checkout sessionOne customer’s visit to one merchant’s checkout. session_id in every request identifies it, and stays the same through retries and changes
Order linesThe items in the cart. Only physical goods are sent to you
Fallback optionsA fixed list of delivery options the merchant puts on the order, used when your TMS can’t answer
Preview optionsOptions you return before the full address is known, marked preview: true. The customer sees them but can’t buy with one
shipment_idYour identifier for a reservation. The merchant receives it as tms_reference on their order, and books against it
Minor unitsAmounts in the currency’s smallest unit, tax included. 4900 is 49.00

This page is also available as Markdown — append .md to its URL — and is indexed in llms.txt.