Команда опциоанльно



This document describes the most basic commands of ACP Shipper API, needed for sending direct mailing. There are some more commands in this API, that may be used by a shipper: for address verification, mailing tracking, creation return and collect parcels. They are described in separate documents, which is listed on in section “Manuals”.

Description

Endpoint url is OR (for test purposes). Trailing slash in the endpoint URL is STRONGLY recommended especially on slow connections. Using the endpoint URL without trailing slash increase response time by 2-3 times.

Following input parameters must be sent via HTTPs POST method:

apikey=XXXXXXXXXX (required) – your personal API access key that we give to you.

command=commandName (required) – possible commands are described below.

testMode=0|1 (optional, default is 0) – run command in test environment (even if =0, test mode may always be enabled for user by administration).

+ additional parameters specific for each command.

Note: all parameters must be properly encoded, as required by HTTP standard. I.e., if request's encoding is “x-www-form-urlencoded” (header “Content-Type: application/x-www-form-urlencoded”), then all non-alphanumeric chars in parameter names and values must be replaced by char % plus their hexadecimal values. E.g., char “&” must be replaced by “%26”. On practice, it is enough to replace only following characters instead all non-alphanumeric characters: +,%, ?, =, &, #.

|original symbol |URL encoded replacement sequence |

|+ |%2B |

|% |%25 |

|? |%3F |

|= |%3D |

|& |%26 |

|# |%23 |

API answer is standard “HTTP 200 OK” answer. Answer body contains text in XML format, specific for each command. In case of common error, such as authorization error or invalid input parameters, answer is the same for all commands:

Some error description

XSD-schemes as described below XML-requests may be found here:

Possible Commands:

1) command=createMailing

Used for the creation of direct mailing item(s) and (optional) printable shipping label.

Specific parameters:

data=text/xml (required) – data describing mailing items for processing (see below).

label=0|1|2|3|4|10|11|12|14|20|30|40 (required) – type of created and returned shipping label:

– 0 – do not create label, trackingNumber must be provided in this case in request XML

– 1 – ACP Ground   (formerly Zoom Ground) label, max weight is 15 Lbs

– 2 – ACP Expedited (formerly Zoom Expedited) label, max weight is 15 Lbs

– 4 – ACP Expedited Max (ACP Expedited with 25 Lbs max weight + faster delivery)

– 3 – ACP Priority      (formerly Zoom Priority) label, max weight is 70 Lbs

– 10– ACP Surface  (formerly Zoom FedEX) label, max weight is 150 Lbs

– 5 – ACP international  label, used for international parcels originating from US, max weight is 44 Lbs, max declared value is 1000 USD (for parcels goes to china – 1000 CNY). (Please, contact us before using this code)

– 11– FedEx International Economy label (Please, contact us before using this code). You will receive two shipping labels after success API call (you must print them all). PNG labels are returned in a solid zip archive. PDF/EPL as a single file which contains two labels.

– 14– FedEx International Priority label (Please, contact us before using this code). You will receive two shipping labels after success API call (you must print them all). PNG labels are returned in a solid zip archive. PDF/EPL as a single file which contains two labels.

– 40 – ACP EU   (formerly TrakPac) label (Please, contact us before using this code)

– 12 – ACP Mini        (formerly Mini) label

– 20 – Canada label – should be choosed if destination country is Canada

– 30 – China label – should be choosed if destination country is China (Please, contact us before using this code)

– 50 – HLO label – Cargo label (Please, contact us before using this code)

labelFormat=PNG|PDF|EPL2 (optional, default is PNG) – required label image format.

labelSize=4x4|4x6 (optional, default is 4x6) – requested label image size in inches. This option takes effect only on label=1,2,3,4. This option overrides default labelSize default setting. Contact support to change the default value if required.

ddp=0|1 (optional, default is 0) – Delivery Duty Paid flag for dutiable parcels:

– 0 – duty must be paid by consignee

– 1 – duty must be paid by shipper

Structure of XML in data parameter:

1ZWE31190196785492

1234-4567890

20121120-093021

John Doe

9559 Collins Ave Apt #903

Beverly Hills

CA

90210

US

123-456-9890

john-doe@

John Doe

Amazon

some address

some city

EU

12345

GB

john@



John Smith

Shippers, LLC

LAX

Los Angeles

CA

90045

US

1 (800) 426-4968

john-smith@

100.50

EUR

1.125

kg

0.5

0.4

0.3

m

FR

4901.99.0070

Book

2

14.65

29.30

0.5







Fields description:

shippingApiRequest – root node.

mailItem – describes particular mailing item. Can be repeated for the creation of multiple items at once (only if input parameter label=0). Container for HAWB data: goods for customer.

trackingNumber – conditional, tracking number of shipping label (USPS/UPS etc), required if input parameter label=0. Cannot be used with input parameter label≠0.

shipperItemId (optional, desired) – internal shipper's mailing item ID, max length 50 chars. If used, allows this mailing item to be pointed to this id later. Especially recommended if trackingNumber is not transmitted (input parameter label≠0) to avoid placing one mailing item twice due to connection problems, etc. Must be unique through all mailing items (direct and return/collect) for this shipper.

displayItemId (optional) – if used, will be printed on mailing label instead of shipperItemId (if input parameter label≠0).

consignee – required, consignee’s address.

name – conditional, person name, max length 35 chars. "amazon" is forbidden.

companyName – conditional, company name, max length 35 chars.

