Credit Notes
Update clearing amount
Updates the clearing amount of a linked invoice payable
PATCH
/
v1
/
credit-notes
/
{creditNoteId}
/
invoice-payables
/
{invoicePayableId}
Update clearing amount
curl --request PATCH \
--url https://api.light.inc/v1/credit-notes/{creditNoteId}/invoice-payables/{invoicePayableId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '{
"amount": 123
}'import requests
url = "https://api.light.inc/v1/credit-notes/{creditNoteId}/invoice-payables/{invoicePayableId}"
payload = { "amount": 123 }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify({amount: 123})
};
fetch('https://api.light.inc/v1/credit-notes/{creditNoteId}/invoice-payables/{invoicePayableId}', 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}/invoice-payables/{invoicePayableId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123
]),
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}/invoice-payables/{invoicePayableId}"
payload := strings.NewReader("{\n \"amount\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.light.inc/v1/credit-notes/{creditNoteId}/invoice-payables/{invoicePayableId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/credit-notes/{creditNoteId}/invoice-payables/{invoicePayableId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"creditNote": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentNumber": "<string>",
"documentDate": "2023-12-25",
"status": "DRAFT",
"amount": 123,
"currency": "USD"
},
"invoicePayable": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentNumber": "<string>",
"documentDate": "2023-12-25",
"status": "DRAFT",
"amount": 123,
"currency": "USD"
},
"amount": 123,
"currency": "USD",
"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.
Body
application/json;charset=UTF-8
Updated amount to clear in cents
Response
default - application/json;charset=UTF-8
default response
ID of the company
Invoice payable details
Show child attributes
Show child attributes
Invoice payable details
Show child attributes
Show child attributes
Clearing amount in cents
Example:
"USD"
Timestamp when the link was created
Timestamp when the link was last updated
⌘I
Update clearing amount
curl --request PATCH \
--url https://api.light.inc/v1/credit-notes/{creditNoteId}/invoice-payables/{invoicePayableId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '{
"amount": 123
}'import requests
url = "https://api.light.inc/v1/credit-notes/{creditNoteId}/invoice-payables/{invoicePayableId}"
payload = { "amount": 123 }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify({amount: 123})
};
fetch('https://api.light.inc/v1/credit-notes/{creditNoteId}/invoice-payables/{invoicePayableId}', 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}/invoice-payables/{invoicePayableId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123
]),
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}/invoice-payables/{invoicePayableId}"
payload := strings.NewReader("{\n \"amount\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.light.inc/v1/credit-notes/{creditNoteId}/invoice-payables/{invoicePayableId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/credit-notes/{creditNoteId}/invoice-payables/{invoicePayableId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"creditNote": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentNumber": "<string>",
"documentDate": "2023-12-25",
"status": "DRAFT",
"amount": 123,
"currency": "USD"
},
"invoicePayable": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentNumber": "<string>",
"documentDate": "2023-12-25",
"status": "DRAFT",
"amount": 123,
"currency": "USD"
},
"amount": 123,
"currency": "USD",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}