Invoice lines

Lines on an invoice. Normally sent nested inside the invoice rather than created here.

The object#

FieldTypeDescription
idread-onlyintegerNolaPro id.
invoiceidintegerInvoiceid. Id only.
invoicestring(30)The invoicenumber of the referenced invoices, instead of the id. Send this or invoiceid, not both unless they agree.
linenumberintegerPosition of this line on its document, starting at 1.
itemidintegerReference to items, by id. Write either this or item.
itemstring(255)The sku of the referenced items, instead of the id. Send this or itemid, not both unless they agree.
descriptionstring(255)Line description printed on the invoice.
qtyqtystring(6dp)Quantity, 6 decimal places, as a string. Stored as decimal(6dp).
qtyunitnameidintegerReference to unitnames, by id. Write either this or qtyunitname.
qtyunitnamestring(50)The unitname of the referenced unitnames, instead of the id. Send this or qtyunitnameid, not both unless they agree.
glaccountidintegerReference to glaccounts, by id. Write either this or glaccount.
glaccountstring(20)Code for the referenced glaccount, instead of the id.
taxflagintegerWhether the first line tax applies. NolaPro carries up to three taxes per line.
priceachmoneystring(6dp)Stored as decimal(19,6).
priceunitnameidintegerPriceunitnameid. Id only.
priceunitnamestring(50)The unitname of the referenced unitnames, instead of the id. Send this or priceunitnameid, not both unless they agree.
qtyunitperpriceunitqtystring(6dp)Quantity, 6 decimal places, as a string. Stored as decimal(6dp).
totalpricemoneystring(4dp)Stored as decimal(19,4).
entrydatestringWhen the record was created.
lastchangedateread-onlystringLast modification. Drives modifiedsince.
costeachmoneystring(6dp)Stored as decimal(19,6).
costglaccountidintegerReference to glaccounts, by id. Write either this or costglaccount.
costglaccountstring(20)The name of the referenced glaccounts, instead of the id. Send this or costglaccountid, not both unless they agree.
main_arinvoicedetailidintegerMain arinvoicedetailid. Id only.
itemoptionidintegerItemoptionid. Id only.
itemoptiongroupidintegerItemoptiongroupid. Id only.
taxflag2integerWhether the second line tax applies.
taxflag3integerWhether the third line tax applies.
taxflagidintegerTaxflagid. Id only.
taxflag2idintegerTaxflag2id. Id only.
taxflag3idintegerTaxflag3id. Id only.
orig_priceachmoneystring(5dp)Stored as decimal(12,5).
discount_amountmoneystring(5dp)Stored as decimal(12,5).
discount_percentnumberstring(5dp)Numeric string, 5 decimal places. Not money - do not apply currency rounding.
old_idread-onlystring(255)Line id in the system this record was imported from.
pricelevelidintegerPricelevelid. Id only.
price_overrideinteger1 when the price was manually overridden, so repricing leaves it alone.
extended_pricemoneystring(5dp)Stored as decimal(19,5).
worktypeidintegerReference to worktypes, by id. Write either this or worktype.
worktypestring(100)Code for the referenced worktype, instead of the id.
worksubtypeidintegerWorksubtypeid. Id only.
returnqtyqtystring(6dp)Quantity, 6 decimal places, as a string. Stored as decimal(6dp).
returndetailidintegerReturndetailid. Id only.
discountidintegerDiscountid. Id only.
discountpercentnumberstring(2dp)Numeric string, 2 decimal places. Not money - do not apply currency rounding.
inventorylocationidintegerInventorylocationid. Id only.
inventorylocationstring(20)The locationcode of the referenced inventorylocations, instead of the id. Send this or inventorylocationid, not both unless they agree.
linedatestringDate recorded for the line (service and rental lines).
linetypeintegerLine type: 0 = standard product line, 1 = product-type tax, 2 = delivery charge, 3 = fuel charge, 4 = restock fee, 5 = billed expense.
partialtaxexemptionidintegerPartial tax exemption applied to the line.
partialtaxexemptionstring(32)The exemptname of the referenced taxexempts, instead of the id. Send this or partialtaxexemptionid, not both unless they agree.
taxclassidintegerTaxclassid. Id only.
taxclassstring(100)The name of the referenced taxclasses, instead of the id. Send this or taxclassid, not both unless they agree.
arorderdetailidintegerArorderdetailid. Id only.
itempricespecialdetailidintegerItempricespecialdetailid. Id only.
numperiodsnumberstring(6dp)Numeric string, 6 decimal places. Not money - do not apply currency rounding.
periodstring(1)Rental period the line bills by: D = daily, W = weekly, M = monthly. Empty for non-rental lines.
producttypetaxidintegerProducttypetaxid. Id only.
rentalbegindatestringDate the rental billing period for the line begins.
arserviceorder_timeidintegerArserviceorder timeid. Id only.
assetidintegerAssetid. Id only.
prpaytypeidintegerPrpaytypeid. Id only.
prpaytypemultipliernumberstring(2dp)Numeric string, 2 decimal places. Not money - do not apply currency rounding.
externalidstring(100)Your own key. Scoped to your company.

Endpoints#

GET/invoicelines/{id}/tax 200422

Tax charged on one invoice line, by jurisdiction.

Documents report a tax total. This is the breakdown - which tax authority charged what, at which rate, and how much of the line was exempt. Anyone filing returns from NolaPro data, or reconciling against an external tax service, needs the per-jurisdiction detail rather than the sum.

Requires scope invoices:read.

Parameters
NameInTypeNotes
idrequiredpathintegerThe invoice line id.
When it fails
StatusCodeMeaning
422unknown_valueNo such parent record in this company.
curl \
  'https://acme.nolapro.com/!/api/v2/invoicelines/104/tax' \
  -H 'Authorization: Bearer $NP_TOKEN'