(either name or companyName is required)

addressLine1, addressLine2 – address information. Combined length of these fields must not be greater than 105 chars. addressLine1 is required field, addressLine2 is optional.

city – required, city name, max length 35 chars.

state –conditional, state/province code, max length 2 chars. Required for countries with states/province/sub-country division. For parcels heading to US state is required field.

zip – required, zip/postal-code, max length 10 chars.

country – required, country code in ISO 3166-1 alpha-2 format (US, GB, CA, …)

phone (optional) – phone number, max length 20 chars. Free form field: 123-456-9890, 1(800) 426-4968, 123456789, etc.

email (required for parcels with value > $800) – email address

shipper (required) – shipper’s address for filling in AMS.

If transmitted, valid address required. If you have more than 1 shipper address there are additional choices:

– set up a different account for each address and omit this node;

– use shipper node in createMailing command.

name – conditional, attention name, max length 35 chars.

companyName – conditional, shipping company name, max length 35 chars.

(either name or companyName is required)

addressLine1, addressLine2 – address information. Combined length of these fields must not be greater than 105 chars. addressLine1 is required field, addressLine2 is optional.

city – required, city name, max length 35 chars.

state –conditional, state/province code, max length 2 chars. Required for countries with states/province/sub-country division.

zip – required, zip/postal-code, max length 10 chars.

country – required, country code in ISO 3166-1 alpha-2 format (US, GB, CA, …)

phone (optional) – phone number, max length 20 chars. Free form field: 123-456-9890, 1(800) 426-4968, 123456789, etc.

email -(required for parcels with value > $800) – email address

shipperURL – optional (desired), shipper’s web site address, is required for parcels heading to DFW.

DFW Airport US customs authorities require this field for clearance.

Leading http:// or https:// is required.

returnAddress (optional) – used only for printing on shipping labels as return address. Format identical to consignee node. If transmitted, valid address required.

value – required, total mailing item's cost, decimal number (i.e. 1234.12).

currency – required, currency code in ISO 4217 format (USD, EUR, GBP, CNY, RMB, …)

weight – required, mailing item total weight in kilograms, decimal number (i.e. 12.345).

weightUnitOfMeasure – required, constant kg.

dimensions (optional) – mailing item’s dimensions in meters.

length – required, length, decimal number.

width – required, width, decimal number.

height – required, height, decimal number.

dimensionsUnitOfMeasure – conditional, constant m, required if dimensions is given.

product – required, describes particular product in this mailing item, should be repeated for each product in it.

countryOfOrigin (optional) – origin country's code in ISO 3166-1 alpha-2 format (US, GB, CA, …).

harmonizationCode (optional, desired)– US customs HTS code, max length 12 chars.

description (required)– product description, max length 300 chars.

manufacturerCode (optional) – product manufacturer's code, max length 35 chars.

sku (optional) – product's SKU.

quantity – (required)purchased quantity, integer.

unitValue (optional, desired) – unit price, decimal number.

value (optional, desired) – total cost of this product, decimal number.

(either unitValue or value is required for parcels with value > $800)

weight (optional) – total weight or this product.

productURL (optional) – link to product’s page. Leading http:// or https:// is required. For example



priorNoticeFilingNumber – optional, reserved for future use, string 12 chars max .

Structure of XML in API answer:

ok

conflict

Error description

1ZWE31190196785492

1234-4567890

PNG

c2FkYXNkZmRhc2......ZhZ2RmaA==

LAX

yes

Direct

2012-08-31T20:00:00Z

Picked Up

1ZWE31190196785492

1234-4567890

20121120-093021

100.50

EUR

1.125

kg

1000001234567890

bag-1234



Fields description:

shippingApiResponse – root node.

mailItem – describes result of creation of particular mailing item. Repeated for every mailing item in request.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– invalid – transmitted mailing item is invalid;

– conflict – conflict with already existing mailing item (e.g., by shipperItemId);

– system – internal system error.

error – text error description in case of error.

trackingNumber – shipping tracking number of label for this mailing item. If creation of shipping label was ordered (input parameter label≠0), it is the tracking number of created label (may be empty in case of error). If not (label=0), it is the tracking number transmitted in request.

shipperItemId – internal shipper's mailing item id, transmitted in request.

labelFormat – format of created label, one of PNG, PDF, EPL2.

label – base64-encoded content of created label.

destinationBag – recommended bag type for shipping this mailing item (i.e. LAX, JFK, ...). Used for sorting mailing items by destination airport on sender's side.

isDutiable (optional) – “yes” for dutiable parcels.

conflictMailItem – in case of conflict with existing mailing item (errorType=conflict), contains description of that mailing item (in case of conflict with someone's else mailing item by tracking number, contains trackingNumber child node only).

type – one of: “Direct”, “Return”, “Collect”, “Undeliverable”.

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – item's current status (“New”, “Picked Up”, etc).

trackingNumber – tracking number.

shipperItemId – internal shipper's mailing item id.

displayItemId – shipper's display item id.

value – total mailing item's cost.

currency – currency code.

weight – mailing item total weight in kilograms.

weightUnitOfMeasure – constant kg.

bagId – system bag id, in which this item is included.

shipperBagId – internal shipper's bag id.

2) command=cancelMailing

Used to cancel some of previously created direct or return/collect mailing item(s).

Specific parameters:

data=text/xml (required) – data describing canceled mailing items (see below).

