Card Transactions
Batch update card transactions
Updates multiple card transactions in a single operation
PATCH
/
v1
/
card-transactions
/
batch-update
Batch update card transactions
curl --request PATCH \
--url https://api.light.inc/v1/card-transactions/batch-update \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
[
{
"cardTransactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
],
"lines": [
{
"lineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
],
"description": "<string>",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"postingDate": "2023-12-25",
"description": "<string>"
}
]
'import requests
url = "https://api.light.inc/v1/card-transactions/batch-update"
payload = [
{
"cardTransactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
],
"lines": [
{
"lineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
],
"description": "<string>",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"postingDate": "2023-12-25",
"description": "<string>"
}
]
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([
{
cardTransactionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
],
lines: [
{
lineId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
],
description: '<string>',
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
taxCodeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
postingDate: '2023-12-25',
description: '<string>'
}
])
};
fetch('https://api.light.inc/v1/card-transactions/batch-update', 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/card-transactions/batch-update",
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([
[
'cardTransactionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
],
'lines' => [
[
'lineId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
],
'description' => '<string>',
'accountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'taxCodeId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'postingDate' => '2023-12-25',
'description' => '<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/card-transactions/batch-update"
payload := strings.NewReader("[\n {\n \"cardTransactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"lines\": [\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"description\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"postingDate\": \"2023-12-25\",\n \"description\": \"<string>\"\n }\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/card-transactions/batch-update")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("[\n {\n \"cardTransactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"lines\": [\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"description\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"postingDate\": \"2023-12-25\",\n \"description\": \"<string>\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/card-transactions/batch-update")
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 {\n \"cardTransactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"lines\": [\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"description\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"postingDate\": \"2023-12-25\",\n \"description\": \"<string>\"\n }\n]"
response = http.request(request)
puts response.read_bodyAuthorizations
apiKeyAuthbearerAuth
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
Body
application/json;charset=UTF-8
Response
default - application/json;charset=UTF-8
default response
⌘I
Batch update card transactions
curl --request PATCH \
--url https://api.light.inc/v1/card-transactions/batch-update \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
[
{
"cardTransactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
],
"lines": [
{
"lineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
],
"description": "<string>",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"postingDate": "2023-12-25",
"description": "<string>"
}
]
'import requests
url = "https://api.light.inc/v1/card-transactions/batch-update"
payload = [
{
"cardTransactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
],
"lines": [
{
"lineId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
],
"description": "<string>",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxCodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"postingDate": "2023-12-25",
"description": "<string>"
}
]
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([
{
cardTransactionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
],
lines: [
{
lineId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
],
description: '<string>',
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
taxCodeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
postingDate: '2023-12-25',
description: '<string>'
}
])
};
fetch('https://api.light.inc/v1/card-transactions/batch-update', 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/card-transactions/batch-update",
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([
[
'cardTransactionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
],
'lines' => [
[
'lineId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
],
'description' => '<string>',
'accountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'taxCodeId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'postingDate' => '2023-12-25',
'description' => '<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/card-transactions/batch-update"
payload := strings.NewReader("[\n {\n \"cardTransactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"lines\": [\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"description\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"postingDate\": \"2023-12-25\",\n \"description\": \"<string>\"\n }\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/card-transactions/batch-update")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("[\n {\n \"cardTransactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"lines\": [\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"description\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"postingDate\": \"2023-12-25\",\n \"description\": \"<string>\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/card-transactions/batch-update")
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 {\n \"cardTransactionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"lines\": [\n {\n \"lineId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 \"description\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"taxCodeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"postingDate\": \"2023-12-25\",\n \"description\": \"<string>\"\n }\n]"
response = http.request(request)
puts response.read_body