> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://beta-docs.payabli.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://beta-docs.payabli.com/_mcp/server.

# Manage line items

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](/api-reference/lineitem/add-item-to-entrypoint-catalog) 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](/api-reference/lineitem/get-item-in-entrypoint) for full documentation.

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

### Request

GET [https://api-sandbox.payabli.com/api/LineItem/\{lineItemId}](https://api-sandbox.payabli.com/api/LineItem/\{lineItemId})

**`GetItem`**

```curl GetItem
curl https://api-sandbox.payabli.com/api/LineItem/700 \
     -H "requestToken: <apiKey>"
```

**`GetItem`**

```python GetItem
import requests

url = "https://api-sandbox.payabli.com/api/LineItem/700"

headers = {"requestToken": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

**`GetItem`**

```javascript GetItem
const url = 'https://api-sandbox.payabli.com/api/LineItem/700';
const options = {method: 'GET', headers: {requestToken: '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**`GetItem`**

```go GetItem
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/LineItem/700"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("requestToken", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

**`GetItem`**

```ruby GetItem
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/LineItem/700")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["requestToken"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

**`GetItem`**

```java GetItem
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-sandbox.payabli.com/api/LineItem/700")
  .header("requestToken", "<apiKey>")
  .asString();
```

**`GetItem`**

```php GetItem
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-sandbox.payabli.com/api/LineItem/700', [
  'headers' => [
    'requestToken' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

**`GetItem`**

```csharp GetItem
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/LineItem/700");
var request = new RestRequest(Method.GET);
request.AddHeader("requestToken", "<apiKey>");
IRestResponse response = client.Execute(request);
```

**`GetItem`**

```swift GetItem
import Foundation

let headers = ["requestToken": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/LineItem/700")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

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

### Response (200)

```json
{
  "itemCost": 5,
  "itemQty": 1,
  "createdAt": "2022-07-01T15:00:01Z",
  "id": 45,
  "itemCategories": [
    "itemCategories"
  ],
  "itemCommodityCode": "010",
  "itemDescription": "Deposit for materials.",
  "itemMode": 0,
  "itemProductCode": "M-DEPOSIT",
  "itemProductName": "Materials deposit",
  "itemUnitOfMeasure": "SqFt",
  "lastUpdated": "2022-07-01T15:00:01Z",
  "pageidentifier": "null",
  "ParentOrgName": "PropertyManager Pro",
  "PaypointDbaname": "Sunshine Gutters",
  "PaypointEntryname": "d193cf9a46",
  "PaypointLegalname": "Sunshine Services, LLC"
}
```

## 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](/api-reference/lineitem/get-list-of-items-for-entrypoint) for full documentation.

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

### Request

GET [https://api-sandbox.payabli.com/api/Query/lineitems/\{entry}](https://api-sandbox.payabli.com/api/Query/lineitems/\{entry})

**`ListItems`**

```curl ListItems
curl -G https://api-sandbox.payabli.com/api/Query/lineitems/8cfec329267 \
     -H "requestToken: <apiKey>" \
     -d fromRecord=251 \
     -d limitRecord=0 \
     -d sortBy=desc(field_name)
```

**`ListItems`**

```python ListItems
import requests

url = "https://api-sandbox.payabli.com/api/Query/lineitems/8cfec329267"

querystring = {"fromRecord":"251","limitRecord":"0","sortBy":"desc(field_name)"}

headers = {"requestToken": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

**`ListItems`**

```javascript ListItems
const url = 'https://api-sandbox.payabli.com/api/Query/lineitems/8cfec329267?fromRecord=251&limitRecord=0&sortBy=desc%28field_name%29';
const options = {method: 'GET', headers: {requestToken: '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**`ListItems`**

```go ListItems
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/Query/lineitems/8cfec329267?fromRecord=251&limitRecord=0&sortBy=desc%28field_name%29"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("requestToken", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

**`ListItems`**

```ruby ListItems
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/Query/lineitems/8cfec329267?fromRecord=251&limitRecord=0&sortBy=desc%28field_name%29")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["requestToken"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

**`ListItems`**

```java ListItems
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-sandbox.payabli.com/api/Query/lineitems/8cfec329267?fromRecord=251&limitRecord=0&sortBy=desc%28field_name%29")
  .header("requestToken", "<apiKey>")
  .asString();
```

**`ListItems`**

```php ListItems
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-sandbox.payabli.com/api/Query/lineitems/8cfec329267?fromRecord=251&limitRecord=0&sortBy=desc%28field_name%29', [
  'headers' => [
    'requestToken' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

**`ListItems`**

```csharp ListItems
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/Query/lineitems/8cfec329267?fromRecord=251&limitRecord=0&sortBy=desc%28field_name%29");
var request = new RestRequest(Method.GET);
request.AddHeader("requestToken", "<apiKey>");
IRestResponse response = client.Execute(request);
```

**`ListItems`**

```swift ListItems
import Foundation

let headers = ["requestToken": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Query/lineitems/8cfec329267?fromRecord=251&limitRecord=0&sortBy=desc%28field_name%29")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

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

### Response (200)

```json
{
  "Records": [
    {
      "LineItem": {
        "itemCost": 12.45,
        "itemQty": 1,
        "itemProductName": "Materials deposit"
      },
      "ParentOrgName": "PropertyManager Pro",
      "PaypointDbaname": "Sunshine Gutters",
      "PaypointEntryname": "d193cf9a46",
      "PaypointLegalname": "Sunshine Services, LLC"
    }
  ],
  "Summary": {
    "pageIdentifier": "null",
    "pageSize": 20,
    "totalAmount": 77.22,
    "totalNetAmount": 77.22,
    "totalPages": 2,
    "totalRecords": 2
  }
}
```

## Update a line item

Send a PUT request to `/api/LineItem/{lineItemId}` to modify an existing line item's details. See the [API reference](/api-reference/lineitem/update-item-in-entrypoint) for full documentation.

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

### Request

PUT [https://api-sandbox.payabli.com/api/LineItem/\{lineItemId}](https://api-sandbox.payabli.com/api/LineItem/\{lineItemId})

**`UpdateItem`**

```curl UpdateItem
curl -X PUT https://api-sandbox.payabli.com/api/LineItem/700 \
     -H "requestToken: <apiKey>" \
     -H "Content-Type: application/json" \
     -d '{
  "itemCost": 12.45,
  "itemQty": 1
}'
```

**`UpdateItem`**

```python UpdateItem
import requests

url = "https://api-sandbox.payabli.com/api/LineItem/700"

payload = {
    "itemCost": 12.45,
    "itemQty": 1
}
headers = {
    "requestToken": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

**`UpdateItem`**

```javascript UpdateItem
const url = 'https://api-sandbox.payabli.com/api/LineItem/700';
const options = {
  method: 'PUT',
  headers: {requestToken: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"itemCost":12.45,"itemQty":1}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**`UpdateItem`**

```go UpdateItem
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/LineItem/700"

	payload := strings.NewReader("{\n  \"itemCost\": 12.45,\n  \"itemQty\": 1\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("requestToken", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

**`UpdateItem`**

```ruby UpdateItem
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/LineItem/700")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["requestToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"itemCost\": 12.45,\n  \"itemQty\": 1\n}"

response = http.request(request)
puts response.read_body
```

**`UpdateItem`**

```java UpdateItem
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api-sandbox.payabli.com/api/LineItem/700")
  .header("requestToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"itemCost\": 12.45,\n  \"itemQty\": 1\n}")
  .asString();
```

**`UpdateItem`**

```php UpdateItem
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-sandbox.payabli.com/api/LineItem/700', [
  'body' => '{
  "itemCost": 12.45,
  "itemQty": 1
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'requestToken' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

**`UpdateItem`**

```csharp UpdateItem
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/LineItem/700");
var request = new RestRequest(Method.PUT);
request.AddHeader("requestToken", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"itemCost\": 12.45,\n  \"itemQty\": 1\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

**`UpdateItem`**

```swift UpdateItem
import Foundation

let headers = [
  "requestToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "itemCost": 12.45,
  "itemQty": 1
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/LineItem/700")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

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 (200)

```json
{
  "isSuccess": true,
  "responseData": 700,
  "responseText": "Success"
}
```

## Delete a line item

Send a DELETE request to `/api/LineItem/{lineItemId}` to remove an existing line item. See the [API reference](/api-reference/lineitem/delete-item-in-entrypoint) for full documentation.

This example deletes the line item with ID `700`.

### Request

DELETE [https://api-sandbox.payabli.com/api/LineItem/\{lineItemId}](https://api-sandbox.payabli.com/api/LineItem/\{lineItemId})

**`DeleteItem`**

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

**`DeleteItem`**

```python DeleteItem
import requests

url = "https://api-sandbox.payabli.com/api/LineItem/700"

headers = {"requestToken": "<apiKey>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

**`DeleteItem`**

```javascript DeleteItem
const url = 'https://api-sandbox.payabli.com/api/LineItem/700';
const options = {method: 'DELETE', headers: {requestToken: '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**`DeleteItem`**

```go DeleteItem
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/LineItem/700"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("requestToken", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

**`DeleteItem`**

```ruby DeleteItem
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/LineItem/700")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["requestToken"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

**`DeleteItem`**

```java DeleteItem
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api-sandbox.payabli.com/api/LineItem/700")
  .header("requestToken", "<apiKey>")
  .asString();
```

**`DeleteItem`**

```php DeleteItem
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api-sandbox.payabli.com/api/LineItem/700', [
  'headers' => [
    'requestToken' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

**`DeleteItem`**

```csharp DeleteItem
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/LineItem/700");
var request = new RestRequest(Method.DELETE);
request.AddHeader("requestToken", "<apiKey>");
IRestResponse response = client.Execute(request);
```

**`DeleteItem`**

```swift DeleteItem
import Foundation

let headers = ["requestToken": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/LineItem/700")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

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

### Response (200)

```json
{
  "isSuccess": true,
  "responseText": "Success"
}
```