Add or update miscellaneous charges in upcoming Invoice for a account
curl --request PUT \
--url https://api.togai.com/accounts/{account_id}/miscellaneous_charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"name": "charge 1",
"value": "100"
},
{
"name": "qty & rate charge",
"rate": 20,
"quantity": 10
},
{
"name": "json logic charge",
"value": "{\"var\": \"um.linitem.id\"}"
}
]
}
'import requests
url = "https://api.togai.com/accounts/{account_id}/miscellaneous_charges"
payload = { "items": [
{
"name": "charge 1",
"value": "100"
},
{
"name": "qty & rate charge",
"rate": 20,
"quantity": 10
},
{
"name": "json logic charge",
"value": "{\"var\": \"um.linitem.id\"}"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{name: 'charge 1', value: '100'},
{name: 'qty & rate charge', rate: 20, quantity: 10},
{name: 'json logic charge', value: '{"var": "um.linitem.id"}'}
]
})
};
fetch('https://api.togai.com/accounts/{account_id}/miscellaneous_charges', 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.togai.com/accounts/{account_id}/miscellaneous_charges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'name' => 'charge 1',
'value' => '100'
],
[
'name' => 'qty & rate charge',
'rate' => 20,
'quantity' => 10
],
[
'name' => 'json logic charge',
'value' => '{"var": "um.linitem.id"}'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.togai.com/accounts/{account_id}/miscellaneous_charges"
payload := strings.NewReader("{\n \"items\": [\n {\n \"name\": \"charge 1\",\n \"value\": \"100\"\n },\n {\n \"name\": \"qty & rate charge\",\n \"rate\": 20,\n \"quantity\": 10\n },\n {\n \"name\": \"json logic charge\",\n \"value\": \"{\\\"var\\\": \\\"um.linitem.id\\\"}\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.togai.com/accounts/{account_id}/miscellaneous_charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"name\": \"charge 1\",\n \"value\": \"100\"\n },\n {\n \"name\": \"qty & rate charge\",\n \"rate\": 20,\n \"quantity\": 10\n },\n {\n \"name\": \"json logic charge\",\n \"value\": \"{\\\"var\\\": \\\"um.linitem.id\\\"}\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/accounts/{account_id}/miscellaneous_charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"name\": \"charge 1\",\n \"value\": \"100\"\n },\n {\n \"name\": \"qty & rate charge\",\n \"rate\": 20,\n \"quantity\": 10\n },\n {\n \"name\": \"json logic charge\",\n \"value\": \"{\\\"var\\\": \\\"um.linitem.id\\\"}\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"name": "charge 1",
"value": "100"
},
{
"name": "charge 2",
"rate": 20,
"quantity": 10,
"value": "200"
}
]
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Invoices
Add or update miscellaneous charges in upcoming Invoice for a account
Add or update miscellaneous charges in upcoming Invoice for a account
PUT
/
accounts
/
{account_id}
/
miscellaneous_charges
Add or update miscellaneous charges in upcoming Invoice for a account
curl --request PUT \
--url https://api.togai.com/accounts/{account_id}/miscellaneous_charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"name": "charge 1",
"value": "100"
},
{
"name": "qty & rate charge",
"rate": 20,
"quantity": 10
},
{
"name": "json logic charge",
"value": "{\"var\": \"um.linitem.id\"}"
}
]
}
'import requests
url = "https://api.togai.com/accounts/{account_id}/miscellaneous_charges"
payload = { "items": [
{
"name": "charge 1",
"value": "100"
},
{
"name": "qty & rate charge",
"rate": 20,
"quantity": 10
},
{
"name": "json logic charge",
"value": "{\"var\": \"um.linitem.id\"}"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{name: 'charge 1', value: '100'},
{name: 'qty & rate charge', rate: 20, quantity: 10},
{name: 'json logic charge', value: '{"var": "um.linitem.id"}'}
]
})
};
fetch('https://api.togai.com/accounts/{account_id}/miscellaneous_charges', 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.togai.com/accounts/{account_id}/miscellaneous_charges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'name' => 'charge 1',
'value' => '100'
],
[
'name' => 'qty & rate charge',
'rate' => 20,
'quantity' => 10
],
[
'name' => 'json logic charge',
'value' => '{"var": "um.linitem.id"}'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.togai.com/accounts/{account_id}/miscellaneous_charges"
payload := strings.NewReader("{\n \"items\": [\n {\n \"name\": \"charge 1\",\n \"value\": \"100\"\n },\n {\n \"name\": \"qty & rate charge\",\n \"rate\": 20,\n \"quantity\": 10\n },\n {\n \"name\": \"json logic charge\",\n \"value\": \"{\\\"var\\\": \\\"um.linitem.id\\\"}\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.togai.com/accounts/{account_id}/miscellaneous_charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"name\": \"charge 1\",\n \"value\": \"100\"\n },\n {\n \"name\": \"qty & rate charge\",\n \"rate\": 20,\n \"quantity\": 10\n },\n {\n \"name\": \"json logic charge\",\n \"value\": \"{\\\"var\\\": \\\"um.linitem.id\\\"}\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/accounts/{account_id}/miscellaneous_charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"name\": \"charge 1\",\n \"value\": \"100\"\n },\n {\n \"name\": \"qty & rate charge\",\n \"rate\": 20,\n \"quantity\": 10\n },\n {\n \"name\": \"json logic charge\",\n \"value\": \"{\\\"var\\\": \\\"um.linitem.id\\\"}\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"name": "charge 1",
"value": "100"
},
{
"name": "charge 2",
"rate": 20,
"quantity": 10,
"value": "200"
}
]
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
account_id corresponding to an account
Maximum string length:
50Example:
"ACC00001"
Body
application/json
Payload to update custom line items
Payload to update custom line items
Show child attributes
Show child attributes
Response
Response for Miscellaneous Charges Request
Miscellaneous charges response
Show child attributes
Show child attributes
โI
