Update Billable Item
curl --request PUT \
--url https://api.sonderplan.com/v2/billable-item \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 92834,
"name": "Aspera Upload",
"description": "Upload to Aspera (per TB)",
"unit_name": "Terabyte",
"buy_cost": "10.00",
"sell_cost": "20.00",
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
],
"currency": "AUD"
}
'import requests
url = "https://api.sonderplan.com/v2/billable-item"
payload = {
"id": 92834,
"name": "Aspera Upload",
"description": "Upload to Aspera (per TB)",
"unit_name": "Terabyte",
"buy_cost": "10.00",
"sell_cost": "20.00",
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
],
"currency": "AUD"
}
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({
id: 92834,
name: 'Aspera Upload',
description: 'Upload to Aspera (per TB)',
unit_name: 'Terabyte',
buy_cost: '10.00',
sell_cost: '20.00',
taxes: [{id: 3247, name: 'GST', rate: '10.00', total: '151.00'}],
custom_fields: [
{
id: 7823,
name: 'Type',
value: 'Video Editing',
value_id: 8973,
update_key: '2_1_7823'
}
],
currency: 'AUD'
})
};
fetch('https://api.sonderplan.com/v2/billable-item', 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/billable-item",
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([
'id' => 92834,
'name' => 'Aspera Upload',
'description' => 'Upload to Aspera (per TB)',
'unit_name' => 'Terabyte',
'buy_cost' => '10.00',
'sell_cost' => '20.00',
'taxes' => [
[
'id' => 3247,
'name' => 'GST',
'rate' => '10.00',
'total' => '151.00'
]
],
'custom_fields' => [
[
'id' => 7823,
'name' => 'Type',
'value' => 'Video Editing',
'value_id' => 8973,
'update_key' => '2_1_7823'
]
],
'currency' => 'AUD'
]),
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/billable-item"
payload := strings.NewReader("{\n \"id\": 92834,\n \"name\": \"Aspera Upload\",\n \"description\": \"Upload to Aspera (per TB)\",\n \"unit_name\": \"Terabyte\",\n \"buy_cost\": \"10.00\",\n \"sell_cost\": \"20.00\",\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\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 \"currency\": \"AUD\"\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.sonderplan.com/v2/billable-item")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 92834,\n \"name\": \"Aspera Upload\",\n \"description\": \"Upload to Aspera (per TB)\",\n \"unit_name\": \"Terabyte\",\n \"buy_cost\": \"10.00\",\n \"sell_cost\": \"20.00\",\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\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 \"currency\": \"AUD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sonderplan.com/v2/billable-item")
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 \"id\": 92834,\n \"name\": \"Aspera Upload\",\n \"description\": \"Upload to Aspera (per TB)\",\n \"unit_name\": \"Terabyte\",\n \"buy_cost\": \"10.00\",\n \"sell_cost\": \"20.00\",\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\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 \"currency\": \"AUD\"\n}"
response = http.request(request)
puts response.read_body{
"success": {
"id": 1
}
}{
"error": {
"code": "404",
"message": "Requested resource was not found"
}
}Billable Item
Update Billable Item
WRITE access to the SALES module is required to access this endpointPUT
/
v2
/
billable-item
Update Billable Item
curl --request PUT \
--url https://api.sonderplan.com/v2/billable-item \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 92834,
"name": "Aspera Upload",
"description": "Upload to Aspera (per TB)",
"unit_name": "Terabyte",
"buy_cost": "10.00",
"sell_cost": "20.00",
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
],
"currency": "AUD"
}
'import requests
url = "https://api.sonderplan.com/v2/billable-item"
payload = {
"id": 92834,
"name": "Aspera Upload",
"description": "Upload to Aspera (per TB)",
"unit_name": "Terabyte",
"buy_cost": "10.00",
"sell_cost": "20.00",
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
],
"currency": "AUD"
}
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({
id: 92834,
name: 'Aspera Upload',
description: 'Upload to Aspera (per TB)',
unit_name: 'Terabyte',
buy_cost: '10.00',
sell_cost: '20.00',
taxes: [{id: 3247, name: 'GST', rate: '10.00', total: '151.00'}],
custom_fields: [
{
id: 7823,
name: 'Type',
value: 'Video Editing',
value_id: 8973,
update_key: '2_1_7823'
}
],
currency: 'AUD'
})
};
fetch('https://api.sonderplan.com/v2/billable-item', 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/billable-item",
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([
'id' => 92834,
'name' => 'Aspera Upload',
'description' => 'Upload to Aspera (per TB)',
'unit_name' => 'Terabyte',
'buy_cost' => '10.00',
'sell_cost' => '20.00',
'taxes' => [
[
'id' => 3247,
'name' => 'GST',
'rate' => '10.00',
'total' => '151.00'
]
],
'custom_fields' => [
[
'id' => 7823,
'name' => 'Type',
'value' => 'Video Editing',
'value_id' => 8973,
'update_key' => '2_1_7823'
]
],
'currency' => 'AUD'
]),
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/billable-item"
payload := strings.NewReader("{\n \"id\": 92834,\n \"name\": \"Aspera Upload\",\n \"description\": \"Upload to Aspera (per TB)\",\n \"unit_name\": \"Terabyte\",\n \"buy_cost\": \"10.00\",\n \"sell_cost\": \"20.00\",\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\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 \"currency\": \"AUD\"\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.sonderplan.com/v2/billable-item")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 92834,\n \"name\": \"Aspera Upload\",\n \"description\": \"Upload to Aspera (per TB)\",\n \"unit_name\": \"Terabyte\",\n \"buy_cost\": \"10.00\",\n \"sell_cost\": \"20.00\",\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\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 \"currency\": \"AUD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sonderplan.com/v2/billable-item")
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 \"id\": 92834,\n \"name\": \"Aspera Upload\",\n \"description\": \"Upload to Aspera (per TB)\",\n \"unit_name\": \"Terabyte\",\n \"buy_cost\": \"10.00\",\n \"sell_cost\": \"20.00\",\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\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 \"currency\": \"AUD\"\n}"
response = http.request(request)
puts response.read_body{
"success": {
"id": 1
}
}{
"error": {
"code": "404",
"message": "Requested resource was not found"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
The ID of the billable item to update
Body
application/json
Billable item object that needs to be updated
Standard billable item model
Billable Item ID
Example:
92834
Name of the billable item
Example:
"Aspera Upload"
Description of the billable item
Example:
"Upload to Aspera (per TB)"
Name of the unit this is charged as
Example:
"Terabyte"
Total cost to you of the billable item
Example:
"10.00"
Total cost to your customer of the billable item
Example:
"20.00"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Currency code (three character format) that this invoice is in
Example:
"AUD"
Response
Successful Operation
Show child attributes
Show child attributes
⌘I