POST/invoicelines/batch 207400409422

Create many.

Requires scope invoices:write.

Parameters
NameInTypeNotes
Body array
FieldTypeDescription
invoiceidrequiredintegerThe DRAFT invoice to add to. A posted invoice is refused - its voucher was written for the current total.
itemidintegerStock item. Omit for a non-stock line and send a description.
descriptionstring(255)Line text. Defaults to the item description.
quantityrequiredqtystringHow many. Decimal STRING, up to 6 places.
pricerequiredmoneystringUnit price. Decimal STRING, not a JSON number.
taxablebooleanWhether the line attracts tax.
externalidstring(100)Your own identifier for this record. Stored verbatim and returned on reads; GET /<resource>?externalid=... finds it again.
When it fails
StatusCodeMeaning
400invalid_requestThe request was malformed.
409invoice_already_postedThe invoice is posted; its voucher was written for the current total.
422rule_violationNolaPro refused the document. message carries its reason.
422unknown_valueA reference did not resolve in this company.
curl -X POST \
  'https://acme.nolapro.com/!/api/v2/invoicelines/batch' \
  -H 'Authorization: Bearer $NP_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: your-unique-key' \
  -d '[
    {
        "invoiceid": 104,
        "quantity": "3.000000",
        "price": "125.0000",
        "externalid": "crm-8842"
    }
]'
Response 207
{
    "results": [
        {
            "index": 1,
            "status": 1
        }
    ]
}
GET/invoicelines 200403

List invoice lines.

Requires scope invoices:read.

Parameters
NameInTypeNotes
itemidquerystringRestrict to one itemid.
inventorylocationidquerystringRestrict to one inventorylocationid.
invoiceidquerystringRestrict to one invoiceid.
descriptionquerystringdescription. Partial match, case-insensitive.
modifiedsincequerystringRFC 3339 UTC timestamp. Returns only records changed since then, including cancelled ones - so cancel defaults to any rather than false when this is used. The response carries _meta.synced_through; store it and send it back next time.
externalidquerystringExact match on your own key.
includequerystringComma-separated extras to embed. Only custom_fields is available: the extra fields this install has defined on the record. Off by default, and an unrecognised value is refused rather than ignored. See Conventions.
When it fails
StatusCodeMeaning
403insufficient_scopeToken lacks read scope.
curl \
  'https://acme.nolapro.com/!/api/v2/invoicelines' \
  -H 'Authorization: Bearer $NP_TOKEN'
POST/invoicelines 201400409422

Create.

Requires scope invoices:write.

Parameters
NameInTypeNotes
Body
FieldTypeDescription
invoiceidrequiredintegerThe DRAFT invoice to add to. A posted invoice is refused - its voucher was written for the current total.
itemidintegerStock item. Omit for a non-stock line and send a description.
descriptionstring(255)Line text. Defaults to the item description.
quantityrequiredqtystringHow many. Decimal STRING, up to 6 places.
pricerequiredmoneystringUnit price. Decimal STRING, not a JSON number.
taxablebooleanWhether the line attracts tax.
externalidstring(100)Your own identifier for this record. Stored verbatim and returned on reads; GET /<resource>?externalid=... finds it again.
When it fails
StatusCodeMeaning
400invalid_requestA required field was missing.
409invoice_already_postedThe invoice is posted; its voucher was written for the current total.
422rule_violationNolaPro refused the document. message carries its reason.
422unknown_valueA reference did not resolve in this company.
curl -X POST \
  'https://acme.nolapro.com/!/api/v2/invoicelines' \
  -H 'Authorization: Bearer $NP_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: your-unique-key' \
  -d '{
    "invoiceid": 104,
    "quantity": "3.000000",
    "price": "125.0000",
    "externalid": "crm-8842"
}'
Response 201
{
    "invoiceid": 104,
    "linenumber": 1,
    "qty": "1.000000",
    "priceach": "125.0000",
    "totalprice": "125.0000",
    "invoicetotal": "125.0000"
}
GET/invoicelines/{id} 200404

Retrieve one record.

Requires scope invoices:read.

Parameters
NameInTypeNotes
idrequiredpathintegerThe record id.
includequerystringComma-separated extras to embed. Only custom_fields is available: the extra fields this install has defined on the record. Off by default, and an unrecognised value is refused rather than ignored. See Conventions.
When it fails
StatusCodeMeaning
404not_foundNo record with that id.
curl \
  'https://acme.nolapro.com/!/api/v2/invoicelines/104' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "invoiceid": 104,
    "invoice": "Example invoice",
    "linenumber": 1,
    "itemid": 104,
    "item": "Example item",
    "description": "Example description"
}
PATCH/invoicelines/{id} 200400404409422

Update.

Requires scope invoices:write.

Parameters
NameInTypeNotes
idrequiredpathintegerThe record id.
Body
FieldTypeDescription
descriptionstring(255)Free text.
qtyqtystringQuantity. Re-derives the invoice total. Decimal STRING.
priceachmoneystringUnit price. Re-derives the parent total. Decimal STRING.
externalidstring(100)Your own identifier for this record.
When it fails
StatusCodeMeaning
400invalid_requestThe request was malformed.
404not_foundNo such record, or it belongs to another company.
409invoice_already_postedThe invoice is posted; its voucher was built from the current figures.
409stale_recordIf-Match did not match; someone else changed it first.
422rule_violationNolaPro refused the change. message carries its reason.
curl -X PATCH \
  'https://acme.nolapro.com/!/api/v2/invoicelines/104' \
  -H 'Authorization: Bearer $NP_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: your-unique-key' \
  -d '{
    "qty": "3.000000",
    "priceach": "12.5000"
}'