Overview

The Zenkraft API is designed to be as standardized across all carriers as possible. The basic structure of each request is the same, with carrier-specific fields typically nested within special services.
It is designed upon the following principles:

  • Basic authentication using a JWT token

  • RESTful using HTTP Verbs

  • JSON requests and responses




Authentication

The Zenkraft API uses a bearer token to authenticate. If you do not have one, please contact support.

zkkey : your_api_key
Base URL
https://api.zenkraft.com

/rate

The rating endpoint is used to return estimated costs & time in transit data from the carrier. Zenkraft normalize this data across carriers providing a standardized date and cost format from the carriers (where the functionality is supported).

Parameters
rate_response manifest_error pickup_response ship_request cancel_request rate references ship_response pickup_request shippingaccount_error rate_error track pickup location shipment customs_items successful_response shippingaccount_request dopu_error currencies rate_request inbound_request track_error inbound dopu_request notifications dopu packages inbound_error manifest_request pickup_error base_shipment shipping_account countries shippingaccount_response base_request tracking_number error special_services track_request ship_error
Field Required Data Type Example Values
weight_units True string lb kg lb
label_type True string PDF ZPL EPL CLP GIF PDF PNG
sender True object
shipping_account True string 5190163571408896
currency True string USD AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BRL BSD BTN BWP BYN BZD CAD CDF CHF CLP CNY COP CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GGP GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS IMP INR IQD IRR ISK JEP JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRU MUR MVR MWK MXN MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SPL SRD STN SVC SYP SZL THB TJS TMT TND TOP TRY TTD TVD TWD TZS UAH UGX UYU UZS VEF VND VUV WST XAF XCD XDR XOF XPF YER ZAR ZMW ZWD
special_services array [u'food', u'extreme_length', u'poison']
include_base64_label boolean True
customs_items
packaging True string your_packaging your_packaging
debug boolean True
carrier True string fedex
references array
packages True array
type True string outbound outbound return
test boolean True
dim_units True string in cm in
recipient True object
service string fedex_freight
notifications array
Example Request / Response


{
    "shipment": {
        "carrier": "",
        "currency": "EUR",
        "debug": true,
        "dim_units": "CM",
        "label_type": "PDF",
        "packages": [
            {
                "height": 0,
                "length": 2,
                "weight": 4,
                "width": 3
            }
        ],
        "packaging": "your_packaging",
        "recipient": {
            "city": "Paris",
            "country": "FR",
            "email": "test@test.com",
            "name": "Test",
            "phone": "0102030405",
            "postal_code": "75008",
            "street1": "Place Charles de Gaulle",
            "company" : "test",
            "street2": ""
        },
        "sender": {
            "city": "CARROS",
            "country": "FR",
            "email": "test@test.com",
            "name": "La spirotechnique",
            "phone": "+33 4 92 08 28 88",
            "postal_code": "06513",
            "company" : "test",
            "street1": "1ER AVENUE 14EME RUE BP 148",
            "street2": ""
        },
        "ship_date": "2020-12-04",
        "shipping_account": 145964311,
        "test": false,
        "type": "outbound",
        "weight_units": "KG"
    }
}






                                                
curl --request POST \ 
--url https://api.zenkraft.com/shippingaccount\
--header 'content-type: application/json' \ 
--header 'zkkey: XXXXXXXXXXXXXXXXXXXXXXX' \ 
--data '.......' 
                                                
                                            
                                                
import requests
import json

endpoint = https://api.zenkraft.com/shippingaccount 

# JSON payload in request code tab
payload = {}

resp = json.loads(r.text)
                                                
                                            
 
                                                
                                            

/ship

The shipping endpoint is used to book shipments with . It will return a shipping label and tracking number in the response.

Parameters
rate_response manifest_error pickup_response ship_request cancel_request rate references ship_response pickup_request shippingaccount_error rate_error track pickup location shipment customs_items successful_response shippingaccount_request dopu_error currencies rate_request inbound_request track_error inbound dopu_request notifications dopu packages inbound_error manifest_request pickup_error base_shipment shipping_account countries shippingaccount_response base_request tracking_number error special_services track_request ship_error
Field Required Data Type Example Values
weight_units True string lb kg lb
label_type True string PDF ZPL EPL CLP GIF PDF PNG
sender True object
shipping_account True string 5190163571408896
currency True string USD AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BRL BSD BTN BWP BYN BZD CAD CDF CHF CLP CNY COP CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GGP GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS IMP INR IQD IRR ISK JEP JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRU MUR MVR MWK MXN MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SPL SRD STN SVC SYP SZL THB TJS TMT TND TOP TRY TTD TVD TWD TZS UAH UGX UYU UZS VEF VND VUV WST XAF XCD XDR XOF XPF YER ZAR ZMW ZWD
special_services array [u'food', u'extreme_length', u'poison']
include_base64_label boolean True
customs_items
packaging True string your_packaging your_packaging
debug boolean True
carrier True string fedex
references array
packages True array
type True string outbound outbound return
test boolean True
dim_units True string in cm in
recipient True object
service string fedex_freight
notifications array
Example Request / Response



