Record Costs and Split Them Across Cost Centers
Record a cost on a record, and optionally split it across cost centers.
Example use case
You receive a bill for a Booth Service and want to record the total or divide it between cost centers.
What you'll end up with
A saved cost on the Booth Service, with an allocation if you choose to send one.
Before you start
Have a workspace API key and identify a Booth Service you can edit. If you want to split the cost, confirm the cost centers in that workspace.
Good to know
Amounts are in the workspace currency. Enter numbers without currency symbols.
At a glance
Time to try
About 10 minutes
Effect on your data
Updates records
Endpoints
2
The runnable request immediately replaces the Booth Service's saved cost and allocation.
How it works
- Choose an existing Booth Service and an amount in your workspace currency.
- Send the amount to replace the saved total and allocation.
- To split the total, look up a cost center and send the complete breakdown instead.
Record the amount and allocation
The runnable example saves a single total in Step 2. Steps 1 and 3 show how to split the total if you need an allocation.
Step 1: Find the cost center for a split
Read the workspace's cost centers and choose the one that should receive part of the cost.
Manual example. This request is separate from the runnable example below.
curl -X GET "https://api.exhibitday.com/v1/references/cost_centers" -H "Authorization: Bearer YOUR_API_KEY"
Example response
[
{
"id": 12345,
"name": "Marketing"
}
]
Check: Use the selected cost center's id from your workspace. Use null for any share marked Not Specified.
Step 2: Record a single amount
Send cost with an amount to set the Booth Service total in your workspace currency.
curl -X PATCH "https://api.exhibitday.com/v1/events/booth_services" -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" --data-binary "{\"id\":12345,\"cost\":{\"amount\":125.50}}"
Example response
{
"status_code": 200,
"status": "OK",
"message": "Booth Service updated.",
"errors": []
}
Check: A successful update confirms the request was saved. A single total goes under Not Specified where cost centers are supported.
Step 3: Replace the amount with a split
Send the complete breakdown so ExhibitDay records the amount assigned to each cost center.
Manual example. This request is separate from the runnable example below.
curl -X PATCH "https://api.exhibitday.com/v1/events/booth_services" -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" --data-binary "{\"id\":12345,\"cost\":{\"amount\":1000,\"cost_center_breakdown\":[{\"cost_center_id\":12345,\"charge\":600},{\"cost_center_id\":null,\"charge\":400}]}}"
Example response
{
"status_code": 200,
"status": "OK",
"message": "Booth Service updated.",
"errors": []
}
Check: The charges add to 1,000. If you supply amount, it must equal the sum after rounding to cents.
Choose how to send the cost
| To do this | What to send |
|---|---|
| Set only the total | Send cost as a number or as an object with amount. Both put the total under Not Specified where cost centers are supported. |
| Split the total | Send the complete cost_center_breakdown. The API adds the charges. If you also send amount, it must match the sum after rounding to cents. Charges must be nonnegative, except on a Misc. credit (see below), and stay within the endpoint's limits. |
| Keep the saved cost | Omit cost on PATCH. |
| Clear the saved cost | Use 0 or an empty breakdown. JSON null clears the cost unless $ignore_params_with_empty_values=true tells the update to ignore it. Blank input follows the endpoint's empty-value rules. |
Try it
Before running the example
| Variable | What to put in it | Required? |
|---|---|---|
YOUR_API_KEY | Replace this placeholder in the example with your workspace API key. | Yes |
id | Replace 12345 in the request with the corresponding ID you can edit. | Yes |
cost | The sample uses 125.50. Replace it with the amount you want to save. | Yes |
Then copy the complete request example below in your language and run it when you are ready to save the cost.
Complete request examples
curl -X PATCH "https://api.exhibitday.com/v1/events/booth_services" -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d "{\"id\":12345,\"cost\":{\"amount\":125.50}}"
const response = await fetch("https://api.exhibitday.com/v1/events/booth_services", {
method: "PATCH",
headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ "id": 12345, "cost": {"amount":125.50} })
});
const data = await response.json();
console.log(response.status, data);
import requests
import json
response = requests.patch(
"https://api.exhibitday.com/v1/events/booth_services",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"id": 12345, "cost": json.loads("{\"amount\":125.50}")},
)
print(response.status_code, response.json())
using System;
using System.Text.Json;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
var response = await client.PatchAsync("https://api.exhibitday.com/v1/events/booth_services",
JsonContent.Create(new { id = 12345, cost = JsonDocument.Parse("{\"amount\":125.50}").RootElement.Clone() }));
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ExhibitDayExample {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.exhibitday.com/v1/events/booth_services"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\"id\":12345,\"cost\":{\"amount\":125.50}}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}
<?php
$curl = curl_init('https://api.exhibitday.com/v1/events/booth_services');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"id":12345,"cost":{"amount":125.50}}',
]);
$response = curl_exec($curl);
if ($response === false) {
throw new RuntimeException(curl_error($curl));
}
echo curl_getinfo($curl, CURLINFO_HTTP_CODE) . PHP_EOL . $response;
curl_close($curl);
require 'net/http'
require 'uri'
uri = URI('https://api.exhibitday.com/v1/events/booth_services')
request = Net::HTTP::Patch.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = '{"id":12345,"cost":{"amount":125.50}}'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(request)
end
puts "#{response.code} #{response.body}"
package main
import (
"fmt"
"io"
"log"
"net/http"
"strings"
)
func main() {
request, err := http.NewRequest("PATCH", "https://api.exhibitday.com/v1/events/booth_services", strings.NewReader("{\"id\":12345,\"cost\":{\"amount\":125.50}}"))
if err != nil { log.Fatal(err) }
request.Header.Set("Authorization", "Bearer YOUR_API_KEY")
request.Header.Set("Content-Type", "application/json")
response, err := (&http.Client{}).Do(request)
if err != nil { log.Fatal(err) }
defer response.Body.Close()
body, err := io.ReadAll(response.Body)
if err != nil { log.Fatal(err) }
fmt.Printf("%d %s\n", response.StatusCode, body)
}
Example response
{
"status_code": 200,
"status": "OK",
"message": "Booth Service updated.",
"errors": []
}
{
"status_code": 400,
"status": "Bad Request",
"message": "X-HTTP-Method-Override: hTTP method override is not supported.",
"error_code": "invalid_request",
"errors": [
"Send the documented HTTP method directly. X-HTTP-Method-Override cannot change a request's HTTP method."
],
"error_params": [
"X-HTTP-Method-Override"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "The Booth tab is hidden on this Event, so its records can't be added, changed or deleted. Show the tab in ExhibitDay before trying again.",
"error_code": "not_allowed",
"errors": [
"The Booth tab is hidden on this Event, so its records can't be added, changed or deleted. Show the tab in ExhibitDay before trying again."
],
"error_params": [
"event_id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "No API key was provided. Send your key in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "missing_api_key",
"errors": [
"Copy the key from Workspace Settings > API & Integrations > API Access in ExhibitDay."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "The API key is not valid. Check that you copied the whole key from Workspace Settings > API & Integrations > API Access, then send it in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "invalid_api_key",
"errors": [
"Check that you sent the whole key. If it was regenerated, use the current key from Workspace Settings > API & Integrations > API Access."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "api_access_disabled",
"errors": [
"Nothing was read or changed."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 404,
"status": "Not Found",
"message": "Booth Service not found. Invalid Booth Service ID: 12345.",
"error_code": "not_found",
"errors": [
"Booth Service not found. Invalid Booth Service ID: 12345."
],
"error_params": [
"id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 404,
"status": "Not Found",
"message": "Booth Service not found. Invalid Booth Service ID: 12345.",
"error_code": "not_found",
"errors": [
"Booth Service not found. Invalid Booth Service ID: 12345."
],
"error_params": [
"id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "This Booth Service changed since you read it; nothing was changed.",
"error_code": "record_changed",
"errors": [
"This Booth Service changed since you read it; nothing was changed."
],
"error_params": [
"expected_revision"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The Booth Service or its related scope changed. Read its current state and decide whether to retry; this request was rolled back.",
"error_code": "record_changed",
"errors": [
"The Booth Service or its related scope changed. Read its current state and decide whether to retry; this request was rolled back."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 429,
"status": "Too Many Requests",
"message": "Error 429 - Too Many Requests",
"error_code": "rate_limited",
"errors": [
"Error 429 - Too Many Requests"
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"An unexpected error occurred. Please try again later."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"Check whether your change was saved before trying again."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
Things to keep in mind
- Use
coston records that support it. For an Event's Booth Reservation, usebooth_reservation_coston the Event update. The oldercost_booth_reservationis a read-only summary. - A readable zero returns a cost object with amount 0. Check the record when the API returns null before treating the amount as zero.
- For Annual Miscellaneous Expenses, the breakdown applies to actual costs. The
planned_amountis a separate budget estimate. - For Assets, send only an amount.
- A Misc. Expense or Credit marked as a credit reads back with a negative amount and negative charges. Send either the positive values or the same negative values: both record the same credit. An expense refuses negative values.
- You can send a cost back exactly as you read it. Each breakdown line's
cost_centername is read-only: the API accepts it, ignores it and saves the line by itscost_center_id. If the name you send doesn't match that cost center's current name, the response carries a warning that explains what was saved. - If a breakdown names the same cost center more than once, its charges are combined into one share.
- If you send older fields with
cost, make sure both describe the same amount and allocation. - Update payment fields separately where supported. Adding an Invoice Attachment leaves the saved cost and payment status as they were.