Update an existing usage entry
curl --request PATCH \
--url https://api.salesbricks.com/api/v2/usage \
--header 'Content-Type: application/json' \
--header 'X-SALESBRICKS-KEY: <api-key>' \
--data '
{
"transaction_id": "12345",
"value": 123,
"properties": {
"source": "api",
"notes": "Updated notes",
"region": "US"
}
}
'import requests
url = "https://api.salesbricks.com/api/v2/usage"
payload = {
"transaction_id": "12345",
"value": 123,
"properties": {
"source": "api",
"notes": "Updated notes",
"region": "US"
}
}
headers = {
"X-SALESBRICKS-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-SALESBRICKS-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_id: '12345',
value: 123,
properties: {source: 'api', notes: 'Updated notes', region: 'US'}
})
};
fetch('https://api.salesbricks.com/api/v2/usage', 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.salesbricks.com/api/v2/usage",
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([
'transaction_id' => '12345',
'value' => 123,
'properties' => [
'source' => 'api',
'notes' => 'Updated notes',
'region' => 'US'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-SALESBRICKS-KEY: <api-key>"
],
]);
$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.salesbricks.com/api/v2/usage"
payload := strings.NewReader("{\n \"transaction_id\": \"12345\",\n \"value\": 123,\n \"properties\": {\n \"source\": \"api\",\n \"notes\": \"Updated notes\",\n \"region\": \"US\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
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.patch("https://api.salesbricks.com/api/v2/usage")
.header("X-SALESBRICKS-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_id\": \"12345\",\n \"value\": 123,\n \"properties\": {\n \"source\": \"api\",\n \"notes\": \"Updated notes\",\n \"region\": \"US\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_id\": \"12345\",\n \"value\": 123,\n \"properties\": {\n \"source\": \"api\",\n \"notes\": \"Updated notes\",\n \"region\": \"US\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Usage entry updated successfully."
}Usage
Update a usage entry
Use this API to update an existing usage entry.
PATCH
/
usage
Update an existing usage entry
curl --request PATCH \
--url https://api.salesbricks.com/api/v2/usage \
--header 'Content-Type: application/json' \
--header 'X-SALESBRICKS-KEY: <api-key>' \
--data '
{
"transaction_id": "12345",
"value": 123,
"properties": {
"source": "api",
"notes": "Updated notes",
"region": "US"
}
}
'import requests
url = "https://api.salesbricks.com/api/v2/usage"
payload = {
"transaction_id": "12345",
"value": 123,
"properties": {
"source": "api",
"notes": "Updated notes",
"region": "US"
}
}
headers = {
"X-SALESBRICKS-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-SALESBRICKS-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_id: '12345',
value: 123,
properties: {source: 'api', notes: 'Updated notes', region: 'US'}
})
};
fetch('https://api.salesbricks.com/api/v2/usage', 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.salesbricks.com/api/v2/usage",
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([
'transaction_id' => '12345',
'value' => 123,
'properties' => [
'source' => 'api',
'notes' => 'Updated notes',
'region' => 'US'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-SALESBRICKS-KEY: <api-key>"
],
]);
$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.salesbricks.com/api/v2/usage"
payload := strings.NewReader("{\n \"transaction_id\": \"12345\",\n \"value\": 123,\n \"properties\": {\n \"source\": \"api\",\n \"notes\": \"Updated notes\",\n \"region\": \"US\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
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.patch("https://api.salesbricks.com/api/v2/usage")
.header("X-SALESBRICKS-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_id\": \"12345\",\n \"value\": 123,\n \"properties\": {\n \"source\": \"api\",\n \"notes\": \"Updated notes\",\n \"region\": \"US\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_id\": \"12345\",\n \"value\": 123,\n \"properties\": {\n \"source\": \"api\",\n \"notes\": \"Updated notes\",\n \"region\": \"US\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Usage entry updated successfully."
}To use this endpoint, ensure that you are using the
v2/usage API endpoint:https://api.salesbricks.com/api/v2/usageAuthorizations
Use your Salesbricks API key to authenticate requests.
Body
application/json
Response
Usage entry updated successfully.
Example:
"Usage entry updated successfully."
⌘I