AP bill lines

Lines on a vendor bill. Normally sent nested inside the bill.

The object#

FieldTypeDescription
idread-onlyintegerNolaPro id.
apbillidintegerApbillid. Id only.
amountmoneystring(4dp)Stored as decimal(19,4).
glaccountidintegerReference to glaccounts, by id. Write either this or glaccount.
glaccountstring(20)Code for the referenced glaccount, instead of the id.
invreceiveidintegerInvreceiveid. Id only.
jobidintegerJobid. Id only.
costcodeidintegerCost code.
costcodestring(20)Code for the referenced costcode, instead of the id.
glcategoryidintegerGlcategoryid. Id only.
glcategorystring(20)The code of the referenced glcategories, instead of the id. Send this or glcategoryid, not both unless they agree.
descriptionstring(100)What the expense line covers.
isretainerinteger1 when the line is withheld retainage.
curratenumberstring(10dp)Numeric string, 10 decimal places. Not money - do not apply currency rounding.
externalidstring(100)Your own key. Scoped to your company.

Endpoints#

POST/apbilllines/batch 207400409422

Create many.

Requires scope bills:write.

Parameters
NameInTypeNotes
Body array
FieldTypeDescription
apbillidrequiredintegerThe UNPOSTED bill to code. A posted bill is refused.
glaccountidintegerAccount id. Or send glaccount by name.
glaccountstring(60)Account name, matched exactly.
amountrequiredmoneystringHow much codes to this account. Cannot take the distribution past the bill total. Decimal STRING, not a JSON number.
jobidintegerJob to cost this to.
costcodeidintegerCost code.
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.
409apbill_already_postedThe bill already carries a voucherid.
422distribution_exceeds_totalThe line would code more than the bill is for.
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/apbilllines/batch' \
  -H 'Authorization: Bearer $NP_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: your-unique-key' \
  -d '[
    {
        "apbillid": 104,
        "amount": "125.0000",
        "externalid": "crm-8842"
    }
]'
Response 207
{
    "results": [
        {
            "index": 1,
            "status": 1
        }
    ]
}
GET/apbilllines 200403

List ap bill lines.

Requires scope bills:read.

Parameters
NameInTypeNotes
jobidquerystringRestrict to one jobid.
descriptionquerystringdescription. Partial match, case-insensitive.
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/apbilllines' \
  -H 'Authorization: Bearer $NP_TOKEN'
POST/apbilllines 201400409422

Create.

Requires scope bills:write.

Parameters
NameInTypeNotes
Body
FieldTypeDescription
apbillidrequiredintegerThe UNPOSTED bill to code. A posted bill is refused.
glaccountidintegerAccount id. Or send glaccount by name.
glaccountstring(60)Account name, matched exactly.
amountrequiredmoneystringHow much codes to this account. Cannot take the distribution past the bill total. Decimal STRING, not a JSON number.
jobidintegerJob to cost this to.
costcodeidintegerCost code.
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.
409apbill_already_postedThe bill already carries a voucherid.
422distribution_exceeds_totalThe line would code more than the bill is for.
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/apbilllines' \
  -H 'Authorization: Bearer $NP_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: your-unique-key' \
  -d '{
    "apbillid": 104,
    "amount": "125.0000",
    "externalid": "crm-8842"
}'
Response 201
{
    "apbillid": 104,
    "glaccountid": 104,
    "amount": "125.0000",
    "billtotal": "125.0000",
    "distributed": "125.0000",
    "undistributed": "125.0000"
}
GET/apbilllines/{id} 200404

Retrieve one record.

Requires scope bills: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/apbilllines/104' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "apbillid": 104,
    "amount": "125.0000",
    "glaccountid": 104,
    "glaccount": "Example glaccount",
    "invreceiveid": 104,
    "jobid": 104
}
PATCH/apbilllines/{id} 200400404409422

Update.

Requires scope bills:write.

Parameters
NameInTypeNotes
idrequiredpathintegerThe record id.
Body
FieldTypeDescription
amountmoneystringHow much codes to this account. Decimal STRING.
glaccountidintegerAccount this line codes to.
jobidintegerJob to cost this to.
costcodeidintegerCost code.
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.
409apbill_already_postedThe bill already carries a voucherid.
409stale_recordIf-Match did not match; someone else changed it first.
422distribution_exceeds_totalThe change would code more than the bill is for.
422rule_violationNolaPro refused the change. message carries its reason.
curl -X PATCH \
  'https://acme.nolapro.com/!/api/v2/apbilllines/104' \
  -H 'Authorization: Bearer $NP_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: your-unique-key' \
  -d '{
    "amount": "12.5000"
}'