How to check prices

Introduction

The Cloudprinter.com network is by design a dynamic network and prices of the products will differ from region to region. The only safe way to know the actual price is by making a price check. The price check can easily be automated, and the process is explained in detail below.


Manual price check

You can make a manual price check via the Cloudprinter.com Admin dashboard. Under "CloudCore Admin" you find "Price check" in the menu at the left. It is a good starting point to get familiar with the product build-up that Cloudprinter.com operates with


Automated price check

A price check request can be made to the CloudCore API to get the specific product and shipping price for a single country or country-state/region combination.

Countries and states/regions

As part of a price check request, the country is specified as a 2-letter abbreviation following ISO 3166-1 alpha-2. The supported country references can be fetched from the CloudCore API shipping/countries endpoint. Read more here.

Shipping countries with the parameter require_state set to the value 1 requires a state/region definition. In these cases, the state references can be fetched from the CloudCore API shipping/states endpoint by providing the parameter country_reference in the post request. Read more here.

Currency

The price check supports multi-currency. In cases where no currency is specified the price check will return EUR pricing. Currency is specified with 3-letter abbreviations following the ISO 4217

Endpoint

endpoint
https://api.cloudprinter.com/cloudcore/1.0/prices/lookup

Request structure

The structure of a price check request is 100% compatible with an order quote request. Processing the price check is just faster than making a full quote.

Example request

json
{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "country": "NL",
    "items": [
        {
            "reference": "ref_id_1234567",
            "product": "textbook_pb_a4_p_bw",
            "count": "1",
            "options": [
                {
                    "type": "pageblock_80off",
                    "count": "120"
                },
                {
                    "type": "total_pages",
                    "count": "120"
                }
            ]
        }
    ]
}
js
const axios = require('axios');
const data = JSON.stringify({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "country": "NL",
    "items": [
        {
            "reference": "ref_id_1234567",
            "product": "textbook_pb_a4_p_bw",
            "count": "1",
            "options": [
                {
                    "type": "pageblock_80off",
                    "count": "120"
                },
                {
                    "type": "total_pages",
                    "count": "120"
                }
            ]
        }
    ]
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudcore/1.0/prices/lookup',
  headers: {
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(response.data);
})
.catch((error) => {
  console.log(error);
});
php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.cloudprinter.com/cloudcore/1.0/prices/lookup',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "country": "NL",
    "items": [
        {
            "reference": "ref_id_1234567",
            "product": "textbook_pb_a4_p_bw",
            "count": "1",
            "options": [
                {
                    "type": "pageblock_80off",
                    "count": "120"
                },
                {
                    "type": "total_pages",
                    "count": "120"
                }
            ]
        }
    ]
}
',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
py
import requests
import json

url = "https://api.cloudprinter.com/cloudcore/1.0/prices/lookup"

payload = json.dumps({
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "country": "NL",
    "items": [
        {
            "reference": "ref_id_1234567",
            "product": "textbook_pb_a4_p_bw",
            "count": "1",
            "options": [
                {
                    "type": "pageblock_80off",
                    "count": "120"
                },
                {
                    "type": "total_pages",
                    "count": "120"
                }
            ]
        }
    ]
}
)
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
sh
curl --location 'https://api.cloudprinter.com/cloudcore/1.0/prices/lookup' \
--header 'Content-Type: application/json' \
--data '{
    "apikey": "13b37bb1ed6d3403e158abe719b4f6d0",
    "country": "NL",
    "items": [
        {
            "reference": "ref_id_1234567",
            "product": "textbook_pb_a4_p_bw",
            "count": "1",
            "options": [
                {
                    "type": "pageblock_80off",
                    "count": "120"
                },
                {
                    "type": "total_pages",
                    "count": "120"
                }
            ]
        }
    ]
}
'

Example JSON Response

json
{
  "price": "4.5412",
  "vat": "0.00",
  "currency": "EUR",
  "expire_date": "2021-04-18T15:32:58+00:00",
  "subtotals": {
    "items": "1.7912",
    "fee": "2.7500",
    "app_fee": "0.0000"
  },
  "shipments": [
    {
      "total_weight": "712",
      "items": [
        {
          "reference": "ref_id_1234567"
        }
      ],
      "quotes": [
        {
          "quote": "a1e771f2e375bc33b5385fcc8091a328481bc45f3bff13de96ba0e7585ff936f",
          "service": "Postal - Untracked",
          "shipping_level": "cp_postal",
          "shipping_option": "National Post - Int. Postal Untracked",
          "price": "4.2000",
          "vat": "0.0000",
          "currency": "EUR"
        },
        {
          "quote": "90aa928c65b6115e2fd76f5c3238381e42630fbe6cd137422db469fb070b5f7f",
          "service": "Express ground - Tracked",
          "shipping_level": "cp_ground",
          "shipping_option": "National Post - Int. Postal Tracked",
          "price": "6.2300",
          "vat": "0.0000",
          "currency": "EUR"
        },
        {
          "quote": "c6159e6c0a1b3e2d4ad7be940a327fb139351149e9f7ad7a1295a534cc37a4c3",
          "service": "Express fast - Tracked",
          "shipping_level": "cp_fast",
          "shipping_option": "DHL - International Express",
          "price": "14.5000",
          "vat": "0.0000",
          "currency": "EUR"
        }
      ]
    }
  ],
  "invoice_currency": "EUR",
  "invoice_exchange_rate": "1.0000"
}

Parameters

NameTypeDescriptionRequired
apikeystringApi access keyrequired
currencystringThe currency of the price check - ISO 4217 - default value is EURoptional
countrystringThe country the order will ship torequired
statestringEnd customers state name - ANSI INCITS 38:2009 alpha-2 - required for USoptional
itemsarrayArray of item objects in the orderrequired
items : referencestringClient item referencerequired
items : productstringThe product idrequired
items : countstringThe product quantityrequired
items : optionsarrayArray of option objects on a itemoptional
items : options : typestringThe option typerequired
items : options : countstringThe option countrequired

Return values

NameTypeDescriptionRequired
pricestringThe total product sum for the order, ex shipping and incl VATrequired
vatstringThe vat part of the total product sumrequired
currencystringThe currency of the price checkrequired
invoice_currencystringThe currency of the invoice for the orderrequired
invoice_exchange_ratestringThe currency exchange rate between the check currency and invoice currencyrequired
subtotalsarrayArray of objects - subtotalsrequired
subtotals : itemsstringThe sum of the item cost for the orderrequired
subtotals : feestringThe sum of the fees for the orderrequired
subtotals : app_feestringThe sum of the app fees for the orderrequired
shipmentsarrayArray of objects - shipments (item bundles)required
shipments : total_weightstringThe calculated total weight of the shipmentrequired
shipments : itemsarrayArray of objects - the items contained in this shipmentrequired
shipments : items : referencestringThe item referencerequired
shipments : quotesarrayArray of objects - available shipping optionsrequired
shipments : quotes : quotestringThe unique quote idrequired
shipments : quotes : servicestringThe shipping service level namerequired
shipments : quotes : shipping_levelstringThe shipping service level referencerequired
shipments : quotes : shipping_optionstringText description of the specific shipping optionrequired
shipments : quotes : pricestringThe price of the shipment incl VATrequired
shipments : quotes : vatstringThe vat part of the shipmentrequired
shipments : quotes : currencystringThe currency of the price checkrequired

HTTP status codes

CodeStatusDescription
200OKThe request has succeeded
400Bad requestThe request was invalid or parameters are missing