Update InventoryCostAdjustment record
curl --request PUT \
--url https://api.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"purchase_order_id": 123,
"bill_id": 123,
"items": [
{
"item_id": 123,
"category_id": 123,
"amount": 123
}
],
"memo": "",
"record_status": "draft"
}
'import requests
url = "https://api.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/"
payload = {
"purchase_order_id": 123,
"bill_id": 123,
"items": [
{
"item_id": 123,
"category_id": 123,
"amount": 123
}
],
"memo": "",
"record_status": "draft"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purchase_order_id: 123,
bill_id: 123,
items: [{item_id: 123, category_id: 123, amount: 123}],
memo: '',
record_status: 'draft'
})
};
fetch('https://api.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/', 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.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/",
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([
'purchase_order_id' => 123,
'bill_id' => 123,
'items' => [
[
'item_id' => 123,
'category_id' => 123,
'amount' => 123
]
],
'memo' => '',
'record_status' => 'draft'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/"
payload := strings.NewReader("{\n \"purchase_order_id\": 123,\n \"bill_id\": 123,\n \"items\": [\n {\n \"item_id\": 123,\n \"category_id\": 123,\n \"amount\": 123\n }\n ],\n \"memo\": \"\",\n \"record_status\": \"draft\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-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.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"purchase_order_id\": 123,\n \"bill_id\": 123,\n \"items\": [\n {\n \"item_id\": 123,\n \"category_id\": 123,\n \"amount\": 123\n }\n ],\n \"memo\": \"\",\n \"record_status\": \"draft\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purchase_order_id\": 123,\n \"bill_id\": 123,\n \"items\": [\n {\n \"item_id\": 123,\n \"category_id\": 123,\n \"amount\": 123\n }\n ],\n \"memo\": \"\",\n \"record_status\": \"draft\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"number": 123,
"company_id": 123,
"company_name": "<string>",
"date": "2023-12-25",
"origin": "bill",
"amount": "<string>",
"purchase_order_id": 123,
"purchase_order_number": 123,
"bill_id": 123,
"reverses_id": 123,
"memo": "<string>",
"return_comment": "<string>",
"posted_at": "2023-11-07T05:31:56Z",
"record_status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"transaction_id": 123,
"items": [
{
"item_id": 123,
"item_name": "<string>",
"category_id": 123,
"category_code": "<string>",
"category_label": "<string>",
"quantity": "<string>",
"amount": "<string>"
}
],
"bill_number": 123,
"reversed_by_id": 123
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}Inventory Cost Adjustments
Update InventoryCostAdjustment record
Update an existing InventoryCostAdjustment record with the provided data. Validates all required fields and business rules.
PUT
/
public
/
v3-alpha
/
inventory-cost-adjustments
/
{record_number}
/
Update InventoryCostAdjustment record
curl --request PUT \
--url https://api.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"purchase_order_id": 123,
"bill_id": 123,
"items": [
{
"item_id": 123,
"category_id": 123,
"amount": 123
}
],
"memo": "",
"record_status": "draft"
}
'import requests
url = "https://api.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/"
payload = {
"purchase_order_id": 123,
"bill_id": 123,
"items": [
{
"item_id": 123,
"category_id": 123,
"amount": 123
}
],
"memo": "",
"record_status": "draft"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purchase_order_id: 123,
bill_id: 123,
items: [{item_id: 123, category_id: 123, amount: 123}],
memo: '',
record_status: 'draft'
})
};
fetch('https://api.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/', 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.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/",
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([
'purchase_order_id' => 123,
'bill_id' => 123,
'items' => [
[
'item_id' => 123,
'category_id' => 123,
'amount' => 123
]
],
'memo' => '',
'record_status' => 'draft'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/"
payload := strings.NewReader("{\n \"purchase_order_id\": 123,\n \"bill_id\": 123,\n \"items\": [\n {\n \"item_id\": 123,\n \"category_id\": 123,\n \"amount\": 123\n }\n ],\n \"memo\": \"\",\n \"record_status\": \"draft\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-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.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"purchase_order_id\": 123,\n \"bill_id\": 123,\n \"items\": [\n {\n \"item_id\": 123,\n \"category_id\": 123,\n \"amount\": 123\n }\n ],\n \"memo\": \"\",\n \"record_status\": \"draft\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v3-alpha/inventory-cost-adjustments/{record_number}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purchase_order_id\": 123,\n \"bill_id\": 123,\n \"items\": [\n {\n \"item_id\": 123,\n \"category_id\": 123,\n \"amount\": 123\n }\n ],\n \"memo\": \"\",\n \"record_status\": \"draft\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"number": 123,
"company_id": 123,
"company_name": "<string>",
"date": "2023-12-25",
"origin": "bill",
"amount": "<string>",
"purchase_order_id": 123,
"purchase_order_number": 123,
"bill_id": 123,
"reverses_id": 123,
"memo": "<string>",
"return_comment": "<string>",
"posted_at": "2023-11-07T05:31:56Z",
"record_status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"transaction_id": 123,
"items": [
{
"item_id": 123,
"item_name": "<string>",
"category_id": 123,
"category_code": "<string>",
"category_label": "<string>",
"quantity": "<string>",
"amount": "<string>"
}
],
"bill_number": 123,
"reversed_by_id": 123
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}Headers
Optional. A unique value (a UUID works well) identifying this operation. If the request is repeated with the same key, the original response is replayed instead of the operation running again, so a retry cannot create a duplicate record. Results are replayable for 48 hours. Reusing a key with a different request body returns 422.
Maximum string length:
255Body
application/json
Response
OK
Was this page helpful?