Comparative Rate POST
Preliminary shipment cost analysis
The RateComparativa endpoint lets you run a preliminary analysis of the costs of a shipment that can be calculated in advance, using your price lists (selling or purchase) saved and managed on Gsped, such as:
Freight (base shipping cost)
Ancillary charges calculable in advance
Cash on delivery (COD) cost
Insurance cost
FUEL
Remote areas or islands
Additional services (floor delivery, Saturday delivery, etc.)
Oversize charges based on standard rules
Etc.
Two types of rating are available:
ACTIVE: cost analysis based only on selling price lists, i.e. the ones you use to resell the shipment to your customers
PASSIVE: shipping cost analysis based on the price lists agreed with the courier during contract negotiation. This mode automatically adds the ACTIVE rating as well, so you can also quickly analyse the difference between the purchase and selling costs of the transport.
RateComparativa - POST
POST https://api.gsped.it/[INSTANCE]/RateComparativa
Headers
x-api-key*
String
API key provided by Gsped
Content-Type*
String
application/json
Request Body
client_id*
Integer
Client ID on which you want to run the rating
colli*
Integer
Number of parcels in the shipment
peso*
Float
Total shipment weight in KG
volume*
Float
Total shipment volume in m³
sender_addr*
String
SENDER address
sender_city*
String
SENDER city
sender_cap*
String
SENDER postal code
sender_prov*
String
SENDER province code
sender_country_code*
String
SENDER country ISO 2-char code
rcpt_addr*
String
RECIPIENT address
rcpt_city*
String
RECIPIENT city
rcpt_cap*
String
RECIPIENT postal code
rcpt_prov*
String
RECIPIENT province code
rcpt_country_code*
String
RECIPIENT country ISO 2-char code
tipo_listino*
String
attivo | passivo — identifies the type of rating to perform. N.B.: If you set passivo, both are returned
invoiced_client_id
Integer
Client ID on which the ACTIVE rating will be run in RESELLER instances
departure_date_time
String
Date and time the goods are expected to be ready, in YYYY-MM-DD HH:MM:SS format. If not set, the request datetime is used. N.B.: If the date provided is in the past, the call returns an error!
contrassegno
Float
Shipment cash on delivery (COD) amount
valore
Float
Insured value amount
documenti
String
0 | 1 — identifies whether this is a documents shipment
al_piano
String
0 | 1 — identifies whether the floor delivery service has been requested (calculated only if the courier provides the service)
al_sabato
String
0 | 1 — identifies the request for the Saturday delivery service (calculated only if the courier provides the service)
preavviso_telefonico
String
S | N — identifies whether a phone notice before delivery is requested
gls_exchange
String
N | S — identifies the request for the EXCHANGE service for the GLS courier
corriereRichiesto
Integer
Identifies the ID of the specific courier you want results for
servizioRichiesto
Integer
Identifies the ID of the service you want the result for. Works in combination with corriereRichiesto
corrieriEsclusi
Array
List of Gsped courier IDs to exclude from the calculation. Cannot be used together with corriereRichiesto
serviziEsclusi
Array
List of Gsped service IDs to exclude from the calculation. Can only be used when corriereRichiesto is present and cannot be used together with servizioRichiesto
daticolli
Array
Data of the individual parcels in CM | KG | MC. Fields: altezza, larghezza, lunghezza, peso, volume
Filter parameter usage rules
corrieriEsclusiandcorriereRichiestocannot be used togetherserviziEsclusiandservizioRichiestocannot be used togetherserviziEsclusican be used only whencorriereRichiestois present
Permissions and price lists
The user associated with the API key must be enabled for active or passive rating: otherwise the call responds 401 with
"error": "Permessi insufficienti".With
tipo_listino=passivo, the passive rating is returned only to users enabled for passive rating; for the others, only the active rating is calculated.With
tipo_listino=attivo, the call responds 400 with"Errori durante procedura di rating, verificare i dati inseriti."even when the data is correct but no selling price list is available for the given client: in this case, usepassivo.
Example code snippets
Example responses
Lowest - POST
POST https://api.gsped.it/[INSTANCE]/RateComparativa/lowest
This endpoint is used the same way as RateComparativa POST, but the response contains only the cheapest service for the selling/purchase price list respectively, according to the request made.
Headers
x-api-key*
String
API key provided by Gsped
Content-Type*
String
application/json
Example responses
Fastest - POST
POST https://api.gsped.it/[INSTANCE]/RateComparativa/fastest
This endpoint is used the same way as RateComparativa POST, but the response contains only the fastest courier for the selling/purchase price list respectively, according to the request made.
Headers
x-api-key*
String
API key provided by Gsped
Content-Type*
String
application/json
