Search API documentation

Type to search the API docs.

Check Asset Availability Before You Reserve

Check whether a Capital Asset can be reserved for your dates, or how much Collateral is available on checkout day.

Example use case

You're preparing for a trade show. You need a display monitor from January 14 through January 17 and 100 tote bags from the warehouse on January 14.

What you'll end up with

The monitor's availability under its reservation policy and a count of the tote bags available on checkout day.

Before you start

Have a workspace API key and the IDs of two Active Assets your workspace owns or that are currently shared with it. In ExhibitDay, find them on the Assets page in the top menu.

Good to know

A Single-Unit Capital Asset tracks one item, like a display monitor. A Collateral / Multi-Quantity Item tracks units, like tote bags or brochures. You check them in different ways.

At a glance

Time to try

About 5 minutes

Effect on your data

Read-only

Endpoints

1

The check leaves reservations and inventory unchanged. ExhibitDay checks availability and access again when you save a reservation.

How it works

  1. For the Capital Asset, supply the inclusive checkout and return dates. Read the availability result and its reservation policy.
  2. For the Collateral item, supply the checkout date. Compare your planned quantity with the count at the Storage Location you'll use.

Check the monitor and tote bags

Step 1: Check a Capital Asset for a period

Send asset_type_id=1 with start_date and end_date. Use the dates the monitor will be out of storage, including setup or return days as needed.

curl -X GET "https://api.exhibitday.com/v1/assets/availability?asset_id=12345&asset_type_id=1&start_date=2030-01-14&end_date=2030-01-17" -H "Authorization: Bearer YOUR_API_KEY"

Example response (shortened)

{
  "asset_reservation_policy_id": 2,
  "is_available_under_reservation_policy": true,
  "overlapping_reservation_count": 1,
  "policy_conflict_count": 0
}

Check: The existing reservation returns the monitor on January 14, when you want to check it out. The dates overlap, but the Moderate policy allows that day. Use is_available_under_reservation_policy to decide whether the proposed period passes the check. Coordinate any same-day handoff with the team.

Capital Asset reservation policyWhich days an existing reservation blocks
1 · StrictEvery day from checkout through return, including both dates.
2 · ModerateOnly the days between checkout and return. A one- or two-day reservation blocks no days.
3 · LiberalNo days. Check the overlap count and coordinate with the people using the Asset.

To see the setting in ExhibitDay, open the Capital Asset and select Reservation Policy.

Step 2: Check a Collateral quantity on checkout day

Send asset_type_id=2 and as_of_date for the day you need the tote bags. Leave out start_date and end_date. Collateral uses the Liberal reservation policy, so compare the quantity in storage with what you need. If you omit as_of_date, the API uses today in your workspace time zone.

curl -X GET "https://api.exhibitday.com/v1/assets/availability?asset_id=67890&asset_type_id=2&as_of_date=2030-01-14" -H "Authorization: Bearer YOUR_API_KEY"

Example response (shortened)

{
  "as_of_date": "2030-01-14",
  "quantity_available_in_storage": 125,
  "storage_locations": [
    { "id": 2001, "name": "Main Warehouse", "quantity_available_in_storage": 80 },
    { "id": 2002, "name": "Office", "quantity_available_in_storage": 45 }
  ]
}

Check: There are 125 bags across both locations, but only 80 at the Main Warehouse. Plan for the remaining 20 before you reserve. To check the warehouse on its own, add storage_location_id=2001. Use a Storage Location that belongs to the workspace that owns the Asset.

Try it

Before running the example

VariableWhat to put in itRequired?
EXHIBITDAY_API_KEYYour workspace API key.Yes
EXHIBITDAY_CAPITAL_ASSET_IDThe Capital Asset ID.Yes
EXHIBITDAY_CAPITAL_START_DATEThe proposed Capital checkout date in YYYY-MM-DD format.Yes
EXHIBITDAY_CAPITAL_RETURN_DATEThe proposed Capital return date in YYYY-MM-DD format, on or after checkout.Yes
EXHIBITDAY_COLLATERAL_ASSET_IDThe Collateral item ID.Yes
EXHIBITDAY_COLLATERAL_CHECKOUT_DATEThe day you need the units, in YYYY-MM-DD format.Yes

The complete example runs both checks and prints the two responses. To check just one type, use the corresponding request above.

Bash

export EXHIBITDAY_API_KEY='YOUR_API_KEY'
export EXHIBITDAY_CAPITAL_ASSET_ID='12345'
export EXHIBITDAY_CAPITAL_START_DATE='2030-01-14'
export EXHIBITDAY_CAPITAL_RETURN_DATE='2030-01-17'
export EXHIBITDAY_COLLATERAL_ASSET_ID='67890'
export EXHIBITDAY_COLLATERAL_CHECKOUT_DATE='2030-01-14'