{
    "shipment": {
        "carrier": "",
        "currency": "GBP",
        "debug": true,
        "dim_units": "CM",
        "include_base64_label": true,
        "label_type": "PDF",
        "packages": [
            {
                "height": 1,
                "length": 1,
                "value": 1,
                "weight": 1,
                "width": 1
            }
        ],
        "packaging": "your_packaging",
        "recipient": {
            "city": "london",
            "company": "Zenkraft User",
            "country": "GB",
            "email": "testexample@gmail.com",
            "name": "Test User",
            "phone": "01222 555 555",
            "postal_code": "EC1R 4UG",
            "state": "",
            "street1": "1 Hardwick Street"
        },
        "sender": {
            "city": "Bath",
            "company": "TestCompany",
            "country": "GB",
            "email": "uk@testing.com",
            "name": "TestCompany Name",
            "phone": "",
            "postal_code": "EC2R 6PJ",
            "street1": "30 Moorgate"
        },
        "service": "economy",
        "ship_date": "2021-01-28",
        "shipping_account": 811195730,
        "test": true,
        "type": "outbound",
        "weight_units": "KG"
    }
}





                                                
curl --request POST \ 
--url https://api.zenkraft.com/shippingaccount\
--header 'content-type: application/json' \ 
--header 'zkkey: XXXXXXXXXXXXXXXXXXXXXXX' \ 
--data '.......' 
                                                
                                            
                                                
import requests
import json

endpoint = https://api.zenkraft.com/shippingaccount 

# JSON payload in request code tab
payload = {}

resp = json.loads(r.text)
                                                
                                            
 
                                                
                                            

/track

Parameters
rate_response manifest_error pickup_response ship_request cancel_request rate references ship_response pickup_request shippingaccount_error rate_error track pickup location shipment customs_items successful_response shippingaccount_request dopu_error currencies rate_request inbound_request track_error inbound dopu_request notifications dopu packages inbound_error manifest_request pickup_error base_shipment shipping_account countries shippingaccount_response base_request tracking_number error special_services track_request ship_error
Field Required Data Type Example Values
test boolean True
debug boolean True
tracking_number True string 567293923024
carrier True string fedex
shipping_account True string 5190163571408896
Example Request / Response




{
    "track": {
      "test":false,
      "carrier": "",
      "shipping_account": 00000000000000,
      "tracking_number": "1Z7881280399212000"  
    }
}




                                                
curl --request POST \ 
--url https://api.zenkraft.com/shippingaccount\
--header 'content-type: application/json' \ 
--header 'zkkey: XXXXXXXXXXXXXXXXXXXXXXX' \ 
--data '.......' 
                                                
                                            
                                                
import requests
import json

endpoint = https://api.zenkraft.com/shippingaccount 

# JSON payload in request code tab
payload = {}

resp = json.loads(r.text)
                                                
                                            
 
                                                
                                            

/cancel

The cancel endpoints allows you to cancel shipments with the carrier.

Parameters
rate_response manifest_error pickup_response ship_request cancel_request rate references ship_response pickup_request shippingaccount_error rate_error track pickup location shipment customs_items successful_response shippingaccount_request dopu_error currencies rate_request inbound_request track_error inbound dopu_request notifications dopu packages inbound_error manifest_request pickup_error base_shipment shipping_account countries shippingaccount_response base_request tracking_number error special_services track_request ship_error
Field Required Data Type Example Values
test boolean True
debug boolean True
tracking_number True string 567293923024
carrier True string fedex
shipping_account True string 5190163571408896
Example Request / Response





{
    "cancel": {
      "shipping_account": 00000000000000,
      "carrier": "ups",
      "tracking_number": "1Z168R020399800319"
    }
  }



                                                
curl --request POST \ 
--url https://api.zenkraft.com/shippingaccount\
--header 'content-type: application/json' \ 
--header 'zkkey: XXXXXXXXXXXXXXXXXXXXXXX' \ 
--data '.......' 
                                                
                                            
                                                
import requests
import json

endpoint = https://api.zenkraft.com/shippingaccount 

# JSON payload in request code tab
payload = {}

resp = json.loads(r.text)
                                                
                                            
 
                                                
                                            

/pickup

The pickup endpoint allows you to schedule pickups for one or more shipments.

