List of purchases
List purchases, 20 per page by default, newest document date first.
query Parameters
pageinteger · min: 1The page to return.
supplier_idintegerOnly this supplier's purchases.
startdatestring · dateDocuments dated on or after this date (
Y-m-d).enddatestring · dateDocuments dated on or before this date (
Y-m-d). Withstartdateequal to it, you get that single day.unpaidstring · enumon: only unpaid purchases.Enum values:ontagsstringComma-separated tag names.
qstringPart of the document number or of the myDATA MARK.
no_imagestring · enumon: only purchases without an attached receipt image.Enum values:onsourcestring · enumai: read from a receipt image; md: imported from myDATA; manual: entered by hand.
Enum values:aimdmanualsortstring · enumSort column. Default
date_occurred.Enum values:date_occurredcreated_atdirstring · enumSort direction,
ascordesc. Default (and for any other value)desc.Enum values:ascdesc
Headers
Acceptstringapplication/json
Responses
OK
dataobject[]linksobjectmetaobject
Create a new purchase
Record a purchase (expense document) from a supplier.
In responses, read datePaid only when paid is true: for an unpaid purchase it shows today's date.
A purchase with the same invoiceNum and supplier as an existing one is refused with 403; id in that response is the existing purchase.
Headers
Acceptstringapplication/json
Request Body
supplierIdinteger · requiredRequired. The supplier (a contact id from
GET /contacts).invoiceNumstring · requiredRequired. The supplier's document number. The same number from the same supplier is refused as a duplicate (403).
cleanAmountnumber · min: 0.1 · requiredRequired. Amount before VAT.
vatAmountnumber · requiredRequired. VAT amount.
dateOccurredstring · date · requiredRequired. Document date,
Y-m-d.irsAmountnumber · min: 0 · requiredRequired. The amount for the income-tax calculation, as you computed it; stored as sent.
irsTypeinteger · enum · requiredRequired. How
irsAmountwas calculated: 1 net value, 2 net value + VAT, 3 % of net value, 4 % of net value + VAT, 5 % of the total, 6 an absolute amount.Enum values:123456
datePaidstring · datePayment date,
Y-m-d, on or afterdateOccurred. Sending it marks the purchase as paid.percentagenumberThe percentage used with
irsType3, 4 or 5.pistwsiinteger · enum1 if the document is a credit note.
Enum values:01infostringtagsstring[]Tag names; missing tags are created.
currencystringForeign-currency purchase: the document's currency. Send with
rate,convertedCleanAmountandconvertedVatAmount.ratenumberExchange rate. With it, the amounts in your currency are
convertedCleanAmount/convertedVatAmount.convertedCleanAmountnumberconvertedVatAmountnumbersystemCurrencystring
Responses
Created.
dataobject