Manage line items

Learn how to add and manage line items for products and services via the API

Applies to:Developers

Use Payabli’s line item functions to create and manage products or services for invoices and bills. This guide covers the key operations for managing line items through the API.

Considerations

Keep these considerations in mind when working with line items:

  • Line items can be designated for invoices, bills, or both.
  • Items are always associated with an organization or a paypoint.
  • The itemMode parameter determines where items can be used (0=invoices, 1=bills, 2=both).

Create a line item

Send a POST request to /api/LineItem/{entryId} to create a new line item in an entrypoint’s catalog. See the API reference for full documentation.

This example creates a consultation service line item in the paypoint with ID 47cae3d74. The item is set for use with invoices only (itemMode: 0).

Get line item details

Send a GET request to /api/LineItem/{lineItemId} to retrieve information about a specific line item. See the API reference for full documentation.

This example retrieves details for the line item with ID 700.

GET
/api/LineItem/:lineItemId
1curl https://api-sandbox.payabli.com/api/LineItem/700 \
2 -H "requestToken: <apiKey>"

A successful request sends a 200 response with a JSON body that contains the line item details.

Response
1{
2 "itemCost": 5,
3 "itemQty": 1,
4 "createdAt": "2022-07-01T15:00:01Z",
5 "id": 45,
6 "itemCategories": [
7 "itemCategories"
8 ],
9 "itemCommodityCode": "010",
10 "itemDescription": "Deposit for materials.",
11 "itemMode": 0,
12 "itemProductCode": "M-DEPOSIT",
13 "itemProductName": "Materials deposit",
14 "itemUnitOfMeasure": "SqFt",
15 "lastUpdated": "2022-07-01T15:00:01Z",
16 "pageidentifier": "null",
17 "ParentOrgName": "PropertyManager Pro",
18 "PaypointDbaname": "Sunshine Gutters",
19 "PaypointEntryname": "d193cf9a46",
20 "PaypointLegalname": "Sunshine Services, LLC"
21}

Get list of line items

Send a GET request to /api/Query/lineitems/{entry} to retrieve all line items for an entrypoint. See the API reference for full documentation.

This example retrieves all line items for the paypoint with ID 47cae3d74.

GET
/api/Query/lineitems/:entry
1curl -G https://api-sandbox.payabli.com/api/Query/lineitems/8cfec329267 \
2 -H "requestToken: <apiKey>" \
3 -d fromRecord=251 \
4 -d limitRecord=0 \
5 -d sortBy=desc(field_name)

A successful request sends a 200 response with a JSON body that contains the list of line items.

Response
1{
2 "Records": [
3 {
4 "LineItem": {
5 "itemCost": 12.45,
6 "itemQty": 1,
7 "itemProductName": "Materials deposit"
8 },
9 "ParentOrgName": "PropertyManager Pro",
10 "PaypointDbaname": "Sunshine Gutters",
11 "PaypointEntryname": "d193cf9a46",
12 "PaypointLegalname": "Sunshine Services, LLC"
13 }
14 ],
15 "Summary": {
16 "pageIdentifier": "null",
17 "pageSize": 20,
18 "totalAmount": 77.22,
19 "totalNetAmount": 77.22,
20 "totalPages": 2,
21 "totalRecords": 2
22 }
23}

Update a line item

Send a PUT request to /api/LineItem/{lineItemId} to modify an existing line item’s details. See the API reference for full documentation.

This example updates the line item with ID 700 to be a materials deposit item with new pricing and measurement details.

PUT
/api/LineItem/:lineItemId
1curl -X PUT https://api-sandbox.payabli.com/api/LineItem/700 \
2 -H "requestToken: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "itemCost": 12.45,
6 "itemQty": 1
7}'

A successful request sends a 200 response with a JSON body that contains the updated line item details. The response is the same as the create line item response.

Response
1{
2 "isSuccess": true,
3 "responseData": 700,
4 "responseText": "Success"
5}

Delete a line item

Send a DELETE request to /api/LineItem/{lineItemId} to remove an existing line item. See the API reference for full documentation.

This example deletes the line item with ID 700.

DELETE
/api/LineItem/:lineItemId
1curl -X DELETE https://api-sandbox.payabli.com/api/LineItem/700 \
2 -H "requestToken: <apiKey>"

A successful request sends a 200 response with a JSON body that contains the deleted line item’s ID.

Response
1{
2 "isSuccess": true,
3 "responseText": "Success"
4}