Create Quote
curl --request POST \
--url https://api.sonderplan.com/v2/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client": [
{
"uuid": "p4",
"contact_person": {
"id": 2837
}
}
],
"id": 1,
"prefix": "INV-",
"number": 892,
"date": 1547501100,
"date_time_iso": "2022-02-22T09:00:00+11:00",
"expiry_date": 1547501100,
"expiry_date_time_iso": "2022-02-22T09:00:00+11:00",
"items": [
{
"id": 982342,
"item_text": "Edit Suite 1 Grading",
"item_uuid": "r2394",
"ratescheme_id": 989234,
"description": "Session booked between 10th Jan -> 12th Jan 2023",
"quantity": "2.4",
"unit": "hourly",
"unit_amount": "20.65",
"unit_buy_amount": "10.15",
"tax": true,
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"discount": "20.00%",
"buy_total": "200.00",
"buy_total_fixed": false,
"order": 2,
"parent_group_id": 234842
}
],
"groups": [
{
"id": 23425,
"name": "Video Editing Services",
"description": "Includes all editing services",
"order": 2,
"hide_items": true
}
],
"status": [
{
"id": 2
}
],
"project": [
{
"id": 2342354,
"start": 1547501100,
"end": 1547538900
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
],
"terms": "Expires in 30 days, subject to stock confirmation etc",
"template_id": 213,
"cloned_id": 545647,
"reference": "QU-9893",
"currency": "AUD",
"created_sp_flag": "true"
}
'import requests
url = "https://api.sonderplan.com/v2/quote"
payload = {
"client": [
{
"uuid": "p4",
"contact_person": { "id": 2837 }
}
],
"id": 1,
"prefix": "INV-",
"number": 892,
"date": 1547501100,
"date_time_iso": "2022-02-22T09:00:00+11:00",
"expiry_date": 1547501100,
"expiry_date_time_iso": "2022-02-22T09:00:00+11:00",
"items": [
{
"id": 982342,
"item_text": "Edit Suite 1 Grading",
"item_uuid": "r2394",
"ratescheme_id": 989234,
"description": "Session booked between 10th Jan -> 12th Jan 2023",
"quantity": "2.4",
"unit": "hourly",
"unit_amount": "20.65",
"unit_buy_amount": "10.15",
"tax": True,
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"discount": "20.00%",
"buy_total": "200.00",
"buy_total_fixed": False,
"order": 2,
"parent_group_id": 234842
}
],
"groups": [
{
"id": 23425,
"name": "Video Editing Services",
"description": "Includes all editing services",
"order": 2,
"hide_items": True
}
],
"status": [{ "id": 2 }],
"project": [
{
"id": 2342354,
"start": 1547501100,
"end": 1547538900
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
],
"terms": "Expires in 30 days, subject to stock confirmation etc",
"template_id": 213,
"cloned_id": 545647,
"reference": "QU-9893",
"currency": "AUD",
"created_sp_flag": "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({
client: [{uuid: 'p4', contact_person: {id: 2837}}],
id: 1,
prefix: 'INV-',
number: 892,
date: 1547501100,
date_time_iso: '2022-02-22T09:00:00+11:00',
expiry_date: 1547501100,
expiry_date_time_iso: '2022-02-22T09:00:00+11:00',
items: [
{
id: 982342,
item_text: 'Edit Suite 1 Grading',
item_uuid: 'r2394',
ratescheme_id: 989234,
description: 'Session booked between 10th Jan -> 12th Jan 2023',
quantity: '2.4',
unit: 'hourly',
unit_amount: '20.65',
unit_buy_amount: '10.15',
tax: true,
taxes: [{id: 3247, name: 'GST', rate: '10.00', total: '151.00'}],
discount: '20.00%',
buy_total: '200.00',
buy_total_fixed: false,
order: 2,
parent_group_id: 234842
}
],
groups: [
{
id: 23425,
name: 'Video Editing Services',
description: 'Includes all editing services',
order: 2,
hide_items: true
}
],
status: [{id: 2}],
project: [{id: 2342354, start: 1547501100, end: 1547538900}],
custom_fields: [
{
id: 7823,
name: 'Type',
value: 'Video Editing',
value_id: 8973,
update_key: '2_1_7823'
}
],
terms: 'Expires in 30 days, subject to stock confirmation etc',
template_id: 213,
cloned_id: 545647,
reference: 'QU-9893',
currency: 'AUD',
created_sp_flag: 'true'
})
};
fetch('https://api.sonderplan.com/v2/quote', 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/quote",
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([
'client' => [
[
'uuid' => 'p4',
'contact_person' => [
'id' => 2837
]
]
],
'id' => 1,
'prefix' => 'INV-',
'number' => 892,
'date' => 1547501100,
'date_time_iso' => '2022-02-22T09:00:00+11:00',
'expiry_date' => 1547501100,
'expiry_date_time_iso' => '2022-02-22T09:00:00+11:00',
'items' => [
[
'id' => 982342,
'item_text' => 'Edit Suite 1 Grading',
'item_uuid' => 'r2394',
'ratescheme_id' => 989234,
'description' => 'Session booked between 10th Jan -> 12th Jan 2023',
'quantity' => '2.4',
'unit' => 'hourly',
'unit_amount' => '20.65',
'unit_buy_amount' => '10.15',
'tax' => true,
'taxes' => [
[
'id' => 3247,
'name' => 'GST',
'rate' => '10.00',
'total' => '151.00'
]
],
'discount' => '20.00%',
'buy_total' => '200.00',
'buy_total_fixed' => false,
'order' => 2,
'parent_group_id' => 234842
]
],
'groups' => [
[
'id' => 23425,
'name' => 'Video Editing Services',
'description' => 'Includes all editing services',
'order' => 2,
'hide_items' => true
]
],
'status' => [
[
'id' => 2
]
],
'project' => [
[
'id' => 2342354,
'start' => 1547501100,
'end' => 1547538900
]
],
'custom_fields' => [
[
'id' => 7823,
'name' => 'Type',
'value' => 'Video Editing',
'value_id' => 8973,
'update_key' => '2_1_7823'
]
],
'terms' => 'Expires in 30 days, subject to stock confirmation etc',
'template_id' => 213,
'cloned_id' => 545647,
'reference' => 'QU-9893',
'currency' => 'AUD',
'created_sp_flag' => '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/quote"
payload := strings.NewReader("{\n \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"id\": 1,\n \"prefix\": \"INV-\",\n \"number\": 892,\n \"date\": 1547501100,\n \"date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"expiry_date\": 1547501100,\n \"expiry_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"items\": [\n {\n \"id\": 982342,\n \"item_text\": \"Edit Suite 1 Grading\",\n \"item_uuid\": \"r2394\",\n \"ratescheme_id\": 989234,\n \"description\": \"Session booked between 10th Jan -> 12th Jan 2023\",\n \"quantity\": \"2.4\",\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"unit_buy_amount\": \"10.15\",\n \"tax\": true,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"discount\": \"20.00%\",\n \"buy_total\": \"200.00\",\n \"buy_total_fixed\": false,\n \"order\": 2,\n \"parent_group_id\": 234842\n }\n ],\n \"groups\": [\n {\n \"id\": 23425,\n \"name\": \"Video Editing Services\",\n \"description\": \"Includes all editing services\",\n \"order\": 2,\n \"hide_items\": true\n }\n ],\n \"status\": [\n {\n \"id\": 2\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\n }\n ],\n \"terms\": \"Expires in 30 days, subject to stock confirmation etc\",\n \"template_id\": 213,\n \"cloned_id\": 545647,\n \"reference\": \"QU-9893\",\n \"currency\": \"AUD\",\n \"created_sp_flag\": \"true\"\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/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"id\": 1,\n \"prefix\": \"INV-\",\n \"number\": 892,\n \"date\": 1547501100,\n \"date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"expiry_date\": 1547501100,\n \"expiry_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"items\": [\n {\n \"id\": 982342,\n \"item_text\": \"Edit Suite 1 Grading\",\n \"item_uuid\": \"r2394\",\n \"ratescheme_id\": 989234,\n \"description\": \"Session booked between 10th Jan -> 12th Jan 2023\",\n \"quantity\": \"2.4\",\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"unit_buy_amount\": \"10.15\",\n \"tax\": true,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"discount\": \"20.00%\",\n \"buy_total\": \"200.00\",\n \"buy_total_fixed\": false,\n \"order\": 2,\n \"parent_group_id\": 234842\n }\n ],\n \"groups\": [\n {\n \"id\": 23425,\n \"name\": \"Video Editing Services\",\n \"description\": \"Includes all editing services\",\n \"order\": 2,\n \"hide_items\": true\n }\n ],\n \"status\": [\n {\n \"id\": 2\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\n }\n ],\n \"terms\": \"Expires in 30 days, subject to stock confirmation etc\",\n \"template_id\": 213,\n \"cloned_id\": 545647,\n \"reference\": \"QU-9893\",\n \"currency\": \"AUD\",\n \"created_sp_flag\": \"true\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sonderplan.com/v2/quote")
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 \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"id\": 1,\n \"prefix\": \"INV-\",\n \"number\": 892,\n \"date\": 1547501100,\n \"date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"expiry_date\": 1547501100,\n \"expiry_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"items\": [\n {\n \"id\": 982342,\n \"item_text\": \"Edit Suite 1 Grading\",\n \"item_uuid\": \"r2394\",\n \"ratescheme_id\": 989234,\n \"description\": \"Session booked between 10th Jan -> 12th Jan 2023\",\n \"quantity\": \"2.4\",\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"unit_buy_amount\": \"10.15\",\n \"tax\": true,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"discount\": \"20.00%\",\n \"buy_total\": \"200.00\",\n \"buy_total_fixed\": false,\n \"order\": 2,\n \"parent_group_id\": 234842\n }\n ],\n \"groups\": [\n {\n \"id\": 23425,\n \"name\": \"Video Editing Services\",\n \"description\": \"Includes all editing services\",\n \"order\": 2,\n \"hide_items\": true\n }\n ],\n \"status\": [\n {\n \"id\": 2\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\n }\n ],\n \"terms\": \"Expires in 30 days, subject to stock confirmation etc\",\n \"template_id\": 213,\n \"cloned_id\": 545647,\n \"reference\": \"QU-9893\",\n \"currency\": \"AUD\",\n \"created_sp_flag\": \"true\"\n}"
response = http.request(request)
puts response.read_body{
"success": {
"id": 1
}
}{
"error": {
"code": "404",
"message": "Requested resource was not found"
}
}Quote
Create Quote
WRITE access to the SALES module is required to access this endpointThe
quoteCreated webhook will be fired when this endpoint has run successfullyPOST
/
v2
/
quote
Create Quote
curl --request POST \
--url https://api.sonderplan.com/v2/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client": [
{
"uuid": "p4",
"contact_person": {
"id": 2837
}
}
],
"id": 1,
"prefix": "INV-",
"number": 892,
"date": 1547501100,
"date_time_iso": "2022-02-22T09:00:00+11:00",
"expiry_date": 1547501100,
"expiry_date_time_iso": "2022-02-22T09:00:00+11:00",
"items": [
{
"id": 982342,
"item_text": "Edit Suite 1 Grading",
"item_uuid": "r2394",
"ratescheme_id": 989234,
"description": "Session booked between 10th Jan -> 12th Jan 2023",
"quantity": "2.4",
"unit": "hourly",
"unit_amount": "20.65",
"unit_buy_amount": "10.15",
"tax": true,
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"discount": "20.00%",
"buy_total": "200.00",
"buy_total_fixed": false,
"order": 2,
"parent_group_id": 234842
}
],
"groups": [
{
"id": 23425,
"name": "Video Editing Services",
"description": "Includes all editing services",
"order": 2,
"hide_items": true
}
],
"status": [
{
"id": 2
}
],
"project": [
{
"id": 2342354,
"start": 1547501100,
"end": 1547538900
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
],
"terms": "Expires in 30 days, subject to stock confirmation etc",
"template_id": 213,
"cloned_id": 545647,
"reference": "QU-9893",
"currency": "AUD",
"created_sp_flag": "true"
}
'import requests
url = "https://api.sonderplan.com/v2/quote"
payload = {
"client": [
{
"uuid": "p4",
"contact_person": { "id": 2837 }
}
],
"id": 1,
"prefix": "INV-",
"number": 892,
"date": 1547501100,
"date_time_iso": "2022-02-22T09:00:00+11:00",
"expiry_date": 1547501100,
"expiry_date_time_iso": "2022-02-22T09:00:00+11:00",
"items": [
{
"id": 982342,
"item_text": "Edit Suite 1 Grading",
"item_uuid": "r2394",
"ratescheme_id": 989234,
"description": "Session booked between 10th Jan -> 12th Jan 2023",
"quantity": "2.4",
"unit": "hourly",
"unit_amount": "20.65",
"unit_buy_amount": "10.15",
"tax": True,
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"discount": "20.00%",
"buy_total": "200.00",
"buy_total_fixed": False,
"order": 2,
"parent_group_id": 234842
}
],
"groups": [
{
"id": 23425,
"name": "Video Editing Services",
"description": "Includes all editing services",
"order": 2,
"hide_items": True
}
],
"status": [{ "id": 2 }],
"project": [
{
"id": 2342354,
"start": 1547501100,
"end": 1547538900
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
],
"terms": "Expires in 30 days, subject to stock confirmation etc",
"template_id": 213,
"cloned_id": 545647,
"reference": "QU-9893",
"currency": "AUD",
"created_sp_flag": "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({
client: [{uuid: 'p4', contact_person: {id: 2837}}],
id: 1,
prefix: 'INV-',
number: 892,
date: 1547501100,
date_time_iso: '2022-02-22T09:00:00+11:00',
expiry_date: 1547501100,
expiry_date_time_iso: '2022-02-22T09:00:00+11:00',
items: [
{
id: 982342,
item_text: 'Edit Suite 1 Grading',
item_uuid: 'r2394',
ratescheme_id: 989234,
description: 'Session booked between 10th Jan -> 12th Jan 2023',
quantity: '2.4',
unit: 'hourly',
unit_amount: '20.65',
unit_buy_amount: '10.15',
tax: true,
taxes: [{id: 3247, name: 'GST', rate: '10.00', total: '151.00'}],
discount: '20.00%',
buy_total: '200.00',
buy_total_fixed: false,
order: 2,
parent_group_id: 234842
}
],
groups: [
{
id: 23425,
name: 'Video Editing Services',
description: 'Includes all editing services',
order: 2,
hide_items: true
}
],
status: [{id: 2}],
project: [{id: 2342354, start: 1547501100, end: 1547538900}],
custom_fields: [
{
id: 7823,
name: 'Type',
value: 'Video Editing',
value_id: 8973,
update_key: '2_1_7823'
}
],
terms: 'Expires in 30 days, subject to stock confirmation etc',
template_id: 213,
cloned_id: 545647,
reference: 'QU-9893',
currency: 'AUD',
created_sp_flag: 'true'
})
};
fetch('https://api.sonderplan.com/v2/quote', 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/quote",
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([
'client' => [
[
'uuid' => 'p4',
'contact_person' => [
'id' => 2837
]
]
],
'id' => 1,
'prefix' => 'INV-',
'number' => 892,
'date' => 1547501100,
'date_time_iso' => '2022-02-22T09:00:00+11:00',
'expiry_date' => 1547501100,
'expiry_date_time_iso' => '2022-02-22T09:00:00+11:00',
'items' => [
[
'id' => 982342,
'item_text' => 'Edit Suite 1 Grading',
'item_uuid' => 'r2394',
'ratescheme_id' => 989234,
'description' => 'Session booked between 10th Jan -> 12th Jan 2023',
'quantity' => '2.4',
'unit' => 'hourly',
'unit_amount' => '20.65',
'unit_buy_amount' => '10.15',
'tax' => true,
'taxes' => [
[
'id' => 3247,
'name' => 'GST',
'rate' => '10.00',
'total' => '151.00'
]
],
'discount' => '20.00%',
'buy_total' => '200.00',
'buy_total_fixed' => false,
'order' => 2,
'parent_group_id' => 234842
]
],
'groups' => [
[
'id' => 23425,
'name' => 'Video Editing Services',
'description' => 'Includes all editing services',
'order' => 2,
'hide_items' => true
]
],
'status' => [
[
'id' => 2
]
],
'project' => [
[
'id' => 2342354,
'start' => 1547501100,
'end' => 1547538900
]
],
'custom_fields' => [
[
'id' => 7823,
'name' => 'Type',
'value' => 'Video Editing',
'value_id' => 8973,
'update_key' => '2_1_7823'
]
],
'terms' => 'Expires in 30 days, subject to stock confirmation etc',
'template_id' => 213,
'cloned_id' => 545647,
'reference' => 'QU-9893',
'currency' => 'AUD',
'created_sp_flag' => '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/quote"
payload := strings.NewReader("{\n \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"id\": 1,\n \"prefix\": \"INV-\",\n \"number\": 892,\n \"date\": 1547501100,\n \"date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"expiry_date\": 1547501100,\n \"expiry_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"items\": [\n {\n \"id\": 982342,\n \"item_text\": \"Edit Suite 1 Grading\",\n \"item_uuid\": \"r2394\",\n \"ratescheme_id\": 989234,\n \"description\": \"Session booked between 10th Jan -> 12th Jan 2023\",\n \"quantity\": \"2.4\",\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"unit_buy_amount\": \"10.15\",\n \"tax\": true,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"discount\": \"20.00%\",\n \"buy_total\": \"200.00\",\n \"buy_total_fixed\": false,\n \"order\": 2,\n \"parent_group_id\": 234842\n }\n ],\n \"groups\": [\n {\n \"id\": 23425,\n \"name\": \"Video Editing Services\",\n \"description\": \"Includes all editing services\",\n \"order\": 2,\n \"hide_items\": true\n }\n ],\n \"status\": [\n {\n \"id\": 2\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\n }\n ],\n \"terms\": \"Expires in 30 days, subject to stock confirmation etc\",\n \"template_id\": 213,\n \"cloned_id\": 545647,\n \"reference\": \"QU-9893\",\n \"currency\": \"AUD\",\n \"created_sp_flag\": \"true\"\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/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"id\": 1,\n \"prefix\": \"INV-\",\n \"number\": 892,\n \"date\": 1547501100,\n \"date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"expiry_date\": 1547501100,\n \"expiry_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"items\": [\n {\n \"id\": 982342,\n \"item_text\": \"Edit Suite 1 Grading\",\n \"item_uuid\": \"r2394\",\n \"ratescheme_id\": 989234,\n \"description\": \"Session booked between 10th Jan -> 12th Jan 2023\",\n \"quantity\": \"2.4\",\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"unit_buy_amount\": \"10.15\",\n \"tax\": true,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"discount\": \"20.00%\",\n \"buy_total\": \"200.00\",\n \"buy_total_fixed\": false,\n \"order\": 2,\n \"parent_group_id\": 234842\n }\n ],\n \"groups\": [\n {\n \"id\": 23425,\n \"name\": \"Video Editing Services\",\n \"description\": \"Includes all editing services\",\n \"order\": 2,\n \"hide_items\": true\n }\n ],\n \"status\": [\n {\n \"id\": 2\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\n }\n ],\n \"terms\": \"Expires in 30 days, subject to stock confirmation etc\",\n \"template_id\": 213,\n \"cloned_id\": 545647,\n \"reference\": \"QU-9893\",\n \"currency\": \"AUD\",\n \"created_sp_flag\": \"true\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sonderplan.com/v2/quote")
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 \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"id\": 1,\n \"prefix\": \"INV-\",\n \"number\": 892,\n \"date\": 1547501100,\n \"date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"expiry_date\": 1547501100,\n \"expiry_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"items\": [\n {\n \"id\": 982342,\n \"item_text\": \"Edit Suite 1 Grading\",\n \"item_uuid\": \"r2394\",\n \"ratescheme_id\": 989234,\n \"description\": \"Session booked between 10th Jan -> 12th Jan 2023\",\n \"quantity\": \"2.4\",\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"unit_buy_amount\": \"10.15\",\n \"tax\": true,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"discount\": \"20.00%\",\n \"buy_total\": \"200.00\",\n \"buy_total_fixed\": false,\n \"order\": 2,\n \"parent_group_id\": 234842\n }\n ],\n \"groups\": [\n {\n \"id\": 23425,\n \"name\": \"Video Editing Services\",\n \"description\": \"Includes all editing services\",\n \"order\": 2,\n \"hide_items\": true\n }\n ],\n \"status\": [\n {\n \"id\": 2\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\n }\n ],\n \"terms\": \"Expires in 30 days, subject to stock confirmation etc\",\n \"template_id\": 213,\n \"cloned_id\": 545647,\n \"reference\": \"QU-9893\",\n \"currency\": \"AUD\",\n \"created_sp_flag\": \"true\"\n}"
response = http.request(request)
puts response.read_body{
"success": {
"id": 1
}
}{
"error": {
"code": "404",
"message": "Requested resource was not found"
}
}Authorizations
Query Parameters
Body
application/json
Quote object that needs to be added
Standard quote model that returns most properties by default