Get Shipping Rates
Retrieve the available carrier contracts and pricing for a given shipment configuration.
POST /shipping/rates
Request
Headers
| Header | Value |
|---|---|
Authorization | Bearer <your_api_token> |
Content-Type | application/json |
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
packages | Package[] | Yes | Array of package dimensions and weight |
shipFrom | Address | Yes | Sender address |
shipTo | Address | Yes | Recipient address |
notes | string | Yes | Shipment notes |
insuranceValue | number | Yes | Insurance value (use 0 for none) |
codValue | number | Yes | Cash-on-delivery value (use 0 for none) |
accessoriServices | string[] | Yes | Additional services (use [] for none) |
Package Object
| Field | Type | Required | Description |
|---|---|---|---|
length | number | Yes | Length in cm |
width | number | Yes | Width in cm |
height | number | Yes | Height in cm |
weight | number | Yes | Weight in kg |
Address Object
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Full name |
company | string | Yes | Company name |
street1 | string | Yes | Primary address line |
street2 | string | Yes | Secondary address line (can be empty string) |
city | string | Yes | City |
state | string | Yes | State/Province code |
postalCode | string | Yes | Postal/ZIP code |
country | string | Yes | 2-letter ISO country code (e.g. IT) |
phone | any | No | Phone number |
email | string | Yes | Email address |
Example
Request
{
"packages": [
{
"length": 17,
"width": 25,
"height": 26,
"weight": 3
}
],
"shipFrom": {
"name": "Antonio Esposito",
"company": "Spedisci.Online",
"street1": "via guglielmo sanfelice 8",
"street2": "",
"city": "Napoli",
"state": "NA",
"postalCode": "80134",
"country": "IT",
"phone": null,
"email": "email@example.com"
},
"shipTo": {
"name": "Mario Rossi",
"company": "",
"street1": "Via Roma 2",
"street2": "",
"city": "Telese Terme",
"state": "BN",
"postalCode": "82037",
"country": "IT",
"phone": null,
"email": "email@example.com"
},
"notes": "test api",
"insuranceValue": 0,
"codValue": 0,
"accessoriServices": []
}Response Fields
Each item in the response array represents one available carrier contract:
| Field | Type | Description |
|---|---|---|
carrierCode | string | Carrier identifier (e.g. gls) |
contractCode | string | Specific contract code (e.g. gls-standard) |
weight_price | string | Price based on weight |
insurance_price | string | Insurance surcharge |
cod_price | string | Cash-on-delivery surcharge |
services_price | string | Additional services price |
fuel | string | Fuel surcharge |
total_price | string | Total price for this option |
Use the carrierCode and contractCode from this response as input to the Create Shipping Label endpoint.
Error Codes
| Code | Description |
|---|---|
200 | OK — array of available rates |
405 | Invalid input |
500 | Internal server error |
501 | Not implemented |
Last updated on