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

# Create item

POST https://api-sandbox.payabli.com/api/LineItem/{entry}
Content-Type: application/json

Adds products and services to an entrypoint's catalog. These are used as line items for invoicing and transactions. In the response, "responseData" displays the item's code.

Reference: https://beta-docs.payabli.com/api-reference/lineitem/add-item-to-entrypoint-catalog

## Authentication

- `requestToken` header (required) — API Key authentication via header

## Servers

- `https://api-sandbox.payabli.com/api` (Sandbox, default)
- `https://api.payabli.com/api` (Production)

## Request

### Path parameters

- `entry` (string, required) — The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)

### Headers

- `idempotencyKey` (string, optional) — A unique ID you can include to prevent duplicating objects or transactions if a request is sent more than once. This key is not generated in Payabli, you must generate it yourself.

### Body (application/json)

This endpoint expects a LineItem.

- `itemCost` (double, required) — Item or product price per unit.
- `itemQty` (integer, required) — Quantity of item or product.
- `itemCategories` (list of string, optional) — Array of tags classifying item or product.
- `itemCommodityCode` (string, optional) — Item or product commodity code. Max length of 250 characters.
- `itemDescription` (string, optional) — Item or product description. Max length of 250 characters.
- `itemMode` (integer, optional) — Internal class of item or product: value '0' is only for invoices, '1' for bills, and '2' is common for both.
- `itemProductCode` (string, optional) — Item or product code. Max length of 250 characters.
- `itemProductName` (string, optional) — Item or product name. Max length of 250 characters.
- `itemUnitOfMeasure` (string, optional) — Unit of measurement. Max length of 100 characters.

## Response

### 200

Success

- `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure.
- `pageIdentifier` (string, optional) — Auxiliary validation used internally by payment pages and components.
- `responseData` (Responsedatanonobject, optional) — If `isSuccess` = true, this contains the line item identifier. If `isSuccess` = false, this contains the reason of the error.
- `responseText` (string, optional) — Response text for operation: 'Success' or 'Declined'.

## Errors

### 400 Bad Request Error

Bad request/ invalid data

- `any`

### 401 Unauthorized Error

Unauthorized request.

- `any`

### 500 Internal Server Error

Internal API Error

- `any`

### 503 Service Unavailable Error

Database connection error

- `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure.
- `responseData` (map from string to any, optional) — The object containing the response data.
- `responseText` (string, optional) — Response text for operation: 'Success' or 'Declined'.

## Types

### Responsedatanonobject

The response data.

## Examples

**Request**

```json
{
  "itemCost": 12.45,
  "itemQty": 1,
  "itemCommodityCode": "010",
  "itemDescription": "Deposit for materials",
  "itemMode": 0,
  "itemProductCode": "M-DEPOSIT",
  "itemProductName": "Materials deposit",
  "itemUnitOfMeasure": "SqFt"
}
```

**Response**

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

**SDK Code**

```python AddItem
import requests

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

payload = {
    "itemCost": 12.45,
    "itemQty": 1,
    "itemCommodityCode": "010",
    "itemDescription": "Deposit for materials",
    "itemMode": 0,
    "itemProductCode": "M-DEPOSIT",
    "itemProductName": "Materials deposit",
    "itemUnitOfMeasure": "SqFt"
}
headers = {
    "requestToken": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript AddItem
const url = 'https://api-sandbox.payabli.com/api/LineItem/47cae3d74';
const options = {
  method: 'POST',
  headers: {requestToken: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"itemCost":12.45,"itemQty":1,"itemCommodityCode":"010","itemDescription":"Deposit for materials","itemMode":0,"itemProductCode":"M-DEPOSIT","itemProductName":"Materials deposit","itemUnitOfMeasure":"SqFt"}'
};

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

```go AddItem
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"itemCost\": 12.45,\n  \"itemQty\": 1,\n  \"itemCommodityCode\": \"010\",\n  \"itemDescription\": \"Deposit for materials\",\n  \"itemMode\": 0,\n  \"itemProductCode\": \"M-DEPOSIT\",\n  \"itemProductName\": \"Materials deposit\",\n  \"itemUnitOfMeasure\": \"SqFt\"\n}")

	req, _ := http.NewRequest("POST", 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))

}
```

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

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

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

request = Net::HTTP::Post.new(url)
request["requestToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"itemCost\": 12.45,\n  \"itemQty\": 1,\n  \"itemCommodityCode\": \"010\",\n  \"itemDescription\": \"Deposit for materials\",\n  \"itemMode\": 0,\n  \"itemProductCode\": \"M-DEPOSIT\",\n  \"itemProductName\": \"Materials deposit\",\n  \"itemUnitOfMeasure\": \"SqFt\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api-sandbox.payabli.com/api/LineItem/47cae3d74")
  .header("requestToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"itemCost\": 12.45,\n  \"itemQty\": 1,\n  \"itemCommodityCode\": \"010\",\n  \"itemDescription\": \"Deposit for materials\",\n  \"itemMode\": 0,\n  \"itemProductCode\": \"M-DEPOSIT\",\n  \"itemProductName\": \"Materials deposit\",\n  \"itemUnitOfMeasure\": \"SqFt\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-sandbox.payabli.com/api/LineItem/47cae3d74', [
  'body' => '{
  "itemCost": 12.45,
  "itemQty": 1,
  "itemCommodityCode": "010",
  "itemDescription": "Deposit for materials",
  "itemMode": 0,
  "itemProductCode": "M-DEPOSIT",
  "itemProductName": "Materials deposit",
  "itemUnitOfMeasure": "SqFt"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'requestToken' => '<apiKey>',
  ],
]);

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

```csharp AddItem
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/LineItem/47cae3d74");
var request = new RestRequest(Method.POST);
request.AddHeader("requestToken", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"itemCost\": 12.45,\n  \"itemQty\": 1,\n  \"itemCommodityCode\": \"010\",\n  \"itemDescription\": \"Deposit for materials\",\n  \"itemMode\": 0,\n  \"itemProductCode\": \"M-DEPOSIT\",\n  \"itemProductName\": \"Materials deposit\",\n  \"itemUnitOfMeasure\": \"SqFt\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift AddItem
import Foundation

let headers = [
  "requestToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "itemCost": 12.45,
  "itemQty": 1,
  "itemCommodityCode": "010",
  "itemDescription": "Deposit for materials",
  "itemMode": 0,
  "itemProductCode": "M-DEPOSIT",
  "itemProductName": "Materials deposit",
  "itemUnitOfMeasure": "SqFt"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/LineItem/47cae3d74")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```