Structure of XML in data parameter:

1ZWE31190196785492

1234-4567890



Fields description:

shippingApiRequest – root node.

mailItem – describes particular mailing item for canceling, can be repeated for canceling several items at once.

trackingNumber – tracking number of mailing item.

shipperItemId – internal shipper's mailing item id.

(either trackingNumber or shipperItemId is required)

Structure of XML in API answer:

ok

conflict

Error description

1ZWE31190196785492

1234-4567890

Direct

2012-08-31T20:00:00Z

Picked Up

1ZWE31190196785492

1234-4567890

20121120-093021

100.50

EUR

1.125

kg

1000001234567890

bag-1234



Fields description:

shippingApiResponse – root node.

mailItem – describes result of canceling of particular mailing item. Repeated for every mailing item in request.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– invalid – transmitted mailing item is invalid;

– notFound – requested mailing item not found;

– conflict – conflict with current mailing item's state;

– system – internal system error.

error – text error description in case of error.

trackingNumber – tracking number of mailing item.

shipperItemId – internal shipper's mailing item id.

conflictMailItem – in case of conflict with current mailing item's state (errorType=conflict), contains description of current mailing item.

type – one of: “Direct”, “Return”, “Collect”, “Undeliverable”.

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – item's current status (“New”, “Picked Up”, etc).

trackingNumber – tracking number.

shipperItemId – internal shipper's mailing item id.

displayItemId – shipper's display item id.

value – total mailing item's cost.

currency – currency code.

weight – mailing item total weight in kilograms.

weightUnitOfMeasure – constant kg.

bagId – system bag id, in which this item is included.

shipperBagId – internal shipper's bag id.

3) command=createBag

Used for aggregation of direct mailing items in shipping bag (e.g., bag 1 of 10) and printing bag label. Each bag consists of 1 or more mailing items.

Specific parameters:

data=text/xml (required) – data describing created bag (see below).

label=0|1 (optional, default is 0) – return bag label (1) or not (0).

labelFormat=PNG|PDF|EPL2 (optional, default is PNG) – required label image format.

airport= (optional, default is JFK) – you need special permission from ACP to use this feature

Structure of XML in data parameter:

bag-1234

Bag 1 of 10

1ZWE31190196785492

1234-4567890



Fields description:

shippingApiRequest – root node.

bag – describes created bag.

shipperBagId (optional, desired) – internal shipper's bag id, max length 50 chars. If used, allows this bag to be pointed to this id later.

comment (optional) – comments for printing on bag label, max length 50 chars.

mailItem – describes particular mailing item for inclusion in the bag. Should be repeated for each included mailing item.

trackingNumber – tracking number of mailing item.

shipperItemId – internal shipper's mailing item id.

(either trackingNumber or shipperItemId is required)

Structure of XML in API answer:

ok

conflict

Error description

1000001234567890

bag-1234

PNG

c2FkYXNkZmRhc2......ZhZ2RmaA==

2012-08-31T20:00:00Z

New

1000001234567890

bag-1234

Bag 1 of 10

conflict

Error description

1ZWE31190196785492

1234-4567890

Direct

2012-08-31T20:00:00Z

Picked Up

1ZWE31190196785492

1234-4567890

20121120-093021

100.50

EUR

1.125

kg

1000001234567890

bag-1234



Fields description:

shippingApiResponse – root node.

bag – describes result of creating bag operation.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– invalid – transmitted bag is invalid;

– conflict – conflict with already existing bag or current mailing items' state;

– system – internal system error.

error – text error description in case of error.

bagId – system id of this bag, for future usage in other commands, like cancelBag (may be empty in case of error).

shipperBagId – internal shipper's bag id.

labelFormat – format of created label, one of PNG, PDF, EPL2.

label – base64-encoded content of created label.

conflictBag – in case of conflict with existing bag (errorType=conflict) by shipperBagId, contains description of that bag.

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – bag's current status (“New”, “Picked Up”, etc).

bagId – system bag id.

shipperBagId – internal shipper's bag id.

comment – shipper's bag comment.

mailItem – in case of conflict (errorType=conflict), describes particular mailing item requested for inclusion in the bag that can NOT be included in it for a particular reason. Repeated for each such mailing item.

errorType – error type. Possible values are:

– invalid – transmitted mailing item is invalid;

– notFound – requested mailing item not found;

– conflict – conflict with current mailing item's state;

– system – internal system error.

error – text error description.

trackingNumber – tracking number of mailing item.

shipperItemId – internal shipper's mailing item id.

conflictMailItem – in case of conflict with current mailing item's state (both bag's errorType=conflict and mailItem's errorType=conflict), contains description of current mailing item.

type – one of: “Direct”, “Return”, “Collect”, “Undeliverable”.

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – item's current status (“New”, “Picked Up”, etc).

trackingNumber – tracking number.

shipperItemId – internal shipper's mailing item id.

displayItemId – shipper's display item id.

value – total mailing item's cost.

currency – currency code.

weight – mailing item total weight in kilograms.

weightUnitOfMeasure – constant kg.

bagId – system bag id, in which this item is included.

shipperBagId – internal shipper's bag id.

4) command=cancelBag

Used to cancel previously created bag for a particular reason.

Specific parameters:

data=text/xml (required) – data describing canceled bag (see below).

Structure of XML in data parameter:

1000001234567890

bag-1234

Fields description:

shippingApiRequest – root node.

