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.