Support for

Flyerlink API Guide

John Valentine
by John Valentine 10 years ago
 
This is for you if you're integrating w3p services into your own systems.

Introduction

What is FLAPI (Flyerlink API)? What is FLAPI (Flyerlink API)?

API reference: documentation style API reference: documentation style

FLAPI: Development and Production FLAPI: Development and Production

Understanding API objects

FLAPI: Relationships FLAPI: Relationships

FLAPI: About Orders and Jobs FLAPI: About Orders and Jobs

FLAPI: About Production and Runs FLAPI: About Production and Runs

FLAPI: About Products FLAPI: About Products

FLAPI: About Customers FLAPI: About Customers

API Requests and Responses

FLAPI: Authentication and Credentials FLAPI: Authentication and Credentials

FLAPI: Format for requests FLAPI: Format for requests

FLAPI: Orders FLAPI: Orders

FLAPI: Jobs FLAPI: Jobs

FLAPI: Customers FLAPI: Customers

FLAPI: Products FLAPI: Products

FLAPI: Accounting FLAPI: Accounting

FLAPI: Production Runs FLAPI: Production Runs

Integration

FLAPI: PHP platform example FLAPI: PHP platform example

P-FLAPI Zapier triggers & actions P-FLAPI Zapier triggers & actions

FAQ

(Work in Progress) (Work in Progress)

Appendix

FLAPI: Enumerated Types FLAPI: Enumerated Types

Flyerlink API Guide

This is for you if you're integrating w3p services into your own systems.

What is FLAPI (Flyerlink API)?

FLAPI is a collection of services, which share a common access point.

API Subsets

We’ve organised these into sub-APIs, to create selective subsets of FLAPI, aimed at implementing a type of service:

P-FLAPI For Producers to fetch jobs that have been sold via Flyerlink, a franchisee, or printing.com channel.
M-FLAPI For w3marketplace suppliers, to create products to be sold in Flyerlink channels
S-FLAPI Stock management, to help fulfil jobs needing materials or off-the-shelf goods.

Services

Service FLAPI P-FLAPI M-FLAPI S-FLAPI
Product specifications (get, create)    
Product prices (get, create)    
Product categories (get)    
Product tags (get, create)    
Product groups (get, create)    
Customers (get, create, update) get get  
Customer addresses (get, create, update) get get  
Jobs (get, create, update) get, upd get, upd  
Job despatches (get, create)  
Job finances (get, create, update, delete) get get  
Orders (get, create, list jobs, add package, update) get, list get, list  
Payments (get) get get  
Invoices (get)  
Runs (get, get filtered, accept)    
Jobs in runs (get, delete) get    
Run types (get, create)    
Stock control functionality       TBC

 

API reference: documentation style

Conventions

Our conventions for formatting our API documentation can have the following elements:

  • Title: what an API call does.
  • Path: the HTTP URL's location, including ids.
  • Description: a bit more detail.
  • Parameters: a table of parameters, their value spec and effects.
  • Request example.
  • Response example.
  • Response Items: a table of possible items found in the response.
  • Relations: how data is shared between objects and methods.

Appearance

Code or data files are boxes and labelled with their type, e.g.

HTTP request
GET http://api.templatecloud.com/sandbox/tag_types/?user_key=ba386e729c5f6870cea89f38e92d7a5c&format=json
HTTP response (JSON)
{
    "tag_types": [
        {
            "id": "1",
            "name": "Industry Types"
        },
        {
            "id": "2",
            "name": "Client"
        },
        etc...
    ]
}

Aside from standard code highlighting, we style as follows:

  • keywords or reserved words
    also used to identify nouns in the API path.
  • literal strings
    identify values for variables, or literally-entered text.
  • variables
    identify a variable or parameter name.
  • arguments
    identify a place where an argument should be inserted.
  • comments
  • annotations (comments set apart from the code)

FLAPI: Development and Production

Your website and its data

You’ll need to replicate some data structures on your website, which correspond with some of those in the FLAPI. At the very least, you’ll be storing id fields from Flyerlink, and temporarily holding arrays of objects when processing the results of queries.

See also

Separating development from production

We provide a developers’ sandbox, to help you avoid incurring charges or writing to live data while you’re testing.

Please ask one of our team to set you up with a production account. 

Development URLs

Production URLs

FLAPI: Relationships

w3p-Flyerlink is a complicated system, containing hundreds of tables, which store data relevant to our business and your business. FLAPI exposes the data that is relevant to your integrated application. In this guide, we explain:

  • the data structure, and how tables relate to each other;
  • what the objects represent in the businesses they support; along with
  • some examples of workflows using the API.

Use this in conjunction with the “API Requests and Responses” chapter, which details each field of the data responses.

Relationships

FLAPI hides some of the complexity of the actual data structures. Instead, we designed our API to return simple lists of items associated with the object of interest.

 

FLAPI: About Orders and Jobs

The most important table is the job table.

Typically, a job results from a customer putting an item in their basket. Each job represents a deliverable item or service from a producer to a customer, including its associated options.

Each job can have several revenue items or options available, and multiple jobs can be grouped together in orders. An order may also have a package deal, where jobs purchased together earn discounts.

  • If you are a producer, publishing products to w3p, and expecting jobs to arrive from other workgroup’s customers, see Production and Runs, below.
  • If you are generating orders from your website, see Selling from your website.

Selling from your website

How customers choose products

If you are selling other producers’ existing products, then it’s fairly straightforward to present the products in a searchable interface, and optionally use the TemplateCloud library of professionally-designed, data-aware templates.

FLAPI provides all the job information you'll need to present our products in your listings. See also:

  • TCAPI (TemplateCloud) Integration Guide.

Selling your own products

If you have your own products to sell, then you’ll need to create those products using POST /products/.

If you're building a website from scratch, you may want to check out our w3shop offering, which has the TemplateCloud & FLAPI in-built.

The customer will then make a product and quantity choice of item from your website, which you might add to your website’s basket, before placing the job (optionally in an order) after checkout.

If you are a supplier, you can produce orders made by others within Flyerlink. Simply use your Flyerlink login to access Production > Dashboard. This will show you all the jobs that need to be produced. P-FLAPI also provides functionality so you can progress these jobs within your own system. See Runs.

You can create jobs without creating orders; simply regard orders as a convenient way of grouping jobs together so they can be handled as one object, e.g. for payments, or combination offers.

Then you use the Production workflow. See Production and Runs, below.

 

FLAPI: About Production and Runs

Checking your ‘in-box’

w3p automatically assigns jobs to your workgroup when they are ordered by customers. These jobs are packaged in runs, the objects that track production.

Periodically poll your list of runs, with criteria: state=production and days=<despatch target>

HTTP request
GET https://dev.flyerlink.com/api.php/runs?state=production&days=10&format=json

Starting work

Examine a run, to get the specifications of all its jobs (there is usually just one job in a run).

HTTP request
GET https://dev.flyerlink.com/api.php/runs/1234/jobs?format=json

Claim the run with ‘accept’ call:

HTTP request
POST https://dev.flyerlink.com/api.php/runs/1234/accept
format=json

The locations of artwork files are detailed in each job object in the above GET /runs/.../jobs/ call.

Now do what you do best: convert the order into goods or services, and then process your items for despatch. Inform w3p that this is done by logging the despatch (see Despatching, below).

Aborting a job

If something 'abortive' happens during production of a job, you can remove it from its run

Either you or the studio can then make changes before it does to production again (status 081)

Note for admins

When a job.status is set to 081, and the run type should be configured to be ‘auto-allocating’, then the job will be allocated immediately to a new run.

Just deallocate - make API changes

If you want to change the job, but the job is locked.

First deallocate the job and then make changes using PUT /jobs API requests.

HTTP request
POST https://dev.flyerlink.com/api.php/runs/1234/jobs/5678/deallocate

OR (alias)

HTTP request
POST https://dev.flyerlink.com/api.php/jobs/5678/deallocate

Deallocate & status 091 - require changes from design studio

To require a studio to make changes provide a costing and reason as url parameters

The studio will then be notified the job has been sent to status 091 and requires changes before it can be produced.

HTTP request
POST https://dev.flyerlink.com/api.php/runs/1234/jobs/5678/deallocate
?costing=CAN&reason=My%20Reason

OR (alias)

HTTP request
POST https://dev.flyerlink.com/api.php/jobs/5678/deallocate
?costing=CAN&reason=My%20Reason

Despatching

Immediately before despatching, get the despatch specification again, in case it has changed since calling GET /runs/1234/jobs

Use the POST /job/…/despatch request to register that you have physically packed and processed a job for despatch.

HTTP request
POST https://dev.flyerlink.com/api.php/jobs/<job.id>/despatch
line=2316091&quantity=1000&boxes=1&run=12345

Other Queries

Has a job been despatched?

HTTP request
GET https://dev.flyerlink.com/api.php/jobs/<job.id>/despatch

What runs have been completed?

HTTP request
GET https://dev.flyerlink.com/api.php/runs?state=production&days=10

FLAPI: About Products

Publishing your products

Stage API call
1. create product category POST /product_categories
2. create product group POST /product_groups
3. create product POST /products
4. add pricing POST /products/.../prices
5. assign permissions (Flyerlink)
6. make live (publish) (always live; use Flyerlink to re-enable)

Maintaining your products

Stage API call
7. change pricing POST /products/.../prices
8. change specifications PUT /products
9. retire product (Flyerlink)

 

FLAPI: About Customers

Stage API call (some parameters omitted)
1. create customer category
POST /categories
2. create customer
POST /customers
    (add addresses)
POST /customers/<customer.code>/addresses

    (view contacts/users)


     (view specific contacts)


      (create contacts/users)


     (update contacts/users)

 

GET /customers/<customer.code>/contacts
GET /customers/<customer.code>/contacts/<contact.id>
POST /customers/<customer.code>/contacts
PUT /customers/<customer.code>/contacts/<contact.id>
    create order for customer
POST /orders
customer=<customer.code>
    create job for customer
POST /jobs
customer=<customer.code>
    view invoices
GET /invoices

Then filter your results by customer.

    (retire customer) Customer records become dormant, rather than retired, so that historical records remain. If you have reason to employ checks before trading with a customer, then record it in your own data.