bag – describes canceled bag.

bagId – system id of the bag.

shipperBagId – internal shipper's bag id.

(either bagId or shipperBagId is required)

Structure of XML in API answer:

ok

conflict

Error description

1000001234567890

bag-1234

2012-08-31T20:00:00Z

New

1000001234567890

bag-1234

Bag 1 of 10

Fields description:

shippingApiResponse – root node.

bag – describes result of canceling bag operation.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– invalid – transmitted bag is invalid;

– notFound – requested bag not found;

– conflict – conflict with current bag's state;

– system – internal system error.

error – text error description in case of error.

bagId – system id of this bag, the same as in request.

shipperBagId – internal shipper's bag id.

conflictBag – in case of conflict with current bag's state (errorType=conflict), contains description of the bag.

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – bag's current status (“New”, “Picked Up”, etc).

bagId – system bag id.

shipperBagId – internal shipper's bag id.

comment – shipper's bag comment.

5) command=closeDay

Closes day and generates End of Day manifest.

Specific parameters:

label=0|1 (optional, default is 0) – return End of Day manifest (1) or not (0).

bagLabels=0|1 (optional, default is 0) - return all this day's bag labels (1) or not (0).

labelFormat=PNG|PDF|EPL2 (optional, default is PNG) – required label image format.

airport= (optional, default is JFK) – you need special permission from ACP to use this feature

Structure of XML in API answer:

ok

empty

Error description

2000000123456789

PNG

c2FkYXNkZmRhc2......ZhZ2RmaA==

1000001234567890

bag-1234

PNG

c2FkYXNkZmRhc2......ZhZ2RmaA==



Fields description:

shippingApiResponse – root node.

day – describes result of closing day operation.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– empty – no new mailing items created since last day closing;

– system – internal system error.

error – text error description in case of error.

dayId – system id of closed day.

shipperDayId – internal shipper's day id, always empty for this command.

labelFormat – format of created label, one of PNG, PDF, EPL2.

label – base64-encoded content of created label.

bag – individual current day's bag (if input parameter bagLabels=1). Repeated for all bags created by createBag command in current day.

bagId – system id of this bag

shipperBagId – internal shipper's bag id.

labelFormat – format of created label, one of PNG, PDF, EPL2.

label – base64-encoded content of created label.

6) command=reopenDay

Undo close day to allow add/remove mailing items, bags, etc.

No specific parameters so far.

Structure of XML in API answer:

ok

conflict

Error description

2000000123456789

2012-08-31T20:00:00Z

Picked Up

2000000123456789

day-1234

Fields description:

shippingApiResponse – root node.

day – describes result of reopening day operation.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– notFound – there are no closed days;

– conflict – conflict with last closed day's state;

– system – internal system error.

error – text error description in case of error.

dayId – system id of reopened day.

shipperDayId – internal shipper's day id.

conflictDay – in case of conflict with last closed day's state (errorType=conflict), contains description of that day.

creationDate – closing date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – day's current status (“New”, “Picked Up”, etc).

dayId – system day id.

shipperDayId – internal shipper's day id.

7) command=createDay

Closes day and generates End of Day manifest. Unlike closeDay, all included units (mail items and bags) must be specified in the request.

Specific parameters:

data=text/xml (required) – data describing created day (see below).

label=0|1 (optional, default is 0) – return End of Day manifest (1) or not (0).

bagLabels=0|1 (optional, default is 0) - return all this day's bag labels (1) or not (0).

labelFormat=PNG|PDF|EPL2 (optional, default is PNG) – required label image format.

airport= (optional, default is JFK) – you need special permission from ACP to use this feature

Structure of XML in data parameter:

day-1234

1000001234567890

bag-1234



1ZWE31190196785492

1234-4567890



Fields description:

shippingApiRequest – root node.

day – describes created day.

shipperDayId (optional, desired) – internal shipper's day id, max length 50 chars. If used, allows this day to be pointed to this id later.

bag – describes particular bag for inclusion in the day. Should be repeated for each included bag.

bagId – system id of the bag.

shipperBagId – internal shipper's bag id.

(either bagId or shipperBagId is required)

mailItem – describes particular mailing item for inclusion in the day. Should be repeated for each included mailing item that is not included in any bag.

trackingNumber – tracking number of mailing item.

shipperItemId – internal shipper's mailing item id.

(either trackingNumber or shipperItemId is required)

Structure of XML in API answer:

ok

conflict

Error description

2000001234567890

day-1234

PNG

c2FkYXNkZmRhc2......ZhZ2RmaA==

2012-08-31T20:00:00Z

New

2000001234567890

day-1234

conflict

Error description

1000001234567890

bag-1234

PNG

c2FkYXNkZmRhc2......ZhZ2RmaA==

2012-08-31T20:00:00Z

New

1000001234567890

bag-1234

Bag 1 of 10



conflict

Error description

1ZWE31190196785492

1234-4567890

Direct

2012-08-31T20:00:00Z

Picked Up

1ZWE31190196785492

1234-4567890

20121120-093021

100.50

EUR

1.125

kg

1000001234567890

bag-1234



Fields description:

shippingApiResponse – root node.

day – describes result of creating day operation.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– invalid – transmitted day is invalid;

– conflict – conflict with already existing day or current bags/mailing items' state;

– system – internal system error.

error – text error description in case of error.

dayId – system id of this day, for future usage in other commands, like cancelDay (may be empty in case of error).

