Support for

FLAPI: Products

Alistair Wilson
by Alistair Wilson 6 years ago
 

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      

 

Product Hierarchy

FLAPI: Product Categories FLAPI: Product Categories

FLAPI: Product Groups FLAPI: Product Groups

Products

FLAPI: Product Specifications FLAPI: Product Specifications

FLAPI: Product Pricing FLAPI: Product Pricing

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
 
 

Jump to contents page of

Flyerlink API Guide

 
 
 

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