FLAPI: Authentication and Credentials

Authentication

Use the username and password we provide, in basic authentication.

Getting your App approved

You’ll need to obtain credentials (username, password) before you can use the API. Get your developer account details by speaking to w3p API support.

This guide documents the API interface itself. For licensing and legal, see http://w3p.com.

Your API credentials

Your credentials allow your systems to access w3p services via FLAPI. If someone else has your credentials, they too can access the same services, posing as your business.

It is important that you take reasonable measures to ensure that you do not publish your credentials:

  • Use SSL for API calls (use https:// instead of http://). 

  • If you experience problems due to unauthorised sharing of your credentials, then change your credentials, close the security hole, and update your services to use your new credentials.

  • Do not hard-code your credentials in every request call; instead use a variable containing the credentials.

    • Specify your credentials once, in a file on a private part of your server, and include it (by reference) in your framework or page code.

  • Do not allow your web server to show code that might display your credentials.

    • Do not use debug code in the production environment, which might reveal the contents of variables that contain your credentials.

    • Handle errors correctly, so they do not reveal the code that caused the error. If you want traceability, then handle and privately log the error, and optionally inform the user there was a problem along with a reference number that can be used for support.

    • Try to use syntax checkers and syntax-highlighting code editors, and separate the processing code from the presentation code. This helps to avoid serving code into your HTML pages.

  • Do not serve scripts or web pages that contain your credentials, i.e. do not design your systems so that your clients’ web browsers are making API requests directly. Instead, your servers should take minimal requests from your client’s pages, and then your servers issue the API requests to the API on your clients’ behalf.

  • Do not inject unprocessed user-supplied strings into expressions, e.g. do not use something like

    PHP
    <?php $thatWorked = 'Insecure handy calculator: ' . eval( $userInput ); ?>

     

FLAPI: Format for requests

Sandbox and documentation site, to help you test

At https://dev-7.flyerlink.com/api_tester.php we provide a sandbox for API requests, which documents the API requests, along with convenient entry forms where you can specify values for parameters..

Request format

Use standard HTTP requests to communicate with the API.

GET requests are used to read data from TemplateCloud using the API;

PUT and POST requests try to write information to TemplateCloud using the API.

The following example is a request to the API’s sandbox handler, which returns a list of tag types:

HTTP request
GET https://dev-7.flyerlink.com/api_tester.php/tag_types/?user_key=ba386e729c5f6870cea89f38e92d7a5c&format=json

You have the option of specifying the response format using the format parameter. Allowed values are json or xml, the default being xml.

When sending a POST or PUT request, we expect them as HTTP form fields
You can push them through as an array
Here's an example of a POST customer request

<?php

$postFields = [
"id" => "HOTEST",
"name" => "Jean TEST",
"username" => "API example",
"password" => "example1234",
"email" => "bbb@test.com",
"telephone" => "01470054111",
"mobile" => "0674584511",
"address1" => "",
"address2" => "Your Address",
"address3" => "",
"address4" => "Manchester",
"address5" => "",
"postcode" => "M17 1AA",
"countrycode" => "GB",
"workgroup" => "W11",
"category" => "816",
"payment_terms_code" => "CASH",
"payment_terms_description" => "Cash"
];

$s = curl_init();
$username = 'xxx';
$password = 'xxx';

curl_setopt($s, CURLOPT_URL, 'http://dev-7.flyerlink.com/api.php/customers');
curl_setopt($s, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt($s, CURLOPT_RETURNTRANSFER, true);
curl_setopt($s, CURLOPT_POST, true);
curl_setopt($s, CURLOPT_POSTFIELDS, $postFields);

$result = curl_exec($s);
$resstatus = curl_getinfo($s, CURLINFO_HTTP_CODE);
curl_close($s);

var_dump($result);
var_dump($resstatus);

You’ll need your own user_key (see Getting your App Approved).

Response format

Error (response code 404)

HTTP response (JSON)
{
  "status": "error",
  "message": "Template not found"
}

Success (response code 200) 

Where one record is returned, it is presented as a lone object, e.g.

HTTP request
GET https://dev-7.flyerlink.com/api_tester.php/tag_types/1?user_key=ba386e729c5f6870cea89f38e92d7a5c&format=json
HTTP response (JSON)
{
    "tag_type": {
        "id": "1",
        "name": "Industry Types"
    }
}

Where more than one record is returned, the top-level object is an array (having a plural name tag_types), containing child tag type objects. 

e.g. here are the requests and responses for tag types

HTTP request
GET https://dev-7.flyerlink.com/api_tester.php/tag_types/?user_key=ba386e729c5f6870cea89f38e92d7a5c&format=json
HTTP response (JSON)
{
    "tag_types": [
        {
            "id": "1",
            "name": "Industry Types"
        },
        {
            "id": "2",
            "name": "Client"
        },
        etc...
    ]
}

XML format

The XML version is below. Note that the above JSON does not encapsulate the array's items as named objects, but the XML necessarily does: 

HTTP request
GET https://dev-7.flyerlink.com/api_tester.php/tag_types/?user_key=ba386e729c5f6870cea89f38e92d7a5c&format=xml
HTTP response (XML)
<response status="ok">
    <tag_types>
        <tag_type>
            <id>1</id>
            <name>Industry Types</name>
        </tag_type>
        <tag_type>
            <id>2</id>
            <name>Client</name>
        </tag_type>
etc...
    </tag_types>
</response>    

POST responses

  • Currently, responses to POST requests are only returned in XML format.
  • Remember to format POST requests by inserting a new line between the path and the parameters. See examples.

FLAPI: Orders

Quick Reference

Available to: FLAPI, M-FLAPI
Orders
GET /orders/<order>
PUT /orders/<order>
GET /orders
POST /orders
Jobs on Orders
GET /orders/<order>/jobs
Packages
POST /orders/<order>/addpackage

Job Structure

  • workgroup
    • customer categories
      • customer
        • order
          • package
          • jobs

Request 'order' list

GET Syntax
/orders/?workgroup=W11&from=2011-04-01&to=2011-05-01

Retrieves a list of orders by date range and workgroup. You must have permission to view the workgroup to see their orders.

HTTP request
GET http://dev.flyerlink.com/api.php/orders/?workgroup=W11&from=2011-04-01&to=2011-05-01
Parameter Description
workgroup Your workgroup or studio code
from Date from formated yyyy-mm-dd
to Date to formated yyyy-mm-dd
format json or xml
HTTP response (JSON)
{
    "order" : {
        "id" : "XYTVP",
        "contact" : "653569",
        "customer" : "LIANFI22",
        "title" : "Ordered online",
        "reference" : "Reference",
        "date":"26\/04\/2011",
        "totals":[{
                "total" : "144",
                "balance" : "0"
            }
        "jobs" : [{
                "id" : "1648885",
                "title" : "Initial Flyers",
                "reference" : "Reference",
                "product" : "LEGA54V",
                "totals":[{
                    "transfer" : "55.50",
                    "selling" : "144",
                    "total" : "144"
                    "currency" : "GBP"
                }
                "complete" : "yes",
                "status" : "081",                
            }
        ]
    }
}
Response Item Description
order Container
  id Unique identifier for the order.
  contact id of the contact (belonging to a customer) who ordered.
  customer id of the customer who ordered.
  title A given title, to help people identify the order.
  reference Customer’s reference for the order, e.g. a purchase order number.
  date Date order was placed
  package If present, details the package attached to the order. Has a single value or null..
  jobs Container item for job items.
    job Container item for each job.
      id unique identifier for the job.
      product product.code for the job.
      title A given title, to help people identify the job.
      reference Customer’s reference for the job, e.g. a purchase job number.

Request 'order' by code

GET Syntax
/orders/<order.code>

Retrieves a single order item. You must have permission to view this order.

HTTP request
GET http://dev.flyerlink.com/api.php/orders/XYYVP?format=json
Parameter Description
format json or xml
HTTP response (JSON)
{
    "order" : {
        "id" : "XYTVP",
        "contact" : "653569",
        "customer" : "LIANFI22",
        "title" : "Ordered online",
        "reference" : "Reference",
        "date":"26\/04\/2011",
        "totals":[{
                "total" : "144",
                "balance" : "0"
            }
        "jobs" : [{
                "id" : "1648885",
                "title" : "Initial Flyers",
                "reference" : "Reference",
                "product" : "LEGA54V",
                "totals":[{
                    "transfer" : "55.50",
                    "selling" : "144",
                    "total" : "144"
                    "currency" : "GBP"
                }
                "complete" : "yes",
                "status" : "081",                
            }
        ]
    }
}
Response Item Description
order Container
  id Unique identifier for the order.
  contact id of the contact (belonging to a customer) who ordered.
  customer id of the customer who ordered.
  title A given title, to help people identify the order.
  reference Customer’s reference for the order, e.g. a purchase order number.
  package If present, details the package attached to the order. Has a single value or null..
  jobs Container item for job items.
    job Container item for each job.
      id unique identifier for the job.
      product product.code for the job.

Change the requested order

PUT Syntax
/orders/<order.code>

Retrieves a single order item. You must have permission to view this order.

HTTP request
PUT http://dev.flyerlink.com/api.php/orders/XYYVP?format=json&reference=201502-Black3
Parameter Description
format json or xml
reference Customer's reference for the order; text.

List jobs in an order

GET Syntax
/orders/<order.code>/jobs

Lists the jobs in the requested order item; a minimal version of
GET /orders/<order.code>.

HTTP request
GET http://dev.flyerlink.com/api.php/orders/XYYVP/jobs?format=json
Parameter Description
format json or xml
HTTP response (JSON)
{
    "jobs" : [{
            "code" : "1648885",
        }
    ]
}
Response Item Description
jobs Container
  job Container item.
    code job.id

Create an order

POST Syntax
/orders

Creates an order.

HTTP request
POST http://dev.flyerlink.com/api.php/orders
format=xml&title=order&customer=HOTEST&contact=13057&reference=#123
Parameter Description
format json or xml
title Order title, name or description
customer your customer code
contact must be a contact of your customer
reference a purchase order or note
HTTP response (XML)
<response status="ok">
  <id>DVQLK</id>
</response>

See also:

Create a job with an existing order id.

HTTP request
POST http://dev.flyerlink.com/api.php/jobs
order=XYTPP&format=xml

FLAPI: Jobs

Quick Reference

Available to: FLAPI, M-FLAPI
Jobs
GET /jobs/<job>
POST /jobs
PUT /jobs/<job>
Job payments
GET /jobs/<job>/payments
Specifying job despatch (before despatch)
GET /jobs/<job>/despatches
GET /jobs/<job>/despatches/<despatch>
Logging actual job despatch (on despatch)
POST /jobs/<job>/despatches
Download JobMaker Pack
GET /jobs/<job>/jobmaker
Deallocate or Cancel Job
GET /jobs/<job>/deallocate

Job Structure

  • workgroup
    • customer categories
      • customer
        • job
          • job revenue items
          • job finishes
          • job despatches
            • consignments
          • (customer addresses)
          • (notes)
          • (orientation)

FLAPI: Job Main Details

Contents

  • Request all jobs
  • Request job by id
  • Create a job
  • Change a job

Request all jobs

Not supported.

Request job by id

GET path
/jobs/<job.id>

Retrieves the requested job, along with relevant details. 

Note that the returned job.addreses contains the despatch specification for the job, and job.despatches contains completed despatches.

 

Parameter Description
format json or xml
include Specify details to be embedded in the response.
HTTP request
GET http://dev.flyerlink.com/api.php/jobs/855086?format=json
HTTP response (JSON)
{
    "job" : {
        "id" : "855086",
        "status" : "081",
        "customer" : "TESTME",
        "contact" : "315401",
        "quantity_allocated" : "2000",
        "quantity_printed" : "2000",
        "quantity_despatched" : "2000",
        "total_transfer" : "102.48",
        "total_selling" : "172.00",
        "total" : "172.00",
        "product_code" : "LEGA40T",
        "client_reference" : "47742",
        "title" : "My doc holder 2014",
        "category" : "899",
        "quantity" : "2000",
        "auto081" : false,
        "service" : "N",
        "status_text" : "PDF'd and sent",
        "complete" : "yes",
        "multifile" : "no",
        "expected_despatch_date" : "23\/05\/2008",
        "front_filename" : "855086_A01.PDF",
        "reverse_filename" : null,
        "fee_charged_on_job" : 1234567
        "pages" : 1,
        "despatches" : [{
                "id" : "270608",
                "quantity" : "2000",
                "cartons" : "2",
                "weight" : "20.0940",
                "consignment" : "01149464",
                "consignment_url" : "http:\/\/cgi.tnt.co.uk\/trackntrace\/conenquiry.asp?ACTION=TRACK&TYPE=C&QUERY=01249422",
                "date" : "2014-05-23",
                "time" : "00:56:24",
                "line" : "1201211"
            }
        ],
        "addresses" : [{
                "name" : "Five Lives Ltd",
                "addr1" : "",
                "addr2" : "Hope Lane",
                "addr3" : "",
                "addr4" : "Felixtown",
                "addr5" : "",
                "addr6" : "United Kingdom",
                "postcode" : "M33 3OW",
                "countrycode" : "GB",
                "contact" : "Dave McTavish",
                "telephone" : "0161 2289977",
                "line" : "1201211"
            }
        ],
        "revenue" : [ {
                "costing" : "NDY",
                "quantity" : "2000",
                "units" : "1",
                "unitcost" : "0.00",
                "unitrev" : "9.00",
                "cost" : "0.00",
                "revenue" : "9.00",
                "prcost" : "0.00",
                "unitprcost" : "0.00",
                "vat" : "0.000",
                "vatcode" : "Z",
                "vattotal" : "0.000",
                "name" : "STANDARD DELIVERY",
                "customname" : "",
                "voucher" : "f",
                "template" : "f"
            }, {
                "costing" : "PR",
                "quantity" : "2000",
                "units" : "250",
                "unitcost" : "12.81",
                "unitrev" : "20.38",
                "cost" : "102.48",
                "revenue" : "163.00",
                "prcost" : "0.00",
                "unitprcost" : "0.00",
                "vat" : "0.000",
                "vatcode" : "Z",
                "vattotal" : "0.000",
                "name" : "PRINTING",
                "customname" : "",
                "voucher" : "f",
                "template" : "f"
            }
        ],
        "notes" : {
            "brief" : null
        },
        "finishes" : [],
        "orientation" : {
            "front" : "Portrait",
            "back" : "Portrait"
        },
        "jobmaker_pack" : {
            "full_pack" : "http:\/\/dev.flyerlink.com\/api.php\/jobs\/855086\/jobmaker",
            "orderlist_csv" : "http:\/\/dev.flyerlink.com\/api.php\/jobs\/855086\/jobmaker?file=csv",
            "orderlist_xml" : "http:\/\/dev.flyerlink.com\/api.php\/jobs\/855086\/jobmaker?file=xml",
            "worksheet" : "http:\/\/dev.flyerlink.com\/api.php\/jobs\/855086\/jobmaker?file=sheet",
            "packing_slip_draft" : "http:\/\/dev.flyerlink.com\/api.php\/jobs\/855086\/jobmaker?file=slip"
        }
    }
}
Response Item Description
job Container item.
  id Unique identifier for the job.
Customer
  customer A customer.code
  category The customer_category.id for this customer.
  contact user.id for the person who ordered the item (a contact).
Specification
  title A human-readable name to help you and your customer identify this job. May be non-unique.
  client_reference Customer’s reference for the job, e.g. a purchase order number.
  product_code product.code
  product Container for product details, when &include=product is requested.
See GET /product.
  auto_081 t for products that progress automatically to production as soon as they are ordered (generally for simple products that need no further preparation).
  service Service level code (internal to Flyerlink). Indicates accelerated, normal, or slower turnaround.
  quantity The number of items ordered. This will be a multiple of the product’s batch quantity.
  finishes

Container item for finish items.

If a job uses a product that has finishing choices, then for that job, one finish from each finishing choice must be chosen.

    finish Container item.
      id finish.code, identifying the option or process.
      quantity Number of items to be processed.
      name The name of the finish, in the current language.
      memo Special instructions to the operator who processes the finish.
Design and Communications
  notes

Container item.

    brief The design brief (memo).
  orientation

Container item.

    front Optional: portrait or landscape.
    back Optional: portrait or landscape.
  jobmaker_pack

Container item. Points to downloadable resources for this job.

    full_pack URL for the API call to download a zip containing all the resources pointed at by orderlist_csv, orderlist_xml, worksheet, packing_slip_draft.
    orderlist_csv URL for the API call to download the order list as a CSV file.
    orderlist_xml URL for the API call to download the order list as an XML file.
    worksheet URL for the API call to download the worksheet as a PDF.
    packing_slip_draft URL for the API call to download the packing slip as a PDF.
Revenue Items
  total_transfer Net amount charged to the selling workgroup, excluding taxes.
  total_selling Net amount charged to the customer, excluding taxes.
  fee_charged_on_job The job.code for the template fee charged (or null). Use /jobs/ to examine it.
  total Gross amount charged to the customer, including taxes.
  revenue Container item for revenue lines
    line Container item
      costing The costing.code, identifying the extra goods or services
      quantity The number of items covered by line
      units Number of times this costing is charged
      unitcost Transfer price, per unit
      unitrev Selling price, per unit
      unitprcost Production cost, per unit
      cost Total transfer price, for this line, = unitcost * units
      revenue Total selling price, for this line, = unitrev * units
      prcost Total production price, for this line, = unitprcost * units
      vat Total tax amount for this line
      vatcode The id of the tax type. These IDs vary by geographic location
      vattotal The currency amount, for taxes
      name The standard name for this costing, in the current language
      customname Where revenue editing is allowed for the costing, this may contain the edited name.
      voucher t when this line accounts for voucher adjustments.
      template t when this line accounts for template charges
Production and Despatch
  status The job’s current status, char(3). See Enumerated types.
  status_text Description of the status
  complete t when the job is invoiced and despatched.
  expected_desaptch_date Date and time, as text: <date> at <time>
  front_filename Filenames, as uploaded, and as presented in the Job Pack download.
  reverse_filename
  quantity_allocated Items grouped (committed) ready for production
  quantity_printed Items processed in production
  quantity_despatched Items packed and processed for despatched
  addresses Container item for address items
    address Container item; see customers:addresses.
      line despatch.id; use /jobs/…/despatches/.../line for detail
  despatches Completed despatches (container item for despatch items)
    despatch
Container item; see customers:addresses.
Each despatch item corresponds to a completed ‘packing and despatch’ operation.
      id despatch.line.id
      quantity Number of items in this despatch (some or all of job.quantity)
      cartons Number of separate boxes or deliverable packages
      weight Weight of the boxes in this despatch for this job, local units (kg or lbs).
      consignment Consignment ID, likely to have been issued by the carrier’s own systems.
      consignment_url Tracking URL, for customers to see the progress of their delivery.
      date Timestamp, local hub time.
      time

Create 'job'

Creates a new job. Note that other data items will need to be in place before creating a job, e.g. category, customer, product. You may optionally specify the despatches you have completed, along with auto081=true.

Parameter Description
format json or xml
title text; familiar name for the job; visible to customer.
customer customer.id
contact contact.id
product_code product.code
quantity a multiple of the product’s batch quantity
category category.code. Obtain this from customer.
order (optional) order.id; Add the created job to this order.
auto081 (optional) When true, the job will automatically progress to production; incompatible with order.
finishes (as required) See GET /products/<product.code>
HTTP request
POST http://dev.flyerlink.com/api.php/jobs
title=Job%20Created%20via%20API&customer=TEST&category=503&contact=12443&product=CSBUS&quantity=1000&auto081=true&despatch_address=000001&despatch_method=1&despatch_quantity=500&format=xml

FLAPI: JobMaker packs

Download a JobMaker pack

GET path
/jobs/<job.id>/jobmaker

Responds with the the requested job's files, packed into a ZIP file. If no arguments are presented, the graphic PDFs will also be included.

Parameter Description
file Default: all.
Possible values: csv|xml|sheet|slip
HTTP request
GET http://dev.flyerlink.com/api.php/jobs/266386/jobmaker

FLAPI: Job Despatch

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&notes=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

FLAPI: Job Finances

Contents

  • List finance lines by job id and costing id
  • Add a finance lines to a job
  • Change a finance line
  • Remove a finance line

List finances by job id and costing id

GET path
/jobs/<job.id>/finances/<costing.id>

Retrieves the requested job finance lines, which are the items that comprise the total charge, e.g. individual goods and services.

Note that the costing.id is case sensitive, so the example below would fail with pr as an argument.
Parameter Description
format json or xml
HTTP request
GET http://dev.flyerlink.com/api.php/jobs/266386/finances/PR?format=json
HTTP response (JSON)
{
    "finance" : {
        "job" : "266386",
        "costing" : "PR",
        "quantity" : "5000",
        "units" : "500",
        "unitcost" : "69.00",
        "unitrev" : "39.00",
        "cost" : "217.35",
        "revenue" : "390.00",
        "prcost" : "0.00",
        "unitprcost" : "0.00",
        "vat" : "20.00",
        "vatcode" : "1",
        "vattotal" : "78.000",
        "name" : "PRINTING",
        "customname" : null,
        "voucher" : "f",
        "template" : "f"
    }
}

Add finances to job

POST path
/jobs/<job.id>/finances

Adds a job finance line. Returns an error message if a line with matching <job.id> and <costing.code>​ already exists.

Parameter Description
format json or xml
costing (required) costing.code.
revenue (required) currency amount for the Selling Price.
HTTP request
POST http://dev.flyerlink.com/api.php/jobs/266386/finances
costing=AAA&revenue=56&format=xml

Change a job finance line

PUT path
/jobs/<job.id>/finances/<costing.code>

Changes a job finance line.

Parameter Description
format json or xml
revenue (required) currency amount for the Selling Price.
HTTP request
PUT http://dev.flyerlink.com/api.php/jobs/266386/finances/C?revenue=56&format=xml

Delete a job finance line

DELETE path
/jobs/<job.id>/finances/<costing.code>

Removes the existing job finance line that matches <job.id> and <costing.code>.

Parameter Description
format json or xml
HTTP request
DELETE http://dev.flyerlink.com/api.php/jobs/2247469/finances/AAA&format=xml

FLAPI: Customers

Quick Reference

Available to: FLAPI, M-FLAPI

Paths for Customers

GET /customers/<customer.code>/
POST /customers/<customer.code>/
name=<name>
PUT /customers/<customer.code>/

Paths for Customer Addresses

GET /customers/<customer.code>/addresses
POST /customers/<customer.code>/addresses
PUT /customers/<customer.code>/addresses

Paths for Customer contacts

GET /customers/<customer.code>/contacts
POST /customers/<customer.code>/contacts
PUT /customers/<customer.code>/contacts/<contact.id>

Customer Structure

  • workgroup
    • customer categories
      • customer

FLAPI: Customer Main Details

Request 'customer' by code

GET Syntax
/customers/<customer.code>

Retrieves a single customer item. You must have permission to view this customer.

HTTP request
GET http://dev.flyerlink.com/api.php/customers/HOTEST?format=json
HTTP response (JSON)
{
    "customer" : {
        "id" : "HOTEST",
        "name" : "printing.com",
        "address1" : "",
        "address2" : "Eighth Street",
        "address3" : "Second Avenue",
        "address4" : "Manchester",
        "address5" : "",
        "postcode" : "M17 1FG",
        "countrycode" : "GB",
        "category" : "417",
        "workgroup" : "W12"
        "payment_terms_code":"CASH",
        "payment_terms_description":"Cash"
    }
}

Create a 'customer'

POST Syntax
/customers

Creates a new customer item, using the specified parameters.
Success is indicated in the response by the status attribute of the response tag. If successful, the customer.id is returned.

Parameter Type Description
format string json or xml.
id char(8) New unique identifier for the customer.
name* char(40) Name for the new customer.
username char(90) username to log into a microsite
Must be unique
password char(255) password to log into their microsite - will be hashed after submission
email char(60) contact's email address
telephone char(20) contact's main telephone number
directtel char(20) additional telephone number
fax char(20) a fax number
mobile char(20) mobile number
website char(255) customers website
title char(4) customer's title
surname char(40) customer's surname
position char(40)
 
customer's job position
address1 ... address5 char(40)

Address lines. address1* is usually the legal / business name.
 

address2* is required as first line of the address, such as street number

address4* is required for the post town

Couriers may require that some of these details match the postcode.

postcode*  
countrycode char(4) Used as an address line, and to validate the postcode against the relevant third-party database (e.g. Post Office for UK).
workgrp char(8) Your workgroup.code.
category* char(4) Default category.code for customers created under this  workgrp (workgroup).
payment_terms_code char(1) Identifies payment terms, e.g.
CASH = must pay basket to order
14 = due in 14 days
payment_terms_description char(30)  
     
HTTP response (XML)
<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
  <id>APICUCT</id>
</response>
HTTP response (XML)
<?xml version="1.0" encoding="UTF-8"?>
<response status="error">
  <message>Data provided is not valid.</message>
  <errors>
    <id>
      <error>has already been taken.</error>
    </id>
  </errors>
</response>

Change 'customer' properties

PUT Syntax
/customers/<customer.code>

Changes the specified properties of a single customer item. You must have permission to access to this customer.

Parameter Type Description
format string json or xml.
name char(40) A short name for your customer’s account.
    (other properties will be implemented soon)
HTTP request
PUT http://dev.flyerlink.com/api.php/customers/HOTEST?name=Smiths&format=json

Request 'contact'

Each customer has at least 1 contact. Each contact has their own name, username and contact information.

View all contacts belonging to a customer

GETSyntax
/customers/<customer.code>/contacts
HTTP request
GET http://dev.flyerlink.com/api.php/customers/BDSPARK/contacts
HTTP response (XML)
<response status="ok">
  <contacts>
    <contact>
      <id>906396</id>
      <customer>BDSPARK</customer>
      <salutation>7</salutation>
      <title>Mr</title>
      <firstname>5</firstname>
      <surname>6</surname>
      <email>branddemand@printing.com</email>
      <telephone>€ à â ä æ ç é Â £</telephone>
      <website>www.sparklecleaning.co.uk</website>
      <directtel>0123456789</directtel>
      <fax></fax>
      <mobile>0723456789</mobile>
      <address></address>
      <username>BDSPAR25</username>
    </contact>
    <contact>
      <id>795724</id>
      <customer>BDSPARK</customer>
      <salutation>alistair</salutation>
      <title></title>
      <firstname>alistair</firstname>
      <surname>wilson</surname>
      <email>alistair.wilson@printing.com</email>
      <telephone></telephone>
      <website></website>
      <directtel></directtel>
      <fax></fax>
      <mobile></mobile>
      <address></address>
      <username>BDALIS22</username>
    </contact>
</contacts>

View all individual contact belonging to a customer

GETSyntax
/customers/<customer.code>/contacts/<contact.id>
HTTP request
GET http://dev.flyerlink.com/api.php/customers/BDSPARK/contacts/906396/
HTTP response (XML)
<response status="ok">
  <contacts>
    <contact>
      <id>906396</id>
      <customer>BDSPARK</customer>
      <salutation>7</salutation>
      <title>Mr</title>
      <firstname>5</firstname>
      <surname>6</surname>
      <email>branddemand@printing.com</email>
      <telephone>€ à â ä æ ç é Â £</telephone>
      <website>www.sparklecleaning.co.uk</website>
      <directtel>0123456789</directtel>
      <fax></fax>
      <mobile>0723456789</mobile>
      <address></address>
      <username>BDSPAR25</username>
    </contact>
 </contacts>

Create 'contact'

POST Syntax
/customers/<customer.code>/contacts/

Creates a new contact belonging to an existing customer, using the specified parameters.
Success is indicated in the response by the status attribute of the response tag. If successful, the contact.id is returned.

Parameter Type Description
format string json or xml.
firstname char(40) Name for the new customer.
username char(90) username to log into a microsite
Must be unique
password char(255) password to log into their microsite - will be hashed after submission
email char(60) contact's email address
telephone char(20) contact's main telephone number
directtel char(20) additional telephone number
fax char(20) a fax number
mobile char(20) mobile number
website char(255) customers website
title char(4) customer's title
surname char(40) customer's surname
position char(40)
 
customer's job position
HTTP response (XML)
<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
  <id>1035064</id>
</response>
HTTP response (XML)
<?xml version="1.0" encoding="UTF-8"?>
<response status="error">
  <message>Data provided is not valid.</message>
  <errors>
    <id>
      <error>has already been taken.</error>
    </id>
  </errors>
</response>

Update 'contact'

PUT Syntax
/customers/<customer.code>/contacts/<contact.id>

Updates an existing contact, details using the same parameters as create contact.
Success is indicated in the response by the status attribute of the response tag. If successful, the contact.id is returned.

FLAPI: Customer Addresses

Each customer has a main invoicing address. They may have additional delivery addresses, accessed using these .../addresses requests.

Request 'addresses' by customer

GET Syntax
/customers/<customer.code>/addresses

Retrieves all addresses for a customer (limited to 300 items).

Request 'address' by customer and address id

GET Syntax
/customers/<customer.code>/addresses/<address.id>

Retrieves a single address item for a customer. Note that the address.id values are 6-character strings of numeric digits, having leading zeros.

HTTP request
GET http://dev.flyerlink.com/api.php/customers/HOTEST/addresses/000004?format=json
HTTP response (JSON)
{
    "address" : {
        "id" : "000004",
        "customer" : "HOTEST",
        "name" : "Fred Valentine",
        "address1" : "Name of the Building, or number+street",
        "address2" : "3rd Avenue",
        "address3" : "The Village",
        "address4" : "Trafford Park",
        "address5" : "",
        "countrycode" : "GB",
        "postcode" : "M17 1FG",
        "telephone" : "",
        "contact" : "Fred Valentine"
    }
}
Response Item Description
product Container item, with status attribute.
  id Unique identifier for the product.
  customer customer.code
  name Trading name of the business, or customer's name.
  address1 ... address5 Address lines. Some couriers require that some of these details match the postcode.
  postcode
  countrycode ISO 2-character country code.
  telephone The contact number, relevant to receiving deliveries at this address.
  contact The name of the person at this address, likely to be available to receive deliveries.

Create a 'customer address'

POST Syntax
/customers/<customer.code>/addresses

Adds a new address to the customer. The new address.id is returned in the response. Use this address.id only in the context of the same customer.code when working with existing addresses.

HTTP request
POST /customers/HOTEST/addresses
name=Address%20Created%20Through%20API&address1=legal%20name&address2=6%20street%20name&address3=town&address4=county&address5=state&countrycode=GB&postcode=ABC%20DEF&telephone=01234%20578901&contact=Mr%20Test%20Cust

Update a 'customer address'

PUT Syntax
/customers/<customer.code>/addresses/<address.id>

Updates one or more fields of an identified customer + address.

Only add the parameters you want to update.

FLAPI: Products

Quick Reference

Available to: FLAPI, M-FLAPI
Product categories (read-only)
GET /product_categories/<prodcat>
Product groups
GET /product_groups/<prodgrp>
POST /product_groups/<prodgrp>
Product specifications
GET /products/<product>
POST /products
Product pricing
GET /products/<product>/prices
POST /products/<product>/prices

Product Structure

  • product zones
    (API has no direct access; product categories refer to these)
    • product categories (read only)
      • product groups (read and write)
        • products (read and write)

Process

To expose your products using FLAPI, do the following, in order:

  • Create a product group, if you have not already, using 

    POST /product_groups/
  • Create a product, using

    POST /products/
  • Specify product pricing, using

    POST /products/<product.id>/prices

Product Types

Our API is not only suited to web-2-print, but also handles other goods or service workflows. You choose the workflow for a product by selecting a product type.

Product Type file required physical item stock-managed default weight
1: printed item  
2: stock-pick item  
3: service        
4: electronic / file-only      

 

FLAPI: Product Categories

We have provided a number of product categories that should suit all likely web-2-print products. Please map your product groups to the product category that is the best fit.

If you cannot find a product category to suit, please request a new product category by contacting API Support.

Request product category by code

Syntax
/product_categories/<product_category.code>

Retrieves a product category.

Parameter Description
format json or xml
HTTP request
GET http://dev.flyerlink.com/api.php/product_categories/BUSCARD?format=json
HTTP response (JSON)
{
    "product_category" : {
        "code" : "BUSCARD",
        "prodzone" : "BUSCARD",
        "name" : "Business Cards"
    }
}
Response Item Description
product_category Container item
  code Unique identifier for the product category.
  name The product category’s name, in the current language.
  prodzone The product zone that this product category belongs to.

FLAPI: Product Groups

A product group may contain many products, and every product belongs to one product group.

We recommend that you group products by similar production or marketing details. For example, all products with a certain finishing type could belong to the same product group, regardless of their page_size, colour_type, or quantity.

Request 'product group' by code

Syntax
/product_groups/<product_group.code>

Retrieves a product group.

Parameter Description
format json or xml
HTTP request
GET http://dev.flyerlink.com/api.php/product_groups/BC?format=json
HTTP response (JSON)
{
    "product_group" : {
        "code" : "BC",
        "name" : "Regular Business Cards",
        "url_slug" : "regular-business-cards",
        "prodcat" : "BUSCARD"
    }
}
Response Item Description
product_group Container item
  code Unique identifier for the product category.
  name The product category’s name, in the current language.
  url_slug The url string (for your public websites) that displays the page for this product group. E.g. my.domain.com/url-slug
  prodcat The product category that this product group belongs to.

Create 'product group'

POST Syntax
/product_groups

Creates a new product group, ready for new products.

* = required parameter.

Parameter Type Description
format string json or xml
name* char(40) Name for the new product group
prodcat char(8) An existing product_category.code.
workgrp char(8) The workgroup.code for the workgroup who makes the product: your own workgroup.code, or your supplier’s workgroup.code.
description memo This is a concise product description. We suggest you follow the standard style of specification that printing.com products use.
commonname char(70) The name that is common to the intended market rather than the (perhaps unknown) name that you give your product.
restrictions memo Any limitations that customers should know about a product, such as how many fabrics an embroidered item of clothing can use.
supplierofwg char(8) workgroup.id for the group of users a product can be supplied to. This is only used if the product group is being made by a OpenSource Supplier. Enter the code of the selling workgroup who that supplier belongs to.
bulletpoint char(60) Short feature list for sales websites.
meta_title char(100) SEO meta-data
meta_description char(128) SEO meta-data
preflight_type char(2) If users will use FileCheck for this product group, choose one of the published preflight profiles; see Enumerated types: Preflight Types.
supplieready_preflight_type char(2) These additional preflight types perform conversions to the layout of the artwork, to conform to generic supplier specifications. See Enumerated types: Supplieready Preflight Types
opensource Boolean true for OpenSource; false for Marketplace. 
HTTP request
POST http://dev.flyerlink.com/api.php/product_groups/BC
format=xml
HTTP response (XML)
<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
  <id>772</id>
</response>
Response Item Description
response Container item with status attribute.
  id Unique identifier for the product group.

FLAPI: Product Specifications

Contents

  • Request all products
  • Request a product by code
    • Optional parameter: quantity
    • Optional parameter: language
  • Create a product

Request all products

Syntax
/products/

Retrieves all products, optionally filtered, limited to 300 items.

It is recommended that you do not make this request if you have more than 300 products, because the retrieved list will be incomplete at 300 items, and is not guaranteed to be ordered in the way you expect.
Parameter Description
format json or xml
code product.id filter. Use a URL-safe ? for (any number of characters) wildcards. Use this parameter as an alternative to /products/<product>
name product.name filter. Use a URL-safe ? for (any number of characters) wildcards.
width Filter for width and height. Specifying both will return products with the required width and height. To return both orientations, query twice, e.g. &width=297&height=210and merge with &width=210&height=297 
height
quantity When quantity used with code, the response includes the calculated pricing for the required quantity.
language When language is present, the response includes the notes item, which contains design and special memos.
HTTP request
GET http://dev.flyerlink.com/api.php/products?format=json

Request 'product' by code

Syntax
/products/<product.code>
HTTP request
GET http://dev.flyerlink.com/api.php/products/MBG3L5T?format=json
HTTP response (JSON)
{
    "product" : {
        "id" : "MBG3L5T",
        "name" : "Premium Gloss Folded Leaflet :: 3 Panel Land A5",
        "filetype" : "PDF",
        "width" : "630.0000",
        "height" : "148.0000",
        "bleed" : "1.5000",
        "rununits" : "1",
        "reverse" : "4",
        "allowmulti" : "t",
        "partnercode" : null,
        "prices" : {
            "selling" : [223, 259, 281, 303, 317, 330, 343, 356, null, null],
            "transfer" : [ ... ]
        },
        "variations" : [{
                "code" : "A",
                "finishes" : [{
                        "code" : "FROLL3",
                        "name" : "3 Panel Roll Fold"
                    }, {
                        "code" : "FZFOLD",
                        "name" : "3 panel Z Fold"
                    }, {
                        "code" : "FMBCUSTM",
                        "name" : "Custom Fold"
                    }, {
                        "code" : "NF",
                        "name" : "Do Not Fold - supply flat"
                    }
                ]
            }
        ]
    }
}
Response Item Description
product Container item, with status attribute.
  id Unique identifier for the product.
  name Brief one-line name that summarises and identifies the product uniquely.
  filetype Usually the file extension, e.g. "PDF". Leave blank for no file.
  templatesizes_id Determines the dimensions and page count of the product, as an alternative to width, height and bleed.
  width

width and height define the finished size of the product.

The PDF page size is (width or height) + bleed * 2, and the bleed is internal to the document edge.

  height
  bleed
  rununits Number of items (sheets) that form a quantity of 1. Most products will have a value of 1; use higher values if your product consists of many identical parts, e.g. a set of cards with parts having different content.
  reverse Number of inks printed on the reverse, e.g. 0, 1, or 4.
  allowmulti Allows multiple files to be submitted, one per page, e.g. two PDF files for a two-sided business card.
  partnercode If your product has a code in another system, you can log it here.
  prices Prices for each revenue stream.
    selling

Each is an array of floats, corresponding to [1..10] batches, and the price of each batch thereafter, up to product.maxbatches

  • selling: what end clients pay the reseller or partner; 
  • transfer: the 'trade' price charged by us to the reseller, or system fees;
  • production: the make or buy costs incurred by the reseller.
    transfer
    production
  variations Container for variation items (where present).
    variation Container: a variation item.
      code A variation group (not a foreign key; has scope only within this product). When creating or changing a job that uses this product, then for that job, you need to choose one finish from each variation group.
      finishes Container for finish items.
        finish Container: a finish item.
          code finish.code
          name finish.name; a short, one-line description.

Optional parameter: quantity

When quantity is used with code, the response includes the quantities item, containing calculated pricing for the required quantity.

Note that quantity should be a multiple of units, up to the limit of (maxbatch * units); see POST /products/.

HTTP request
GET http://dev.flyerlink.com/api.php/products/FZMBGA4V?quantity=1000&format=json
HTTP response (JSON)
{
    "product" : {
        "id" : "FZMBGA4V",
        ...
        "prices" : { ... },
        "variations" : [{ ... }],
        "quantities" : [{
                "quantity" : 1000,
                "batches" : 2,
                "selling_price" : 84,
                "transfer_price" : 40.2
            }
        ]
    }
}
Response Item Description
  quantities Container item, for quantity items.
    quantity = product.units * quantities.batches
    batches Number of batches required for exactly this quantity.
    selling_price Price for each revenue stream: float value. The selling_price is what is charged to the end-user; transfer_price is what the reseller is charged.
    transfer_price

Optional parameter: language

When language is used with code, the response includes the notes item.

HTTP request
GET http://dev.flyerlink.com/api.php/products/CSBUS41?language=en_GB&format=json
HTTP response (JSON)
{
    "product" : {
        "id" : "CSBUS41",
        ...
        "prices" : { ... },
        "variations" : [{ ... }],
        "notes" : {
            "design" : "...",
            "special" : "..."
        }
    }
}
Response Item Description
  notes Container item.
    design Provides hints to designers about the design of this product.
    special Provide information about the intended purpose of the product, or instructions about how it should be sold.

Create 'product'

Creates a new product.

  • You’ll need a product category and product group before creating the product.
  • After creating the product, add prices and tags.

Name, description, notes (etc) will be added only in your own language.

* indicates required.

Syntax
/products/<product.code>
HTTP request
POST http://dev.flyerlink.com/api.php/products/MBG3L5T
name=API%20Product%20Example&description=Product%20Description&notes=Design%20Notes&special=Special%20Instructions&producttype_id=1&websitecolour=5&mindays=0&days=4&maxdays=99&backstopdays=4&units=1000&maxbatch=0&rev=1&defunct=0&nocarecall=0&editrev=0&pageno=19&prodgr=00&gdelivery=t&partnercode=555&height=50&width=70&format=json
Parameter Description
format json or xml
Ownership and Publication
partnercode Your assigned partner code.
defunct Set 1 (true) to make the product unavailable; 0 (false) to make it live.
Descriptive
name product.name. Should be unique in your product list.
description Product description. Concisely describes the specification on websites. We suggest you adopt the style of printing.com’s product descriptions. 
notes Design notes.
special Special instructions – help for those in a Studio.
Physical Attributes
templatesizes_id If supplied, this determines the dimensions of the product, otherwise you must supply the width, height, bleed, units, and rev.
width The finished size of the product. Correct assignment of width and height will ensure the required orientation, e.g. for landscape, &width=297&height=210, and for portrait, &width=210&height=297.
height
bleed
websitecolour Specifies the printing, and its visual indication on websites. See Enumerated types.
units

units = the quantity of 1 batch.

maxbatch is a limit on the maximum number of batches (and therefore quantity) that may be ordered in a single job.

maxbatch
prodgr product group code.
producttype_id

1: printed item;
2: stock-pick item;
3: service;
4: electronic/file only.

See product types.

Production Schedule
gdelivery Set 1 (true) to make the product a ‘guaranteed fixed turnaround’; 0 (false) to use mindays and maxdays.
custom_service_levels

If gdelivery=0, then days is the lower limit; backstopdays is the upper limit, defining a range of days that the producer needs to make the product, e.g. "5 to 7" days. If the product was created with custom_service_levels=1, then mindays is the minimum you allow and maxdays is the maximum you allow. 

days
backstopdays
mindays
maxdays
Flyerlink CRM
nocarecall When 1 (true), the workgroup will not receive reminders to seek customer feedback/care call.
Localization  
language (TBC)

 

FLAPI: Product Pricing

Request 'product pricing' by 'product code'

GET Syntax
/products/<product.id>/prices

Retrieves pricing for the requested product. All available service levels are returned, though usually only one will be present.

selling = price that a workgroup sells at. 
transfer = price that a workgroup buys at. 
production = cost that a workgroup incurs from third party suppliers (Marketplace, or workgroup suppliers).

HTTP request
GET http://dev.flyerlink.com/api.php/products/MBG3L5T?/prices?format=json
HTTP response (JSON)
{
    "services" : [{
            "adddays" : "2",
            "batches" : [{
                    "selling" : 64,
                    "transfer" : <float>,
                    "production" : 0,
                    "_attrs" : {
                        "batch" : 1
                    }
                }
                ... <other 'batch' items> ...
                }, {
                    "selling" : 164,
                    "transfer" : <float>,
                    "production" : 0,
                    "_attrs" : {
                        "batch" : 10
                    }
                }, {
                    "selling" : 7, 
                    "transfer" : <float>,
                    "production" : 0,
                    "_attrs" : {
                        "batch" : "runon"
                    }
                }
            ]
        }
    ]
}

Set 'product pricing' by 'product code'

POST Syntax
/products/<product.id>/prices/

Sets pricing for the requested product. 

Important: Each price has three aspects, and all possible combinations of [turnaround], [batches], [transaction type] for the product must be set in one request. The pricing for a product is wiped immediately before your new data is entered, so any omitted combinations will be erased.

Be sure to include data for your product’s ‘base turnaround’ where turnaround = product.days. This is the only turnaround that you must specify; pricing for other turnaround values (within your allowed range) is optional.

The format of each entry is:

prices[turnaround][batches][type]=value.

All three must be included in a request.

  • Your assigned territory.
  • production turnaround, in working days.
  • batches (quantity = batches × product.units). 
  • transaction type: { selling | transfer | production }.
  • value: price amount.

Below is the simplest example, for a turnaround of 2 production days, and only 1 batch. Note: we've put line-feeds before each & for legibility.

HTTP request
POST http://dev.flyerlink.com/api.php/products/MBG3L5T/prices
territory=TEMP
&prices[2][1][selling]=50
&prices[2][1][transfer]=40
&prices[2][1][production]=0
&format=json

FLAPI: Accounting

Quick Reference

Contains: invoices and payments

Invoices are generated when the ‘make’ or ‘print’ step is performed on a run in production; there is no API method for explicitly generating an invoice, but you can read existing invoices, with criteria.

Available to: FLAPI, M-FLAPI

Invoicing
GET /invoices
GET /invoices/<invoice.id>
Payments
GET /payments/
GET /payments/<payment.id>

See also:

  • GET /jobs/<job.code>/payments

FLAPI: Invoices

Contents

  • List invoices
  • Request an invoice by invoice code

About Invoices

Invoices are generated when the ‘make’ or ‘print’ step is performed on a run in production; there is no API method for explicitly generating an invoice, but you can read existing invoices, with criteria.

List invoices

GET path
/invoices/

Retrieves all invoices, with optional filters.

Parameter Description
format json or xml
workgroup workgroup.id
from Date range, with from and to both having format yyyy-mm-dd
to
type (optional filter) sales is the Selling Price invoice to the customer; transfer is the Transfer Price charge to you, from the producer.
include_unposted Set to 1 to includes pending invoices. Default: 0
HTTP request
GET http://dev.flyerlink.com/api.php/invoices/?format=json
HTTP response (JSON)
{
    "invoices" : {
        [
            <invoice item, as per example 'GET /invoices/<invoice.code>' >
            "items" : [ { ... } , ... ]
            "id" : ... (etc)
        ],
        ... <more items of type invoice>
    }
}
Response Item Description
invoices Container item for invoice items.
  invoice Container item.
    ... See GET /invoices/<invoice.code>

Retrieve an invoice by code

GET path
/invoices/<invoice.code>

Retrieves the specified invoice.

Parameter Description
format json or xml
HTTP request
GET http://dev.flyerlink.com/api.php/invoices/1234567?format=json
HTTP response (JSON)
{
    "invoice" : {
        "items" : [
            {
                "code" : "12499538",
                "invoice" : "4251603",
                "type" : "I",
                "costing" : "AF",
                "quantity" : "250.00",
                "units" : "1",
                "unitcost" : "0.0000",
                "vat" : "1",
                "vatrate" : "19.60",
                "nominal" : "PR",
                "vattotal" : "0.0000",
                "net" : "0.00",
                "text" : "(description for carriage)",
                "created_at" : "2013-05-20 15:33:32.923574"
            }, {
                "code" : "12499540",
                "invoice" : "4251603",
                "type" : "I",
                "costing" : "PR",
                "quantity" : "250.00",
                "units" : "250",
                "unitcost" : "0.0000",
                "vat" : "1",
                "vatrate" : "19.60",
                "nominal" : "PR",
                "vattotal" : "0.0000",
                "net" : "0.00",
                "text" : "(product description)",
                "created_at" : "2013-05-20 15:33:32.923574"
            }
        ],
        "id" : "4251603",
        "customer" : "(customer.code)",
        "items_net" : "0.00",
        "items_tax" : "0.00",
        "job" : "2280537",
        "memo" : "",
        "despatch" : null,
        "production" : "f",
        "date" : "2013-05-20",
        "post" : "t",
        "print" : "t",
        "run" : "564977",
        "workgroup" : "WFRA",
        "type" : "Transfer Price Invoice",
        "groupinv" : ""
    }
}
Response Item Description
invoice Container
  items Container item.
    item Container item for each invoice line
      code invoice_line.code
      invoice invoice.id
      costing costing.code, detailing the reason (service) for the invoice line.
      nominal An accounting category reference
      quantity The precision of two decimal places allows this to be used as an hour count, for charging at an hourly rate. Otherwise, use whole numbers as a number of batches.
      units A count of the number of items in a batch, e.g. 500 for Business Cards
      unitcost per unit
      net total excluding taxes
      vat tax code
      vatrate as %, e.g. 20
      vattotal amount of tax
      text Description of the invoice line, usually product.description when costing=PR, otherwise it is costing.description
      created_at Datestamp, local Hub time.
    id invoice.id
    customer customer.code
    items_net Total amount charged, excluding tax (sum of invoice_line.net)
    items_tax Total tax charged (sum of invoice_line.vat)
    job The job.code that this invoice relates to.
    memo  
    despatch despatch.code where available. If you invoice during production, this will typically be blank.
    production Indicates whether this is a production invoice (only used for network partners)
    date Date that this invoice was generated.
    post t when the invoice has been posted.
    print t when the invoice has been posted.
    run run.id
    workgroup workgroup.id for invoicing. For a sales invoice, this is the selling workgroup. For transfer price invoices, the manufacturer's workgroup.
    type sales or transfer
    groupinv

f (false) when the invoice is sent immediately on production.

t (true) when the invoice is later to be sent as a consolidated weekly invoice, containing all invoices for the customer.

FLAPI: Payments

Contents

  • List payments
  • Request a payment by payment code
  • Request payments by job code

About payments

Payments are generated when a payment is made by the customer for a job or order.

List payments

GET path
/payments/

Retrieves all payments, with optional filters.

Parameter Description
format json or xml
workgroup workgroup.id of the workgroup to be paid; same as customer.workgroup.
customer

(optional) customer.id for the customer that the payment was allocated against.

from (optional) An inclusive date range for the payment date, with from and to both having format yyyy-mm-dd
to
type (optional filter) sales (default) is a payment by a retail customer for a job; transfer_price is a payment to a supplier or trade.
show_disputed Also shows 'referred' payments
show_cancelled Also shows 'cancelled' payments
HTTP request
GET http://dev.flyerlink.com/api.php/payments/?format=json
HTTP response (JSON)
{
    "payments" : [{
            "code" : "677844",
            "date" : "2013-11-18",
            "time" : "10:34:59",
            "customer" : "FXRPG44",
            "payment_amount" : "375.80",
            "total_allocated" : "375.80",
            "disputed" : "f",
            "disputed_notes" : null,
            "cancelled" : "f",
            "post_date" : null,
            "payment_method" : "DC",
            "notes" : null,
            "online_transaction" : "t",
            "quickbooks_code" : "Visa",
            "opera_code" : "R3",
            "cash" : "f",
            "card" : "t",
            "cheque" : "f",
            "refund" : "f",
            "card_type" : "Debit Card",
            "card_name" : "Visa Debit",
            "allocations" : [],
            "transfer_payment" : false,
            "transfer_price_allocated" : "0.00",
            "transfer_paid_workgroup" : null,
            "transfer_paid_workgroup_name" : ""
        }, 
        ...
    ]
}
Response Item Description
payments Container item for payments items.
  payments Container item.
    ... See GET /payments/<payment.code>

Retrieve an payment by code

GET path
/payments/<payment.code>

Retrieves the specified payment entry.

Parameter Description
format json or xml
HTTP request
GET http://dev.flyerlink.com/api.php/payments/750790?format=json
HTTP response (JSON)
{
    "date" : "2014-06-19",
    "time" : "16:41:54",
    "customer" : "FXRPG42",
    "payment_amount" : "91.80",
    "total_allocated" : "91.80",
    "disputed" : "f",
    "disputed_notes" : null,
    "cancelled" : "f",
    "post_date" : null,
    "payment_method" : "CC",
    "notes" : null,
    "online_transaction" : "t",
    "quickbooks_code" : "MasterCard",
    "opera_code" : "R3",
    "cash" : "f",
    "card" : "t",
    "cheque" : "f",
    "refund" : "f",
    "card_type" : "Credit Card",
    "card_name" : "MasterCard",
    "allocations" : [{
            "job" : "1986992",
            "date" : "2012-06-19",
            "time" : "16:41:56",
            "amount" : "91.80",
            "tp_amount" : "0.00"
        }
    ],
    "transfer_payment" : false,
    "transfer_price_allocated" : "0.00",
    "transfer_paid_workgroup" : null,
    "transfer_paid_workgroup_name" : ""
}
Response Item Description
payment Container
  allocations Container item.
    item Container item for each invoice line
      job invoice_line.code
      date invoice.id
      time costing.code, detailing the reason (service) for the invoice line.
      amount An accounting category reference
      tp_amount The precision of two decimal places allows this to be used as an hour count, for charging at an hourly rate. Otherwise, use whole numbers as a number of batches.
  date Inclusive date range for the payments.
  time
  payment_amount customer.code
  total_allocated The amount that has been allocated to jobs.
  disputed  
  disputed_notes  
  cancelled Boolean: t|f.
  post_date  
  payment_method  
  notes  
  online_transaction Boolean: t|f.
  quickbooks_code Corresponds to codes usd by accounting software.
  opera_code Corresponds to codes usd by accounting software.
  cash Boolean: t|f.
  card Boolean: t|f.
  cheque Boolean: t|f.
  refund Boolean: t|f.
  card_type Human-readable description for the type of card used for payment.
  card_name Usually the card provider's name, e.g. MasterCard.

Retrieve an payment by job code

GET path
/jobs/<job.code>/payments

Retrieves the specified payment entries for a requested job code.

FLAPI: Production Runs

Quick Reference

Available to: FLAPI, M-FLAPI
Runs
GET /runs
GET /runs/<run.id>
PUT /runs/<order>
POST /runs/<run.id>/accept
Jobs on Runs
GET /runs/<run.code>/jobs
GET /runs/<run.code>/jobs/<job.code>/jobmaker
POST /runs/<run.code>/jobs/<job.code>/deallocate

Run Structure

Runs are containers for jobs.

Each run is a production or processing batch, invoicing is triggered by the completion of a run.

  • run
    • (allocated) jobs

List all runs

GET Syntax
/runs

Retrieves all run items matching criteria.

To find all Runs Awaiting Production, add parameters to show runs with the waiting state belonging to the production workgroup your interested in.

HTTP request
GET http://dev.flyerlink.com/api.php/runs?format=json
Parameter Description
format json or xml
state One of: waiting, production, completed. (required)
days Where present, filters the list to include only runs having jobs due within that number of days (optional).
prod_workgrp Filter, identifying production workgroups to include (comma-separated string, optional).
e.g. SUP1,SUP2,SUP3
Default: all workgroups.
HTTP response (JSON)
{
    "runs" : [{
            "id" : "567251",
            "created_date" : "2013-06-13",
            "name" : "Automatic allocation",
            "runtype" : "OSUP1001",
            "description" : "Production Method 001",
            "finished_date" : null,
            "workgroup" : "SUP1"
        },
        …
        {
            "id" : "566428",
            "created_date" : "2013-06-05",
            "name" : "Automatic allocation",
            "runtype" : "OSUP2001",
            "description" : "Production Method 001",
            "finished_date" : "2013-06-25",
            "workgroup" : "SUP2"
        }
    ]
}
Response Item Description
runs Containeritem for run items.
  run Container item for each run.
    id Unique identifier for the run.
    created_date Timestamp for run creation.
    name The run's name (text)
    description The run's description (text)
    finished_date When the run is completed, format: yyyy-mm-dd. Otherwise null.
    runtype Identifies the runtype.code.
    workgroup The workgroup that produces the run type.

Request 'run' by code

GET Syntax
/runs/<run.code>

Retrieves a single run item. You must have permission to view this run.

HTTP request
GET http://dev.flyerlink.com/api.php/runs/449445?format=json
Parameter Description
format json or xml
HTTP response (JSON)
{
    "run" : {
        "id" : "449445",
        "created_date" : "2008-05-22",
        "name" : "",
        "runtype" : "OSUP2001",
        "description" : "LX 150gsm Gloss 4x0 (L\/S40)",
        "finished_date" : "2008-05-23"
        "workgroup" : "SUP2"
    } 
}
Response Item Description
run Container item for each run.
  id Unique identifier for the run.
  created_date Timestamp for run creation.
  name The run's name (text)
  description The run's description (text)
  finished_date When the run is completed, format: yyyy-mm-dd. Otherwise null.

Accept a Run

POST Syntax
/runs/<run.code>/accept

Accepts a run. Allows you to start processing its jobs.

HTTP request
POST http://dev.flyerlink.com/api.php/runs/1234567/accept
format=xml

List jobs allocated to a run

GET Syntax
/runs/<order.code>

Retrieves a list of the jobs allocated to a run. You must have permission to view this run.

HTTP request
GET http://dev.flyerlink.com/api.php/runs/449445/jobs?format=json
Parameter Description
format json or xml
HTTP response (JSON)
{
    "jobs" : [{
            "id" : "832945",
            "status" : "081",
            "customer" : "FIFANDS",
            "contact" : "440519",
            "quantity_allocated" : "1000",
            "quantity_printed" : "1000",
            "quantity_despatched" : "1000",
            "total_transfer" : "82.32",
            "total_selling" : "181.00",
            "total" : "181.00",
            "product_code" : "LEGA40T",
            "title" : "MADE-IT-UP LEAFLETS",
            "category" : "625",
            "quantity" : "1000",
            "auto081" : false,
            "service" : "N",
            "status_text" : "PDF'd and sent",
            "reseller_workgroup" : "P336",
            "reseller_details" : {
                "code" : "WXGIN",
                "name" : "Branding by Djinn",
                "addr1" : "Branding by Djinn Ltd",
                "addr2" : "15 Percival Gate",
                "addr3" : "",
                "addr4" : "Sheffield",
                "addr5" : "",
                "addr6" : "United Kingdom",
                "postcode" : "S2 8QX",
                "countrycode" : "GB",
                "main_contact_firstname" : "David",
                "main_contact_surname" : "Rover",
                "main_contact_title" : null,
                "main_contact_email" : "david@brandingbydjinn.co.uk",
                "main_contact_telephone" : "0114 441 9112",
                "invoice_contact_firstname" : "David",
                "invoice_contact_surname" : "Rover",
                "invoice_contact_title" : null,
                "invoice_contact_email" : "david@brandingbydjinn.co.uk",
                "invoice_contact_telephone" : "0114 441 9112",
                "vat_number" : "1228963419"
            },
            "complete" : "yes",
            "multifile" : "yes",
            "expected_despatch_date" : "23\/05\/2008 at 00:55",
            "front_filename" : "832945_A01.PDF",
            "reverse_filename" : null,
            "pages" : 1,
            "despatches" : [{
                    "id" : "270607",
                    "quantity" : "1000",
                    "cartons" : "1",
                    "weight" : "10.0300",
                    "consignment" : "01149454",
                    "consignment_url" : "http:\/\/cgi.tnt.co.uk\/trackntrace\/conenquiry.asp?ACTION=TRACK&TYPE=C&QUERY=01149454",
                    "date" : "2008-05-23",
                    "time" : "00:55:57",
                    "line" : "1172890"
                }
            ],
            "addresses" : [{
                    "name" : "<name>",
                    "addr1" : "<address line 1>",
                    "addr2" : "<address line 2>",
                    "addr3" : "Hampton Vale",
                    "addr4" : "Peterborough",
                    "addr5" : "",
                    "addr6" : "United Kingdom",
                    "postcode" : "PE7 1AA",
                    "countrycode" : "GB",
                    "contact" : "steve ",
                    "telephone" : "01733 123456",
                    "line" : "1172890"
                }
            ],
            "revenue" : [{
                    "costing" : "ADF",
                    "quantity" : "1",
                    "units" : "1",
                    "unitcost" : "0.00",
                    "unitrev" : "50.00",
                    "cost" : "0.00",
                    "revenue" : "50.00",
                    "prcost" : "0.00",
                    "unitprcost" : "0.00",
                    "vat" : "0.00",
                    "vatcode" : "Z",
                    "vattotal" : "0.000",
                    "name" : "DESIGN \/ FINISHED ARTWORK",
                    "customname" : "",
                    "voucher" : "f",
                    "template" : "f"
                }, 
                ... <more items of type revenue> ...
            ],
            "notes" : {
                "brief" : null
            },
            "finishes" : [],
            "orientation" : {
                "front" : "Portrait",
                "back" : "Portrait"
            },
            "jobmaker_pack" : {
                "full_pack" : "http:\/\/dev.flyerlink.com\/api.php\/jobs\/449445\/jobmaker",
                "orderlist_csv" : "http:\/\/dev.flyerlink.com\/api.php\/jobs\/449445\/jobmaker?file=csv",
                "orderlist_xml" : "http:\/\/dev.flyerlink.com\/api.php\/jobs\/449445\/jobmaker?file=xml",
                "worksheet" : "http:\/\/dev.flyerlink.com\/api.php\/jobs\/449445\/jobmaker?file=sheet",
                "packing_slip_draft" : "http:\/\/dev.flyerlink.com\/api.php\/jobs\/449445\/jobmaker?file=slip"
            },
            "file_paths" : {
                "front" : ["WPR1\/Runs\/449\/449445\/832945_A01.PDF"],
                "reverse" : []
            }
        }, 
        ... <more items of type job> ...
        }
    ] 
}
Response Item Description
jobs Container
  job Container item. See Job Main Details for properties. Below are the additional properties available from /runs/...
    reseller_workgroup Workgroup code for the reseller.
    reseller_details Container for contact/company details.
    file_paths Available only to the supplier who owns the run type.
      front

Array of FTP path+filenames for graphic files (PDFs), relative to your home FTP folder. Access files at

http://<user>:<pass>@<www.example.com>/<file-path>
      reverse

Cancel or de-allocate a job in production

POST Syntax
/runs/<run.code>/jobs/<job.code>/deallocate

Or you can simply send the job without the run with this alias

POST Syntax
/jobs/<job.code>/deallocate

De-allocates a job and sends it back to the studio to make changes before they try to send to production again. Use this if there are issues with the job and changes are needed such as the file being not fit for production or the delivery address or job details are invalid. You must have permission to view this run.

HTTP request
POST http://dev.flyerlink.com/api.php/runs/449445/jobs/1234567/deallocate?format=json&costing=CAN&reason=the artwork supplied is not print ready
Parameter Description
format json or xml
costing use "CAN"
reason

An explanation about why the job is not fit for production and what needs to be changed so it can be produced

HTTP response (XML)
<?xml version="1.0" encoding="UTF-8"?>
<response status="ok" /

FLAPI: PHP platform example

Interface

You might like to use an interface to manage your API session, package your requests, and include authentication credentials.

In the example below, we use Pest, available at

https://github.com/educoder/pest

Here’s an code snippet that gets and displays FLAPI data (from the developer sandbox) in PHP

PHP
// Load the library (Pest folder must be in PHP's include path)
require_once 'Pest/PestJSON.php';
include '../data/flapi_credentials.php'; // e.g. contains: $flapi = [ ‘user’, ‘pass’ ];

// Init the library (put in your TC credentials here)
$apiClient = new PestJSON( 'https://dev.flyerlink.com/api.php' ); 
//  $apiClient->setupAuth( 'username', 'password' );
$apiClient->setupAuth($flapi[0],$flapi[1]);

// Make a simple get call (this returns tag types in JSON format)
try {
    $result = $apiClient->get('/product_categories/?format=json');
}
catch (Exception $e) {
    // Handle error. In practice there are several exception types,
    // which you can use to differentiate between different error conditions
    die( $e->getMessage() );
}

// Examine successful result
// This just outputs to the page; you'll want to present it nicely.
echo '<pre>';
print_r( $result );
echo '</pre>';

P-FLAPI Zapier triggers & actions

P-FLAPI can be connected to via Zapier setting up a few Zapier triggers & actions

Zapier simplifies the process of development with APIs by connecting to a number of pre-built services (such as wordpress, woocommerce, gravity forms, drupal and other CMS) and also simplifies the management of APIs

Here's a video of integrating P-FLAPI with a simple Gravity Form sheet to understand how it works.

 

1) Trigger when job is ready for production
When a job is ready for production we will send a webhook to notify you, you can create a "Zap" in zapier so Zapier catches the webhook and then you can add another zap to manage the zap.

Create a Zapier account via https://zapier.com
Choose "Create Zap"

For a trigger choose Webhook by Zapier (premium)

Let your account manager know the webhook url zapier provides ( it'll be similar to https://hooks.zapier.com/hooks/catch/11111111/xxxx111/ )

Then add another application to your zap for your next step. This could be to create a job in a CMS you use such as WooCommerce

2) Action for job despatch

When you've completed a job in your system you'll need to create a new zap with a trigger coming from your CMS (perhaps a webhook?)

Then add an action with this python code

import requests
if ('JobID' in input_data):
    url = 'https://API_UESRNAME:API_PASSWORD@www.flyerlink.com/api.php/jobs/' + input_data['JobID'] + '/despatch?format=json&all=true'
    payload={all:true}
    headers = { 'Authorization': 'Basic Wi5XTVVLLkFQSTo5eUw2MkhhdmFX' }
    response = requests.request('POST', url, headers=headers, data=payload)
    print(response.text)
    return {}

The Job ID sent through will need to match our Job ID sent in the original Trigger
The Job ID will need to be sent in your first zap step to confirm which job is ready for production

The parts in bold API_USERNAME and API_PASSWORD will need to be replaced with your API username and password to give permission for you to despatch your jobs and only your jobs. You'll need to get in touch if you do not know this.

3) Trigger for job request to cancel production
If a studio makes a mistake (perhaps the job despatch needs to be changed, or there's a file mistake) they can send a request to cancel production.
You can then have a process to decide if it's too late to cancel or if a cancel is possible. If it's too late, you don't need to do anything. But if it's too late you can do step 4).

For step 3), again create a zap that's a webhook trigger.
Let your account manager know the webhook trigger url zapier provides ( it'll be similar to https://hooks.zapier.com/hooks/catch/11111111/xxxx111/ )

4) Action to cancel job

Create a zap to process a trigger from your CMS to cancel a job. This could be because of an issue with the file or because it was requested by a studio in the trigger 3).