shipperDayId – internal shipper's day id.

labelFormat – format of created label, one of PNG, PDF, EPL2.

label – base64-encoded content of created label.

conflictDay – in case of conflict with existing day (errorType=conflict) by shipperDayId, contains description of that bag.

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – day's current status (“New”, “Picked Up”, etc).

bagId – system day id.

shipperDayId – internal shipper's day id.

bag – individual current day's bag. If input parameter bagLabels=1 and result=ok, repeated for all bags created by createBag command in current day and contains label information. In case of conflict (errorType=conflict), repeated for all particular bags that can NOT be included in it for a particular reason.

errorType – error type (in case of error). Possible values are:

– invalid – transmitted bag is invalid;

– notFound – requested bag found;

– conflict – conflict with current bag's state;

– system – internal system error.

error – text error description.

bagId – system id of this bag

shipperBagId – internal shipper's bag id.

labelFormat – format of created label, one of PNG, PDF, EPL2.

label – base64-encoded content of created label.

conflictBag – in case of conflict with current bag's state (errorType=conflict), contains description of the bag.

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – bag's current status (“New”, “Picked Up”, etc).

bagId – system bag id.

shipperBagId – internal shipper's bag id.

comment – shipper's bag comment.

mailItem – in case of conflict (errorType=conflict), describes particular mailing item requested for inclusion in the day that can NOT be included in it for a particular reason. Repeated for each such mailing item.

errorType – error type. Possible values are:

– invalid – transmitted mailing item is invalid;

– notFound – requested mailing item not found;

– conflict – conflict with current mailing item's state;

– system – internal system error.

error – text error description.

trackingNumber – tracking number of mailing item.

shipperItemId – internal shipper's mailing item id.

conflictMailItem – in case of conflict with current mailing item's state (both bag's errorType=conflict and mailItem's errorType=conflict), contains description of current mailing item.

type – one of: “Direct”, “Return”, “Collect”, “Undeliverable”.

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – item's current status (“New”, “Picked Up”, etc).

trackingNumber – tracking number.

shipperItemId – internal shipper's mailing item id.

displayItemId – shipper's display item id.

value – total mailing item's cost.

currency – currency code.

weight – mailing item total weight in kilograms.

weightUnitOfMeasure – constant kg.

bagId – system bag id, in which this item is included.

shipperBagId – internal shipper's bag id.

8) command=cancelDay

Used to cancel previously created day for a particular reason.

Specific parameters:

data=text/xml (required) – data describing canceled day (see below).

Structure of XML in data parameter:

2000001234567890

day-1234

Fields description:

shippingApiRequest – root node.

day – describes canceled day.

dayId – system id of the day.

shipperDayId – internal shipper's day id.

(either dayId or shipperDayId is required)

Structure of XML in API answer:

ok

conflict

Error description

2000001234567890

day-1234

2012-08-31T20:00:00Z

New

2000001234567890

day-1234

Fields description:

shippingApiResponse – root node.

day – describes result of canceling day operation.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– invalid – transmitted day is invalid;

– notFound – requested day not found;

– conflict – conflict with current day's state;

– system – internal system error.

error – text error description in case of error.

dayId – system id of this day, the same as in request.

shipperDayId – internal shipper's day id.

conflictDay – in case of conflict with current day's state (errorType=conflict), contains description of the day.

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – day's current status (“New”, “Picked Up”, etc).

dayId – system day id.

shipperDayId – internal shipper's day id.

9) command=getInfo

Used to get information about all new direct mailing items and bags created in account since last closeDay operation, that have not been picked up yet (command may be used even if shipper does not use closeDay at all ad works only with mailing items). May be used to verify current account's state before requesting closeDay or for handling possible errors that may appear while working with API.

No specific parameters so far.

Structure of XML in API answer:

ok

system

Error description

2012-08-31T20:00:00Z

New

1ZWE31190196785492

1234-4567890

20121120-093021

100.50

EUR

1.125

kg

1000001234567890

bag-1234



2012-08-31T20:00:00Z

New

1000001234567890

bag-1234

Bag 1 of 10



Fields description:

shippingApiResponse – root node.

info – describes result of operation.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– system – internal system error.

error – text error description in case of error.

mailItem – individual current day's mailing item. Repeated for all mailing items created by createMailing command in current day.

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – item's current status (“New”).

trackingNumber – tracking number.

shipperItemId – internal shipper's mailing item id.

displayItemId – shipper's display item id.

value – total mailing item's cost.

currency – currency code.

weight – mailing item total weight in kilograms.

weightUnitOfMeasure – constant kg.

bagId – system bag id, in which this item is included.

shipperBagId – internal shipper's bag id.

bag – individual current day's bag. Repeated for all bags created by createBag command in current day.

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

status – bag's current status (“New”).

bagId – system bag id.

shipperBagId – internal shipper's bag id.

comment – shipper's bag comment.

10) command=createManifest

Used to create MAWB manifest.

Specific parameters:

data=text/xml (required) – data describing required manifest.

Please note that total size of data parameter must be less than 49.999 Mb

expressClearance=0|1 (optional, default is 0) – make express customs clearance:

– 0 – usual clearance

– 1 – express clearance

Structure of XML in data parameter:

123-1234567

34

56

34

56.0

kg

123-1234567.PDF

AGGKGKGDDGGDK…YYYY

123-1234567.xls

JFJFYYUOYOOPJFFH…YRYJG

