curl --request PUT \
--url https://api.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Product A",
"description": "Detailed description of the product or service",
"quantity": 2,
"unit_price": 100,
"flat_fee": 10,
"discount_amount": 5,
"discount_percent": 10,
"tax_rate": 10,
"tax_name": "Sales Tax",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"display_order": 2
}
'import requests
url = "https://api.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}"
payload = {
"name": "Product A",
"description": "Detailed description of the product or service",
"quantity": 2,
"unit_price": 100,
"flat_fee": 10,
"discount_amount": 5,
"discount_percent": 10,
"tax_rate": 10,
"tax_name": "Sales Tax",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"display_order": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Product A',
description: 'Detailed description of the product or service',
quantity: 2,
unit_price: 100,
flat_fee: 10,
discount_amount: 5,
discount_percent: 10,
tax_rate: 10,
tax_name: 'Sales Tax',
service_start_date: '2024-03-01',
service_end_date: '2024-03-31',
display_order: 2
})
};
fetch('https://api.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}', 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.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}",
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([
'name' => 'Product A',
'description' => 'Detailed description of the product or service',
'quantity' => 2,
'unit_price' => 100,
'flat_fee' => 10,
'discount_amount' => 5,
'discount_percent' => 10,
'tax_rate' => 10,
'tax_name' => 'Sales Tax',
'service_start_date' => '2024-03-01',
'service_end_date' => '2024-03-31',
'display_order' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}"
payload := strings.NewReader("{\n \"name\": \"Product A\",\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"unit_price\": 100,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Product A\",\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"unit_price\": 100,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Product A\",\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"unit_price\": 100,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n}"
response = http.request(request)
puts response.read_body{
"unit_price": 123,
"amount": 123,
"flat_fee": 123,
"tax_rate": 123,
"tax_amount": 123,
"discount_amount": 123,
"discount_percent": 123,
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"quantity": 1,
"currency": "USD",
"description": "<string>",
"tax_name": "<string>",
"service_start_date": "2023-12-25",
"service_end_date": "2023-12-25",
"display_order": 123
}{}{}Line Item Update Api
Updates a line item. Tax updates trigger amount recalculation and PDF regeneration.
curl --request PUT \
--url https://api.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Product A",
"description": "Detailed description of the product or service",
"quantity": 2,
"unit_price": 100,
"flat_fee": 10,
"discount_amount": 5,
"discount_percent": 10,
"tax_rate": 10,
"tax_name": "Sales Tax",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"display_order": 2
}
'import requests
url = "https://api.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}"
payload = {
"name": "Product A",
"description": "Detailed description of the product or service",
"quantity": 2,
"unit_price": 100,
"flat_fee": 10,
"discount_amount": 5,
"discount_percent": 10,
"tax_rate": 10,
"tax_name": "Sales Tax",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"display_order": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Product A',
description: 'Detailed description of the product or service',
quantity: 2,
unit_price: 100,
flat_fee: 10,
discount_amount: 5,
discount_percent: 10,
tax_rate: 10,
tax_name: 'Sales Tax',
service_start_date: '2024-03-01',
service_end_date: '2024-03-31',
display_order: 2
})
};
fetch('https://api.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}', 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.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}",
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([
'name' => 'Product A',
'description' => 'Detailed description of the product or service',
'quantity' => 2,
'unit_price' => 100,
'flat_fee' => 10,
'discount_amount' => 5,
'discount_percent' => 10,
'tax_rate' => 10,
'tax_name' => 'Sales Tax',
'service_start_date' => '2024-03-01',
'service_end_date' => '2024-03-31',
'display_order' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}"
payload := strings.NewReader("{\n \"name\": \"Product A\",\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"unit_price\": 100,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Product A\",\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"unit_price\": 100,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.justpaid.io/api/v1/invoice/{invoice_uuid}/line-items/{line_item_uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Product A\",\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"unit_price\": 100,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n}"
response = http.request(request)
puts response.read_body{
"unit_price": 123,
"amount": 123,
"flat_fee": 123,
"tax_rate": 123,
"tax_amount": 123,
"discount_amount": 123,
"discount_percent": 123,
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"quantity": 1,
"currency": "USD",
"description": "<string>",
"tax_name": "<string>",
"service_start_date": "2023-12-25",
"service_end_date": "2023-12-25",
"display_order": 123
}{}{}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Input schema for updating a line item (all fields optional).
Name of the line item
"Product A"
Additional details about the line item
"Detailed description of the product or service"
Quantity of units
x >= 12
Price per unit
100
Fixed flat fee amount
10
Discount amount in currency
5
Discount percentage (0-100)
0 <= x <= 10010
Tax rate percentage (0-100). Updating triggers amount recalculation.
0 <= x <= 10010
Name of the tax applied
"Sales Tax"
Service period start date
"2024-03-01"
Service period end date
"2024-03-31"
Display order for line item
x >= 1Response
Line item updated successfully
Output schema for invoice line items with UUID for external API.
255^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$3The description of the line item
255The date the service starts for the item
The date the service ends for the item
The order in which the line item will be displayed in the UI/pdf
Was this page helpful?