The python code you'll need to process this is

import requests
if ('JobID' in input_data):
    url = 'https://API_USERNAME:API_PASSWORD@www.flyerlink.com/api.php/jobs/' + input_data['JobID'] + '/deallocate?format=json&all=true'
    payload={'all':'true'}
    headers = { 'Authorization': 'Basic Wi5XTVVLLkFQSTo5eUw2MkhhdmFX' }
    response = requests.request('POST', url, headers=headers, data=payload)
    print(response.text)
    return {}

(Work in Progress)

Our work here isn't yet done!

We're developing more content, and this should soon be complete.

FLAPI: Enumerated Types

Here we show lists of items that might be referred-to using fixed ids.

Contents

  • Languages
  • Job Status
  • Preflight Types
  • Supplieready Preflight Types
  • Websitecolour

Languages

language
id locale local name language group
22 tc_IE Irish (W3P & TC) Irish (W3P & TC) 1 English
14 tc_NZ New Zealand (TemplateCloud) New Zealand (TemplateCloud) 1 English
15 tc_AU Australia (TemplateCloud) Australia (TemplateCloud) 1 English
9 tc_GB English (W3P & TC) English (W3P & TC) 1 English
23 tc_FR French (TemplateCloud) Français (TemplateCloud) 2 French
24 tc_NL Dutch (TemplateCloud) Nederland (TemplateCloud) 3 Dutch
25 tc_ES Spanish (TemplateCloud) Espanol (TemplateCloud) 4 Spanish
18 tc_SE Swedish (TemplateCloud) Svenska (TemplateCloud) 5 Swedish
19 tc_DE German (TemplateCloud) Deutsch (TemplateCloud) 6 German
20 tc_IT Italian (TemplateCloud) Italiano (TemplateCloud) 7 Italian
21 tc_PO Portuguese (TemplateCloud) Portugues (TemplateCloud) 8 Portuguese
16 tc_US American (TemplateCloud) American (TemplateCloud) 9 American

