Documentation

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 stepWhat the portal asks your software
Chooses a unitPOST /rentals: hold it for 20 minutes on all your channels and say what's paid today
Gives their details and verifies their emailPUT /rentals/{id}/tenant and GET /rentals/{id}/contract
Accepts the contractPOST /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 bankNothing: the bank notifies your server, as today, and you tell us with PUT /connect/v1/rentals/{rentalId}
Comes back to the portalGET /rentals/{id}, GET /rentals/{id}/access and, to download it, GET /rentals/{id}/signed-contract
Leaves, at any stepDELETE /rentals/{id}: the unit is free again
An online rental, from start to finish
  1. 1

    CustomerPortal

    Chooses the unit and the move-in day

  2. 2

    PortalYour software

    POST /rentals

    You hold it for 20 minutes and say what's paid today

  3. 3

    CustomerPortal

    Gives their details and verifies their email

  4. 4

    PortalYour software

    PUT /rentals/{id}/tenant and GET /rentals/{id}/contract

    Their details, and the contract for them to read

  5. 5

    CustomerPortal

    Accepts the contract

  6. 6

    PortalYour software

    POST /rentals/{id}/acceptance

    The proof that they accepted it

  7. 7

    CustomerPortal

    Presses "Pay"

  8. 8

    PortalYour software

    GET /rentals/{id} and POST /rentals/{id}/payment

    The signed order. From here, held for up to 30 minutes

  9. 9

    CustomerBank

    Pays on the operator's bank page

  10. 10

    BankYour software

    Your gateway's notification

    Only with it is the payment taken as made

  11. 11

    Your softwarePortal

    PUT /connect/v1/rentals/{rentalId} with paid

    And the unit, now rented: PUT …/units/{unitId}

  12. 12

    BankPortal

    The customer comes back to the portal

  13. 13

    PortalYour software

    GET /rentals/{id}/access and GET /rentals/{id}/signed-contract

    How 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 id of POST /rentals. Keep it: it's the {rentalId} of PUT /connect/v1/rentals/{rentalId}, what you tell us.
  • Yours, the id you reply to POST /rentals with (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 in GET and DELETE);
  • says whether it's a test or production call, with Qbox-Mode: test or live;
  • carries an Idempotency-Key in POST, PUT and DELETE: 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)FieldsWhat it is
rentfrom, to and amountThe rent for those days
depositamountThe deposit
extraconcept and amountAnything 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:

statusWhat it means
heldHeld, before they start paying
payingPaying on the gateway
paidPaid: it's theirs
payment_failedThe last attempt didn't go through: it stays held until heldUntil and can be tried again
expiredTime ran out without a payment
cancelledThe customer left it, or you cancelled it
refundedIt 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.

PUT /rentals/rnt_8f2c41/tenant
{
  "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.

POST /rentals/rnt_8f2c41/acceptance
{
  "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:

POST /rentals/rnt_8f2c41/payment → 200
{
  "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)WhenWhat the portal does
paidYour gateway notifies you that it has charged"It's yours!", with the contract and how to get in
payment_failedThe 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
expiredTime runs out without a paymentIt closes it: the unit is free again
cancelledYou cancel itIt closes it: the unit is free again
refundedThe 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.

GET /rentals/rnt_8f2c41/access
{
  "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

  1. Your software, certified for level 2.
  2. The centre, with onlineRental: true in PUT /facilities/{id}: it takes online payments with your software.
  3. 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:

  1. Your rental address, in your area: public and https://, like your webhooks', because our servers call it. On your machine, use a tunnel.
  2. A centre of your "Test operator" with onlineRental: true and free units with a price.
  3. 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:

TestHow it passes
What's paid today, and the unit heldReply to POST /rentals with the rental and its lines
A successful paymentPay and, with your gateway's notification, PUT /connect/v1/rentals/{rentalId} with paid
A payment that failsPay with a declined card and tell us with payment_failed
A late payment, refundedLet the time run out, pay afterwards, refund it and tell us with refunded
LeavingLeave a rental at any step: you get DELETE /rentals/{id}, and reply with the rental
How to get inAfter a payment, reply to GET /rentals/{id}/access
The unit, sent as rentedAfter 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

codeHTTPWhen
unit_not_available409The unit is no longer free, or can't be held
online_rental_disabled403That centre doesn't take online payments with your software
tenant_email_mismatch409The document belongs to one of the operator's customers with another email
contract_changed409The accepted contract is no longer the current one
access_not_ready409There's no PIN or QR code yet
invalid_state409Not possible in its current state: already paid, already left…
invalid_tenant and invalid_date422A value that isn't valid

Questions? Write to us at team@findqbox.com.