Skip to main content
PUT
/
accounting
/
items
Update an Item
curl --request PUT \
  --url https://api.rootfi.dev/v3/accounting/items \
  --header 'Content-Type: application/json' \
  --header 'api_key: <api-key>' \
  --data '
{
  "company_id": 123,
  "data": [
    {
      "platform_id": "a979d4e1-9795-ee11-be36-6045bdc629b7",
      "name": "Brian Vega",
      "description": null,
      "updated_at": "2023-12-08T00:00:00.000Z",
      "status": "ACTIVE",
      "bill_item": {
        "tax_id": "123456",
        "account_id": "123456",
        "unit_price": 123.45,
        "description": "Test Item"
      },
      "code": "9837",
      "invoice_item": {
        "tax_id": "123456",
        "account_id": "123456",
        "unit_price": 123.45,
        "description": "Test Item"
      },
      "is_bill_item": true,
      "is_invoice_item": true,
      "type": "INVENTORY",
      "quantity_on_hand": 10
    }
  ]
}
'
import requests

url = "https://api.rootfi.dev/v3/accounting/items"

payload = {
"company_id": 123,
"data": [
{
"platform_id": "a979d4e1-9795-ee11-be36-6045bdc629b7",
"name": "Brian Vega",
"description": None,
"updated_at": "2023-12-08T00:00:00.000Z",
"status": "ACTIVE",
"bill_item": {
"tax_id": "123456",
"account_id": "123456",
"unit_price": 123.45,
"description": "Test Item"
},
"code": "9837",
"invoice_item": {
"tax_id": "123456",
"account_id": "123456",
"unit_price": 123.45,
"description": "Test Item"
},
"is_bill_item": True,
"is_invoice_item": True,
"type": "INVENTORY",
"quantity_on_hand": 10
}
]
}
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PUT',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_id: 123,
data: [
{
platform_id: 'a979d4e1-9795-ee11-be36-6045bdc629b7',
name: 'Brian Vega',
description: null,
updated_at: '2023-12-08T00:00:00.000Z',
status: 'ACTIVE',
bill_item: {
tax_id: '123456',
account_id: '123456',
unit_price: 123.45,
description: 'Test Item'
},
code: '9837',
invoice_item: {
tax_id: '123456',
account_id: '123456',
unit_price: 123.45,
description: 'Test Item'
},
is_bill_item: true,
is_invoice_item: true,
type: 'INVENTORY',
quantity_on_hand: 10
}
]
})
};

