Purchase Orders
Update PurchaseOrder record (v1)
Update an existing PurchaseOrder record with the provided data. Validates all required fields and business rules.
PUT
/
public
/
v1
/
purchase-orders
/
{record_number}
/
Update PurchaseOrder record
curl --request PUT \
--url https://api.dualentry.com/public/v1/purchase-orders/{record_number}/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"date": "2023-12-25",
"company_id": 123,
"vendor_id": 123,
"exchange_rate": 123,
"memo": "<string>",
"items": [
{
"position": 123,
"item_id": 123,
"memo": "<string>",
"quantity": 123,
"rate": 123,
"classifications": [
{
"id": 123,
"name": "<string>",
"line_id": 123,
"line_name": "<string>",
"parent_classification_id": 123,
"parent_classification_line_id": 123
}
],
"tax": {
"code": "<string>",
"rate": 123,
"amount": 123,
"is_taxable": true,
"tax_exempt_amount": 123,
"vat_rate_id": 123,
"gst_tax_rate_id": 123
},
"id": 123
}
],
"supply_date": "2023-12-25",
"place_of_supply": "<string>",
"tax_registration_numbers": {
"company": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
],
"counterparty": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
]
},
"attachments": [],
"record_status": "posted",
"term_id": 123,
"reference_number": ""
}
'import requests
url = "https://api.dualentry.com/public/v1/purchase-orders/{record_number}/"
payload = {
"date": "2023-12-25",
"company_id": 123,
"vendor_id": 123,
"exchange_rate": 123,
"memo": "<string>",
"items": [
{
"position": 123,
"item_id": 123,
"memo": "<string>",
"quantity": 123,
"rate": 123,
"classifications": [
{
"id": 123,
"name": "<string>",
"line_id": 123,
"line_name": "<string>",
"parent_classification_id": 123,
"parent_classification_line_id": 123
}
],
"tax": {
"code": "<string>",
"rate": 123,
"amount": 123,
"is_taxable": True,
"tax_exempt_amount": 123,
"vat_rate_id": 123,
"gst_tax_rate_id": 123
},
"id": 123
}
],
"supply_date": "2023-12-25",
"place_of_supply": "<string>",
"tax_registration_numbers": {
"company": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
],
"counterparty": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
]
},
"attachments": [],
"record_status": "posted",
"term_id": 123,
"reference_number": ""
}
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({
date: '2023-12-25',
company_id: 123,
vendor_id: 123,
exchange_rate: 123,
memo: '<string>',
items: [
{
position: 123,
item_id: 123,
memo: '<string>',
quantity: 123,
rate: 123,
classifications: [
{
id: 123,
name: '<string>',
line_id: 123,
line_name: '<string>',
parent_classification_id: 123,
parent_classification_line_id: 123
}
],
tax: {
code: '<string>',
rate: 123,
amount: 123,
is_taxable: true,
tax_exempt_amount: 123,
vat_rate_id: 123,
gst_tax_rate_id: 123
},
id: 123
}
],
supply_date: '2023-12-25',
place_of_supply: '<string>',
tax_registration_numbers: {
company: [{type: '<string>', number: '<string>', region: '<string>'}],
counterparty: [{type: '<string>', number: '<string>', region: '<string>'}]
},
attachments: [],
record_status: 'posted',
term_id: 123,
reference_number: ''
})
};
fetch('https://api.dualentry.com/public/v1/purchase-orders/{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/v1/purchase-orders/{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([
'date' => '2023-12-25',
'company_id' => 123,
'vendor_id' => 123,
'exchange_rate' => 123,
'memo' => '<string>',
'items' => [
[
'position' => 123,
'item_id' => 123,
'memo' => '<string>',
'quantity' => 123,
'rate' => 123,
'classifications' => [
[
'id' => 123,
'name' => '<string>',
'line_id' => 123,
'line_name' => '<string>',
'parent_classification_id' => 123,
'parent_classification_line_id' => 123
]
],
'tax' => [
'code' => '<string>',
'rate' => 123,
'amount' => 123,
'is_taxable' => true,
'tax_exempt_amount' => 123,
'vat_rate_id' => 123,
'gst_tax_rate_id' => 123
],
'id' => 123
]
],
'supply_date' => '2023-12-25',
'place_of_supply' => '<string>',
'tax_registration_numbers' => [
'company' => [
[
'type' => '<string>',
'number' => '<string>',
'region' => '<string>'
]
],
'counterparty' => [
[
'type' => '<string>',
'number' => '<string>',
'region' => '<string>'
]
]
],
'attachments' => [
],
'record_status' => 'posted',
'term_id' => 123,
'reference_number' => ''
]),
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/v1/purchase-orders/{record_number}/"
payload := strings.NewReader("{\n \"date\": \"2023-12-25\",\n \"company_id\": 123,\n \"vendor_id\": 123,\n \"exchange_rate\": 123,\n \"memo\": \"<string>\",\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"memo\": \"<string>\",\n \"quantity\": 123,\n \"rate\": 123,\n \"classifications\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"line_id\": 123,\n \"line_name\": \"<string>\",\n \"parent_classification_id\": 123,\n \"parent_classification_line_id\": 123\n }\n ],\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123\n },\n \"id\": 123\n }\n ],\n \"supply_date\": \"2023-12-25\",\n \"place_of_supply\": \"<string>\",\n \"tax_registration_numbers\": {\n \"company\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ],\n \"counterparty\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ]\n },\n \"attachments\": [],\n \"record_status\": \"posted\",\n \"term_id\": 123,\n \"reference_number\": \"\"\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/v1/purchase-orders/{record_number}/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"date\": \"2023-12-25\",\n \"company_id\": 123,\n \"vendor_id\": 123,\n \"exchange_rate\": 123,\n \"memo\": \"<string>\",\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"memo\": \"<string>\",\n \"quantity\": 123,\n \"rate\": 123,\n \"classifications\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"line_id\": 123,\n \"line_name\": \"<string>\",\n \"parent_classification_id\": 123,\n \"parent_classification_line_id\": 123\n }\n ],\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123\n },\n \"id\": 123\n }\n ],\n \"supply_date\": \"2023-12-25\",\n \"place_of_supply\": \"<string>\",\n \"tax_registration_numbers\": {\n \"company\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ],\n \"counterparty\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ]\n },\n \"attachments\": [],\n \"record_status\": \"posted\",\n \"term_id\": 123,\n \"reference_number\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v1/purchase-orders/{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 \"date\": \"2023-12-25\",\n \"company_id\": 123,\n \"vendor_id\": 123,\n \"exchange_rate\": 123,\n \"memo\": \"<string>\",\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"memo\": \"<string>\",\n \"quantity\": 123,\n \"rate\": 123,\n \"classifications\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"line_id\": 123,\n \"line_name\": \"<string>\",\n \"parent_classification_id\": 123,\n \"parent_classification_line_id\": 123\n }\n ],\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123\n },\n \"id\": 123\n }\n ],\n \"supply_date\": \"2023-12-25\",\n \"place_of_supply\": \"<string>\",\n \"tax_registration_numbers\": {\n \"company\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ],\n \"counterparty\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ]\n },\n \"attachments\": [],\n \"record_status\": \"posted\",\n \"term_id\": 123,\n \"reference_number\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"term_id": 123,
"term_name": "<string>",
"internal_id": 123,
"number": 123,
"date": "2023-12-25",
"company_id": 123,
"company_name": "<string>",
"company_currency": "<string>",
"vendor_id": 123,
"vendor_name": "<string>",
"exchange_rate": "<string>",
"billed_total": "<string>",
"due_total": "<string>",
"amount": "<string>",
"memo": "<string>",
"items": [
{
"classifications": [
{
"id": 123,
"name": "<string>",
"line_id": 123,
"line_name": "<string>",
"parent_classification_id": 123,
"parent_classification_line_id": 123
}
],
"id": 123,
"item_id": 123,
"position": 123,
"memo": "<string>",
"quantity": "<string>",
"rate": "<string>",
"quantity_billed": "<string>",
"quantity_due": "<string>",
"net_amount": "<string>",
"tax_amount": "<string>",
"gross_amount": "<string>",
"amount": "<string>",
"item_type": "<string>",
"hsn_sac_code": "<string>",
"tax": {
"code": "<string>",
"rate": "<string>",
"amount": "<string>",
"is_taxable": true,
"tax_exempt_amount": "<string>",
"vat_rate_id": 123,
"gst_tax_rate_id": 123,
"tax_components": [
{
"rate": "<string>",
"amount": "<string>",
"position": 123,
"region": "<string>"
}
],
"amount_with_tax": "<string>",
"rate_name": "<string>",
"rate_type": "<string>",
"tax_treatment": "<string>"
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"attachments": [],
"created_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"updated_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"approval_status": "<string>",
"next_approvers": [
{
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"full_name": "<string>",
"avatar_url": "<string>"
}
],
"rejected_by": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"full_name": "<string>",
"rejection_reason": "<string>"
},
"reference_number": ""
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}Authorizations
Path Parameters
The number attribute of the record.
Body
application/json
Available options:
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XAG, XAU, XCD, XDR, XOF, XPD, XPF, XPT, YER, ZAR, ZMW, ZWL Show child attributes
Show child attributes
Maximum string length:
2Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
draft, posted, archived Response
OK
Name of the company
Available options:
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XAG, XAU, XCD, XDR, XOF, XPD, XPF, XPT, YER, ZAR, ZMW, ZWL Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,16}0*$Total quantity of items that were already billed
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$Total quantity of items yet to be billed
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$Total amount of ordered items
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$Show child attributes
Show child attributes
Available options:
draft, posted, archived Available options:
billed, unbilled, partially_billed Date and time the record was created
Date and time the record was last updated
Show child attributes
Show child attributes
Schema for audit actor information.
Show child attributes
Show child attributes
Schema for audit actor information.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Schema for rejector information including rejection reason.
Show child attributes
Show child attributes
Last modified on July 13, 2026
Was this page helpful?
⌘I
Update PurchaseOrder record
curl --request PUT \
--url https://api.dualentry.com/public/v1/purchase-orders/{record_number}/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"date": "2023-12-25",
"company_id": 123,
"vendor_id": 123,
"exchange_rate": 123,
"memo": "<string>",
"items": [
{
"position": 123,
"item_id": 123,
"memo": "<string>",
"quantity": 123,
"rate": 123,
"classifications": [
{
"id": 123,
"name": "<string>",
"line_id": 123,
"line_name": "<string>",
"parent_classification_id": 123,
"parent_classification_line_id": 123
}
],
"tax": {
"code": "<string>",
"rate": 123,
"amount": 123,
"is_taxable": true,
"tax_exempt_amount": 123,
"vat_rate_id": 123,
"gst_tax_rate_id": 123
},
"id": 123
}
],
"supply_date": "2023-12-25",
"place_of_supply": "<string>",
"tax_registration_numbers": {
"company": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
],
"counterparty": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
]
},
"attachments": [],
"record_status": "posted",
"term_id": 123,
"reference_number": ""
}
'import requests
url = "https://api.dualentry.com/public/v1/purchase-orders/{record_number}/"
payload = {
"date": "2023-12-25",
"company_id": 123,
"vendor_id": 123,
"exchange_rate": 123,
"memo": "<string>",
"items": [
{
"position": 123,
"item_id": 123,
"memo": "<string>",
"quantity": 123,
"rate": 123,
"classifications": [
{
"id": 123,
"name": "<string>",
"line_id": 123,
"line_name": "<string>",
"parent_classification_id": 123,
"parent_classification_line_id": 123
}
],
"tax": {
"code": "<string>",
"rate": 123,
"amount": 123,
"is_taxable": True,
"tax_exempt_amount": 123,
"vat_rate_id": 123,
"gst_tax_rate_id": 123
},
"id": 123
}
],
"supply_date": "2023-12-25",
"place_of_supply": "<string>",
"tax_registration_numbers": {
"company": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
],
"counterparty": [
{
"type": "<string>",
"number": "<string>",
"region": "<string>"
}
]
},
"attachments": [],
"record_status": "posted",
"term_id": 123,
"reference_number": ""
}
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({
date: '2023-12-25',
company_id: 123,
vendor_id: 123,
exchange_rate: 123,
memo: '<string>',
items: [
{
position: 123,
item_id: 123,
memo: '<string>',
quantity: 123,
rate: 123,
classifications: [
{
id: 123,
name: '<string>',
line_id: 123,
line_name: '<string>',
parent_classification_id: 123,
parent_classification_line_id: 123
}
],
tax: {
code: '<string>',
rate: 123,
amount: 123,
is_taxable: true,
tax_exempt_amount: 123,
vat_rate_id: 123,
gst_tax_rate_id: 123
},
id: 123
}
],
supply_date: '2023-12-25',
place_of_supply: '<string>',
tax_registration_numbers: {
company: [{type: '<string>', number: '<string>', region: '<string>'}],
counterparty: [{type: '<string>', number: '<string>', region: '<string>'}]
},
attachments: [],
record_status: 'posted',
term_id: 123,
reference_number: ''
})
};
fetch('https://api.dualentry.com/public/v1/purchase-orders/{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/v1/purchase-orders/{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([
'date' => '2023-12-25',
'company_id' => 123,
'vendor_id' => 123,
'exchange_rate' => 123,
'memo' => '<string>',
'items' => [
[
'position' => 123,
'item_id' => 123,
'memo' => '<string>',
'quantity' => 123,
'rate' => 123,
'classifications' => [
[
'id' => 123,
'name' => '<string>',
'line_id' => 123,
'line_name' => '<string>',
'parent_classification_id' => 123,
'parent_classification_line_id' => 123
]
],
'tax' => [
'code' => '<string>',
'rate' => 123,
'amount' => 123,
'is_taxable' => true,
'tax_exempt_amount' => 123,
'vat_rate_id' => 123,
'gst_tax_rate_id' => 123
],
'id' => 123
]
],
'supply_date' => '2023-12-25',
'place_of_supply' => '<string>',
'tax_registration_numbers' => [
'company' => [
[
'type' => '<string>',
'number' => '<string>',
'region' => '<string>'
]
],
'counterparty' => [
[
'type' => '<string>',
'number' => '<string>',
'region' => '<string>'
]
]
],
'attachments' => [
],
'record_status' => 'posted',
'term_id' => 123,
'reference_number' => ''
]),
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/v1/purchase-orders/{record_number}/"
payload := strings.NewReader("{\n \"date\": \"2023-12-25\",\n \"company_id\": 123,\n \"vendor_id\": 123,\n \"exchange_rate\": 123,\n \"memo\": \"<string>\",\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"memo\": \"<string>\",\n \"quantity\": 123,\n \"rate\": 123,\n \"classifications\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"line_id\": 123,\n \"line_name\": \"<string>\",\n \"parent_classification_id\": 123,\n \"parent_classification_line_id\": 123\n }\n ],\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123\n },\n \"id\": 123\n }\n ],\n \"supply_date\": \"2023-12-25\",\n \"place_of_supply\": \"<string>\",\n \"tax_registration_numbers\": {\n \"company\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ],\n \"counterparty\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ]\n },\n \"attachments\": [],\n \"record_status\": \"posted\",\n \"term_id\": 123,\n \"reference_number\": \"\"\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/v1/purchase-orders/{record_number}/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"date\": \"2023-12-25\",\n \"company_id\": 123,\n \"vendor_id\": 123,\n \"exchange_rate\": 123,\n \"memo\": \"<string>\",\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"memo\": \"<string>\",\n \"quantity\": 123,\n \"rate\": 123,\n \"classifications\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"line_id\": 123,\n \"line_name\": \"<string>\",\n \"parent_classification_id\": 123,\n \"parent_classification_line_id\": 123\n }\n ],\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123\n },\n \"id\": 123\n }\n ],\n \"supply_date\": \"2023-12-25\",\n \"place_of_supply\": \"<string>\",\n \"tax_registration_numbers\": {\n \"company\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ],\n \"counterparty\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ]\n },\n \"attachments\": [],\n \"record_status\": \"posted\",\n \"term_id\": 123,\n \"reference_number\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v1/purchase-orders/{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 \"date\": \"2023-12-25\",\n \"company_id\": 123,\n \"vendor_id\": 123,\n \"exchange_rate\": 123,\n \"memo\": \"<string>\",\n \"items\": [\n {\n \"position\": 123,\n \"item_id\": 123,\n \"memo\": \"<string>\",\n \"quantity\": 123,\n \"rate\": 123,\n \"classifications\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"line_id\": 123,\n \"line_name\": \"<string>\",\n \"parent_classification_id\": 123,\n \"parent_classification_line_id\": 123\n }\n ],\n \"tax\": {\n \"code\": \"<string>\",\n \"rate\": 123,\n \"amount\": 123,\n \"is_taxable\": true,\n \"tax_exempt_amount\": 123,\n \"vat_rate_id\": 123,\n \"gst_tax_rate_id\": 123\n },\n \"id\": 123\n }\n ],\n \"supply_date\": \"2023-12-25\",\n \"place_of_supply\": \"<string>\",\n \"tax_registration_numbers\": {\n \"company\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ],\n \"counterparty\": [\n {\n \"type\": \"<string>\",\n \"number\": \"<string>\",\n \"region\": \"<string>\"\n }\n ]\n },\n \"attachments\": [],\n \"record_status\": \"posted\",\n \"term_id\": 123,\n \"reference_number\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"term_id": 123,
"term_name": "<string>",
"internal_id": 123,
"number": 123,
"date": "2023-12-25",
"company_id": 123,
"company_name": "<string>",
"company_currency": "<string>",
"vendor_id": 123,
"vendor_name": "<string>",
"exchange_rate": "<string>",
"billed_total": "<string>",
"due_total": "<string>",
"amount": "<string>",
"memo": "<string>",
"items": [
{
"classifications": [
{
"id": 123,
"name": "<string>",
"line_id": 123,
"line_name": "<string>",
"parent_classification_id": 123,
"parent_classification_line_id": 123
}
],
"id": 123,
"item_id": 123,
"position": 123,
"memo": "<string>",
"quantity": "<string>",
"rate": "<string>",
"quantity_billed": "<string>",
"quantity_due": "<string>",
"net_amount": "<string>",
"tax_amount": "<string>",
"gross_amount": "<string>",
"amount": "<string>",
"item_type": "<string>",
"hsn_sac_code": "<string>",
"tax": {
"code": "<string>",
"rate": "<string>",
"amount": "<string>",
"is_taxable": true,
"tax_exempt_amount": "<string>",
"vat_rate_id": 123,
"gst_tax_rate_id": 123,
"tax_components": [
{
"rate": "<string>",
"amount": "<string>",
"position": 123,
"region": "<string>"
}
],
"amount_with_tax": "<string>",
"rate_name": "<string>",
"rate_type": "<string>",
"tax_treatment": "<string>"
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"attachments": [],
"created_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"updated_by": {
"actor_type": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"approval_status": "<string>",
"next_approvers": [
{
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"full_name": "<string>",
"avatar_url": "<string>"
}
],
"rejected_by": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"full_name": "<string>",
"rejection_reason": "<string>"
},
"reference_number": ""
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}{
"errors": {},
"success": false
}