Read more about the sandbox environment in the Sandbox guide.
Authentication
The Shipping API uses JWT (JSON Web Tokens) for authentication. All the endpoints require a JWT in the Authorization header as a Bearer token.
JWT must contain your Access Key and be signed with your Secret Key using HMAC SHA256 (HS256). Read more about API keys here.
The exact implementation of generating the JWT varies by programming language, and you can see some examples on the code panel. We recommend using popular community-maintained libraries for generating and verifying JWTs.
Visit jwt.io to learn more about JWTs, find libraries for your programming language, or debug and verify your JWTs.
JWT headers
Key
Required
Type
Description
alg
yes
string
Must be set to HS256
typ
yes
string
Must be set to JWT
JWT payload
Here is the minimum required payload for all requests:
Key
Required
Type
Description
accessKey
yes
string
Your Access Key obtained from the Partner System.
exp
yes
number
Expiration time of the token in Unix time. We recommend setting this to 1 hour from issuing the token.
Some response codes apply to all the endpoints listed below.
Http code
Description
400
Input data validations failed. There might be some validation issues with the request body, query params, or URL parameters. Please review the request body requirements to fix the issue.
401
JWT token validation failed. Please check the authentication guide to construct a valid token.
404
Requested or related resource is not found. The entity that you are trying to retrieve does not exist.
API endpoints
Get all carriers
The endpoint allows you to fetch all carriers available through the Montonio Shipping API. It will tell you which carriers can be activated, which are already activated, and whether the carrier supports a Montonio contract.
Represents the request has been processed successfully. It will return all store carriers.
Response fields
Key
Type
Description
carriers
array
List of carriers available through Montonio Shipping.
carriers[].id
string
Unique identifier of the carrier.
carriers[].code
string
Carrier code used in API requests.
carriers[].name
string
Display name of the carrier.
carriers[].logoUrl
string
URL to the carrier’s logo image.
carriers[].contracts
array or null
List of active contracts for this carrier, or null if no contracts are activated.
carriers[].hasMontonioContract
boolean
Whether this carrier supports Montonio contracts (required for rate calculation).
carriers[].supportedContractTypes
array
List of contract types the carrier supports: DIRECT, MONTONIO, or both.
carriers[].contracts[].id
string
Unique identifier of the contract.
carriers[].contracts[].carrierId
string
Reference to the carrier.
carriers[].contracts[].country
string
Country code for the contract (ISO 3166-2).
carriers[].contracts[].lastUsedParcelNumber
number or null
Last used parcel number for sequential numbering.
carriers[].contracts[].daysAllowedForReturns
number or null
Number of days allowed for returns.
carriers[].contracts[].isDirectContract
boolean
Whether this is a direct contract with the carrier.
carriers[].contracts[].returnsAllowed
boolean
Whether returns are enabled for this contract.
carriers[].contracts[].parcelHandoverMethod
string or null
Parcel handover method (Unisend only): COURIER, LOCKER, or null.
carriers[].contracts[].defaultLockerSize
string or null
Default locker size (Unisend only): S, M, L, XL, or null.
carriers[].contracts[].logisticsContractNumber
string or null
Logistics contract number if applicable.
carriers[].contracts[].credentials
object
Contract credentials information.
carriers[].contracts[].credentials.username
string or null
Username for direct contracts (masked for security).
carriers[].contracts[].createdAt
string
ISO 8601 timestamp of when the contract was created.
Get shipping methods for a store
The endpoint lets you fetch available carriers with shipping methods grouped by country for your store. This enables you to display the available carriers and their shipping methods by country.
Represents the request has been processed successfully. It will return all store shipping methods.
Response fields
Each shipping method in the response includes:
Key
Type
Description
type
string
The type of shipping method. Available values: courier, pickupPoint.
subtypes
array
List of subtypes available for this shipping method.
subtypes[].code
string
Subtype identifier. For pickupPoint: parcelMachine, postOffice, parcelShop. For courier: standard, standardB2B.
constraints
object
Constraints and requirements for this shipping method.
constraints.parcelDimensionsRequired
boolean
Whether parcel dimensions (length, width, height) are required when creating shipments with this shipping method. When true, the length, width, and height fields must be provided for each parcel in the shipment request.
Get pickup points for a store
The endpoint allows you to fetch carrier-specific pickup points for your store. If you use the type query param, you can further narrow down your search results.
The unique identifier of the courier service. Use this as the shippingMethod.id when creating a shipment.
name
string
The display name of the courier service.
type
string
The type of courier service. Values: standard, standardB2B.
carrierCode
string
The carrier code for this courier service.
additionalServices
array
List of additional services available for this courier service. Each service has a code field (cod or ageVerification).
Get possible shipping methods for given parcels
The endpoint allows you to fetch all shipping methods considering the parcel dimensions. This is a way to validate which shipping methods are available for a specific route, considering parcels and dimensions.
For example, parcel machines have specific weight and dimension limits.
Return all store shipping methods available for parcels.
Response fields
The response structure is the same as the GET /shipping-methods endpoint. Each shipping method includes a constraints object with a parcelDimensionsRequired field. See the Response fields section above for details.
Calculate shipping rates
The endpoint allows you to calculate shipping rates for given parcels and destination. This is useful for displaying shipping costs to customers at checkout before creating a shipment.
Service type: cod (Cash on Delivery) or ageVerification.
params
object
conditional
Required for cod. Contains amount (number, 0.01-10000).
parcels
array
yes
The list of parcels. Below are the properties for a single parcel
Key
Type
Required
Value
weight
number
yes
2. weight should be measured in kg. At the moment, only two digits are allowed after decimal.
height
number
no
0.64. height should be measured in meters. At the moment, only two digits are allowed after decimal.
width
number
no
0.38. width should be measured in meters. At the moment, only two digits are allowed after decimal.
length
number
no
0.39. length should be measured in meters. At the moment, only two digits are allowed after decimal.
receiver
object
yes
Receiver information.
Key
Type
Required
Value
firstName
string
no
receiver’s first name.
lastName
string
no
receiver’s last name.
name
string
yes
receiver’s full name.
streetAddress
string
conditional
if shipping method is courier then it is mandatory.
locality
string
conditional
if shipping method is courier then it is mandatory.
postalCode
string
conditional
if shipping method is courier then it is mandatory.
country
string
conditional
if shipping method is courier then it is mandatory.
phoneCountryCode
string
yes
372. Represents the country code for the phone number.
phoneNumber
string
yes
5555555. Represents the phone number without the phone county code.
region
string
no
It represents the region of the address.
email
string
no
It represents the email address.
companyName
string
no
It represents company/business name of the receiver.
sender
object
no
Sender information.
Key
Type
Required
Value
name
string
yes
Represents sender’s full name.
streetAddress
yes
conditional
Represents the street address of the sender.
locality
string
yes
Represents the locality of the sender.
postalCode
string
yes
Represents the postalCode of the address.
country
string
yes
country code for the address.
phoneCountryCode
string
yes
372. Represents the country code for the phone number.
phoneNumber
string
yes
5555555. Represents the phone number without the phone county code.
region
string
no
It represents the region of the address.
email
string
no
It represents the email address.
companyName
string
no
It represents company/business name of the receiver.
products
array
no
List of shipped products. Adding products enables the pick list feature and displays products on the tracking page.
Key
Type
Required
Description
sku
string
yes
Product SKU identifier. Max 100 characters.
name
string
yes
Product name. Max 255 characters.
quantity
number
yes
Product quantity. Max value is 999. Decimals allowed.
barcode
string
no
Product barcode (any format). Max 100 characters.
price
number
no
Product unit price. Max 2 decimal places.
currency
string
no
ISO 4217 currency code (e.g., EUR, USD).
attributes
object
no
Custom attributes (e.g., {"color": "Red", "size": "M"}). Max 20 attributes.
imageUrl
string
no
URL to product image. Max 2048 characters.
storeProductUrl
string
no
URL to product page in your store. Max 2048 characters.
description
string
no
Product description. Max 5000 characters. HTML is stripped.
montonioOrderUuid
string
no
The UUID received from Montonio as a response to creating an order.
orderComment
string
no
Comment field, usually specified by customer.
synchronous
boolean
no
When set to true, the shipment will be registered synchronously and the response will include the final registration status. When false or omitted, the shipment is queued for asynchronous processing and returns with status pending. Default: false.
This endpoint allows you to update a shipment. A shipment can only be updated when it’s in status registrationFailed or registered.
It is currently not possible to update the shipment’s products.
An object that defines the shipping method and optional additional services. See the Create Shipment section for the full structure including additionalServices, parcelHandoverMethod, and lockerSize.
parcels
array
no
The list of parcels. Below are the properties for a single parcel
Key
Type
Required
Value
weight
number
yes
2. weight should be measured in kg. At the moment, only two digits are allowed after decimal.
height
number
no
0.64. height should be measured in meters. At the moment, only two digits are allowed after decimal.
width
number
no
0.38. width should be measured in meters. At the moment, only two digits are allowed after decimal.
length
number
no
0.39. length should be measured in meters. At the moment, only two digits are allowed after decimal.
receiver
object
no
Receiver information.
Key
Type
Required
Value
firstName
string
no
receiver’s first name.
lastName
string
no
receiver’s last name.
name
string
yes
receiver’s full name.
streetAddress
string
conditional
if shipping method is courier then it is mandatory.
locality
string
conditional
if shipping method is courier then it is mandatory.
postalCode
string
conditional
if shipping method is courier then it is mandatory.
country
string
conditional
if shipping method is courier then it is mandatory.
phoneCountryCode
string
yes
372. Represents the country code for the phone number.
phoneNumber
string
yes
5555555. Represents the phone number without the phone county code.
region
string
no
It represents the region of the address.
email
string
no
It represents the email address.
companyName
string
no
It represents company/business name of the receiver.
sender
object
no
Sender information.
Key
Type
Required
Value
name
string
yes
Represents sender’s full name.
streetAddress
yes
conditional
Represents the street address of the sender.
locality
string
yes
Represents the locality of the sender.
postalCode
string
yes
Represents the postalCode of the address.
country
string
yes
country code for the address.
phoneCountryCode
string
yes
372. Represents the country code for the phone number.
phoneNumber
string
yes
5555555. Represents the phone number without the phone county code.
region
string
no
It represents the region of the address.
email
string
no
It represents the email address.
companyName
string
no
It represents company/business name of the receiver.
When set to true, the label file will be generated synchronously and the response will include the download URL. When false or omitted, label generation is queued and returns with status pending. Default: false.
The endpoint allows you to create a webhook that can be used to subscribe to different events, such as shipment.registered, shipment.registrationFailed, shipment.labelsCreated, shipment.statusUpdated, labelFile.ready and labelFile.creationFailed.