Get Available Charges

GET /inventory/landed-costs/vendor-bill-lines

Group: Inventory › Landed Costs · Operation ID: getAvailableCharges

Returns the vendor bill charges available to capitalize for a legal entity.

Returns the vendor bill charges available to capitalize for a legal entity, the endpoint to call before building a landed cost, because you cannot write the create payload without it.

Each row is a line of an approved vendor bill that a landed cost item configuration makes eligible. Its id is what goes into a charge's chargeId. Its functionalLineTotal is what is left to allocate in the entity's functional currency, and that is the figure to send as amount, because a landed cost is consumed with no conversion, so a foreign-currency bill's own lineTotal is the wrong number.

allocationMode is what the configuration recommends for the charge. Pass it back. Omitting it does not fall through to the configuration, it falls through to the item's own default, which may be a different mode.

An empty array almost always means nothing is configured, not that there are no bills. A vendor bill line is eligible only when it matches a row in inventory/landed-cost-items, by item or by GL account. With that configuration empty, nothing matches. Check it before looking at the bills.

excludeFullyAllocated defaults to true, which leaves out charges with nothing left. Pass false to see everything, including what previous landed costs have taken.

Open in the interactive reference

Parameters

Name In Type Required Description
Api-Version header "v1" yes The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1.
entityId query string yes The legal entity whose bills to look at. Required, because eligibility, the functional currency and the bills are all per entity.
excludeFullyAllocated query boolean no Whether to leave out charges with nothing left to allocate. Defaults to true. Pass false to see what previous landed costs have already taken.

Response

200 Success

Under data (getAvailableChargesOutput):

Field Type Required Description
charges array of object yes The charges available, newest bills first. An empty array when nothing matches, which usually means nothing is configured in inventory/landed-cost-items rather than that there are no bills.
charges[].id string yes The vendor bill line. This is what a landed cost charge's chargeId takes.
charges[].vendorBillId string no The vendor bill the line belongs to. A landed cost derives it and does not ask for it. See id on GET accounting/vendor-bills/:id.
charges[].vendorBillNumber string no The vendor bill's number.
charges[].description string no The line's own description, for example 'Sea freight, Shanghai to Felixstowe'.
charges[].poNumber string no The number of the purchase order the line is matched to, where it is matched to one.
charges[].billStatus string no The vendor bill's status. Always approved, because an unapproved bill's lines are not eligible.
charges[].billDate string (date) no The date of the vendor bill. It is also the date the currency conversion below is taken at.
charges[].dueDate string (date) no The vendor bill's due date. Format YYYY-MM-DD.
charges[].vendorName string no The name of the vendor who billed it.
charges[].entityId string no The legal entity the bill belongs to.
charges[].itemId string no The item the charge is billed as, where it is billed as one rather than coded to an account.
charges[].itemCode string no The short code of that item.
charges[].itemName string no The name of that item, falling back to the line's description.
charges[].allocationMode string no The allocation mode the landed cost item configuration recommends for this charge. Possible values: 'Equal', 'Quantity', 'LineTotal', 'Weight', 'Volume'. Pass it back on create. Omitting it falls through to the item's own default, which is a different lookup and may be a different mode.
charges[].lineTotal string (decimal) no The line's total, in the vendor bill's currency.
charges[].allocatedAmount string (decimal) no The amount previous landed costs have already taken, in the vendor bill's currency.
charges[].currency string no The vendor bill's currency, which need not be the entity's functional currency. Format ISO 4217, for example 'GBP'.
charges[].functionalLineTotal string (decimal) no The line's total in the entity's functional currency, converted at billDate. This is the figure to allocate, because a landed cost is stated in the functional currency and nothing converts it afterwards.
charges[].functionalAllocatedAmount string (decimal) no The amount already taken, in the entity's functional currency. Subtract it from functionalLineTotal for what is left.
charges[].functionalCurrency string no The entity's functional currency. It is the currency of the two functional figures above, and of every amount on a landed cost. Format ISO 4217, for example 'GBP'.

Errors

Code Status
ENTITY_NOT_FOUND 400

Statuses