fetch('https://api.rootfi.dev/v3/accounting/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rootfi.dev/v3/accounting/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'company_id' => 123,
'data' => [
[
'platform_id' => 'a979d4e1-9795-ee11-be36-6045bdc629b7',
'name' => 'Brian Vega',
'description' => null,
'updated_at' => '2023-12-08T00:00:00.000Z',
'status' => 'ACTIVE',
'bill_item' => [
'tax_id' => '123456',
'account_id' => '123456',
'unit_price' => 123.45,
'description' => 'Test Item'
],
'code' => '9837',
'invoice_item' => [
'tax_id' => '123456',
'account_id' => '123456',
'unit_price' => 123.45,
'description' => 'Test Item'
],
'is_bill_item' => true,
'is_invoice_item' => true,
'type' => 'INVENTORY',
'quantity_on_hand' => 10
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://api.rootfi.dev/v3/accounting/items"

payload := strings.NewReader("{\n \"company_id\": 123,\n \"data\": [\n {\n \"platform_id\": \"a979d4e1-9795-ee11-be36-6045bdc629b7\",\n \"name\": \"Brian Vega\",\n \"description\": null,\n \"updated_at\": \"2023-12-08T00:00:00.000Z\",\n \"status\": \"ACTIVE\",\n \"bill_item\": {\n \"tax_id\": \"123456\",\n \"account_id\": \"123456\",\n \"unit_price\": 123.45,\n \"description\": \"Test Item\"\n },\n \"code\": \"9837\",\n \"invoice_item\": {\n \"tax_id\": \"123456\",\n \"account_id\": \"123456\",\n \"unit_price\": 123.45,\n \"description\": \"Test Item\"\n },\n \"is_bill_item\": true,\n \"is_invoice_item\": true,\n \"type\": \"INVENTORY\",\n \"quantity_on_hand\": 10\n }\n ]\n}")

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

req.Header.Add("api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.rootfi.dev/v3/accounting/items")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"company_id\": 123,\n \"data\": [\n {\n \"platform_id\": \"a979d4e1-9795-ee11-be36-6045bdc629b7\",\n \"name\": \"Brian Vega\",\n \"description\": null,\n \"updated_at\": \"2023-12-08T00:00:00.000Z\",\n \"status\": \"ACTIVE\",\n \"bill_item\": {\n \"tax_id\": \"123456\",\n \"account_id\": \"123456\",\n \"unit_price\": 123.45,\n \"description\": \"Test Item\"\n },\n \"code\": \"9837\",\n \"invoice_item\": {\n \"tax_id\": \"123456\",\n \"account_id\": \"123456\",\n \"unit_price\": 123.45,\n \"description\": \"Test Item\"\n },\n \"is_bill_item\": true,\n \"is_invoice_item\": true,\n \"type\": \"INVENTORY\",\n \"quantity_on_hand\": 10\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.rootfi.dev/v3/accounting/items")

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

request = Net::HTTP::Put.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"company_id\": 123,\n \"data\": [\n {\n \"platform_id\": \"a979d4e1-9795-ee11-be36-6045bdc629b7\",\n \"name\": \"Brian Vega\",\n \"description\": null,\n \"updated_at\": \"2023-12-08T00:00:00.000Z\",\n \"status\": \"ACTIVE\",\n \"bill_item\": {\n \"tax_id\": \"123456\",\n \"account_id\": \"123456\",\n \"unit_price\": 123.45,\n \"description\": \"Test Item\"\n },\n \"code\": \"9837\",\n \"invoice_item\": {\n \"tax_id\": \"123456\",\n \"account_id\": \"123456\",\n \"unit_price\": 123.45,\n \"description\": \"Test Item\"\n },\n \"is_bill_item\": true,\n \"is_invoice_item\": true,\n \"type\": \"INVENTORY\",\n \"quantity_on_hand\": 10\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "rootfi_id": 32302,
    "rootfi_deleted_at": null,
    "rootfi_created_at": "2024-01-24T11:12:00.315Z",
    "rootfi_updated_at": "2024-01-24T11:12:00.000Z",
    "rootfi_company_id": 1109,
    "platform_id": "123456_1",
    "platform_unique_id": "123456",
    "name": "Brian Vega",
    "description": null,
    "updated_at": "2023-12-08T00:00:00.000Z",
    "status": "ACTIVE",
    "bill_item": {
      "tax_id": "123456",
      "account_id": "123456",
      "unit_price": 123.45,
      "description": "Test Item"
    },
    "code": "9837",
    "invoice_item": {
      "tax_id": "123456",
      "account_id": "123456",
      "unit_price": 123.45,
      "description": "Test Item"
    },
    "is_bill_item": true,
    "is_invoice_item": true,
    "type": "INVENTORY",
    "quantity_on_hand": 10
  }
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}
The Items Data Model is designed to simplify the management and retrieval of item-related information across various accounting platforms.
Only supported for Zoho Books, Quickbooks, Xero

Authorizations

api_key
string
header
required

Body

application/json
company_id
integer
required

The ID of the company in the accounting platform

data
accountingUpdateItemFields · object[]
required

The data of the items endpoint

run_async
boolean | null

Run the request asynchronously

Response

data
accountingItemObject · object | null

List of items

sync_id
string | null

The sync id of the request