Contents
- List despatches by job id
- Request a despatch by job id and despatch id
- Add a despatch specification to a job
- Log a despatch as completed
About Despatches
There are two aspects to despatches:
- /jobs/<job.id>/despatches/ — (noun) specifying despatches, during the ordering process,
- /jobs/<job.id>/despatch/ — (verb) logging that a consignment has been despatched.
List despatches by job id
GET path
/jobs/<job.id>/despatches
List the entries for a requested job’s despatch specification. Note that all quantities will be a multiple of the batch quantity of the product of the job.
Parameter |
Description |
format |
json or xml |
HTTP request
GET http://dev.flyerlink.com/api.php/jobs/1792840/despatches?format=json
HTTP response (JSON)
{
"despatches" : [
{
"id" : "2316091",
"account" : "FRIMPTME",
"despatch_method" : "DU",
"quantity" : "500",
"address" : null,
"job" : "1792840"
}
]
}
Response Item |
Description |
despatches |
Container item for despatch item. |
|
id |
despatch.line.id |
|
account |
customer.code |
|
despatch_method |
despatch_method.code for your workgroup, usually 1. |
|
quantity |
Number of items in this despatch (some or all of job.quantity) |
|
address |
null for the customer’s default address, or an address.id for another address. |
|
job |
job.code; the same as specified in the request parameter. |
Retrieve a despatch by job id and despatch id
GET path
/jobs/<job.id>/despatches/<despatch.id>
Retrieves the specified entry for a requested job’s despatch specification.
Parameter |
Description |
format |
json or xml |
HTTP request
GET http://dev.flyerlink.com/api.php/jobs/1792840/despatches/546816?format=json
HTTP response (JSON)
{
"despatches" : [
{
"id" : "546816",
"account" : "PRODDEPT",
"despatch_method" : "D",
"quantity" : "5000",
"address" : null,
"job" : "266386"
}
]
}
Add a despatch spec to a job
POST path
/jobs/<job.id>/despatches
Specifies the despatch instructions for a job.
To remove a existing entry, specify the account + address + despatch_method, with a quantity of 0.
Parameter |
Description |
format |
json or xml |
account |
customer.id |
address |
address.id, if not the customer’s own address. |
quantity |
The number of items despatched; a multiple of the product’s batch quantity. |
despatch_method |
despatchmethod.id |
notes |
A 30-character delivery hint, usually printed on a despatch label. |
HTTP request
POST http://dev.flyerlink.com/api.php/jobs/1792840/despatches
account=TESTCUST&address=000001&quantity=500&despatch_method=1¬es=Despatch%20created?format=json
Log job as fully despatched
POST path
/jobs/<job.id>/despatch
Logs the despatch of a job.
Parameter |
Description |
format |
json or xml |
all |
true |
consignment |
a courier's consignment ID |
tracking_url |
The url to find delivery tracking from a courier |
HTTP request
POST http://dev.flyerlink.com/api.php/jobs/1792840/despatch
?format=json&all=true&consignment=12345&tracking_url=https://www.mycourier.com/tracking/12345
Log a despatch line as partially despatched
POST path
/jobs/<job.id>/despatch
Logs a partial despatch of a job.
Parameter |
Description |
format |
json or xml |
line |
id for the despatch |
quantity |
The quantity of items in the despatch |
boxes |
The number of boxes/cartons/containers used to despatch this quantity. |
run |
run.id |
consignment |
a courier's consignment ID |
tracking_url |
The url to find delivery tracking from a courier |
HTTP request
POST http://dev.flyerlink.com/api.php/jobs/1792840/despatch
line=2316091&quantity=1&boxes=1&run=521445&consignment=12345&tracking_url=https://www.mycourier.com/tracking/12345&format=json