This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Update item

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

Updates an item.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: payabliApi
  version: 1.0.0
paths:
  /LineItem/{lineItemId}:
    put:
      operationId: update-item
      summary: Update item in entrypoint
      description: Updates an item.
      tags:
        - subpackage_lineItem
      parameters:
        - name: lineItemId
          in: path
          description: ID for the line item (also known as a product, service, or item).
          required: true
          schema:
            type: integer
        - name: requestToken
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:PayabliApiResponse6'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_:LineItem'
servers:
  - url: https://api-sandbox.payabli.com/api
  - url: https://api.payabli.com/api
components:
  schemas:
    type_:ItemCommodityCode:
      type: string
      description: Item or product commodity code. Max length of 250 characters.
      title: ItemCommodityCode
    type_:ItemDescription:
      type: string
      description: Item or product description. Max length of 250 characters.
      title: ItemDescription
    type_:ItemProductCode:
      type: string
      description: Item or product code. Max length of 250 characters.
      title: ItemProductCode
    type_:ItemProductName:
      type: string
      description: Item or product name. Max length of 250 characters.
      title: ItemProductName
    type_:ItemUnitofMeasure:
      type: string
      description: Unit of measurement. Max length of 100 characters.
      title: ItemUnitofMeasure
    type_:LineItem:
      type: object
      properties:
        itemCategories:
          type: array
          items:
            type: string
          description: Array of tags classifying item or product.
        itemCommodityCode:
          $ref: '#/components/schemas/type_:ItemCommodityCode'
        itemCost:
          type: number
          format: double
          description: Item or product price per unit.
        itemDescription:
          $ref: '#/components/schemas/type_:ItemDescription'
        itemMode:
          type: integer
          description: >-
            Internal class of item or product: value '0' is only for invoices,
            '1' for bills, and '2' is common for both.
        itemProductCode:
          $ref: '#/components/schemas/type_:ItemProductCode'
        itemProductName:
          $ref: '#/components/schemas/type_:ItemProductName'
        itemQty:
          type: integer
          description: Quantity of item or product.
        itemUnitOfMeasure:
          $ref: '#/components/schemas/type_:ItemUnitofMeasure'
      required:
        - itemCost
        - itemQty
      title: LineItem
    type_:IsSuccess:
      type: boolean
      description: >-
        Boolean indicating whether the operation was successful. A `true` value
        indicates success. A `false` value indicates failure.
      title: IsSuccess
    type_:PageIdentifier:
      type: string
      description: Auxiliary validation used internally by payment pages and components.
      title: PageIdentifier
    type_:Responsedatanonobject:
      oneOf:
        - type: string
        - type: integer
      description: The response data.
      title: Responsedatanonobject
    type_:ResponseText:
      type: string
      description: 'Response text for operation: ''Success'' or ''Declined''.'
      title: ResponseText
    type_:PayabliApiResponse6:
      type: object
      properties:
        isSuccess:
          $ref: '#/components/schemas/type_:IsSuccess'
        pageIdentifier:
          $ref: '#/components/schemas/type_:PageIdentifier'
        responseData:
          $ref: '#/components/schemas/type_:Responsedatanonobject'
          description: >-
            If `isSuccess` = true, this contains the line item identifier. If
            `isSuccess` = false, this contains the reason of the error.
        responseText:
          $ref: '#/components/schemas/type_:ResponseText'
      required:
        - responseText
      description: Response schema for line item operations.
      title: PayabliApiResponse6
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: requestToken

```

## SDK Code Examples

```typescript UpdateItem
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.lineItem.updateItem(700, {
        itemCost: 12.45,
        itemQty: 1,
    });
}
main();

```

```python UpdateItem
from payabli import payabli

client = payabli(
    api_key="YOUR_API_KEY_HERE",
)

client.line_item.update_item(
    line_item_id=700,
    item_cost=12.45,
    item_qty=1,
)

```

```csharp UpdateItem
using PayabliPayabliApi;
using System.Threading.Tasks;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayabliPayabliApiClient(
            apiKey: "YOUR_API_KEY_HERE"
        );

        await client.LineItem.UpdateItemAsync(
            700,
            new LineItem {
                ItemCost = 12.45,
                ItemQty = 1
            }
        );
    }

}

```

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

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