Skip to content

Shipping Cost Estimation

Sondre Haugen edited this page Oct 20, 2023 · 15 revisions
Endpoint /consignment_costs
Formats XML
Authentication required? Yes
Sender ID required? Yes

Shipping Cost Estimation

To be used when you want to estimate the cost of a shipment/consignment. The more accurate the consignment data, the more accurate the price will be. The XML body of the request is 100% identical to the consignments.xml request body.

Usage

Requesting a cost estimation for a consignment.

cURL

curl -g -XPOST -d@consignment.xml -H'X-Cargonizer-Key: 12345' -H'X-Cargonizer-Sender: 678' 'https://api.cargonizer.no/consignment_costs.xml'

HTTP

POST /consignment_costs.xml HTTP/1.1
Host: cargonizer.no
X-Cargonizer-Key: 12345
X-Cargonizer-Sender: 678
<contents of "consignment.xml">

Pseudocode

http = new HTTPRequest();
http.method = 'POST';
http.url = 'https://api.cargonizer.no/consignment_costs.xml';
http.headers.add('X-Cargonizer-Key', '12345');
http.headers.add('X-Cargonizer-Sender', '678');
http.body = new File('consignment.xml').read();
response = http.execute();

The contents of consignment_costs.xml are the same as those for creating a consignment.

Examples

A Minimal consignment_costs.xml

<consignments>
  <consignment transport_agreement="12345">
    <product>bring2_business_parcel</product>
    <parts>
      <consignee>
        <name>Juan Ponce De Leon</name>
        <country>NO</country>
        <postcode>1337</postcode>
      </consignee>
    </parts>
    <items>
      <item type="package" amount="1" weight="12" volume="27"/>
    </items>
  </consignment>
</consignments>

Note: Weight in kg. Volume in dm3.

Response

Description

Gross amount is the freight price without your transport agreement and net amount is the freight price calculated by using your transport agreement.

Element Description
gross-amount type=”float Gross price
net-amount type=”float” Net price

Example Of Response

<?xml version="1.0" encoding="UTF-8"?>
<consignment-cost>
    <estimated-cost type="float">96.25</estimated-cost>
    <gross-amount type="float">96.25</gross-amount>
    <net-amount type="float">55.30</net-amount>
</consignment-cost>

Clone this wiki locally