Getting started
Quickstart
From zero to a centre in testing, step by step, with curl and C#.
From your test credentials to a centre in Madrid with its sizes, its units, its floor plan and a request, without publishing anything. Each step has its curl and its C# (.NET 8, with HttpClient and System.Text.Json, no packages), and each C# piece builds on the previous ones.
Before you start
- Your access, accepted. Request it from the Developers page. Your area is in Qbox, at
https://app.findqbox.com/software. - A return URL for the permission, in your area, under “Credentials”. In testing,
http://localhost:5000/qbox/callbackworks. On a Mac, port 5000 is usually taken by AirPlay: use another one, such as 5080, here and in the examples.
using System.Net;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
var http = new HttpClient(); // one for the whole app
const string Api = "https://api.findqbox.com/connect/v1";
const string TokenUrl = "https://api.findqbox.com/connect/oauth/token";
var clientId = Environment.GetEnvironmentVariable("QBOX_CLIENT_ID")!;
var clientSecret = Environment.GetEnvironmentVariable("QBOX_CLIENT_SECRET")!;
var redirectUri = "http://localhost:5000/qbox/callback";1. Your test credentials
In your area, under “Credentials”, create the test ones: a client_id (qt_test_…) and its client_secret (qts_test_…). The secret is only shown then: keep it on your server, never in an app or a browser.
2. Your software's token
With your credentials alone. It sees no centre: it's for GET /connections, the operators that have given you access, and POST /webhooks/test.
curl -X POST https://api.findqbox.com/connect/oauth/token \
-u "$CLIENT_ID:$CLIENT_SECRET" \
-d grant_type=client_credentials
curl https://api.findqbox.com/connect/v1/connections -H "Authorization: Bearer $SOFTWARE_TOKEN"3. Your “Test operator” gives you access
It's how a real operator will give it (The operator's permission): an authorization code with PKCE. On your server, create the code_verifier (43 to 128 characters) and its code_challenge (its SHA-256, in base64url without =), keep them with a state in the person's session, and send their browser to Qbox:
CODE_VERIFIER=$(openssl rand -base64 48 | tr '+/' '-_' | tr -d '=\n')
CODE_CHALLENGE=$(printf '%s' "$CODE_VERIFIER" | openssl dgst -sha256 -binary | openssl base64 | tr '+/' '-_' | tr -d '=\n')
echo "https://app.findqbox.com/oauth/authorize?response_type=code&client_id=$CLIENT_ID&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fqbox%2Fcallback&scope=facilities.write%20leads.read&state=madrid-1&code_challenge=$CODE_CHALLENGE&code_challenge_method=S256"In Qbox you sign in with your account and see your software, what it will be able to do and your “Test operator”. Choose where its requests go and give access. We return to your redirect_uri with code and state: check that the state is yours, and exchange the code within 5 minutes.
curl -X POST https://api.findqbox.com/connect/oauth/token \
-u "$CLIENT_ID:$CLIENT_SECRET" \
-d grant_type=authorization_code \
-d code=$CODE \
-d redirect_uri=http://localhost:5000/qbox/callback \
-d code_verifier=$CODE_VERIFIERThe response brings the operator's access_token, its refresh_token and its connectionId. The token lasts an hour: renew it with grant_type=refresh_token, and keep the new refresh_token each time.
4. Send a centre
With the operator's token, the whole centre. This is the smallest one that passes: its name, its address, its point on the map, its hours, its VAT and its deposit. Where its requests arrive by email is chosen by the operator in Qbox.
curl -X PUT https://api.findqbox.com/connect/v1/facilities/madrid-01 \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"version": "2026-11-08T09:00:00Z",
"name": "Trasteros Serrano Salamanca",
"address": { "street": "Calle de Serrano 120", "postalCode": "28006",
"city": "Madrid", "province": "Madrid", "country": "ES" },
"location": { "lat": 40.4365, "lng": -3.6862 },
"openingHours": { "kind": "daily", "opens": "07:00", "closes": "22:00" },
"pricesIncludeVat": true,
"policies": { "depositMonths": 1 }
}'It answers with its status: in_review, as a new centre. In testing nothing is published: in your area, under “Operators”, you see how its listing would look and can simulate the review.
5. Its sizes
One of storage units and one of lockers ("format": "locker"): two one above the other in a storage unit's height, a Twin. See Sizes, prices and units.
curl -X PUT https://api.findqbox.com/connect/v1/facilities/madrid-01/unit-types \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"version": "t-2026-11-08",
"unitTypes": [
{ "id": "M", "name": "Size M", "color": "#1E6B52" },
{ "id": "TW", "name": "Twin locker", "format": "locker" }
]
}'6. Its units
A storage unit with its measurements, and the Twin's two lockers: each one is its own unit, with its number and its level, and carries the floor area of its spot.
curl -X PUT https://api.findqbox.com/connect/v1/facilities/madrid-01/units \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"version": "u-2026-11-08T09:05:00Z",
"units": [
{ "id": "T-021", "number": "21", "areaM2": 2.6, "status": "available", "monthlyPrice": 49,
"unitTypeId": "M", "widthM": 2, "depthM": 1.3 },
{ "id": "T-101", "number": "101", "areaM2": 1.5, "status": "available", "monthlyPrice": 25,
"unitTypeId": "TW", "level": "lower" },
{ "id": "T-102", "number": "102", "areaM2": 1.5, "status": "occupied", "monthlyPrice": 22,
"unitTypeId": "TW", "level": "upper" }
]
}'And then each change, as it happens: the lower locker has just been rented.
curl -X PUT https://api.findqbox.com/connect/v1/facilities/madrid-01/units/T-101 \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"number": "101", "areaM2": 1.5, "status": "occupied", "monthlyPrice": 25, "unitTypeId": "TW", "level": "lower"}'7. Its floor plan
One SVG per floor, and in it each unit's shape with its data-unit-id. The Twin is one spot drawn as two shapes, one per locker, each with its own:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 160">
<g data-unit-id="T-021">
<rect x="20" y="20" width="160" height="104" fill="#fff" stroke="#1F1B18"/>
<text x="100" y="78" text-anchor="middle">21</text>
</g>
<g data-unit-id="T-101">
<rect x="200" y="20" width="60" height="120" fill="#fff" stroke="#1F1B18"/>
<text x="230" y="84" text-anchor="middle">101</text>
</g>
<g data-unit-id="T-102">
<rect x="260" y="20" width="60" height="120" fill="#fff" stroke="#1F1B18"/>
<text x="290" y="84" text-anchor="middle">102</text>
</g>
</svg>8. Your webhooks
In your area, under “Webhooks”, set your URL, press “Create the secret” and save it (whsec_…): without a secret no webhook goes out. The URL has to be public and https://: on your machine, use a tunnel (ngrok, Cloudflare Tunnel…). Check each webhook's signature before using it, with the body untouched. In ASP.NET Core, with the IsValid from Webhooks:
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
var webhookSecret = builder.Configuration["Qbox:WebhookSecret"]!;
app.MapPost("/qbox/webhooks", async (HttpRequest request) =>
{
using var reader = new StreamReader(request.Body);
var rawBody = await reader.ReadToEndAsync();
if (!IsValid(rawBody, request.Headers["Qbox-Signature"].ToString(), webhookSecret)) return Results.Unauthorized();
using var webhook = JsonDocument.Parse(rawBody);
var id = webhook.RootElement.GetProperty("id").GetString();
var type = webhook.RootElement.GetProperty("type").GetString();
// If you already have this id, it's a repeat. If not, save it, answer, and do the work afterwards.
return Results.Ok();
});
app.Run();To try it, “Test the signature” in your area, or POST /webhooks/test with your software's token:
curl -X POST https://api.findqbox.com/connect/v1/webhooks/test -H "Authorization: Bearer $SOFTWARE_TOKEN"9. A test request
In your area, under “Operators”, send a test request to your centre: it reaches you with lead.created, and with GET /leads too. Once it's in your software, mark it as handled:
curl "https://api.findqbox.com/connect/v1/leads?since=2026-11-08T00:00:00Z" -H "Authorization: Bearer $TOKEN"
curl -X PUT https://api.findqbox.com/connect/v1/leads/$LEAD_ID/status \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"status": "handled"}'Next
- Photos:
PUT /facilities/{facilityId}/photos/{photoId}, with the image as the body. See Floor plan and photos. - The daily list:
PUT /facilities, with all the operator's centres, at least once a day. See Publish your centres. - A test 429: with
Qbox-Simulate: rate_limited, and the same request after itsRetry-After, asPutJsondoes. See The test environment. - Keeping it all up to date: what you send, when, and what happens if something fails. See Keeping in sync and availability.
- Production: with every test passed, you go to production yourself from your area. See Going to production.
- Online rental: level 2, with a test rental from start to finish. See Online rental.