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

# Update item

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

Updates an item.

Reference: https://beta-docs.payabli.com/api-reference/lineitem/update-item-in-entrypoint

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

- `lineItemId` (integer, required) — ID for the line item (also known as a product, service, or item).

### 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
}
```

**Response**

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

**SDK Code**

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

```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);
}
```

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

}
```

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

```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();
```

```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();
```

```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);
```

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