Level 2 · Online rental
Online rental
Level 2: customers rent on the portal and pay on the operator's gateway, with what your software decides.
With level 2, customers rent on the centre's listing and move in the same day. The portal runs the journey and asks your software in real time; the customer only leaves the portal to pay, on the operator's usual bank payment page (with Redsys, its redirect POS), and comes back.
Your software decides and charges: the price and what's paid today, holding the unit while they pay, the contract, the order signed with the operator's key, the bank's notification and the card reference for the monthly payments, and the PIN and QR code. Qbox never sees a card or a gateway key, and never touches the money: it goes straight to the operator's account.
The journey
| Customer's step | What the portal asks your software |
|---|---|
| Chooses a unit | POST /rentals: hold it for 20 minutes on all your channels and say what's paid today |
| Gives their details and verifies their email | PUT /rentals/{id}/tenant and GET /rentals/{id}/contract |
| Accepts the contract | POST /rentals/{id}/acceptance, with proof of acceptance |
| Clicks "Pay" | POST /rentals/{id}/payment: the signed order, and the unit held for up to 30 minutes |
| Pays at the bank | Nothing: the bank notifies your server, as today, and you tell us with PUT /connect/v1/rentals/{rentalId} |
| Comes back to the portal | GET /rentals/{id}, GET /rentals/{id}/access and, to download it, GET /rentals/{id}/signed-contract |
| Leaves, at any step | DELETE /rentals/{id}: the unit is free again |
- 1
CustomerPortal
Chooses the unit and the move-in day
- 2
PortalYour software
POST /rentalsYou hold it for 20 minutes and say what's paid today
- 3
CustomerPortal
Gives their details and verifies their email
- 4
PortalYour software
PUT /rentals/{id}/tenantandGET /rentals/{id}/contractTheir details, and the contract for them to read
- 5
CustomerPortal
Accepts the contract
- 6
PortalYour software
POST /rentals/{id}/acceptanceThe proof that they accepted it
- 7
CustomerPortal
Presses "Pay"
- 8
PortalYour software
GET /rentals/{id}andPOST /rentals/{id}/paymentThe signed order. From here, held for up to 30 minutes
- 9
CustomerBank
Pays on the operator's bank page
- 10
BankYour software
Your gateway's notification
Only with it is the payment taken as made
- 11
Your softwarePortal
PUT /connect/v1/rentals/{rentalId}withpaidAnd the unit, now rented:
PUT …/units/{unitId} - 12
BankPortal
The customer comes back to the portal
- 13
PortalYour software
GET /rentals/{id}/accessandGET /rentals/{id}/signed-contractHow to get in, and the signed contract
The two identifiers
Each rental has two, and each goes one way:
- Ours, a UUID: it arrives in the
idofPOST /rentals. Keep it: it's the{rentalId}ofPUT /connect/v1/rentals/{rentalId}, what you tell us. - Yours, the
idyou reply toPOST /rentalswith (rnt_8f2c41): it's the{id}of every call we make to you afterwards,/rentals/{id}/….
Your rental address
Set it in your area, under "Online rental": for example, https://api.your-software.example/qbox/v1. Calls append /rentals and the rest. Each one:
- is signed like webhooks:
Qbox-Signature, with your webhook secret (the body is empty inGETandDELETE); - says whether it's a test or production call, with
Qbox-Mode: testorlive; - carries an
Idempotency-KeyinPOST,PUTandDELETE: same key, same response, without doing it twice; - waits 8 seconds at most for your reply: there's a customer waiting;
- and understands your errors like ours:
{"error": {"code": "…", "message": "…"}}, with its HTTP status.
What's paid today
POST /rentals sends {id, connectionId, facilityId, unitId, startDate, locale}. Keep the id: it's ours, the one in PUT /connect/v1/rentals/{rentalId}. Check the unit is still free, hold it and reply with the rental. If it's no longer free, 409 unit_not_available.
You calculate what's paid today; the portal shows it line by line without calculating anything. Almost every operator charges the rest of the month and the full deposit today, and then on the 1st of each month:
{
"id": "ba10b121-762e-444d-a2bb-5642c1ff7bb1",
"connectionId": "6f1c2a7e-0b1d-4c8e-9a51-2d6f0e7b4c10",
"facilityId": "madrid-01",
"unitId": "T-021",
"startDate": "2026-10-26",
"locale": "es"
}Line (kind) | Fields | What it is |
|---|---|---|
rent | from, to and amount | The rent for those days |
deposit | amount | The deposit |
extra | concept and amount | Anything else charged today: a padlock, insurance… |
Amounts are final, with VAT. total is what's paid today, and heldUntil, until when you hold it: the portal never shows it held for more than 20 minutes, or more than 30 from when they start paying. You reply with this same shape to every call that returns the rental, with its status at that moment:
status | What it means |
|---|---|
held | Held, before they start paying |
paying | Paying on the gateway |
paid | Paid: it's theirs |
payment_failed | The last attempt didn't go through: it stays held until heldUntil and can be tried again |
expired | Time ran out without a payment |
cancelled | The customer left it, or you cancelled it |
refunded | It was paid when it was no longer theirs, and refunded |
The customer's details
PUT /rentals/{id}/tenant sends their details, with the email already verified with a code. For a company, kind is company, name its legal name and representative whoever signs on its behalf. Reply with the rental, as in POST /rentals: if their details change what's paid, the portal shows the new figures.
{
"kind": "person",
"name": "Ana García López",
"documentType": "nif",
"documentNumber": "12345678Z",
"documentCountry": "ES",
"email": "ana.garcia@example.com",
"phone": "+34 612345678",
"address": {
"street": "Calle de Alcalá 45, 2.º B",
"postalCode": "28014",
"city": "Madrid",
"region": "Madrid",
"country": "ES"
},
"representative": null
}documentType is nif (a DNI, a NIE or a CIF, with its check letter already verified), passport or other. If that document belongs to a customer the operator already has under another email, 409 tenant_email_mismatch.
The contract
GET /rentals/{id}/contract replies {version, title, text}: the full text, in Spanish, with its general terms inside, with the rental's details and without a number or date, which are added on payment. Paragraphs are separated by a blank line; from 200 to 200,000 characters.
On acceptance, POST /rentals/{id}/acceptance sends you the proof: the fingerprint of the text they read (textSha256: the SHA-256, in hexadecimal, of text in UTF-8, without leading or trailing spaces and with line breaks as \n), the version, the time, the email, the IP, the browser and earlyStart, which is always false. Keep it with the contract. If the contract has changed since they read it, 409 contract_changed.
{
"textSha256": "ddf83bc5d4eab3517556c1fe78c5ae9ca1470a87f74906e1a74239d74c548a85",
"version": "contract-2026-11",
"acceptedAt": "2026-10-26T17:28:30Z",
"email": "ana.garcia@example.com",
"ip": "203.0.113.24",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 26_0 like Mac OS X)…",
"earlyStart": false
}The payment
POST /rentals/{id}/payment sends {returnUrls: {ok, ko}}, the portal pages the customer comes back to. Prepare the order with the operator's key, set ok and ko as its return pages (with Redsys, URLOK and URLKO; only accept those starting with https://www.quetrastero.com/) and reply where to take them:
{
"redirect": {
"method": "POST",
"url": "https://gateway.operators-bank.example/pay",
"fields": {
"Ds_SignatureVersion": "HMAC_SHA256_V1",
"Ds_MerchantParameters": "eyJEU19NRVJDSEFOVF9BTU9VTlQi…",
"Ds_Signature": "Kz3rQ1v8…"
}
},
"heldUntil": "2026-10-26T18:04:00Z"
}A payment is made when your gateway notifies your server, never when the browser comes back.
With that notification you turn the rental into a contract, keep the card reference for the monthly payments and tell us, with the token of the centre's operator (in tests, your "Test operator"):
curl -X PUT https://api.findqbox.com/connect/v1/rentals/$RENTAL_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"status": "paid", "contractNumber": "TS-2026-0418"}'The response says where the rental stands on the portal: open, completed, expired, cancelled or refunded.
What you tell us (status) | When | What the portal does |
|---|---|---|
paid | Your gateway notifies you that it has charged | "It's yours!", with the contract and how to get in |
payment_failed | The card is declined, or the customer doesn't finish | "The payment didn't go through": the unit stays held until heldUntil and they can try again |
expired | Time runs out without a payment | It closes it: the unit is free again |
cancelled | You cancel it | It closes it: the unit is free again |
refunded | The payment arrives when the unit no longer belonged to that rental, and you refund it | "Your payment has been refunded" |
If you don't tell us, the portal asks with GET /rentals/{id} when the customer comes back and every two minutes while it's still open.
After the payment: the unit
While the rental is open, the portal shows the unit as reserved without you sending anything. When you tell us paid, it goes on reserving it until your software sends that unit: only then does the portal know how it stands. So when you turn it into a contract, send the unit as rented too, just as when it's rented at your office:
curl -X PUT https://api.findqbox.com/connect/v1/facilities/madrid-01/units/T-021 \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"number": "21", "areaM2": 2.6, "status": "occupied", "monthlyPrice": 49, "unitTypeId": "M"}'Until you send it, the portal goes on reserving it by itself and nobody else can rent it. It's a safety net, not the way to do it: in the search results it may still count as free. That's why sending it is one of the certification's tests.
If the rental ends unpaid (they leave it, time runs out), send nothing: the portal shows it again as you had it. See Keeping in sync and availability.
How to get in
Once paid, GET /rentals/{id}/access replies {pin, qr, app, instructions}, each optional; if it's not ready yet, 409 access_not_ready. The portal shows it on "It's yours!" and doesn't store it: it asks you each time it shows it.
{
"pin": "318604927",
"qr": "QBX-318604927",
"app": { "name": "Kuartus", "email": "ana.garcia@example.com" },
"instructions": "Key in the PIN at the street door and at your corridor's."
}The pin is 4 to 12 digits; qr, the text the code carries, which the portal draws; app, the app that opens the door and the email they sign in to it with.
GET /rentals/{id}/signed-contract returns the signed contract as a PDF, which the customer also gets by email. It reaches them as it is, so your seal or signature still holds; that's why it can't carry JavaScript, actions that open something outside, forms that run or attached files: if it does, the portal doesn't deliver it.
What turns on online rental at a centre
- Your software, certified for level 2.
- The centre, with
onlineRental: trueinPUT /facilities/{id}: it takes online payments with your software. - It is turned on centre by centre. At the centres of a company you declared yourself, your software turns it on with
onlineRental; if the company has an account in Qbox, it turns it on there, under "Connect your software".
The centre also has to be published and have free units with a price. Its listing then shows "Rent and move in today".
Tests and turning it on
A test rental needs three things, all with your test credentials:
- Your rental address, in your area: public and
https://, like your webhooks', because our servers call it. On your machine, use a tunnel. - A centre of your "Test operator" with
onlineRental: trueand free units with a price. - That centre, published: under "Operators", open the centre and simulate the review with "Publish it".
Then, under "Online rental", "Start a test rental": the portal takes you through the whole journey, like a customer, to your software's test gateway. Its payment page can be on http://localhost, because your browser is what goes to it. Pay with its test cards: nothing is charged, and the rental's emails say «[Prueba]». The seven tests pass on their own:
| Test | How it passes |
|---|---|
| What's paid today, and the unit held | Reply to POST /rentals with the rental and its lines |
| A successful payment | Pay and, with your gateway's notification, PUT /connect/v1/rentals/{rentalId} with paid |
| A payment that fails | Pay with a declined card and tell us with payment_failed |
| A late payment, refunded | Let the time run out, pay afterwards, refund it and tell us with refunded |
| Leaving | Leave a rental at any step: you get DELETE /rentals/{id}, and reply with the rental |
| How to get in | After a payment, reply to GET /rentals/{id}/access |
| The unit, sent as rented | After a payment, send that unit with occupied: PUT …/units/{unitId}, or the whole list |
"Live calls" shows each call from the portal to your software and each PUT of yours, with its result and time. Once they all pass and your software is in production, you turn it on yourself from your area. Every call and its fields are in the API reference, under its webhooks.
Your software's errors
code | HTTP | When |
|---|---|---|
unit_not_available | 409 | The unit is no longer free, or can't be held |
online_rental_disabled | 403 | That centre doesn't take online payments with your software |
tenant_email_mismatch | 409 | The document belongs to one of the operator's customers with another email |
contract_changed | 409 | The accepted contract is no longer the current one |
access_not_ready | 409 | There's no PIN or QR code yet |
invalid_state | 409 | Not possible in its current state: already paid, already left… |
invalid_tenant and invalid_date | 422 | A value that isn't valid |