Purchase Orders
Batch update purchase order lines
Updates multiple purchase order line items
PUT
/
v1
/
purchase-orders
/
{purchaseOrderId}
/
lines
/
bulk
Batch update purchase order lines
curl --request PUT \
--url https://api.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
[
{
"lineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"unitPrice": 123,
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
]
}
]
'import requests
url = "https://api.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk"
payload = [
{
"lineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"unitPrice": 123,
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
]
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify([
{
lineId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
costCenterId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
taxCodeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 123,
unitPrice: 123,
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
]
}
])
};
fetch('https://api.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk', 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.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk",
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([
[
'lineId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'costCenterId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'accountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'taxCodeId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123,
'unitPrice' => 123,
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk"
payload := strings.NewReader("[\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"unitPrice\": 123,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
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.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("[\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"unitPrice\": 123,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "[\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"unitPrice\": 123,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n]"
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchaseOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"unitPrice": 123,
"amount": 123,
"netAmount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"internalName": "<string>",
"label": "<string>",
"context": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
]
}
]Authorizations
apiKeyAuthbearerAuth
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
Path Parameters
Body
application/json;charset=UTF-8
List of custom properties to set on the vendor. Replaces the existing set.
Show child attributes
Show child attributes
Response
default - application/json;charset=UTF-8
default response
Custom properties set on the vendor.
Show child attributes
Show child attributes
⌘I
Batch update purchase order lines
curl --request PUT \
--url https://api.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
[
{
"lineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"unitPrice": 123,
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
]
}
]
'import requests
url = "https://api.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk"
payload = [
{
"lineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"unitPrice": 123,
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
]
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify([
{
lineId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
costCenterId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
taxCodeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 123,
unitPrice: 123,
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
]
}
])
};
fetch('https://api.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk', 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.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk",
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([
[
'lineId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'costCenterId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'accountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'taxCodeId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123,
'unitPrice' => 123,
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk"
payload := strings.NewReader("[\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"unitPrice\": 123,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
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.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("[\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"unitPrice\": 123,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/purchase-orders/{purchaseOrderId}/lines/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "[\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"unitPrice\": 123,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n]"
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchaseOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"unitPrice": 123,
"amount": 123,
"netAmount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"internalName": "<string>",
"label": "<string>",
"context": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
]
}
]