Line Item Management
Line item management is a critical component of our system, allowing you to efficiently handle line item data. On this page, we will explore various line item management endpoints that enable you to programmatically manage line item information.
The Line Item Model
The line item model encompasses all the information related to individual items in orders or invoices. It includes details such as the item name, quantity, price, and additional attributes that help you manage these items.
Properties
- Name
name
- Type
- string
- Description
The name of the line item. Required.
- Name
quantity
- Type
- double
- Description
The quantity of the line item. Required.
- Name
price
- Type
- double
- Description
The price of the line item. Required.
- Name
sequence
- Type
- integer
- Description
Sequence number of the line item in an order or invoice. Optional, defaults to 5.
- Name
receivedQuantity
- Type
- double
- Description
The quantity of the line item that has been received. Optional.
- Name
description
- Type
- text
- Description
A description of the line item. Optional.
- Name
image
- Type
- text
- Description
URL of an image representing the line item. Optional.
- Name
unit
- Type
- string
- Description
The unit of measure for the line item. Optional.
- Name
tax
- Type
- double
- Description
The tax applied to the line item. Optional.
- Name
status
- Type
- string
- Description
The status of the line item. Optional.
- Name
note
- Type
- text
- Description
A note associated with the line item. Optional.
- Name
code
- Type
- string
- Description
A code associated with the line item. Optional.
- Name
binName
- Type
- string
- Description
The name of the bin where the item is stored. Optional.
- Name
externalId
- Type
- string
- Description
An external identifier for the line item. Optional.
- Name
externalValue
- Type
- string
- Description
An external value associated with the line item. Optional.
- Name
metadata
- Type
- json
- Description
Additional metadata associated with the line item. Defaults to an empty JSON object ''. Optional.
- Name
markup
- Type
- double
- Description
The markup percentage for the line item. Optional.
- Name
cost
- Type
- double
- Description
The cost of the line item. Optional.
- Name
isRevenue
- Type
- boolean
- Description
Indicates whether the line item is considered as revenue. Optional.
- Name
orderTax
- Type
- boolean
- Description
Indicates if tax is applied to the order. Optional.
List all Line Items
This endpoint enables you to retrieve a paginated list of all line items from an order, purchase or invoice by ID.
By default, it displays a maximum of ten line items per page.
Required attributes
- Name
filter
- Type
- array
- Description
Provide the ID of the order, purchase, invoice, or estimate to retrieve the line items. This is a mandatory field. The
filter
attribute supports the following types: 'order', 'purchase', 'invoice', 'estimate'. Use the type as a key in thefilter
object, followed by the respective ID as its value. For example, to filter by an order ID, you would usefilter[order]=<order-id>
.
Optional attributes
- Name
limit
- Type
- integer
- Description
- Limit the number of clients returned.
- Name
offset
- Type
- integer
- Description
- Offset the number of results to skip before starting to return them.
- Name
orderBy
- Type
- string[]
- Description
- Specify the ordering of the results. Default is
['createdAt:DESC']
.
- Name
search
- Type
- string
- Description
- A search term to filter the results.
Request
curl -G https://api.invoiss.com/public/lineItems \
-H "Authorization: {token}" \
-d "limit=10&filter[order]={order_id}"
Response
{
"items":[
{
"id":"94981392-a044-454b-a2d5-e8187a23bfdc",
"image":null,
"name":"Sample Item",
"description":"Item Description",
"price":101,
"quantity":69,
"orderTax":null,
"unit":null,
"status":null,
"code":null,
"sequence":5,
"externalId":"external-id-1",
"externalValue":null,
"markup":null,
"isRevenue":null,
"cost":null,
"receivedQuantity":null,
"metadata":{
},
"item":null,
"order":{
"number":"3DPMDX-Draft",
"type":"ORDER",
"metadata":{
},
"externalId":null,
"company":{
"name":"Tester Company"
},
"companyLocation":null,
"client":{
"name":null,
"contact":"Test Tester",
},
"serviceDate":null,
"createdAt":"2023-12-22T11:16:47.000Z",
"updatedAt":"2023-12-22T11:16:47.000Z",
"paidTotal":0
},
"purchase":null,
"category":null,
"uom":null,
"prices":[
],
"modifierGroups":[
],
"tax":null
}
],
"count":1
}
Create or Update a Line Item
This endpoint allows you to add a new line item or update an existing one. To create or update a line item, you must provide essential information such as name, quantity, and price.
Required attributes
- Name
quantity
- Type
- number
- Description
The quantity of the line item.
- Name
name
- Type
- string
- Description
The name of the line item.
Optional attributes
- Name
sequence
- Type
- number
- Description
The sequence number of the line item in the order.
- Name
receivedQuantity
- Type
- number
- Description
The quantity of the line item received.
- Name
description
- Type
- string
- Description
A description of the line item.
- Name
image
- Type
- string
- Description
URL of an image representing the line item.
- Name
unit
- Type
- string
- Description
The unit of measure for the line item.
- Name
price
- Type
- number
- Description
The price of the line item.
- Name
tax
- Type
- number
- Description
The tax applied to the line item.
- Name
status
- Type
- string
- Description
The status of the line item.
- Name
note
- Type
- string
- Description
A note associated with the line item.
- Name
binName
- Type
- string
- Description
The name of the bin where the item is stored.
- Name
item
- Type
- ID
- Description
The unique identifier of the item.
- Name
uom
- Type
- ID
- Description
The unit of measure identifier.
- Name
category
- Type
- ID
- Description
The category identifier of the line item.
- Name
order
- Type
- ID
- Description
The order identifier to which the line item belongs.
- Name
store
- Type
- ID
- Description
The store identifier where the line item is available.
- Name
purchase
- Type
- ID
- Description
The purchase identifier related to the line item.
- Name
modifierGroups
- Type
- array
- Description
Groups of modifiers applied to the line item.
- Name
prices
- Type
- array
- Description
Different price validators for the line item.
- Name
code
- Type
- string
- Description
A code associated with the line item.
- Name
externalId
- Type
- string
- Description
An external identifier for the line item.
- Name
externalValue
- Type
- string
- Description
An external value associated with the line item.
- Name
metadata
- Type
- object
- Description
Additional metadata associated with the line item.
- Name
markup
- Type
- number
- Description
The markup percentage for the line item.
- Name
cost
- Type
- number
- Description
The cost of the line item.
- Name
isRevenue
- Type
- boolean
- Description
Indicates whether the line item is considered revenue.
- Name
orderTax
- Type
- boolean
- Description
Indicates if tax is applied to the order.
Request
curl https://api.invoiss.com/public/lineItems \
-H "Authorization: {token}" \
-d '{
"inputs": [
{
"name": "New Line Item",
"quantity": 20,
"price": 15.99
}
]
}'
Response
{
true
}