PowerShell

$env:EXHIBITDAY_API_KEY = 'YOUR_API_KEY'
$env:EXHIBITDAY_CAPITAL_ASSET_ID = '12345'
$env:EXHIBITDAY_CAPITAL_START_DATE = '2030-01-14'
$env:EXHIBITDAY_CAPITAL_RETURN_DATE = '2030-01-17'
$env:EXHIBITDAY_COLLATERAL_ASSET_ID = '67890'
$env:EXHIBITDAY_COLLATERAL_CHECKOUT_DATE = '2030-01-14'

Complete example program

Code Samples
#!/usr/bin/env bash
# Requires Bash, curl and Python3. No API key is written into the program.
python3 - <<'EXHIBITDAY_PY'
# Python 3; standard library only. Set EXHIBITDAY_API_KEY before running.
import http.client
import json
import os
import re
import time
import urllib.error
import urllib.parse
import urllib.request

BASE = "https://api.exhibitday.com/v1"
SPEC = json.loads("{\"preserveNumbers\":true,\"requests\":{\"capital\":{\"method\":\"GET\",\"path\":\"/assets/availability\"},\"collateral\":{\"method\":\"GET\",\"path\":\"/assets/availability\"}}}")
API_KEY = os.environ["EXHIBITDAY_API_KEY"]
if any(ord(char) < 32 or ord(char) > 126 for char in API_KEY):
    raise RuntimeError("Use the API key as one ASCII header value without control characters")
if not API_KEY.strip():
    raise RuntimeError("Set EXHIBITDAY_API_KEY")

def decode_json(text):
    if SPEC["preserveNumbers"]:
        # Quote JSON NUMBER tokens, never text inside a JSON string, to keep CSV decimals exact.
        text = re.sub(r'"(?:\\.|[^"\\])*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?',
                      lambda m: m[0] if m[0].startswith('"') else json.dumps(m[0]), text)
    return json.loads(text)

from pathlib import Path
# This terminal version uses curl for HTTP and Python's standard library for JSON/CSV.
import subprocess
import tempfile

def transport(method, url, headers, data):
    with tempfile.TemporaryDirectory(prefix="exhibitday-guide-") as directory:
        folder = Path(directory)
        # curl may leave no output file for a valid bodyless304 response.
        (folder / "body").write_bytes(b"")
        command = ["curl", "--disable", "--silent", "--show-error", "--request", method, "--url", url,
                   "--max-time", "30", "--dump-header", str(folder / "headers"),
                   "--output", str(folder / "body"), "--write-out", "%{http_code}"]
        for name, value in headers.items():
            command += ["--header", name + ": " + value]
        if data is not None:
            (folder / "request").write_bytes(data)
            command += ["--data-binary", "@" + str(folder / "request")]
        result = subprocess.run(command, capture_output=True, text=True)
        if result.returncode:
            raise urllib.error.URLError(result.stderr.strip())
        response_headers = {}
        blocks = (folder / "headers").read_text(encoding="iso-8859-1").replace("\r\n", "\n").strip().split("\n\n")
        for line in blocks[-1].splitlines()[1:]:
            name, separator, value = line.partition(":")
            if separator:
                response_headers[name] = value.strip()
        return int(result.stdout), (folder / "body").read_bytes(), response_headers


class ApiError(RuntimeError):
    """An API error response. Branch on error_code (and status), never on the message text.
    uncertain is True when a PATCH or DELETE got no response or a server error: it may or may not have been applied."""
    def __init__(self, status, body, uncertain=False):
        self.status = status
        self.uncertain = uncertain
        self.error_code = body.get("error_code") if isinstance(body, dict) else None
        super().__init__(f"{body.get('error_code')} {body.get('error_params')}: {body.get('errors')} (request {body.get('request_id')})"
                         if isinstance(body, dict) else "HTTP " + str(status) if status else "No response")

