Expenses
Create line item
Creates a new line item
POST
/
v1
/
expenses
/
{expenseId}
/
line-items
Create line item
curl --request POST \
--url https://api.light.inc/v1/expenses/{expenseId}/line-items \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"originalAmount": 123,
"billingAmount": 123,
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"reimbursementCategoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.light.inc/v1/expenses/{expenseId}/line-items"
payload = {
"originalAmount": 123,
"billingAmount": 123,
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"reimbursementCategoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
originalAmount: 123,
billingAmount: 123,
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
costCenterId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
reimbursementCategoryId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.light.inc/v1/expenses/{expenseId}/line-items', 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/expenses/{expenseId}/line-items",
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([
'originalAmount' => 123,
'billingAmount' => 123,
'accountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'costCenterId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'reimbursementCategoryId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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/expenses/{expenseId}/line-items"
payload := strings.NewReader("{\n \"originalAmount\": 123,\n \"billingAmount\": 123,\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"reimbursementCategoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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/expenses/{expenseId}/line-items")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"originalAmount\": 123,\n \"billingAmount\": 123,\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"reimbursementCategoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/expenses/{expenseId}/line-items")
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 \"originalAmount\": 123,\n \"billingAmount\": 123,\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"reimbursementCategoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expenseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"originalAmount": 123,
"billingAmount": 123,
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"reimbursementCategoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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
Response
default - application/json;charset=UTF-8
default response
⌘I
Create line item
curl --request POST \
--url https://api.light.inc/v1/expenses/{expenseId}/line-items \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"originalAmount": 123,
"billingAmount": 123,
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"reimbursementCategoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.light.inc/v1/expenses/{expenseId}/line-items"
payload = {
"originalAmount": 123,
"billingAmount": 123,
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"reimbursementCategoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
originalAmount: 123,
billingAmount: 123,
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
costCenterId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
reimbursementCategoryId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.light.inc/v1/expenses/{expenseId}/line-items', 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/expenses/{expenseId}/line-items",
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([
'originalAmount' => 123,
'billingAmount' => 123,
'accountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'costCenterId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'reimbursementCategoryId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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/expenses/{expenseId}/line-items"
payload := strings.NewReader("{\n \"originalAmount\": 123,\n \"billingAmount\": 123,\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"reimbursementCategoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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/expenses/{expenseId}/line-items")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"originalAmount\": 123,\n \"billingAmount\": 123,\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"reimbursementCategoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/expenses/{expenseId}/line-items")
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 \"originalAmount\": 123,\n \"billingAmount\": 123,\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"reimbursementCategoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expenseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"originalAmount": 123,
"billingAmount": 123,
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"reimbursementCategoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}