Standard API Calls - legacy

 

This version of the API has been deprecated. If you're doing an implementation from zero, we suggest you take a look at the cleaner, JSON-friendly new version. The new version will also be the focus of development and new features will be created for it, so depending on your particular use case it might be worth switching. We have no plans to discontinue the old version.

 

 

 

URL

Each instance of the CurierManager app may have its own base URL. The generic api url is:

BaseURL/Main?api_key=<api key>&…

The default CurierManager instance is at http://app.curiermanager.ro/cscourier/ (but it may differ in your case) so the full URL to create an expedition will be:

http://app.curiermanager.ro/cscourier/Main?api_key=<api_key>&API_createAWB=true&...

The API Key can be created by the courier company. Note: the client using the api key needs to have a working user.

 The API can be tested using the following address

BaseURL/test_api.html

 

Create expedition

Main?api_key=<api key>&API_createAWB=true

The following fields can be added:

"type", "service_type", "retur", "retur_type", "ramburs", "ramburs_type", "insurance", "weight", "content", "comments", "cnt",

from_name, from_contact, from_str, from_nr, from_bl, from_sc, from_et, from_ap, from_interfon, from_sector, from_city, from_county, from_zipcode, from_country, from_phone,

to_name, to_contact", to_str, to_nr, to_bl, to_sc, to_et, to_ap, to_interfon, to_sector, to_city, to_county, to_country, to_zipcode, to_phone, to_extra

 

type: envelope | package 

service_type: obtain from courier company (eg: regular, express)

retur: 0 | 1  -  Package swap

cnt: number of packages/envelopes

retur_type: colet | document

ramburs: <CoD amount>

ramburs_type: cont | cash  -  CoD type (if sender receives the CoD amount in bank account or as cash

weight: <weight in kg>

from_... fields are used for the sender address, to_... fields for the recipient address

...name: name, company name if applicable

...contact: contact within company

...str: street

...nr: street number

...bl: building

...sc: entrance

...interfon: interphone number

to_extra: any extra information regarding recipient address

use_default_from_address: if "true", it will use the default expedition address in the system instead of the fields above.

 

Any number of extra services (like “Delivery Saturday”) can be specified, each by adding a parameter like service_<service id> with the value true. For example if Delivery Saturday has the id 57, you would have: service_57=true

 The full list of available services can be obtained through the API using the URL:

Main?api_key=<api key>&API_listServices=true

 

Return value

By default, the CreateAWB API call returns a text response, containing the number of the created AWB. You can use the optional parameter json_response=true to get the full details of the created expedition in JSON format.

The status for the created expedition will be uncollected by default (neridicat for Romanian accounts). It can be changed from the Settings menu (Initial_api_status).

 

awb_event_handler is an optional parameter which can be used when creating the awb. It contains an URL towards which the system will send event call – POST requests containing a JSON map with the following fields:

  • awb – awb number
  • status – awb status

 Right now the system is sending events for status changes.

Events are being sent asynchronously, with a delay of max 60s.

 

Get expedition price

Main?api_key=<api key>&API_getPrice=true

Takes the same parameters as API_createAWB, and returns a single number – the price of the expedition.

 

Print AWB

Main?api_key=<apikey>& API_printAWB=true &awbno=<awbno>

Returns the HTML version of the printed waybill.

If you want to save the awb in a pdf format add &pdf=true to the previous link:

Main?api_key=<apikey>& API_printAWB=true&pdf=true&awbno=<awbno>

You can change the format with the parameter format, with the legal values: a6, default. The default value is approximately a5. 

 

Get expedition status:

Main?api_key=<apikey>&API_getStatus=true&awbno=<awbno>

Returns a text with the current expedition status.

 

Change expedition status:

Main?api_key=<apikey>&API_changeStatus=true&awbno=<awbno>&status=<newstatus>

Changes the status of the expedition. Can be used to change status from draft to uncollected, from uncollected to active. Can also be used to cancel an expedition, if the permissions to do so are granted.

 

Get expedition info:

Main?api_key=<apikey>&API_getAWBInfo=true&awbno=<awbno>

Returns a JSON map consisting of:

  • text fields with expedition info ("id", "no", "status", "from_address", "to_address", "from_city", "to_city", "from_country", "to_country", "ramburs", "ramburs_type")
  • "invoice", which contains a map with invoice info (date as unixtime, series, no, value - invoice value without VAT)
  • "decont_client", which contains a map with client settlement info: date as unixtime, transaction_no, value

 

Cancel an expedition:

Main?api_key=<apikey>&API_cancelAWB=true&awbno=<awbno>

Returns "ok" in case of success, or "forbidden" if the current client does not have the permission to cancel expeditions.

 

Get city list

Main?api_key=<apikey>&API_listCities=true

Returns a json list of cities, with the fields "name" and "province" for each.

 

 

The life-cycle of an expedition

An expedition can have one of the following statuses:

  • draft – it can still be edited by the client. It is not ready for pick-up
  • uncollected – it is ready and waiting for pickup
  • active - being delivered
  • delivered - the expedition has been delivered successfully
  • returned - the expedition has been returned for some reason
  • canceled -  the expedition has been canceled before pickup
  • exception - anything else

Romanian companies have the option to use Romanian language status names. These are: initial, neridicat, in_curs, livrat, returnat, anulat, exceptie.

 

 

Search support