def call(name, params=None, body=None, key=None):
    route = SPEC["requests"][name]
    headers = {"Authorization": "Bearer " + API_KEY, "Accept": "application/json"}
    if route["method"] == "POST":
        if not key: raise RuntimeError("Save a create key before sending POST")
        headers["Idempotency-Key"] = key
    data = None if body is None else json.dumps(body).encode("utf-8")
    if data is not None:
        headers["Content-Type"] = "application/json"
    query = urllib.parse.urlencode(params or {})
    url = BASE + route["path"] + ("?" + query if query else "")
    # Only GET has automatic retries in this workflow. A PATCH or DELETE that got no response or a
    # server error is never resent blindly: it may already have been applied, so the caller reads the record first.
    resend = route["method"] == "GET"
    for attempt in range(5):
        try:
            status, raw, response_headers = transport(route["method"], url, headers, data)
        except (urllib.error.URLError, TimeoutError, ConnectionError, http.client.HTTPException):
            if not resend:
                raise ApiError(0, None, uncertain=True)
            if attempt == 4:
                raise
            time.sleep(2 ** attempt)
            continue
        response_headers = {k.lower(): v for k, v in response_headers.items()}
        result = None
        if status != 304 and raw:
            try:
                result = decode_json(raw.decode("utf-8"))
            except (ValueError, UnicodeError):
                if status < 400:
                    raise RuntimeError("Expected a JSON success response")
        if status >= 500 and not resend:
            raise ApiError(status, result, uncertain=True)
        retry = resend and (status == 429 or status >= 500)
        if retry:
            if attempt == 4:
                raise RuntimeError("Retry limit reached; check the request outcome before starting a new create")
            delay = response_headers.get("retry-after", str(2 ** attempt))
            time.sleep(max(0, float(delay)))
            continue
        if status >= 400:
            raise ApiError(status, result)
        return {"status": status, "body": result, "headers": response_headers, "raw": raw}
    raise RuntimeError("Retry limit reached")


def positive_id(value):
    if not re.fullmatch(r"[1-9][0-9]*", value) or int(value) > 9223372036854775807: raise RuntimeError("Use a positive record ID")
    return value

def print_value(value):
    print(value if isinstance(value, str) else json.dumps(value, ensure_ascii=False))

def required(name):
    value = os.environ.get(name)
    if value is None or not value.strip(): raise RuntimeError("Set " + name)
    return value


def main():
    capital_id = positive_id(required("EXHIBITDAY_CAPITAL_ASSET_ID"))
    collateral_id = positive_id(required("EXHIBITDAY_COLLATERAL_ASSET_ID"))
    capital_start = required("EXHIBITDAY_CAPITAL_START_DATE")
    capital_return = required("EXHIBITDAY_CAPITAL_RETURN_DATE")
    collateral_date = required("EXHIBITDAY_COLLATERAL_CHECKOUT_DATE")
    capital_response = call("capital", {"asset_id": capital_id, "asset_type_id": "1", "start_date": capital_start, "end_date": capital_return}, None, None)
    print_value(capital_response["raw"].decode("utf-8"))
    collateral_response = call("collateral", {"asset_id": collateral_id, "asset_type_id": "2", "as_of_date": collateral_date}, None, None)
    print_value(collateral_response["raw"].decode("utf-8"))


if __name__ == "__main__":
    main()

EXHIBITDAY_PY

Example response

{
  "asset_id": 12345,
  "asset_type_id": 1,
  "is_advisory": true,
  "is_asset_owned_by_this_workspace": true,
  "start_date": "2030-01-14",
  "end_date": "2030-01-17",
  "as_of_date": null,
  "asset_reservation_policy_id": 2,
  "is_available_under_reservation_policy": true,
  "overlapping_reservation_count": 1,
  "policy_conflict_count": 0,
  "is_requested_period_unchanged": false,
  "quantity_available_in_storage": null,
  "projected_future_balance": null,
  "storage_locations": null
}
Note: This is the full Capital Asset response from Step 1.

The curl example uses Bash, curl and Python 3. Node.js needs version 18 or later (save as .cjs). Python uses its standard library. C# needs a .NET 8 console project (Program.cs). Java needs Java 11 or later and Gson 2.14.0 (Main.java). PHP needs PHP 8.1 or later with cURL. Ruby 3.1 or later and Go 1.18 or later use their standard libraries.

Things to keep in mind

  • Collateral availability includes inventory adjustments, Event checkouts and scheduled returns. A scheduled return adds units back from its return date. Confirm physical stock when your plan depends on that return. Negative quantities are returned as recorded.
  • projected_future_balance includes future inventory movements. Use quantity_available_in_storage with your chosen as_of_date for the checkout decision.
  • When editing an existing reservation, pass its accessible ID in excluded_reservation_id. This excludes the reservation's current allocation. An unchanged Capital period can still pass under the existing save rule. For Collateral, both its checkout and its scheduled return are excluded.

If a request fails

For a validation error, check the Asset type and its date fields. If the Asset can't be found, check that it's Active and still owned by or shared with the workspace for the key you're using.