Create credit note line
Creates a new line item on a credit note in draft status.
curl --request POST \
--url https://api.light.inc/v1/credit-notes/{creditNoteId}/lines \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
],
"netTransactionAmount": {
"amount": 123
},
"grossTransactionAmount": {
"amount": 123
},
"taxTransactionAmount": {
"amount": 123
},
"description": "<string>",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accrualTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accrualStartDate": "2023-12-25",
"accrualEndDate": "2023-12-25"
}
'import requests
url = "https://api.light.inc/v1/credit-notes/{creditNoteId}/lines"
payload = {
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
],
"netTransactionAmount": { "amount": 123 },
"grossTransactionAmount": { "amount": 123 },
"taxTransactionAmount": { "amount": 123 },
"description": "<string>",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accrualTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accrualStartDate": "2023-12-25",
"accrualEndDate": "2023-12-25"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify({
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
],
netTransactionAmount: {amount: 123},
grossTransactionAmount: {amount: 123},
taxTransactionAmount: {amount: 123},
description: '<string>',
ledgerTaxId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ledgerAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
accrualTemplateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
accrualStartDate: '2023-12-25',
accrualEndDate: '2023-12-25'
})
};
fetch('https://api.light.inc/v1/credit-notes/{creditNoteId}/lines', 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/credit-notes/{creditNoteId}/lines",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
],
'netTransactionAmount' => [
'amount' => 123
],
'grossTransactionAmount' => [
'amount' => 123
],
'taxTransactionAmount' => [
'amount' => 123
],
'description' => '<string>',
'ledgerTaxId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ledgerAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'accrualTemplateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'accrualStartDate' => '2023-12-25',
'accrualEndDate' => '2023-12-25'
]),
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/credit-notes/{creditNoteId}/lines"
payload := strings.NewReader("{\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 \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxTransactionAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualStartDate\": \"2023-12-25\",\n \"accrualEndDate\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.light.inc/v1/credit-notes/{creditNoteId}/lines")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\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 \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxTransactionAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualStartDate\": \"2023-12-25\",\n \"accrualEndDate\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/credit-notes/{creditNoteId}/lines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\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 \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxTransactionAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualStartDate\": \"2023-12-25\",\n \"accrualEndDate\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"creditNoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"grossTransactionAmount": {
"amount": 123
},
"netTransactionAmount": {
"amount": 123
},
"description": "<string>",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxTransactionAmount": {
"amount": 123
},
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"accrualTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accrualStartDate": "2023-12-25",
"accrualEndDate": "2023-12-25",
"accrualDefaultDuration": 123
}Authorizations
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
Path Parameters
Body
List of custom properties for this line
List of custom properties to set on the vendor. Replaces the existing set.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Line description
ID of the tax code
ID of the ledger account
ID of the accrual template
Start date for accrual
End date for accrual
Response
default response
Unique identifier for the object
ID of the company
ID of the credit note this line belongs to
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Description of the credit note line item
ID of the tax code
Show child attributes
Show child attributes
ID of the ledger account
ID of the cost center
Timestamp when the credit note line item was created
Timestamp when the credit note line item was last updated
ID of the accrual template
Start date for accrual
End date for accrual
Default duration for accrual in months
curl --request POST \
--url https://api.light.inc/v1/credit-notes/{creditNoteId}/lines \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
],
"netTransactionAmount": {
"amount": 123
},
"grossTransactionAmount": {
"amount": 123
},
"taxTransactionAmount": {
"amount": 123
},
"description": "<string>",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accrualTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accrualStartDate": "2023-12-25",
"accrualEndDate": "2023-12-25"
}
'import requests
url = "https://api.light.inc/v1/credit-notes/{creditNoteId}/lines"
payload = {
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
],
"netTransactionAmount": { "amount": 123 },
"grossTransactionAmount": { "amount": 123 },
"taxTransactionAmount": { "amount": 123 },
"description": "<string>",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accrualTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accrualStartDate": "2023-12-25",
"accrualEndDate": "2023-12-25"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify({
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
],
netTransactionAmount: {amount: 123},
grossTransactionAmount: {amount: 123},
taxTransactionAmount: {amount: 123},
description: '<string>',
ledgerTaxId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ledgerAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
accrualTemplateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
accrualStartDate: '2023-12-25',
accrualEndDate: '2023-12-25'
})
};
fetch('https://api.light.inc/v1/credit-notes/{creditNoteId}/lines', 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/credit-notes/{creditNoteId}/lines",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
],
'netTransactionAmount' => [
'amount' => 123
],
'grossTransactionAmount' => [
'amount' => 123
],
'taxTransactionAmount' => [
'amount' => 123
],
'description' => '<string>',
'ledgerTaxId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ledgerAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'accrualTemplateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'accrualStartDate' => '2023-12-25',
'accrualEndDate' => '2023-12-25'
]),
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/credit-notes/{creditNoteId}/lines"
payload := strings.NewReader("{\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 \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxTransactionAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualStartDate\": \"2023-12-25\",\n \"accrualEndDate\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.light.inc/v1/credit-notes/{creditNoteId}/lines")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\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 \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxTransactionAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualStartDate\": \"2023-12-25\",\n \"accrualEndDate\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/credit-notes/{creditNoteId}/lines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\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 \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxTransactionAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"accrualStartDate\": \"2023-12-25\",\n \"accrualEndDate\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"creditNoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"grossTransactionAmount": {
"amount": 123
},
"netTransactionAmount": {
"amount": 123
},
"description": "<string>",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxTransactionAmount": {
"amount": 123
},
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"accrualTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accrualStartDate": "2023-12-25",
"accrualEndDate": "2023-12-25",
"accrualDefaultDuration": 123
}