Support for

FLAPI: Accounting

John Valentine
by John Valentine 10 years ago
 

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 FLAPI: Invoices

FLAPI: Payments FLAPI: Payments

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.

 
 

See also

FLAPI: Jobs

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.