Parameters
rate_response manifest_error pickup_response ship_request cancel_request rate references ship_response pickup_request shippingaccount_error rate_error track pickup location shipment customs_items successful_response shippingaccount_request dopu_error currencies rate_request inbound_request track_error inbound dopu_request notifications dopu packages inbound_error manifest_request pickup_error base_shipment shipping_account countries shippingaccount_response base_request tracking_number error special_services track_request ship_error
Field Required Data Type Example Values
test boolean True
debug boolean True
carrier True string fedex
shipping_account True string 5190163571408896
time object
Example Request / Response







{
    "pickup": {
        "carrier": "",
        "debug": true,
        "dim_units": "IN",
        "location": {
            "city": "JERSEY CITY",
            "company": "CHELSEA SYSTEMS LLC",
            "country": "US",
            "email": "seth@wgacany.com",
            "location_type": "business",
            "name": "SETH WEISSER",
            "phone": "+1 201-743-7562",
            "postal_code": "07310",
            "state": "NJ",
            "street1": "812 JERSEY AVE 8TH FL / DOCK 12"
        },
        "shipments": [
            {
                "packages": [
                    {
                        "quantity": 1,
                        "weight": 3
                    }
                ],
                "recipient": {
                    "country": "GB"
                },
                "service": "express_worldwide_p"
            }
        ],
        "shipping_account": 197299590,
        "test": true,
        "time": {
            "close_time": "16:45",
            "date": "2021-05-20",
            "ready_time": "09:45"
        },
        "weight_units": "LB"
    }
}

                                                
curl --request POST \ 
--url https://api.zenkraft.com/shippingaccount\
--header 'content-type: application/json' \ 
--header 'zkkey: XXXXXXXXXXXXXXXXXXXXXXX' \ 
--data '.......' 
                                                
                                            
                                                
import requests
import json

endpoint = https://api.zenkraft.com/shippingaccount 

# JSON payload in request code tab
payload = {}

resp = json.loads(r.text)
                                                
                                            
 
                                                
                                            

/dopu

Parameters
rate_response manifest_error pickup_response ship_request cancel_request rate references ship_response pickup_request shippingaccount_error rate_error track pickup location shipment customs_items successful_response shippingaccount_request dopu_error currencies rate_request inbound_request track_error inbound dopu_request notifications dopu packages inbound_error manifest_request pickup_error base_shipment shipping_account countries shippingaccount_response base_request tracking_number error special_services track_request ship_error
Field Required Data Type Example Values
test boolean True
debug boolean True
carrier True string fedex
location True object
shipping_account True string 5190163571408896
Example Request / Response






{
    "dopu": {
        "carrier": "",
        "location": {
            "city": "london",
            "country": "GB",
            "postal_code": "EC1R 4UG",
            "state": "",
            "street1": "1 hardwick street"
        },
        "shipping_account": "673603996",
        "test": true
    }
}


                                                
curl --request POST \ 
--url https://api.zenkraft.com/shippingaccount\
--header 'content-type: application/json' \ 
--header 'zkkey: XXXXXXXXXXXXXXXXXXXXXXX' \ 
--data '.......' 
                                                
                                            
                                                
import requests
import json

endpoint = https://api.zenkraft.com/shippingaccount 

# JSON payload in request code tab
payload = {}

resp = json.loads(r.text)
                                                
                                            
 
                                                
                                            

/manifest

Manifesting allows you to notify the carrier that your shipments are ready for shipping/pickup.

Parameters
rate_response manifest_error pickup_response ship_request cancel_request rate references ship_response pickup_request shippingaccount_error rate_error track pickup location shipment customs_items successful_response shippingaccount_request dopu_error currencies rate_request inbound_request track_error inbound dopu_request notifications dopu packages inbound_error manifest_request pickup_error base_shipment shipping_account countries shippingaccount_response base_request tracking_number error special_services track_request ship_error
Example Request / Response








{
    "manifest": {
        "carrier": "",
        "debug": true,
        "shipping_account": 40910738,
        "test": true,
        "tracking_numbers": [
            "33GKB500127801000961509",
            "111JD575508301000961502",
            "111JD575511501000961500"
        ]
    }
}
                                                
curl --request POST \ 
--url https://api.zenkraft.com/shippingaccount\
--header 'content-type: application/json' \ 
--header 'zkkey: XXXXXXXXXXXXXXXXXXXXXXX' \ 
--data '.......' 
                                                
                                            
                                                
import requests
import json

endpoint = https://api.zenkraft.com/shippingaccount 

# JSON payload in request code tab
payload = {}

resp = json.loads(r.text)
                                                
                                            
 
                                                
                                            

Object References

rate_response

Field Type Required Min Length Max Length
rates array True - -

manifest_error

Field Type Required Min Length Max Length
message string True - -
code string True - -
detail string True - -

pickup_response

Field Type Required Min Length Max Length
pickup object True - -

rate

Definition of the shipment payload