somebody@

LAX

2012-12-10T10:00:00

JFK

2012-12-10T12:40:00-07:00

AA

123

1ZWE31190196785492

1ZWE31468778779797





Fields description:

shippingApiRequest – root node.

manifest – describes a manifest.

manifestNumber – MAWB# (for example 112-44995451)

senderWarehouseId (optional) – ID of warehouse-sender.

receiverWarehouseId (optional) – ID of warehouse-receiver.

If not sent then account’s default warehouse is used.

Contact us to get warehouses values. List of current warehouse IDs is available at (available for registered users only)

shippingUnits – integer, loose parcels considers to be a separate unite. E.g. you ship 5 bags (each one contents many parcels) and 3 loose parcels. Then you should to send "8" in this field. userDefinedWeight – decimal (3 decimal places after comma), actual weight of all shipping (MAWB etc)

userDefinedWeightUOM – one of kg, lb – weight unit of measure

manifestImage – MAWB “image” file (file size limit is 12 Mb). Accepted formats are PDF, PNG, JPG, BMP, TIFF, DOC, XLS

name 128 chars max, field contains file name

data field contains base64 encode file contents

manifestFile – file with the all HAWBs (file size limit is 20 Mb). We recommend to use the same file that you gave to the air company. Accepted formats XLS, CSV, DOC, Zipped (XLS, CSV, DOC)

name 128 chars max, field contains file name

data field contains base64 encoded file contents

 

alertEmail – email, We will send a confirmation email with copy of uploaded data

manifestPart – contains manifest part data. Repeated for every manifest part.

departureFacility – string, departure airport

departureDate – departure date/time, format is “yyyy-mm-ddThh:mm:ss[(+|-)hh:mm]”. If timezone is not set (2017-10-19T10:11:12) it defaults to GMT

arrivalFacility – arrival airport

arrivalDate – arrival date/time, format is “yyyy-mm-ddThh:mm:ss[(+|-)hh:mm]”. If timezone is not set (2017-10-19T10:11:12) it defaults to GMT

carrier – carrier's code

tripNumber – flight number

unit – describes required unit.

unitId – unit ID (tracking number for parcel, system ID for bag or end of day manifest).

Structure of XML in API answer:

ok

conflict

Error description

1534646

123456789

2012-08-31T20:00:00Z

123456

1534646

123456789

123-1234567

34

56

40

10

2

1

10.125

kg

notFound

Error description

1ZWE31190196785492

mailItem

Direct

2012-08-31T20:00:00Z

10

Picked Up

0

123456

123457

1ZWE31190196785492

123456

20121120-093021

1.125

kg

101234567890

201234567890

LAX-DHL

DHL

Normal

Direct

2012-08-31T20:00:00Z

10

Picked Up

0

123456

123457

101234567890

123456

20

20.25

kg

201234567890

LAX-DHL/JFK-USPS

DHL/USPS

2012-08-31T20:00:00Z

10

Picked Up

0

123456

123457

201234567890

20

2

20.25

kg

LAX-DHL/JFK-USPS

DHL/USPS



Fields description:

shippingApiResponse – root node.

manifest – describes a result of creating manifest.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– invalid – transmitted data is invalid;

– conflict – conflict with already existing manifest by userManifesId or some of mailing items can not be included in the manifest.

– system – internal system error.

error – text error description in case of error.

manifestId – system ID of created manifest (in no errors).

userManifestId – transmitted userManifestId.

conflictManifest – describes already existing manifest with that created manifest conflicted (in case of errorType=conflict)

creationDate – creation date/time in UTC, format is “yyyy-mm-ddThh:mm:ssZ”.

warehouseId – ID of warehouse created this manifest.

manifestId – system ID of manifest.

userManifestId – user ID of manifest.

manifestNumber – external manifest number.

senderWarehouseId – ID of warehouse-sender.

receiverWarehouseId - ID of warehouse-receiver.

numItems – total number of mailing items.

numBags – total number of bags.

numDays – total number of end of day manifests.

numParts – number of parts in manifest.

weight – total weight in kilograms, decimal number (i.e. 12.345).

weightUnitOfMeasure – constant kg.

unit – repeated for every unit that CAN NOT be included in the manifest (in case of global errorType=conflict)

errorType – units error type. Possible values are:

– invalid – transmitted data is invalid;

– notFound – unit not found;

– conflict – conflict with current unit's state.

– system – internal system error.

error – text error description.

unitId – transmitted unitId.

unitType – one of: mailItem, bag, day.

conflictMailItem OR conflictBag OR conflictDay (in case of unit's errorType=conflict; there may appear only on of them, depending on unitType) – describes corresponding mailing unit; format is the same as in other commands' answers (acceptUnit, etc).

11) command=modifyManifest

Used to modify previously created MAWB manifest.

Specific parameters:

data=text/xml (required) – data describing required manifest.

Please note that total size of data parameter must be less than 49.999 Mb

Structure of XML in data parameter:

123456789

123-1234567

34

56.0

kg

123-1234567.PDF

AGGKGKGDDGGDK…YYYY

123-1234567.xls

JFJFYYUOYOOPJFFH…YRYJG

somebody@

LAX

2012-12-10T10:00:00

JFK

2012-12-10T12:40:00-07:00

AA

123

1ZWE31190196785492





Fields description:

shippingApiRequest – root node.

manifest – describes a manifest.

manifestId – system manifest ID.

