Skip to content

Retrieve accounting codes for an invoice.

Request

Path
invoiceIdinteger, (int32)required

The invoice Id

const invoiceId = 'YOUR_invoiceId_PARAMETER';
const resp = await fetch(
  `https://api-sandbox.lawvu.com/invoice-apis/v1/invoices/${invoiceId}/accountingCodes`,
  {method: 'GET'}
);

const data = await resp.text();
console.log(data);

Responses

OK

Body
componentsArray of objects or null(AccountingCodeComponent)
Response
{
  "components": [
    {
      "fieldId": 18,
      "fieldName": "Region",
      "fieldType": "Region",
      "optionId": 623,
      "optionLabel": "AMER - Americas",
      "optionCode": "AMER"
    },
    {
      "fieldId": 17,
      "fieldName": "Department",
      "fieldType": "Department",
      "optionId": null,
      "optionLabel": null,
      "optionCode": null
    },
    {
      "fieldId": 115428,
      "fieldName": "Billing Entity",
      "fieldType": "BillingEntity",
      "optionId": 1681,
      "optionLabel": "amc-global - AMC Global",
      "optionCode": "amc-global"
    },
    {
      "fieldId": 171427,
      "fieldName": "Cost Centre",
      "fieldType": "AccountingCode",
      "optionId": 1779,
      "optionLabel": "A0003 - Procurement",
      "optionCode": "A0003"
    },
    {
      "fieldId": 171428,
      "fieldName": "Project Code",
      "fieldType": "AccountingCode",
      "optionId": 1783,
      "optionLabel": "P2026-002 - New division - East Sydney",
      "optionCode": "P2026-002"
    }
  ]
}