Documentation

Getting started

Your customers

Declare each customer company and send its centres, without it having to do anything.

Your software says which customer each centre belongs to, and nobody at that company has to sign in to Qbox or give any access. You declare the company, ask for its token and send its centres with the usual operations.

The steps

  1. You ask for your software’s token, with your credentials alone.
  2. You declare the company, under your own identifier for it: PUT /companies/{companyId}.
  3. You ask for that company’s token, with your credentials and its identifier.
  4. You send its centres with that token, as Publish your centres explains.
  5. Its centres are published. On arrival, if the Qbox team has marked your software as trusted; otherwise, after a review. When the first one is published, we tell the company by email, once.

Declare a company

With your software’s token:

SOFTWARE_TOKEN=$(curl -s -X POST https://api.findqbox.com/connect/oauth/token \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -d grant_type=client_credentials | jq -r .access_token)

curl -X PUT https://api.findqbox.com/connect/v1/companies/c-1042 \
  -H "Authorization: Bearer $SOFTWARE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "legalName": "Trasteros Serrano SL",
    "taxId": "B87654323",
    "kind": "company",
    "tradeName": "Trasteros Serrano",
    "website": "https://trasterosserrano.example.com",
    "contact": { "name": "Marta Serrano", "email": "marta@trasterosserrano.example.com", "phone": "+34 612345678", "locale": "es" },
    "leadsTo": "both"
  }'
FieldWhat it is
legalNameIts legal name or, if self-employed, their first name and surnames
taxIdIts tax ID (in Spain, its NIF). It’s checked like the one of a signup in Qbox: if it isn’t valid, or doesn’t match kind, 422 invalid_company with invalid_tax_id
kindcompany or self_employed
tradeNameThe name its customers know it by, if not the legal one: the one the portal shows
websiteIts website, if it has one
contactWho to write to at the company: their name, their email and, optionally, their phone and their language (locale). Its notice goes there and, by email, its requests. Never shown on the portal
leadsToWhere its requests go: both, your webhook and its email (the default); software, only your webhook; email, only its email

By declaring a company you state that it is your customer, that its centres are its own and that it has told you to publish them, with their prices and availability, and to receive their requests. The terms for software say so.

Its status

statusWhat it meansWhat you do
activeYou can ask for its token and send its centresCarry on
waiting_operatorThe company already has an account in Qbox, so its centres aren’t published by themselves. We tell itAsk it for access, as The operator’s permission explains, and use its tokens
waiting_teamAnother software already sends that company, with the same tax ID, and yours isn’t trusted yet: the team looks at it. If it is, it never gets here: the latest integration wins, the company becomes yours and the other one’s centres come off the portalWait, and ask with GET /companies/{companyId}
closedThe company took its centres off the portal and wants no more publishedNothing: only the company opens it again
removedYou removed itDeclare it again, if it comes back

GET /companies/{companyId} says where one stands, with how many centres you have sent and how many are on the portal; GET /companies, all the ones you have declared. With DELETE /companies/{companyId} you stop sending a company: its centres come off the portal and its token stops working; if you declare it again, it comes back with what you send.

A company’s token

curl -X POST https://api.findqbox.com/connect/oauth/token \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -d grant_type=client_credentials \
  -d company=c-1042

It lasts an hour and carries no refresh_token: when it expires, you ask for another with your credentials. With it, every operation of its centres and its requests works, and its webhooks carry that connectionId. A company’s token doesn’t declare another company: that takes your software’s token.

What the company receives

  • One email, once, when its first centre is published: that it is on the portal through your software, where its requests arrive and a link to see its centres or take them off, without an account.
  • Its requests, by leadsTo. By email they go to the centre’s address (leadsEmail) or, if you don’t send one, to the company’s contact.
  • Nothing else. It doesn’t have to create an account or accept anything: it goes on running its centres from your software, which Qbox doesn’t replace. hasAccount only becomes true if someone at the company signs up in Qbox on their own; it then chooses there where its requests arrive, and you go on sending its centres as before.

We ask you for a switch per company in your own panel, for your team or your customer to turn on: your software is what connects, never someone who has to learn Qbox first.

If the company takes a centre off

It does so with the link in its notice, whenever it likes. You get facility.reviewed with decision: "withdrawn" and the reason in message, and the centre stays withdrawn: sending it again doesn’t bring it back to the portal, only the company does. If it takes them all off and asks for no more to be published, its status becomes closed, its tokens answer 403 connection_revoked and no other is given.

Online rental

With level 2 certified, at the centres of a company you declared your software turns it on and off, with onlineRental on the centre: nobody has to press anything in Qbox. The Qbox team can stop it at a centre; it then stays published, with “Request information”. Once the company has an account in Qbox (hasAccount), it stays as it was and from then on the company turns it on or off. See Online rental.

The limits

  • 100 new companies a day and 2,000 in all: 409 too_many_companies;
  • the same tax ID twice, under another identifier: 409 company_exists;
  • 2,000 centres per company, as per operator.

In testing

You declare test companies the same way, up to 20, and nobody receives anything. They all work on your “Test operator”, so their test centres are the same ones. Declaring one and asking for its token passes the company test of Certification.

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