All other fields are the same as in createManifest command.

Structure of XML in API answer:

ok

conflict

Error description

1534646

123456789

2012-08-31T20:00:00Z

123456

1534646

123456789

123-1234567

34

56

40

10

2

1

10.125

kg

notFound

Error description

1ZWE31190196785492

mailItem

Direct

2012-08-31T20:00:00Z

10

Picked Up

0

123456

123457

1ZWE31190196785492

123456

20121120-093021

1.125

kg

101234567890

201234567890

LAX-DHL

DHL

Normal

Direct

2012-08-31T20:00:00Z

10

Picked Up

0

123456

123457

101234567890

123456

20

20.25

kg

201234567890

LAX-DHL/JFK-USPS

DHL/USPS

2012-08-31T20:00:00Z

10

Picked Up

0

123456

123457

201234567890

20

2

20.25

kg

LAX-DHL/JFK-USPS

DHL/USPS



Fields description:

All fields are the same as in createManifest command's response. Field errorType has one more possible value:

– notFound – required manifest not found;

12) command=cancelManifest

Used to cancel created before manifest (in case of some error in it, etc).

Specific parameters:

data=text/xml (required) – data describing required manifest.

Structure of XML in data parameter:

123456

12345689

Fields description:

shippingApiRequest – root node.

manifest – describes a manifest.

manifestId – system manifest ID.

userManifestId – internal warehouse's manifest ID.

(either manifestId or userManifestId is required)

Structure of XML in API answer:

ok

conflict

Error description

1534646

1534646

2012-08-31T20:00:00Z

123456

1534646

1534646

123-1234567

34

56

40

10

2

1

10.125

kg

Fields description:

shippingApiResponse – root node.

manifest – describes a result of canceling manifest.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– invalid – transmitted data is invalid;

– notFound – required manifest not found;

– conflict – conflict with current manifest's state;

– sent – manifest is already sent to manifest recipient(s) (see sendMatifest command, etc.)

– system – internal system error.

error – text error description in case of error.

manifestId – system ID of manifest.

userManifestId – user ID of manifest.

conflictManifest – describes existing manifest (in case of errorType=conflict), format is the same as in createManifest command's answer.

13) command=getManifest

Used to get full data of previously created manifest.

Specific parameters:

data=text/xml (required) – data describing required manifest.

Structure of XML in data parameter:

123456

12345689

Fields description:

shippingApiRequest – root node.

manifest – describes a manifest.

manifestId – system manifest ID.

userManifestId – internal warehouse's manifest ID.

(either manifestId or userManifestId is required)

Structure of XML in API answer:

ok

invalid

Error description

1534646

1534646

2012-08-31T20:00:00Z

123456

0

New

123-1234567

34

John Smith

Shippers, LLC

LAX

Los Angeles

CA

90045

US

1 (800) 426-4968

john-smith@

56

John Smith

Shippers, LLC

LAX

Los Angeles

CA

90045

US

1 (800) 426-4968

john-smith@

40

10

2

1

10.125

kg

LAX

A

2012-12-10T10:00:00

JFK

B

2012-12-10T12:40:00-07:00

AA

123

20

5

1

50.125

kg

112233

Amazon

John Doe

Amazon

some address

some city

EU

12345

GB

john@

Direct

waste

Custom instruction

2012-08-31T20:00:00Z

10

Picked Up

0

123456

123457

1ZWE31190196785492

123456

20121120-093021

John Doe

9559 Collins Ave Apt #903

Beverly Hills

CA

90210

US

123-456-9890

john-doe@

John Doe

Amazon

some address

some city

EU

12345

GB

john@

John Smith

Shippers, LLC

LAX

Los Angeles

CA

90045

US

1 (800) 426-4968

john-smith@

100.50

EUR

1.125

kg

0.5

0.4

0.3

m

FR

4901.99.0070

Book

2

14.65

29.30

0.5



101234567890

201234567890

LAX-DHL

DHL

Normal

10.50

1.50

0.00

12.00



Direct

2012-08-31T20:00:00Z

10

Picked Up

0

123456

123457

101234567890

123456

20

20.25

kg

201234567890

LAX-DHL/JFK-USPS

DHL/USPS



2012-08-31T20:00:00Z

10

Picked Up

0

123456

123457

201234567890

20

2

20.25

kg

LAX-DHL/JFK-USPS

DHL/USPS





Fields description:

shippingApiResponse – root node.

manifest – describes a manifest.

result – operation result, string ok or error.

errorType – error type in case of error. Possible values are:

– invalid – transmitted data is invalid;

– notFound – required manifest not found;

– system – internal system error.

error – text error description in case of error.

manifest – manifest description, includes all fields that present in return of getManifestList command, plus:

senderAddress – address of warehouse-sender.

receiverAddress – address of warehouse-receiver.

manifestPart – repeats for every manifest part, includes all info given in createManifest command, plus:

numItems – number of mailing items in this part.

numBags – number of bags in this part.

numDays – number of end of day manifests in this part.

weight – total weight in kilograms, decimal number (i.e. 12.345).

weightUnitOfMeasure – constant kg.

mailItem – repeats for every mailing item in this part, contains full info about mailing item. See detailed description in getUnitInfo command.

bag – repeats for every bag in this part, contains short info about it.

day – repeats for every day manifest in this part, contains short info about it.

Description

The system has three types of objects:

1. Parcel

