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).

Create line item example
  curl --request POST \
      --url https://api-sandbox.payabli.com/api/LineItem/47cae3d74 \
      --header 'accept: application/json' \
      --header 'content-type: application/*+json' \
      --header 'requestToken: <API TOKEN>' \
      --data '
  {
    "itemCategories": [
      "consult and planning"
    ],
    "itemProductName": "Consult",
    "itemDescription": "Tour consult and quoting service", 
    "itemCost": 100,
    "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 123.

Get line item example
curl --request GET \
 --url https://api-sandbox.payabli.com/api/LineItem/123 \
 --header 'requestToken: <api-key>'

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 line items list example
curl --request GET \
 --url https://api-sandbox.payabli.com/api/Query/lineitems/47cae3d74 \
 --header 'requestToken: <api-key>'

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 123 to be a materials deposit item with new pricing and measurement details.

Update line item example
  curl --request PUT \
  --url https://api-sandbox.payabli.com/api/LineItem/123 \
  --header 'Content-Type: application/json' \
  --header 'requestToken: <api-key>' \
  --data '{
  "itemProductCode": "M-DEPOSIT",
  "itemProductName": "Materials deposit",
  "itemDescription": "Deposit for materials.",
  "itemCommodityCode": "010",
  "itemUnitOfMeasure": "SqFt",
  "itemCost": 12.45,
  "itemQty": 1,
  "itemMode": 0
  }'

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 123.

Delete line item example
curl --request DELETE \
 --url https://api-sandbox.payabli.com/api/LineItem/123 \
 --header 'requestToken: <api-key>'

Response format

Most line item operations return a standardized response format:

Response format example
  {
    "responseText": "Success",
    "responseData": 123, // this is the line item ID
    "pageidentifier": null,
    "isSuccess": true
  }

The GET operations return either a list of items for an entrypoint or the details of a specific item.