Cloudprinter Core API

This documentation describes the Cloudprinter Core API v1.0

Getting started


To get started with Cloudprinter please register online here: Client registration

Basics


RESTful API

The Cloudprinter API is RESTful API. All API calls are implemented as HTTP post. The HTTP response codes 200 and 201 are positive responses, all other response codes must be considered as error. Data will only be returned for HTTP response code 200. Error descriptions can be returned on 4xx response codes.

Request Data

All request data posted to the API must be in JSON objects. The documentation for each API call describes the request data parameters in detail.

Return Data

Return data from the API is in JSON objects. The documentation for each API call describes the return values in detail.

Content-type

Set content-type to application/json on all requests.

Authentication

Each request to the API contains an API key for authentication. API keys are created in the Cloudprinter admin system under CloudCore API Interface.


Order calls

List all orders

endpoint
https://api.cloudprinter.com/cloudcore/1.0/orders/

Request a list of all orders

Example request

json
{
  "apikey": "__YOUR_API_KEY__"
}
js
const axios = require('axios');
const data = JSON.stringify({
  "apikey": "__YOUR_API_KEY__"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudcore/1.0/orders/,',
  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/orders/,',
  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": "__YOUR_API_KEY__"
}
',
  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/orders/,"

payload = json.dumps({
  "apikey": "__YOUR_API_KEY__"
}
)
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/orders/,' \
--header 'Content-Type: application/json' \
--data '{
  "apikey": "__YOUR_API_KEY__"
}
'

Example JSON Response

json
[
    {
        "reference": "12346",
        "order_date": "2015-08-05 10:00:00",
        "state": "1",
        "state_code": "order_state_new"
    },
    {
        "reference": "12348",
        "order_date": "2015-08-05 10:00:00",
        "state": "1",
        "state_code": "order_state_new"
    }
]

Parameters

NameTypeDescriptionRequired
apikeystringApi access keyrequired

Return values

NameTypeDescription
referencestringThe clients own order reference identifier
statestringThe order state. See state definitions
state_codestringThe text version of the order state
order_datestringThe time the order was added

HTTP status codes

CodeStatusDescription
200OKThe request has succeeded
204No contentThe requested order was not found
400Bad requestThe request was invalid or parameters are missing
403ForbiddenThe request was denied due to missing credentils

Get order info:

endpoint
https://api.cloudprinter.com/cloudcore/1.0/orders/info

Request details on a specific order

Example request

json
{
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
js
const axios = require('axios');
const data = JSON.stringify({
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudcore/1.0/orders/info,',
  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/orders/info,',
  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": "__YOUR_API_KEY__",
  "reference": "12346"
}
',
  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/orders/info,"

payload = json.dumps({
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
)
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/orders/info,' \
--header 'Content-Type: application/json' \
--data '{
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
'

Example JSON Response

json

{
  "reference": "123456",
  "state": "45",
  "state_code": "order_state_uploaded",
  "order_date": "2017-02-01 11:22:33",
  "email": "customer1@example.com",
  "addresses": [
    {
      "type": "delivery",
      "firstname": "John",
      "lastname": "Doe",
      "street1": "Example street",
      "zip": "1234",
      "city": "Example city",
      "state": "Example state",
      "country": "NL"
    }
  ],
  "items": [
    {
      "reference": "123561",
      "name": "book_hardcover_21x21",
      "count": "1",
      "shipping_option": "DHL - National Standard (DE)",
      "tracking": "FEDEX",
      "options": [
        {
          "type": "total_pages",
          "count": "24"
        },
        {
          "type": "gloss_pages_170g",
          "count": "24"
        },
        {
          "type": "gloss_laminate_cover",
          "count": "1"
        }
      ],
      "files": [
      	{
      	  "type": "cover",
      	  "url": "https://download.example.com/files/9aade201b3a85ceec318b2240d5eb373",
      	  "md5sum": "4578c3ecf64e47581b175d542f8b0160"
      	},
      	{
      	  "type": "book",
      	  "url": "https://download.example.com/files/c4b5a0b95114f40fc8c9d4e7cd504290",
      	  "md5sum": "1ef89e74e628e223ae94aa4586330833"
      	}
      ]
    }
  ]
}

Parameters

NameTypeDescriptionRequired
apikeystringApi access keyrequired
referencestringThe clients own order reference identifierrequired

Return values

NameTypeDescription
referencestringThe clients own order reference identifier
statestringThe order state. See state definitions
state_codestringThe text version of the order state
order_datestringThe time the order was added
emailstringThe email address of the end consumer
AddressesTypeDescription
addressesarrayArray of one or more address objects
addresses : typestringThe addres type (delivery)
addresses : firstnamestringFirstname of the recipient
addresses : lastnamestringLastname of the recipient
addresses : street1stringStreet
addresses : zipstringZip
addresses : citystringCity
addresses : statestringState ANSI INCITS 38:2009 alpha-2
addresses : countrystringCountry - ISO 3166-1 alpha-2
ItemsTypeDescription
itemsarrayArray of one or more item objects
items : referencestringThe clients item reference id
items : namestringThe name of the item
items : countstringThe quantity of the item
items:shipping_optionstringthe shipping option of the item
items : trackingstringTracking code of the item
Item optionsTypeDescription
optionsarrayArray of zero or more option objects
options : typestringThe option type
options : countstringThe quantity of the option
FilesTypeDescription
filesarrayArray of one or more file objects
files : typestringThe type of file
files : md5stringMd5 sum of the file - used for validation
files : urlstringUrl to the order file

HTTP status codes

CodeStatusDescription
200OKThe request has succeeded
400Bad requestThe request was invalid or parameters are missing
410GoneThe requested order was not found

Add order:

endpoint
https://api.cloudprinter.com/cloudcore/1.0/orders/add

Add a new order including one or more items, adresses, options and files.

Note: Files are added with a URL from where Cloudprinter can fetch the files when the order has been accepted. A TLS encrypted HTTPS connection, use of an access key in the query string and use of a network access control list is recomented.

Example: "https://download.example.com/files/28fa76ff5a9e0566eaa1e11f1ce51f09"

Example request

json
{
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346",
  "email": "support@client-company.com",
  "addresses": [
    {
      "type": "delivery",
      "company": "Example company",
      "firstname": "Example firstname",
      "lastname": "Example lastname",
      "street1": "Example street 1234",
      "zip": "99999",
      "city": "Example city",
      "country": "DE",
      "email": "email@example.com",
      "phone": "12345678"
    }
  ],
  "items": [
    {
      "reference": "12346-1",
      "product": "book_hardcover_21x30",
      "shipping_level": "cp_saver",
      "title": "Book Hardcover 21x30",
      "count": "5",
      "files": [
        {
          "type": "cover",
          "url": "https://download.example.com/files/9aade201b3a85ceec318b2240d5eb373",
          "md5sum": "4578c3ecf64e47581b175d542f8b0160"
        },
        {
          "type": "book",
          "url": "https://download.example.com/files/c4b5a0b95114f40fc8c9d4e7cd504290",
          "md5sum": "1ef89e74e628e223ae94aa4586330833"
        }
      ],
      "options": [
        {
          "type": "total_pages",
          "count": "36"
        },
        {
          "type": "paper_130mcg",
          "count": "36"
        }
      ]
    }
  ]
}
js
const axios = require('axios');
const data = JSON.stringify({
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346",
  "email": "support@client-company.com",
  "addresses": [
    {
      "type": "delivery",
      "company": "Example company",
      "firstname": "Example firstname",
      "lastname": "Example lastname",
      "street1": "Example street 1234",
      "zip": "99999",
      "city": "Example city",
      "country": "DE",
      "email": "email@example.com",
      "phone": "12345678"
    }
  ],
  "items": [
    {
      "reference": "12346-1",
      "product": "book_hardcover_21x30",
      "shipping_level": "cp_saver",
      "title": "Book Hardcover 21x30",
      "count": "5",
      "files": [
        {
          "type": "cover",
          "url": "https://download.example.com/files/9aade201b3a85ceec318b2240d5eb373",
          "md5sum": "4578c3ecf64e47581b175d542f8b0160"
        },
        {
          "type": "book",
          "url": "https://download.example.com/files/c4b5a0b95114f40fc8c9d4e7cd504290",
          "md5sum": "1ef89e74e628e223ae94aa4586330833"
        }
      ],
      "options": [
        {
          "type": "total_pages",
          "count": "36"
        },
        {
          "type": "paper_130mcg",
          "count": "36"
        }
      ]
    }
  ]
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudcore/1.0/orders/add,',
  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/orders/add,',
  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": "__YOUR_API_KEY__",
  "reference": "12346",
  "email": "support@client-company.com",
  "addresses": [
    {
      "type": "delivery",
      "company": "Example company",
      "firstname": "Example firstname",
      "lastname": "Example lastname",
      "street1": "Example street 1234",
      "zip": "99999",
      "city": "Example city",
      "country": "DE",
      "email": "email@example.com",
      "phone": "12345678"
    }
  ],
  "items": [
    {
      "reference": "12346-1",
      "product": "book_hardcover_21x30",
      "shipping_level": "cp_saver",
      "title": "Book Hardcover 21x30",
      "count": "5",
      "files": [
        {
          "type": "cover",
          "url": "https://download.example.com/files/9aade201b3a85ceec318b2240d5eb373",
          "md5sum": "4578c3ecf64e47581b175d542f8b0160"
        },
        {
          "type": "book",
          "url": "https://download.example.com/files/c4b5a0b95114f40fc8c9d4e7cd504290",
          "md5sum": "1ef89e74e628e223ae94aa4586330833"
        }
      ],
      "options": [
        {
          "type": "total_pages",
          "count": "36"
        },
        {
          "type": "paper_130mcg",
          "count": "36"
        }
      ]
    }
  ]
}
',
  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/orders/add,"

payload = json.dumps({
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346",
  "email": "support@client-company.com",
  "addresses": [
    {
      "type": "delivery",
      "company": "Example company",
      "firstname": "Example firstname",
      "lastname": "Example lastname",
      "street1": "Example street 1234",
      "zip": "99999",
      "city": "Example city",
      "country": "DE",
      "email": "email@example.com",
      "phone": "12345678"
    }
  ],
  "items": [
    {
      "reference": "12346-1",
      "product": "book_hardcover_21x30",
      "shipping_level": "cp_saver",
      "title": "Book Hardcover 21x30",
      "count": "5",
      "files": [
        {
          "type": "cover",
          "url": "https://download.example.com/files/9aade201b3a85ceec318b2240d5eb373",
          "md5sum": "4578c3ecf64e47581b175d542f8b0160"
        },
        {
          "type": "book",
          "url": "https://download.example.com/files/c4b5a0b95114f40fc8c9d4e7cd504290",
          "md5sum": "1ef89e74e628e223ae94aa4586330833"
        }
      ],
      "options": [
        {
          "type": "total_pages",
          "count": "36"
        },
        {
          "type": "paper_130mcg",
          "count": "36"
        }
      ]
    }
  ]
}
)
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/orders/add,' \
--header 'Content-Type: application/json' \
--data '{
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346",
  "email": "support@client-company.com",
  "addresses": [
    {
      "type": "delivery",
      "company": "Example company",
      "firstname": "Example firstname",
      "lastname": "Example lastname",
      "street1": "Example street 1234",
      "zip": "99999",
      "city": "Example city",
      "country": "DE",
      "email": "email@example.com",
      "phone": "12345678"
    }
  ],
  "items": [
    {
      "reference": "12346-1",
      "product": "book_hardcover_21x30",
      "shipping_level": "cp_saver",
      "title": "Book Hardcover 21x30",
      "count": "5",
      "files": [
        {
          "type": "cover",
          "url": "https://download.example.com/files/9aade201b3a85ceec318b2240d5eb373",
          "md5sum": "4578c3ecf64e47581b175d542f8b0160"
        },
        {
          "type": "book",
          "url": "https://download.example.com/files/c4b5a0b95114f40fc8c9d4e7cd504290",
          "md5sum": "1ef89e74e628e223ae94aa4586330833"
        }
      ],
      "options": [
        {
          "type": "total_pages",
          "count": "36"
        },
        {
          "type": "paper_130mcg",
          "count": "36"
        }
      ]
    }
  ]
}
'

Example JSON Response

json
{
    "order": "12346"
}

Parameters

NameTypeDescriptionRequired
apikeystringApi access keyrequired
referencestringThe clients own order reference identifier - this must be unique among all ordersrequired
emailstringEmail address of the clints support team for contact regarding processing and production issuesrequired
pricestringEnd customer sales price ex. vat/tax pr item in selected currency - comma as decimal separator, used for customsoptional
currencystringThe currency of the end customer sales price - ISO 4217optional
hcstringHarmonized code - classify product according to Harmonized Systemoptional
metaarrayMeta data array for custom production parameters - only available for Enterprise clientsoptional
addresses
addressesarrayArray of one or more address objectsrequired
addresses : typestringThe type of address - valid values are: "delivery"required
addresses : companystringEnd customers company nameoptional
addresses : firstnamestringEnd customers firstnamerequired
addresses : lastnamestringEnd customers lastnamerequired
addresses : street1stringEnd customers street namerequired
addresses : street2stringEnd customers street nameoptional
addresses : zipstringEnd customers zip/postal coderequired
addresses : citystringEnd customers city namerequired
addresses : statestringEnd customers state name - ANSI INCITS 38:2009 alpha-2 - required for US and CAoptional
addresses : countrystringEnd customers country - ISO 3166-1 alpha-2required
addresses : emailstringEnd customers email address - used in case of problems during deliveryrequired
addresses : phonestringEnd customers phone number - used in case of problems during deliveryrequired
addresses : customer_identificationstringEnd customers identification information - Read moreoptional
files
filesarrayArray of zero or more file objectsoptional
files : typestringThe type of file - valid values are: "delivery_note", "promotion"required
files : urlstringUrl to the order filerequired
files : md5sumstringMd5 sum of the file - used for validationrequired
items
itemsarrayArray of one or more item objectsrequired
items : referencestringThe clients own item reference identifier - this must be unique with in the orderrequired
items : productstringThe name of the product - valid values can be requested via Products Callsrequired
items : countstringThe number of copies to produce of this specific itemrequired
items : shipping_levelstringThe preferred shipping level - standard options are: "cp_postal", "cp_ground", "cp_saver", "cp_fast" (required if no "quote" hash is set)required
items : quotestringA quote hash reference from a quote call.optional
items : titlestringThe title of the productoptional
items : pricestringEnd customer sales price ex. vat/tax in selected currency - comma as decimal separator, used for customsoptional
items : currencystringThe currency of the end customer sales price - ISO 4217optional
items : hcstringHarmonized code - classify product according to Harmonized Systemoptional
items : reorder_causestringReorder cause for reorders - Read moreoptional
items : reorder_descstringAdditional description of the problem - Read moreoptional
items : reorder_order_referencestringReference to the original order - Read moreoptional
items : reorder_item_referencestringReference to the item in the original order - Read moreoptional
items files
items : filesarrayArray of one or more file objectsrequired
items : files : typestringThe type of file - valid values are: "product", "cover", "book"required
items : files : urlstringUrl to the product file for the specific itemrequired
items : files : md5sumstringMd5 sum of the file - used for validationrequired
items options
items : optionsarrayArray of zero or more option objectsoptional
items : options : typestringThe type of option - "total_pages" required for books, adding papertype eg. 130mcg is recomendedrequired
items : options : countstringThe number of times the specific option is used pr itemrequired

Return values

NameTypeDescription
orderstringThe clients own order reference identifier

HTTP status codes

CodeStatusDescription
201CreatedThe order registration was created with success
400Bad requestThe request was invalid or parameters are missing

Cancel order:

endpoint
https://api.cloudprinter.com/cloudcore/1.0/orders/cancel

Request cancellation of a specific order.

Example request

json
{
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
js
const axios = require('axios');
const data = JSON.stringify({
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudcore/1.0/orders/cancel,',
  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/orders/cancel,',
  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": "__YOUR_API_KEY__",
  "reference": "12346"
}
',
  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/orders/cancel,"

payload = json.dumps({
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
)
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/orders/cancel,' \
--header 'Content-Type: application/json' \
--data '{
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
'

Parameters

NameTypeDescriptionRequired
apikeystringApi access keyrequired
referencestringThe clients own order reference identifierrequired

HTTP status codes

CodeStatusDescription
200OKThe request has succeeded
400Bad requestThe request was invalid or parameters are missing
403ForbiddenThe request was denied due to missing credentils
409ConflictThe request failed due to wrong order state
410GoneThe requested order was not found

Order log:

endpoint
https://api.cloudprinter.com/cloudcore/1.0/orders/log

Request log data for a specific order.

Example request

json
{
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
js
const axios = require('axios');
const data = JSON.stringify({
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudcore/1.0/orders/log,',
  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/orders/log,',
  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": "__YOUR_API_KEY__",
  "reference": "12346"
}
',
  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/orders/log,"

payload = json.dumps({
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
)
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/orders/log,' \
--header 'Content-Type: application/json' \
--data '{
  "apikey": "__YOUR_API_KEY__",
  "reference": "12346"
}
'

Example JSON Response

json

[
    {
        "reference": "12346",
        "create_date": "2016-04-12 12:37:01",
        "state": "5"
    },
    {
        "reference": "12346",
        "create_date": "2016-04-12 12:37:02",
        "state": "6"
    }
]

Parameters

NameTypeDescriptionRequired
apikeystringApi access keyrequired
referencestringThe clients own order reference identifierrequired

Return values

NameTypeDescription
referencestringThe clients own order reference identifier
create_datestringThe date and time of the state change
statestringThe order state. See state definitions

HTTP status codes

CodeStatusDescription
200OKThe request has succeeded
204No contentThe requested order was not found
400Bad requestThe request was invalid or parameters are missing

Order quote:

endpoint
https://api.cloudprinter.com/cloudcore/1.0/orders/quote

Request quote data for a list of items

Example request

json
{
  "apikey": "__YOUR_API_KEY__",
  "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": "__YOUR_API_KEY__",
  "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/orders/quote,',
  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/orders/quote,',
  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": "__YOUR_API_KEY__",
  "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/orders/quote,"

payload = json.dumps({
  "apikey": "__YOUR_API_KEY__",
  "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/orders/quote,' \
--header 'Content-Type: application/json' \
--data '{
  "apikey": "__YOUR_API_KEY__",
  "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 quote - 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 quoterequired
invoice_currencystringThe currency of the invoice for the orderrequired
invoice_exchange_ratestringThe currency exchange rate between the quote currency and invoice currencyrequired
expire_datestringThe quote expiration date, 48 hours after the request was maderequired
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 quoterequired

HTTP status codes

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

Product calls:

List all products:

endpoint
https://api.cloudprinter.com/cloudcore/1.0/products

Request a list of all products already enabled for the account.

Example request

json
{
  "apikey": "__YOUR_API_KEY__"
}
js
const axios = require('axios');
const data = JSON.stringify({
  "apikey": "__YOUR_API_KEY__"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudcore/1.0/products,',
  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/products,',
  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": "__YOUR_API_KEY__"
}
',
  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/products,"

payload = json.dumps({
  "apikey": "__YOUR_API_KEY__"
}
)
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/products,' \
--header 'Content-Type: application/json' \
--data '{
  "apikey": "__YOUR_API_KEY__"
}
'

Example JSON Response

json
[
  {
    "name": "Textbook CW A6 P BW",
    "note": "Textbook Casewrap (PUR, 3 mm board) A6 Portrait DIG BW 80OFF",
    "reference": "textbook_cw_a6_p_bw",
    "category": "Textbook BW",
    "from_price": "3.33",
    "currency": "EUR"
  },
  {
    "name": "Textbook CW A5 P BW",
    "note": "Textbook Casewrap (PUR, 3 mm board) A5 Portrait DIG BW 80OFF",
    "reference": "textbook_cw_a5_p_bw",
    "category": "Textbook BW",
    "from_price": "4.44",
    "currency": "EUR"
  }
]

Parameters

NameTypeDescriptionRequired
apikeystringAPI access keyrequired

Return values

NameTypeDescription
namestringProduct short name
notestringProduct long description
referencestringProduct API reference
categorystringProduct category
from_pricestringProduct from price
currencystringThe currency in ISO 4217

HTTP status codes

CodeStatusDescription
200OKThe request has succeeded
204No contentThe requested order was not found
400Bad requestThe request was invalid or parameters are missing
403ForbiddenThe request was denied due to missing credentils

Product info:

endpoint
https://api.cloudprinter.com/cloudcore/1.0/products/info

Get detailed information on a single product. This includes price on the base product and available options, as well as specs on the product.

Example request

json
{
  "apikey": "__YOUR_API_KEY__",
  "reference": "textbook_cw_a6_p_bw"
}
js
const axios = require('axios');
const data = JSON.stringify({
  "apikey": "__YOUR_API_KEY__",
  "reference": "textbook_cw_a6_p_bw"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudcore/1.0/products/info,',
  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/products/info,',
  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": "__YOUR_API_KEY__",
  "reference": "textbook_cw_a6_p_bw"
}
',
  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/products/info,"

payload = json.dumps({
  "apikey": "__YOUR_API_KEY__",
  "reference": "textbook_cw_a6_p_bw"
}
)
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/products/info,' \
--header 'Content-Type: application/json' \
--data '{
  "apikey": "__YOUR_API_KEY__",
  "reference": "textbook_cw_a6_p_bw"
}
'

Example JSON Response

json
{
  "name": "Textbook CW A6 P BW",
  "note": "Textbook Casewrap A6 Portrait Digital Toner BW",
  "reference": "textbook_cw_a6_p_bw",
    "prices": [
    {
      "price": "4.5500",
      "min": "1",
      "max": "65535",
      "note": "Textbook Casewrap A6 Portrait Digital Toner BW",
      "reference": "textbook_cw_a6_p_bw",
      "currency": "EUR",
      "price_unit": "Pr quantity",
      "price_unit_type": "price_unit_pr_quantity",
      "type": "product"
    },
    {
      "price": "0.0149",
      "min": "1",
      "max": "65535",
      "note": "Pageblock paper 80gsm Offset",
      "reference": "pageblock_80off",
      "currency": "EUR",
      "price_unit": "Pr page",
      "price_unit_type": "price_unit_pr_page",
      "type": "option"
    },
    {
      "price": "0.0242",
      "min": "1",
      "max": "65535",
      "note": "Pageblock paper 130gsm Machine Coated Silk",
      "reference": "pageblock_130mcs",
      "currency": "EUR",
      "price_unit": "Pr page",
      "price_unit_type": "price_unit_pr_page",
      "type": "option"
    },
    {
      "price": "0.0000",
      "min": "1",
      "max": "65535",
      "note": "Cover paper 130gsm Machine Coated Gloss",
      "reference": "cover_130mcg",
      "currency": "EUR",
      "price_unit": "Pr book, no pages",
      "price_unit_type": "price_unit_pr_book",
      "type": "option"
    },
    {
      "price": "0.0000",
      "min": "1",
      "max": "65535",
      "note": "Cover lamination Matte finish",
      "reference": "cover_finish_matte",
      "currency": "EUR",
      "price_unit": "Pr book, no pages",
      "price_unit_type": "price_unit_pr_book",
      "type": "option"
    },
    {
      "price": "0.0000",
      "min": "1",
      "max": "65535",
      "note": "Cover lamination Gloss finish",
      "reference": "cover_finish_gloss",
      "currency": "EUR",
      "price_unit": "Pr book, no pages",
      "price_unit_type": "price_unit_pr_book",
      "type": "option"
    }
  ],
  "options": [
    {
      "reference": "cover_finish_matte",
      "note": "Cover lamination Matte finish",
      "type": "type_book_cover_finish",
      "default": 0
    },
    {
      "reference": "cover_finish_gloss",
      "note": "Cover lamination Gloss finish",
      "type": "type_book_cover_finish",
      "default": 1
    },
    {
      "reference": "pageblock_80off",
      "note": "Pageblock paper 80gsm Offset",
      "type": "type_book_paper",
      "default": 1
    },
    {
      "reference": "pageblock_130mcs",
      "note": "Pageblock paper 130gsm Machine Coated Silk",
      "type": "type_book_paper",
      "default": 0
    },
    {
      "reference": "cover_130mcg",
      "note": "Cover paper 130gsm Machine Coated Gloss",
      "type": "type_canvas_paper",
      "default": 1
    }
  ],
  "specs": [
    {
      "note": "Binding method / technology",
      "value": "CW - Casewrap"
    },
    {
      "note": "Bleed in mm",
      "value": "3"
    },
    {
      "note": "Cover overlap in mm",
      "value": "3"
    },
    {
      "note": "Cover squeeze in mm",
      "value": "5"
    },
    {
      "note": "Cover wrap in mm",
      "value": "18"
    },
    {
      "note": "Is the product orientation dependent",
      "value": "Yes"
    },
    {
      "note": "Minimum order quantity",
      "value": "1"
    },
    {
      "note": "Number of printable sides",
      "value": "2"
    },
    {
      "note": "Orientation of the product",
      "value": "Portrait"
    },
    {
      "note": "Per set order quantity",
      "value": "1"
    },
    {
      "note": "Size category",
      "value": "A6P"
    },
    {
      "note": "The exact height of the book in mm. after trimming",
      "value": "148"
    },
    {
      "note": "The exact width of the book in mm. after trimming",
      "value": "105"
    },
    {
      "note": "The page safety margin in mm",
      "value": "10"
    },
    {
      "note": "Colors on the back of the page",
      "value": "Black/White"
    },
    {
      "note": "Colors on the front of the page",
      "value": "Black/White"
    },
    {
      "note": "Print technology",
      "value": "Digital Toner"
    }
  ]
}

Parameters

NameTypeDescriptionRequired
apikeystringApi access keyrequired
referencestringThe reference of the productrequired

Return values

NameTypeDescription
namestringProduct short name
notestringProduct long description
referencestringProduct API reference
NameTypeDescription
pricesarrayArray of price objects
prices : pricestringProduct or option price
prices : minstringMinimum item quantity range
prices : maxstringMaximum item quantity range
prices : notestringProduct long description
prices : referencestringFor options, the API reference
prices : currencystringThe currency in ISO 4217
prices : price_unitstringThe price unit type (Pr. Order, Pr. Item, Pr. Quantity, Pr. Page)
prices : typestringType of price (product, option)
NameTypeDescription
optionsarrayArray of option objects
options : referencestringFor options API reference
options : notestringOption long description
options : typestringOption category type
options : defaultnumberDefault option flag (0, 1) - 1 for default - Default options work within options of the same option category type and only if not specified in the order
NameTypeDescription
specsarrayArray of spec objects
specs : notestringSpec long description
specs : valuestringSpec value

HTTP status codes

CodeStatusDescription
200OKThe request has succeeded
204No contentThe requested order was not found
400Bad requestThe request was invalid or parameters are missing

List shipping levels:

endpoint
https://api.cloudprinter.com/cloudcore/1.0/shipping/levels

Request a list of available shipping levels for the account.

Example request

json
{
  "apikey": "__YOUR_API_KEY__"
}
js
const axios = require('axios');
const data = JSON.stringify({
  "apikey": "__YOUR_API_KEY__"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudcore/1.0/shipping/levels,',
  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/shipping/levels,',
  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": "__YOUR_API_KEY__"
}
',
  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/shipping/levels,"

payload = json.dumps({
  "apikey": "__YOUR_API_KEY__"
}
)
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/shipping/levels,' \
--header 'Content-Type: application/json' \
--data '{
  "apikey": "__YOUR_API_KEY__"
}
'

Example JSON Response

json
[
  {
    "shipping_level_reference": "cp_saver",
    "shipping_level": "cp_saver",
    "name": "Express saver - Tracked",
    "note": "Saver express  - Fast saver tracked delivery - Cloudprinter shared"
  },
  {
    "shipping_level_reference": "cp_ground",
    "shipping_level": "cp_ground",
    "name": "Express ground - Tracked",
    "note": "Ground express - Fast ground delivery - Cloudprinter shared"
  }
]

Parameters

NameTypeDescriptionRequired
apikeystringAPI access keyrequired

Return values

NameTypeDescription
shipping_level_referencestringShipping level API reference
shipping_levelstringShipping level API reference (to be deprecated)
namestringShipping level short name
notestringShipping level long description

HTTP status codes

CodeStatusDescription
200OKThe request has succeeded
400Bad requestThe request was invalid or parameters are missing
403ForbiddenThe request was denied due to missing credentils

Shipping countries:

endpoint
https://api.cloudprinter.com/cloudcore/1.0/shipping/countries

Request a list of available shipping countries for the account.

Example request

json
{
  "apikey": "__YOUR_API_KEY__"
}
js
const axios = require('axios');
const data = JSON.stringify({
  "apikey": "__YOUR_API_KEY__"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudcore/1.0/shipping/countries,',
  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/shipping/countries,',
  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": "__YOUR_API_KEY__"
}
',
  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/shipping/countries,"

payload = json.dumps({
  "apikey": "__YOUR_API_KEY__"
}
)
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/shipping/countries,' \
--header 'Content-Type: application/json' \
--data '{
  "apikey": "__YOUR_API_KEY__"
}
'

Example JSON Response

json
[
  {
    "country_reference": "AE",
    "note": "United Arab Emirates",
    "require_state": 1
  },
  {
    "country_reference": "AF",
    "note": "Afghanistan",
    "require_state": 0
  }
]

Parameters

NameTypeDescriptionRequired
apikeystringApi access keyrequired

Return values

NameTypeDescription
country_referencestringShipping country short name
notestringShipping country long description
require_statestring1 = Country requires state, 0 = Country does not require state

HTTP status codes

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

Shipping states/regions:

endpoint
https://api.cloudprinter.com/cloudcore/1.0/shipping/states

Request a list of available shipping countries for the account.

Example request

json
{
  "apikey": "__YOUR_API_KEY__",
  "country_reference":"AE"
}
js
const axios = require('axios');
const data = JSON.stringify({
  "apikey": "__YOUR_API_KEY__",
  "country_reference":"AE"
}
);

const config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.cloudprinter.com/cloudcore/1.0/shipping/states,',
  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/shipping/states,',
  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": "__YOUR_API_KEY__",
  "country_reference":"AE"
}
',
  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/shipping/states,"

payload = json.dumps({
  "apikey": "__YOUR_API_KEY__",
  "country_reference":"AE"
}
)
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/shipping/states,' \
--header 'Content-Type: application/json' \
--data '{
  "apikey": "__YOUR_API_KEY__",
  "country_reference":"AE"
}
'

Example JSON Response

json
[
  {
      "state_reference": "AJ",
      "name": "Ajman",
      "note": "Ajman"
  },
  {
      "state_reference": "AZ",
      "name": "Abu Dhabi",
      "note": "Abu Dhabi"
  }
]

Parameters

NameTypeDescriptionRequired
apikeystringApi access keyrequired
country_referencestringCountry - ISO 3166-1 alpha-2required

Return values

NameTypeDescription
state_referencestringShipping state reference
namestringShipping state short name
notestringShipping state long name

HTTP status codes

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