This is the actual parcel that is sent by a Shipper to a specified destination. There are 2 commands that can be used to work with parcels: createMaling and cancelMailing. If the parcel needs to be edited after its creation, it must first be cancelled and re-created.

2. Bag

This is a bag into which parcels are added during the preparation for the shipment process wherein they will be picked up. There are 2 commands that can be used to work with bags: createBag and cancelBag. If the bag needs to be edited after its creation, it must first be cancelled and re-created.

3. Day

The day is an object that groups all bags and parcels that are created during a specific period of time (not necessarily the actual day) and are sent for shipment together. There are also 2 commands that can be used to work with days: closeDay and reopenDay. closeDay groups all new bags and parcels that have not been grouped or sent yet, while reopenDay cancels the last such grouping.

The parcel is the only operating object in the system that is required for work. Bags and days are specified groups of parcels that enable some features (for example, to receive a group of parcels by a Shipper), but are not required for work. It is possible to use bags and not use days, or to use days and not use bags, or to not use either of them. Only the use of the parcel is required for work.

Internal ID

All objects in the system are identified by an internal ID which is reported in a system response for the objects created and it can be used in other operations to classify these objects later. The ID for the parcels is its trackingNumber and can be transferred from an outside program while creating a parcel or it can be generated by the system. The ID for Bags is bagId and is generated by the system. The ID for Days is dayId and it is also generated by the system (as opposed to the others, the dayId is purely informational and not used anywhere else; the command reopenDay opens the last closed day).

While creating packages and bags, the Shipper can also transmit its own internal ID; shipperItemId and shipperBagId, respectively (the ID must be unique to the Shipper for the duration of work). These IDs can be used later to identify objects in place of using the system ID (or with them - in this case, both identifiers must be valid to locate the object). The use of this internal ID is optional but recommended, as it assists in avoiding possible mistakes. For example, if while creating a package with a label (i.e. a trackingNumber is not transferred) the parcel itself was created, but the API result wasn’t received due to communication problems. When a second attempt to create this parcel is made, a duplicate of the parcel will be created because a shipperItemId was not used. An error may be displayed (which can be corrected properly later).

Errors

If an error occurs during system operations, the response of the system contains information that allows the error to be corrected accurately. For example, if you are trying to create an ID that already exists in the system you will receive a result containing a type of “conflict” error that includes the data of the existing parcel. Based on this information presented, a determination can be made regarding the reasons for the error. For example, if the existing package with the same ID was created a week ago, this may be the mistake of client software. If the creation of the parcel took place recently, the API response had not been received due to communication problems and data for the existing parcels in the new result matches the one created, it can be assumed that the parcel was created successfully and therefore we can take the data from this result.

getInfo

The additional command getInfo provides current information about all newly created (i.e. still unsent) parcels and bags from the last closing day. It can be used before applying the command closeDay to ensure that all of the data on the server is correct. In the case of inaccurate results, you will be able to receive current information and to choose how to handle any errors based upon it.

Live Examples

1. The Shipper uses its own labels and is generating a parcel to John Doe. The Shipper is supposed to call createMailing with label=0 and the trackingNumber=123456 (for instance)

2. The Shipper warehouse worker made a mistake. The parcel to John Doe was destroyed accidentally. The Shipper is supposed to call cancelMailing with trackingNumber =123456.

3. The Shipper worker made a mistake and forgot to add an item into the parcel. The Mailing is to be cancelled (use command cancelMailing), and a new one is to be created (use command createMailing). The mailing ID can be the same as it was the first time. The old Mailing should be cancelled prior creating a new mailing with the same mailing ID because the system requires ID uniqueness.

4. The Shipper places individual parcels in a shipping bag. The Integrator working with the Shipper should:

3.1. Keep local records of a “temporary bag.” The temporary bag instance is not to be transferred to ACP.

3.2. The worker keeps packing the real bag (or some other shipping unit), and the Integrator is supposed to keep records of mailing IDs.

3.3. When the “temporarily bag” is full (the worker is ready to seal the physical bag), the Integrator is supposed to call the command createBag.

3.4. Save the bagId received and the label graphics. Print the label.

3.5. The worker should seal the label on the bag.

5. The worker accidentally “sealed” the bag too early. The old bag should be cancelled (use command cancelBag) and a new bag created (use command createBag). Follow the same order as for Mailing cancellation.

6. Two or more Shipping Stations:

If the Shipper has two or more shipping stations (different workers pack orders in two different places) – it is Integrator responsibility to maintain different “temporarily bags” locally. Ideally, each worker should have his or her own “temporary bag” that he or she works with. Each time when one of the workers finishes packing their bag – createBag is supposed to be called.

7. At the end of the day OR in the middle of the day when a track is leaving the Shipper warehouse, the Integrator is supposed to call closeDaycommand. This may be several closed days during one real day.

8. In the case that the day was accidentally closed too early – the Integrator is supposed to reopen the day (use command reopenDay). After the day has been reopened, it can be modified.

Demo and Training Access

If you have a specific question that is not answered in this document; or you need to test a chain of command to check some business case – feel free to use the demo access at You may use a general API key (published on the page by default) – just remember that it’s available for anyone; therefore the database may content random parcels. Feel free to use your own API key – just don’t forget to mark the test mode checkbox – otherwise your account might be billed.

[pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download

To fulfill the demand for quickly locating and searching documents.

It is intelligent file search solution for home and business.

Literature Lottery

Related searches