Support for

FLAPI: Invoices

Matthew Francis
by Matthew Francis 9 years ago
 

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.

 

Jump to contents page of

FLAPI: Accounting

 
 
 

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