curl --request POST \
--url https://api.sonderplan.com/v2/invoice-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Long Form Jobs",
"type_id": 1,
"default": false,
"title": "Invoice",
"logo": [
{
"name": "Avid_Icon",
"size": 174285,
"alias": "7e73ab25155974c230d09494548201b9f5056ef",
"extension": "png",
"mime_type": "image/png"
}
],
"top_left_container": "<string>",
"top_center_container": "<string>",
"top_right_container": "<string>",
"middle_left_container": "<string>",
"middle_center_container": "<string>",
"middle_right_container": "<string>",
"bottom_left_container": "<string>",
"bottom_center_container": "<string>",
"bottom_right_container": "<string>",
"email_subject_template": "<string>",
"email_body_template": "<string>",
"options": {
"items_column_visibility": {
"item": true,
"description": true,
"quantity": true,
"price": true,
"discount": true,
"tax": true,
"total": true
},
"totals_visibility": {
"sub_total": true,
"discount_total": true,
"net_total": true,
"tax_total": true,
"total": true
}
}
}
'import requests
url = "https://api.sonderplan.com/v2/invoice-template"
payload = {
"name": "Long Form Jobs",
"type_id": 1,
"default": False,
"title": "Invoice",
"logo": [
{
"name": "Avid_Icon",
"size": 174285,
"alias": "7e73ab25155974c230d09494548201b9f5056ef",
"extension": "png",
"mime_type": "image/png"
}
],
"top_left_container": "<string>",
"top_center_container": "<string>",
"top_right_container": "<string>",
"middle_left_container": "<string>",
"middle_center_container": "<string>",
"middle_right_container": "<string>",
"bottom_left_container": "<string>",
"bottom_center_container": "<string>",
"bottom_right_container": "<string>",
"email_subject_template": "<string>",
"email_body_template": "<string>",
"options": {
"items_column_visibility": {
"item": True,
"description": True,
"quantity": True,
"price": True,
"discount": True,
"tax": True,
"total": True
},
"totals_visibility": {
"sub_total": True,
"discount_total": True,
"net_total": True,
"tax_total": True,
"total": True
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Long Form Jobs',
type_id: 1,
default: false,
title: 'Invoice',
logo: [
{
name: 'Avid_Icon',
size: 174285,
alias: '7e73ab25155974c230d09494548201b9f5056ef',
extension: 'png',
mime_type: 'image/png'
}
],
top_left_container: '<string>',
top_center_container: '<string>',
top_right_container: '<string>',
middle_left_container: '<string>',
middle_center_container: '<string>',
middle_right_container: '<string>',
bottom_left_container: '<string>',
bottom_center_container: '<string>',
bottom_right_container: '<string>',
email_subject_template: '<string>',
email_body_template: '<string>',
options: {
items_column_visibility: {
item: true,
description: true,
quantity: true,
price: true,
discount: true,
tax: true,
total: true
},
totals_visibility: {
sub_total: true,
discount_total: true,
net_total: true,
tax_total: true,
total: true
}
}
})
};
fetch('https://api.sonderplan.com/v2/invoice-template', 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.sonderplan.com/v2/invoice-template",
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([
'name' => 'Long Form Jobs',
'type_id' => 1,
'default' => false,
'title' => 'Invoice',
'logo' => [
[
'name' => 'Avid_Icon',
'size' => 174285,
'alias' => '7e73ab25155974c230d09494548201b9f5056ef',
'extension' => 'png',
'mime_type' => 'image/png'
]
],
'top_left_container' => '<string>',
'top_center_container' => '<string>',
'top_right_container' => '<string>',
'middle_left_container' => '<string>',
'middle_center_container' => '<string>',
'middle_right_container' => '<string>',
'bottom_left_container' => '<string>',
'bottom_center_container' => '<string>',
'bottom_right_container' => '<string>',
'email_subject_template' => '<string>',
'email_body_template' => '<string>',
'options' => [
'items_column_visibility' => [
'item' => true,
'description' => true,
'quantity' => true,
'price' => true,
'discount' => true,
'tax' => true,
'total' => true
],
'totals_visibility' => [
'sub_total' => true,
'discount_total' => true,
'net_total' => true,
'tax_total' => true,
'total' => true
]
]
]),
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.sonderplan.com/v2/invoice-template"
payload := strings.NewReader("{\n \"name\": \"Long Form Jobs\",\n \"type_id\": 1,\n \"default\": false,\n \"title\": \"Invoice\",\n \"logo\": [\n {\n \"name\": \"Avid_Icon\",\n \"size\": 174285,\n \"alias\": \"7e73ab25155974c230d09494548201b9f5056ef\",\n \"extension\": \"png\",\n \"mime_type\": \"image/png\"\n }\n ],\n \"top_left_container\": \"<string>\",\n \"top_center_container\": \"<string>\",\n \"top_right_container\": \"<string>\",\n \"middle_left_container\": \"<string>\",\n \"middle_center_container\": \"<string>\",\n \"middle_right_container\": \"<string>\",\n \"bottom_left_container\": \"<string>\",\n \"bottom_center_container\": \"<string>\",\n \"bottom_right_container\": \"<string>\",\n \"email_subject_template\": \"<string>\",\n \"email_body_template\": \"<string>\",\n \"options\": {\n \"items_column_visibility\": {\n \"item\": true,\n \"description\": true,\n \"quantity\": true,\n \"price\": true,\n \"discount\": true,\n \"tax\": true,\n \"total\": true\n },\n \"totals_visibility\": {\n \"sub_total\": true,\n \"discount_total\": true,\n \"net_total\": true,\n \"tax_total\": true,\n \"total\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sonderplan.com/v2/invoice-template")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Long Form Jobs\",\n \"type_id\": 1,\n \"default\": false,\n \"title\": \"Invoice\",\n \"logo\": [\n {\n \"name\": \"Avid_Icon\",\n \"size\": 174285,\n \"alias\": \"7e73ab25155974c230d09494548201b9f5056ef\",\n \"extension\": \"png\",\n \"mime_type\": \"image/png\"\n }\n ],\n \"top_left_container\": \"<string>\",\n \"top_center_container\": \"<string>\",\n \"top_right_container\": \"<string>\",\n \"middle_left_container\": \"<string>\",\n \"middle_center_container\": \"<string>\",\n \"middle_right_container\": \"<string>\",\n \"bottom_left_container\": \"<string>\",\n \"bottom_center_container\": \"<string>\",\n \"bottom_right_container\": \"<string>\",\n \"email_subject_template\": \"<string>\",\n \"email_body_template\": \"<string>\",\n \"options\": {\n \"items_column_visibility\": {\n \"item\": true,\n \"description\": true,\n \"quantity\": true,\n \"price\": true,\n \"discount\": true,\n \"tax\": true,\n \"total\": true\n },\n \"totals_visibility\": {\n \"sub_total\": true,\n \"discount_total\": true,\n \"net_total\": true,\n \"tax_total\": true,\n \"total\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sonderplan.com/v2/invoice-template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Long Form Jobs\",\n \"type_id\": 1,\n \"default\": false,\n \"title\": \"Invoice\",\n \"logo\": [\n {\n \"name\": \"Avid_Icon\",\n \"size\": 174285,\n \"alias\": \"7e73ab25155974c230d09494548201b9f5056ef\",\n \"extension\": \"png\",\n \"mime_type\": \"image/png\"\n }\n ],\n \"top_left_container\": \"<string>\",\n \"top_center_container\": \"<string>\",\n \"top_right_container\": \"<string>\",\n \"middle_left_container\": \"<string>\",\n \"middle_center_container\": \"<string>\",\n \"middle_right_container\": \"<string>\",\n \"bottom_left_container\": \"<string>\",\n \"bottom_center_container\": \"<string>\",\n \"bottom_right_container\": \"<string>\",\n \"email_subject_template\": \"<string>\",\n \"email_body_template\": \"<string>\",\n \"options\": {\n \"items_column_visibility\": {\n \"item\": true,\n \"description\": true,\n \"quantity\": true,\n \"price\": true,\n \"discount\": true,\n \"tax\": true,\n \"total\": true\n },\n \"totals_visibility\": {\n \"sub_total\": true,\n \"discount_total\": true,\n \"net_total\": true,\n \"tax_total\": true,\n \"total\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": {
"id": 2384
}
}{
"error": {
"code": 400,
"message": "name is required... Name of the invoice template"
}
}Create Invoice Template
WRITE access to the ADMIN module is required to access this endpointcurl --request POST \
--url https://api.sonderplan.com/v2/invoice-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Long Form Jobs",
"type_id": 1,
"default": false,
"title": "Invoice",
"logo": [
{
"name": "Avid_Icon",
"size": 174285,
"alias": "7e73ab25155974c230d09494548201b9f5056ef",
"extension": "png",
"mime_type": "image/png"
}
],
"top_left_container": "<string>",
"top_center_container": "<string>",
"top_right_container": "<string>",
"middle_left_container": "<string>",
"middle_center_container": "<string>",
"middle_right_container": "<string>",
"bottom_left_container": "<string>",
"bottom_center_container": "<string>",
"bottom_right_container": "<string>",
"email_subject_template": "<string>",
"email_body_template": "<string>",
"options": {
"items_column_visibility": {
"item": true,
"description": true,
"quantity": true,
"price": true,
"discount": true,
"tax": true,
"total": true
},
"totals_visibility": {
"sub_total": true,
"discount_total": true,
"net_total": true,
"tax_total": true,
"total": true
}
}
}
'import requests
url = "https://api.sonderplan.com/v2/invoice-template"
payload = {
"name": "Long Form Jobs",
"type_id": 1,
"default": False,
"title": "Invoice",
"logo": [
{
"name": "Avid_Icon",
"size": 174285,
"alias": "7e73ab25155974c230d09494548201b9f5056ef",
"extension": "png",
"mime_type": "image/png"
}
],
"top_left_container": "<string>",
"top_center_container": "<string>",
"top_right_container": "<string>",
"middle_left_container": "<string>",
"middle_center_container": "<string>",
"middle_right_container": "<string>",
"bottom_left_container": "<string>",
"bottom_center_container": "<string>",
"bottom_right_container": "<string>",
"email_subject_template": "<string>",
"email_body_template": "<string>",
"options": {
"items_column_visibility": {
"item": True,
"description": True,
"quantity": True,
"price": True,
"discount": True,
"tax": True,
"total": True
},
"totals_visibility": {
"sub_total": True,
"discount_total": True,
"net_total": True,
"tax_total": True,
"total": True
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Long Form Jobs',
type_id: 1,
default: false,
title: 'Invoice',
logo: [
{
name: 'Avid_Icon',
size: 174285,
alias: '7e73ab25155974c230d09494548201b9f5056ef',
extension: 'png',
mime_type: 'image/png'
}
],
top_left_container: '<string>',
top_center_container: '<string>',
top_right_container: '<string>',
middle_left_container: '<string>',
middle_center_container: '<string>',
middle_right_container: '<string>',
bottom_left_container: '<string>',
bottom_center_container: '<string>',
bottom_right_container: '<string>',
email_subject_template: '<string>',
email_body_template: '<string>',
options: {
items_column_visibility: {
item: true,
description: true,
quantity: true,
price: true,
discount: true,
tax: true,
total: true
},
totals_visibility: {
sub_total: true,
discount_total: true,
net_total: true,
tax_total: true,
total: true
}
}
})
};
fetch('https://api.sonderplan.com/v2/invoice-template', 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.sonderplan.com/v2/invoice-template",
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([
'name' => 'Long Form Jobs',
'type_id' => 1,
'default' => false,
'title' => 'Invoice',
'logo' => [
[
'name' => 'Avid_Icon',
'size' => 174285,
'alias' => '7e73ab25155974c230d09494548201b9f5056ef',
'extension' => 'png',
'mime_type' => 'image/png'
]
],
'top_left_container' => '<string>',
'top_center_container' => '<string>',
'top_right_container' => '<string>',
'middle_left_container' => '<string>',
'middle_center_container' => '<string>',
'middle_right_container' => '<string>',
'bottom_left_container' => '<string>',
'bottom_center_container' => '<string>',
'bottom_right_container' => '<string>',
'email_subject_template' => '<string>',
'email_body_template' => '<string>',
'options' => [
'items_column_visibility' => [
'item' => true,
'description' => true,
'quantity' => true,
'price' => true,
'discount' => true,
'tax' => true,
'total' => true
],
'totals_visibility' => [
'sub_total' => true,
'discount_total' => true,
'net_total' => true,
'tax_total' => true,
'total' => true
]
]
]),
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.sonderplan.com/v2/invoice-template"
payload := strings.NewReader("{\n \"name\": \"Long Form Jobs\",\n \"type_id\": 1,\n \"default\": false,\n \"title\": \"Invoice\",\n \"logo\": [\n {\n \"name\": \"Avid_Icon\",\n \"size\": 174285,\n \"alias\": \"7e73ab25155974c230d09494548201b9f5056ef\",\n \"extension\": \"png\",\n \"mime_type\": \"image/png\"\n }\n ],\n \"top_left_container\": \"<string>\",\n \"top_center_container\": \"<string>\",\n \"top_right_container\": \"<string>\",\n \"middle_left_container\": \"<string>\",\n \"middle_center_container\": \"<string>\",\n \"middle_right_container\": \"<string>\",\n \"bottom_left_container\": \"<string>\",\n \"bottom_center_container\": \"<string>\",\n \"bottom_right_container\": \"<string>\",\n \"email_subject_template\": \"<string>\",\n \"email_body_template\": \"<string>\",\n \"options\": {\n \"items_column_visibility\": {\n \"item\": true,\n \"description\": true,\n \"quantity\": true,\n \"price\": true,\n \"discount\": true,\n \"tax\": true,\n \"total\": true\n },\n \"totals_visibility\": {\n \"sub_total\": true,\n \"discount_total\": true,\n \"net_total\": true,\n \"tax_total\": true,\n \"total\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sonderplan.com/v2/invoice-template")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Long Form Jobs\",\n \"type_id\": 1,\n \"default\": false,\n \"title\": \"Invoice\",\n \"logo\": [\n {\n \"name\": \"Avid_Icon\",\n \"size\": 174285,\n \"alias\": \"7e73ab25155974c230d09494548201b9f5056ef\",\n \"extension\": \"png\",\n \"mime_type\": \"image/png\"\n }\n ],\n \"top_left_container\": \"<string>\",\n \"top_center_container\": \"<string>\",\n \"top_right_container\": \"<string>\",\n \"middle_left_container\": \"<string>\",\n \"middle_center_container\": \"<string>\",\n \"middle_right_container\": \"<string>\",\n \"bottom_left_container\": \"<string>\",\n \"bottom_center_container\": \"<string>\",\n \"bottom_right_container\": \"<string>\",\n \"email_subject_template\": \"<string>\",\n \"email_body_template\": \"<string>\",\n \"options\": {\n \"items_column_visibility\": {\n \"item\": true,\n \"description\": true,\n \"quantity\": true,\n \"price\": true,\n \"discount\": true,\n \"tax\": true,\n \"total\": true\n },\n \"totals_visibility\": {\n \"sub_total\": true,\n \"discount_total\": true,\n \"net_total\": true,\n \"tax_total\": true,\n \"total\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sonderplan.com/v2/invoice-template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Long Form Jobs\",\n \"type_id\": 1,\n \"default\": false,\n \"title\": \"Invoice\",\n \"logo\": [\n {\n \"name\": \"Avid_Icon\",\n \"size\": 174285,\n \"alias\": \"7e73ab25155974c230d09494548201b9f5056ef\",\n \"extension\": \"png\",\n \"mime_type\": \"image/png\"\n }\n ],\n \"top_left_container\": \"<string>\",\n \"top_center_container\": \"<string>\",\n \"top_right_container\": \"<string>\",\n \"middle_left_container\": \"<string>\",\n \"middle_center_container\": \"<string>\",\n \"middle_right_container\": \"<string>\",\n \"bottom_left_container\": \"<string>\",\n \"bottom_center_container\": \"<string>\",\n \"bottom_right_container\": \"<string>\",\n \"email_subject_template\": \"<string>\",\n \"email_body_template\": \"<string>\",\n \"options\": {\n \"items_column_visibility\": {\n \"item\": true,\n \"description\": true,\n \"quantity\": true,\n \"price\": true,\n \"discount\": true,\n \"tax\": true,\n \"total\": true\n },\n \"totals_visibility\": {\n \"sub_total\": true,\n \"discount_total\": true,\n \"net_total\": true,\n \"tax_total\": true,\n \"total\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": {
"id": 2384
}
}{
"error": {
"code": 400,
"message": "name is required... Name of the invoice template"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Name of the Invoice Template
"Long Form Jobs"
1 = Invoice, 2 = Quote
1
Sets the default template used when creating an invoice
false
Text shown in the top left hand corner of the template
"Invoice"
Show child attributes
Show child attributes
Top left grid container content
Top center grid container content
Top right grid container content
Middle left grid container content
Middle center grid container content
Middle right grid container content
Bottom left grid container content
Bottom center grid container content
Bottom right grid container content
Template used to populate the email subject line
Template used to populate the email body
Additional options and settings that apply to this invoice template
Show child attributes
Show child attributes
Response
Successful Operation
Show child attributes
Show child attributes