curl --request PUT \
--url https://api.example.com/api/bills/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"billDate": "2024-03-15",
"vendorId": 1001,
"entries": [
{
"index": 1,
"itemId": 1,
"rate": 1,
"quantity": 1,
"discount": 1,
"discountType": "percentage",
"description": "This is a description",
"taxCode": "123456",
"taxRateId": 1,
"warehouseId": 1,
"projectId": 1,
"projectRefId": 1,
"projectRefType": "TASK",
"projectRefInvoicedAmount": 100,
"sellAccountId": 1020,
"costAccountId": 1021,
"landedCost": true
}
],
"billNumber": "BILL-2024-001",
"referenceNo": "PO-2024-001",
"dueDate": "2024-04-15",
"exchangeRate": 1.25,
"warehouseId": 101,
"branchId": 201,
"projectId": 301,
"note": "Office supplies and equipment for Q2 2024",
"open": true,
"isInclusiveTax": false,
"attachments": [
{
"key": "attachments/bills/receipt.pdf"
}
],
"discountType": "amount",
"discount": 100,
"adjustment": 50
}
'import requests
url = "https://api.example.com/api/bills/{id}"
payload = {
"billDate": "2024-03-15",
"vendorId": 1001,
"entries": [
{
"index": 1,
"itemId": 1,
"rate": 1,
"quantity": 1,
"discount": 1,
"discountType": "percentage",
"description": "This is a description",
"taxCode": "123456",
"taxRateId": 1,
"warehouseId": 1,
"projectId": 1,
"projectRefId": 1,
"projectRefType": "TASK",
"projectRefInvoicedAmount": 100,
"sellAccountId": 1020,
"costAccountId": 1021,
"landedCost": True
}
],
"billNumber": "BILL-2024-001",
"referenceNo": "PO-2024-001",
"dueDate": "2024-04-15",
"exchangeRate": 1.25,
"warehouseId": 101,
"branchId": 201,
"projectId": 301,
"note": "Office supplies and equipment for Q2 2024",
"open": True,
"isInclusiveTax": False,
"attachments": [{ "key": "attachments/bills/receipt.pdf" }],
"discountType": "amount",
"discount": 100,
"adjustment": 50
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
billDate: '2024-03-15',
vendorId: 1001,
entries: [
{
index: 1,
itemId: 1,
rate: 1,
quantity: 1,
discount: 1,
discountType: 'percentage',
description: 'This is a description',
taxCode: '123456',
taxRateId: 1,
warehouseId: 1,
projectId: 1,
projectRefId: 1,
projectRefType: 'TASK',
projectRefInvoicedAmount: 100,
sellAccountId: 1020,
costAccountId: 1021,
landedCost: true
}
],
billNumber: 'BILL-2024-001',
referenceNo: 'PO-2024-001',
dueDate: '2024-04-15',
exchangeRate: 1.25,
warehouseId: 101,
branchId: 201,
projectId: 301,
note: 'Office supplies and equipment for Q2 2024',
open: true,
isInclusiveTax: false,
attachments: [{key: 'attachments/bills/receipt.pdf'}],
discountType: 'amount',
discount: 100,
adjustment: 50
})
};
fetch('https://api.example.com/api/bills/{id}', 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.example.com/api/bills/{id}",
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([
'billDate' => '2024-03-15',
'vendorId' => 1001,
'entries' => [
[
'index' => 1,
'itemId' => 1,
'rate' => 1,
'quantity' => 1,
'discount' => 1,
'discountType' => 'percentage',
'description' => 'This is a description',
'taxCode' => '123456',
'taxRateId' => 1,
'warehouseId' => 1,
'projectId' => 1,
'projectRefId' => 1,
'projectRefType' => 'TASK',
'projectRefInvoicedAmount' => 100,
'sellAccountId' => 1020,
'costAccountId' => 1021,
'landedCost' => true
]
],
'billNumber' => 'BILL-2024-001',
'referenceNo' => 'PO-2024-001',
'dueDate' => '2024-04-15',
'exchangeRate' => 1.25,
'warehouseId' => 101,
'branchId' => 201,
'projectId' => 301,
'note' => 'Office supplies and equipment for Q2 2024',
'open' => true,
'isInclusiveTax' => false,
'attachments' => [
[
'key' => 'attachments/bills/receipt.pdf'
]
],
'discountType' => 'amount',
'discount' => 100,
'adjustment' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"organization-id: <organization-id>"
],
]);
$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.example.com/api/bills/{id}"
payload := strings.NewReader("{\n \"billDate\": \"2024-03-15\",\n \"vendorId\": 1001,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"rate\": 1,\n \"quantity\": 1,\n \"discount\": 1,\n \"discountType\": \"percentage\",\n \"description\": \"This is a description\",\n \"taxCode\": \"123456\",\n \"taxRateId\": 1,\n \"warehouseId\": 1,\n \"projectId\": 1,\n \"projectRefId\": 1,\n \"projectRefType\": \"TASK\",\n \"projectRefInvoicedAmount\": 100,\n \"sellAccountId\": 1020,\n \"costAccountId\": 1021,\n \"landedCost\": true\n }\n ],\n \"billNumber\": \"BILL-2024-001\",\n \"referenceNo\": \"PO-2024-001\",\n \"dueDate\": \"2024-04-15\",\n \"exchangeRate\": 1.25,\n \"warehouseId\": 101,\n \"branchId\": 201,\n \"projectId\": 301,\n \"note\": \"Office supplies and equipment for Q2 2024\",\n \"open\": true,\n \"isInclusiveTax\": false,\n \"attachments\": [\n {\n \"key\": \"attachments/bills/receipt.pdf\"\n }\n ],\n \"discountType\": \"amount\",\n \"discount\": 100,\n \"adjustment\": 50\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
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.example.com/api/bills/{id}")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"billDate\": \"2024-03-15\",\n \"vendorId\": 1001,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"rate\": 1,\n \"quantity\": 1,\n \"discount\": 1,\n \"discountType\": \"percentage\",\n \"description\": \"This is a description\",\n \"taxCode\": \"123456\",\n \"taxRateId\": 1,\n \"warehouseId\": 1,\n \"projectId\": 1,\n \"projectRefId\": 1,\n \"projectRefType\": \"TASK\",\n \"projectRefInvoicedAmount\": 100,\n \"sellAccountId\": 1020,\n \"costAccountId\": 1021,\n \"landedCost\": true\n }\n ],\n \"billNumber\": \"BILL-2024-001\",\n \"referenceNo\": \"PO-2024-001\",\n \"dueDate\": \"2024-04-15\",\n \"exchangeRate\": 1.25,\n \"warehouseId\": 101,\n \"branchId\": 201,\n \"projectId\": 301,\n \"note\": \"Office supplies and equipment for Q2 2024\",\n \"open\": true,\n \"isInclusiveTax\": false,\n \"attachments\": [\n {\n \"key\": \"attachments/bills/receipt.pdf\"\n }\n ],\n \"discountType\": \"amount\",\n \"discount\": 100,\n \"adjustment\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/bills/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"billDate\": \"2024-03-15\",\n \"vendorId\": 1001,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"rate\": 1,\n \"quantity\": 1,\n \"discount\": 1,\n \"discountType\": \"percentage\",\n \"description\": \"This is a description\",\n \"taxCode\": \"123456\",\n \"taxRateId\": 1,\n \"warehouseId\": 1,\n \"projectId\": 1,\n \"projectRefId\": 1,\n \"projectRefType\": \"TASK\",\n \"projectRefInvoicedAmount\": 100,\n \"sellAccountId\": 1020,\n \"costAccountId\": 1021,\n \"landedCost\": true\n }\n ],\n \"billNumber\": \"BILL-2024-001\",\n \"referenceNo\": \"PO-2024-001\",\n \"dueDate\": \"2024-04-15\",\n \"exchangeRate\": 1.25,\n \"warehouseId\": 101,\n \"branchId\": 201,\n \"projectId\": 301,\n \"note\": \"Office supplies and equipment for Q2 2024\",\n \"open\": true,\n \"isInclusiveTax\": false,\n \"attachments\": [\n {\n \"key\": \"attachments/bills/receipt.pdf\"\n }\n ],\n \"discountType\": \"amount\",\n \"discount\": 100,\n \"adjustment\": 50\n}"
response = http.request(request)
puts response.read_bodyEdit the given bill.
curl --request PUT \
--url https://api.example.com/api/bills/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"billDate": "2024-03-15",
"vendorId": 1001,
"entries": [
{
"index": 1,
"itemId": 1,
"rate": 1,
"quantity": 1,
"discount": 1,
"discountType": "percentage",
"description": "This is a description",
"taxCode": "123456",
"taxRateId": 1,
"warehouseId": 1,
"projectId": 1,
"projectRefId": 1,
"projectRefType": "TASK",
"projectRefInvoicedAmount": 100,
"sellAccountId": 1020,
"costAccountId": 1021,
"landedCost": true
}
],
"billNumber": "BILL-2024-001",
"referenceNo": "PO-2024-001",
"dueDate": "2024-04-15",
"exchangeRate": 1.25,
"warehouseId": 101,
"branchId": 201,
"projectId": 301,
"note": "Office supplies and equipment for Q2 2024",
"open": true,
"isInclusiveTax": false,
"attachments": [
{
"key": "attachments/bills/receipt.pdf"
}
],
"discountType": "amount",
"discount": 100,
"adjustment": 50
}
'import requests
url = "https://api.example.com/api/bills/{id}"
payload = {
"billDate": "2024-03-15",
"vendorId": 1001,
"entries": [
{
"index": 1,
"itemId": 1,
"rate": 1,
"quantity": 1,
"discount": 1,
"discountType": "percentage",
"description": "This is a description",
"taxCode": "123456",
"taxRateId": 1,
"warehouseId": 1,
"projectId": 1,
"projectRefId": 1,
"projectRefType": "TASK",
"projectRefInvoicedAmount": 100,
"sellAccountId": 1020,
"costAccountId": 1021,
"landedCost": True
}
],
"billNumber": "BILL-2024-001",
"referenceNo": "PO-2024-001",
"dueDate": "2024-04-15",
"exchangeRate": 1.25,
"warehouseId": 101,
"branchId": 201,
"projectId": 301,
"note": "Office supplies and equipment for Q2 2024",
"open": True,
"isInclusiveTax": False,
"attachments": [{ "key": "attachments/bills/receipt.pdf" }],
"discountType": "amount",
"discount": 100,
"adjustment": 50
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
billDate: '2024-03-15',
vendorId: 1001,
entries: [
{
index: 1,
itemId: 1,
rate: 1,
quantity: 1,
discount: 1,
discountType: 'percentage',
description: 'This is a description',
taxCode: '123456',
taxRateId: 1,
warehouseId: 1,
projectId: 1,
projectRefId: 1,
projectRefType: 'TASK',
projectRefInvoicedAmount: 100,
sellAccountId: 1020,
costAccountId: 1021,
landedCost: true
}
],
billNumber: 'BILL-2024-001',
referenceNo: 'PO-2024-001',
dueDate: '2024-04-15',
exchangeRate: 1.25,
warehouseId: 101,
branchId: 201,
projectId: 301,
note: 'Office supplies and equipment for Q2 2024',
open: true,
isInclusiveTax: false,
attachments: [{key: 'attachments/bills/receipt.pdf'}],
discountType: 'amount',
discount: 100,
adjustment: 50
})
};
fetch('https://api.example.com/api/bills/{id}', 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.example.com/api/bills/{id}",
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([
'billDate' => '2024-03-15',
'vendorId' => 1001,
'entries' => [
[
'index' => 1,
'itemId' => 1,
'rate' => 1,
'quantity' => 1,
'discount' => 1,
'discountType' => 'percentage',
'description' => 'This is a description',
'taxCode' => '123456',
'taxRateId' => 1,
'warehouseId' => 1,
'projectId' => 1,
'projectRefId' => 1,
'projectRefType' => 'TASK',
'projectRefInvoicedAmount' => 100,
'sellAccountId' => 1020,
'costAccountId' => 1021,
'landedCost' => true
]
],
'billNumber' => 'BILL-2024-001',
'referenceNo' => 'PO-2024-001',
'dueDate' => '2024-04-15',
'exchangeRate' => 1.25,
'warehouseId' => 101,
'branchId' => 201,
'projectId' => 301,
'note' => 'Office supplies and equipment for Q2 2024',
'open' => true,
'isInclusiveTax' => false,
'attachments' => [
[
'key' => 'attachments/bills/receipt.pdf'
]
],
'discountType' => 'amount',
'discount' => 100,
'adjustment' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"organization-id: <organization-id>"
],
]);
$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.example.com/api/bills/{id}"
payload := strings.NewReader("{\n \"billDate\": \"2024-03-15\",\n \"vendorId\": 1001,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"rate\": 1,\n \"quantity\": 1,\n \"discount\": 1,\n \"discountType\": \"percentage\",\n \"description\": \"This is a description\",\n \"taxCode\": \"123456\",\n \"taxRateId\": 1,\n \"warehouseId\": 1,\n \"projectId\": 1,\n \"projectRefId\": 1,\n \"projectRefType\": \"TASK\",\n \"projectRefInvoicedAmount\": 100,\n \"sellAccountId\": 1020,\n \"costAccountId\": 1021,\n \"landedCost\": true\n }\n ],\n \"billNumber\": \"BILL-2024-001\",\n \"referenceNo\": \"PO-2024-001\",\n \"dueDate\": \"2024-04-15\",\n \"exchangeRate\": 1.25,\n \"warehouseId\": 101,\n \"branchId\": 201,\n \"projectId\": 301,\n \"note\": \"Office supplies and equipment for Q2 2024\",\n \"open\": true,\n \"isInclusiveTax\": false,\n \"attachments\": [\n {\n \"key\": \"attachments/bills/receipt.pdf\"\n }\n ],\n \"discountType\": \"amount\",\n \"discount\": 100,\n \"adjustment\": 50\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
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.example.com/api/bills/{id}")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"billDate\": \"2024-03-15\",\n \"vendorId\": 1001,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"rate\": 1,\n \"quantity\": 1,\n \"discount\": 1,\n \"discountType\": \"percentage\",\n \"description\": \"This is a description\",\n \"taxCode\": \"123456\",\n \"taxRateId\": 1,\n \"warehouseId\": 1,\n \"projectId\": 1,\n \"projectRefId\": 1,\n \"projectRefType\": \"TASK\",\n \"projectRefInvoicedAmount\": 100,\n \"sellAccountId\": 1020,\n \"costAccountId\": 1021,\n \"landedCost\": true\n }\n ],\n \"billNumber\": \"BILL-2024-001\",\n \"referenceNo\": \"PO-2024-001\",\n \"dueDate\": \"2024-04-15\",\n \"exchangeRate\": 1.25,\n \"warehouseId\": 101,\n \"branchId\": 201,\n \"projectId\": 301,\n \"note\": \"Office supplies and equipment for Q2 2024\",\n \"open\": true,\n \"isInclusiveTax\": false,\n \"attachments\": [\n {\n \"key\": \"attachments/bills/receipt.pdf\"\n }\n ],\n \"discountType\": \"amount\",\n \"discount\": 100,\n \"adjustment\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/bills/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"billDate\": \"2024-03-15\",\n \"vendorId\": 1001,\n \"entries\": [\n {\n \"index\": 1,\n \"itemId\": 1,\n \"rate\": 1,\n \"quantity\": 1,\n \"discount\": 1,\n \"discountType\": \"percentage\",\n \"description\": \"This is a description\",\n \"taxCode\": \"123456\",\n \"taxRateId\": 1,\n \"warehouseId\": 1,\n \"projectId\": 1,\n \"projectRefId\": 1,\n \"projectRefType\": \"TASK\",\n \"projectRefInvoicedAmount\": 100,\n \"sellAccountId\": 1020,\n \"costAccountId\": 1021,\n \"landedCost\": true\n }\n ],\n \"billNumber\": \"BILL-2024-001\",\n \"referenceNo\": \"PO-2024-001\",\n \"dueDate\": \"2024-04-15\",\n \"exchangeRate\": 1.25,\n \"warehouseId\": 101,\n \"branchId\": 201,\n \"projectId\": 301,\n \"note\": \"Office supplies and equipment for Q2 2024\",\n \"open\": true,\n \"isInclusiveTax\": false,\n \"attachments\": [\n {\n \"key\": \"attachments/bills/receipt.pdf\"\n }\n ],\n \"discountType\": \"amount\",\n \"discount\": 100,\n \"adjustment\": 50\n}"
response = http.request(request)
puts response.read_bodyHeaders
Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.
"Bearer bc_1234567890abcdef"
Required if Authorization is a JWT token. The organization ID to operate within.
Path Parameters
The bill id
Body
Date the bill was issued
"2024-03-15"
Vendor identifier
1001
Bill line items
Show child attributes
Show child attributes
Unique bill number
"BILL-2024-001"
Reference number
"PO-2024-001"
Date the bill is due
"2024-04-15"
Exchange rate applied to bill amounts
1.25
Warehouse identifier
101
Branch identifier
201
Project identifier
301
Additional notes about the bill
"Office supplies and equipment for Q2 2024"
Indicates if the bill is open
true
Indicates if tax is inclusive in prices
false
File attachments associated with the bill
Show child attributes
Show child attributes
Type of discount applied
percentage, amount "amount"
Discount value
100
Adjustment value
50