Invoice Approvals
Get invoice approvals
Returns approval records for specified invoice payables
GET
/
v1
/
invoice-approval
Get invoice approvals
curl --request GET \
--url https://api.light.inc/v1/invoice-approval \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"roles": [
"<string>"
],
"name": "<string>"
}
'import requests
url = "https://api.light.inc/v1/invoice-approval"
payload = {
"roles": ["<string>"],
"name": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify({roles: ['<string>'], name: '<string>'})
};
fetch('https://api.light.inc/v1/invoice-approval', 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/invoice-approval",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'roles' => [
'<string>'
],
'name' => '<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/invoice-approval"
payload := strings.NewReader("{\n \"roles\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("GET", 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.get("https://api.light.inc/v1/invoice-approval")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"roles\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/invoice-approval")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"roles\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoicePayableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoiceDocumentKey": "<string>",
"invoiceNumber": "<string>",
"invoiceAmount": 123,
"invoiceCurrency": "USD",
"invoiceIssuedAt": "2023-11-07T05:31:56Z",
"invoiceIssuedDate": "2023-12-25",
"invoiceDueAt": "2023-11-07T05:31:56Z",
"invoiceDueDate": "2023-12-25",
"userApprovals": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approvalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"priority": 123,
"status": "APPROVED",
"note": "<string>",
"completedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"notifiedAt": "2023-11-07T05:31:56Z"
}
],
"note": "<string>",
"status": "APPROVED",
"completedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]Authorizations
apiKeyAuthbearerAuth
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
Query Parameters
Response
default - application/json;charset=UTF-8
default response
Example:
"USD"
Show child attributes
Show child attributes
⚠️ This enum is not exhaustive; new values may be added in the future.
Available options:
APPROVED, DECLINED, CANCELLED, FAILED, IN_PROGRESS ⌘I
Get invoice approvals
curl --request GET \
--url https://api.light.inc/v1/invoice-approval \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"roles": [
"<string>"
],
"name": "<string>"
}
'import requests
url = "https://api.light.inc/v1/invoice-approval"
payload = {
"roles": ["<string>"],
"name": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify({roles: ['<string>'], name: '<string>'})
};
fetch('https://api.light.inc/v1/invoice-approval', 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/invoice-approval",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'roles' => [
'<string>'
],
'name' => '<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/invoice-approval"
payload := strings.NewReader("{\n \"roles\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("GET", 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.get("https://api.light.inc/v1/invoice-approval")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"roles\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/invoice-approval")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"roles\": [\n \"<string>\"\n ],\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoicePayableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoiceDocumentKey": "<string>",
"invoiceNumber": "<string>",
"invoiceAmount": 123,
"invoiceCurrency": "USD",
"invoiceIssuedAt": "2023-11-07T05:31:56Z",
"invoiceIssuedDate": "2023-12-25",
"invoiceDueAt": "2023-11-07T05:31:56Z",
"invoiceDueDate": "2023-12-25",
"userApprovals": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approvalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"priority": 123,
"status": "APPROVED",
"note": "<string>",
"completedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"notifiedAt": "2023-11-07T05:31:56Z"
}
],
"note": "<string>",
"status": "APPROVED",
"completedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]