Field Type Required Min Length Max Length
weight_units string True - -
label_type string True - -
sender object True - -
shipping_account string True - -
currency string True - -
special_services array - -
include_base64_label boolean - -
customs_items - -
packaging string True - -
debug boolean - -
carrier string True - -
references array - -
packages array True - -
type string True - -
test boolean - -
dim_units string True - -
recipient object True - -
service string - -
notifications array - -

references

For carriers that allow you to add reference information to your shipment.

Field Type Required Min Length Max Length
type string True - -
value string True - -

ship_response

Definition of the shipment payload

Field Type Required Min Length Max Length
weight_units string True - -
label_type string True - -
sender object True - -
shipping_account string True - -
currency string True - -
type string True - -
special_services array - -
include_base64_label boolean - -
customs_items - -
packaging string True - -
notifications array - -
tracking_number string - -
carrier string True - -
references array - -
label string - -
packages array True - -
debug boolean - -
dim_units string True - -
recipient object True - -
service string True - -
test boolean - -

shippingaccount_error

Field Type Required Min Length Max Length
message string True - -
code string True - -
detail string True - -

rate_error

Field Type Required Min Length Max Length
message string True - -
code string True - -
detail string True - -

track

Field Type Required Min Length Max Length
test boolean - -
debug boolean - -
tracking_number string True - -
carrier string True - -
shipping_account string True - -

pickup

Field Type Required Min Length Max Length
test boolean - -
debug boolean - -
carrier string True - -
shipping_account string True - -
time object - -

location

Field Type Required Min Length Max Length
city string True - 35
name string True - 35
street1 string True - 35
street2 string - 35
phone string 10 15
state string - 35
postal_code string - 20
country string True - -
company string - 35
email string - -

shipment

Definition of the shipment payload

Field Type Required Min Length Max Length
weight_units string True - -
label_type string True - -
sender object True - -
shipping_account string True - -
notifications array - -
debug boolean - -
recipient object True - -
include_base64_label boolean - -
packaging string True - -
currency string True - -
carrier string True - -
references array - -
type string True - -
customs_items - -
dim_units string True - -
packages array True - -
special_services array - -
service string True - -
test boolean - -

customs_items

Additional information about packages

Field Type Required Min Length Max Length
value number True - -
description string True - -
weight number True - -
quantity integer True - -

successful_response

Field Type Required Min Length Max Length
success object True - -

dopu_error

Field Type Required Min Length Max Length
message string True - -
code string True - -
detail string True - -

currencies

Field Type Required Min Length Max Length

track_error

Field Type Required Min Length Max Length
message string True - -
code string True - -
detail string True - -

inbound

Definition of the shipment payload

Field Type Required Min Length Max Length
weight_units string True - -
label_type string True - -
end_date string - -
sender object True - -
shipping_account string True - -
notifications array - -
debug boolean - -
recipient object True - -
include_base64_label boolean - -
start_date string - -
packaging string True - -
currency string True - -
carrier string True - -
references array - -
type string True - -
customs_items - -
dim_units string True - -
packages array True - -
special_services array - -
service string - -
test boolean - -

notifications

For carriers that allow you to set email/sms for notifications to your shippers.

Field Type Required Min Length Max Length
type string True - -
value string True - -

dopu

Field Type Required Min Length Max Length
test boolean - -
debug boolean - -
carrier string True - -
location object True - -
shipping_account string True - -

packages

We need to know the size and dimensions of your packages.

Field Type Required Min Length Max Length
width number - -
length number - -
weight number True - -
value number - -
height number - -

inbound_error

Field Type Required Min Length Max Length
message string True - -
code string True - -
detail string True - -

pickup_error

Field Type Required Min Length Max Length
message string True - -
code string True - -
detail string True - -

base_shipment

Definition of the shipment payload

Field Type Required Min Length Max Length
weight_units string True - -
label_type string True - -
sender object True - -
shipping_account string True - -
currency string True - -
special_services array - -
include_base64_label boolean - -
customs_items - -
packaging string True - -
debug boolean - -
carrier string True - -
references array - -
packages array True - -
type string True - -
test boolean - -
dim_units string True - -
recipient object True - -
service string - -
notifications array - -

shipping_account

Shipping account number

Field Type Required Min Length Max Length

countries

Field Type Required Min Length Max Length

shippingaccount_response

Carrier credentials

Field Type Required Min Length Max Length
name string - -
country string True - -
auth object - -
carrier string True - -
test boolean - -
id string - -

tracking_number

Tracking number of shipment

Field Type Required Min Length Max Length

error

Field Type Required Min Length Max Length
message string True - -
code string True - -
detail string True - -

special_services

Specific special services (e.g. COD or a Required Signature) depend on a carrier, so go through our documentation to find which those are

Field Type Required Min Length Max Length

ship_error

Field Type Required Min Length Max Length
message string True - -
code string True - -
detail string True - -