Job Status

Job status can be used to manage your workflow. Read them to see the state of items in your workflow, and write them to report when you have made progress and want to choose the next step. 

Popular values are listed below.

status
id name
000 Job has been created
011 Design required
033 Proof has been requested
061 Changes required
071 All aspects of the job have been accepted by the customer; make the job ready for production.
081 Ready for production
091 Error found during production: job abandoned/rejected
094 Error found during production: job continued

Preflight Types

These profiles are used at product group level, to specify the file checks and corrections that are applied to all products within the product group.

preflighttype
id name
C Coated preflight
L Large Format preflight
N No preflighting
U Uncoated preflight
UR Uncoated reverse preflight (coated front, uncoated reverse)
Z Don’t convert files

Supplieready Preflight Types

These profiles are used at product group level, to specify the file checks and corrections that are applied to all products within the product group. Supplieready profiles perform corrections to the geometry and markup of the files.

id description
SN Uncoated No crop marks Don’t scale
SE Uncoated No crop marks Scale
SM Uncoated Crop marks Don’t scale
SU Uncoated Crop marks Scale
SC Coated No crop marks Don’t scale
SS Coated No crop marks Scale
ST Coated Crop marks Don’t scale
SW Coated Crop marks Scale

Websitecolour

Popular values are listed below. If you need something else, let us know.

id name
1 Blank – unprinted
2 Full colour front
3 Full colour front, black and white reverse
4 Full colour both sides
5 1 colour front
6 2 colour front
15 Full colour
39 Full colour both sides + spot UV front
40 Full colour both sides + spot UV both sides
46 Full colour booklet: 8 pages
47 Full colour booklet: 12 pages
48 Full colour booklet: 16 pages
62 Full colour booklet: 20 pages
63 Full colour booklet: 24 pages
 
 

Jump to contents page of

w3p APIs

 
 
 

All content is (c) Nettl Systems Limited, 2024 and may not be used, copied or distributed without permission.