Other
How do I connect a partner through the external API?
A partner is a delivery service, an aggregator or your own ordering website. Through the B52 external API the partner sees your menu and stop list and sends orders, and B52 passes them to the stations. The partner receives the order statuses back by itself.
The connection is made by the account owner. No programming is needed: you give the partner a key, and from there their developers work with the API themselves.
1. What the partner gets
With the key, the partner can:
- read the menu: groups, dishes, modifiers, prices;
- see the stop list and payment types;
- send delivery and pickup orders, change and cancel them;
- pass on customer details.
The key opens only your venue. Each partner has its own key, and you can revoke it at any time.
2. Open the «Integrations» section
- In the left menu, expand the «Setup» group.
- Select «Integrations». Only the owner sees this item.
At the top is the table of partners: «Partner», «Status», «Key» (the last characters) and «Last request». Below is the «Partner orders» block.
3. Connect a partner
- In the top right corner, click «Connect partner».
- In the «Partner name» field, enter a name, for example the name of the delivery service. This is how the partner is named in Back office and in reports.
- In the «Webhook URL» field, enter the address the partner gave you. It starts with https://. If there is no address yet, leave the field empty and fill it in later.
- The «Trust the partner's phone numbers» option is on by default. Turn it off if the partner passes masked phone numbers. Then customers will not be merged by phone.
- Click «Connect» at the bottom of the window.
B52 creates a payment type with the partner's name by itself. You can see it in the «Payment» section. For a partner order, the fiscal receipt is issued at the location when the order is closed.
4. Give the key to the partner
Right after connecting, the «Partner key» window opens, marked «Shown only once». It has three fields:
- «API key» — the access key, it starts with b52_;
- «Webhook secret» — the partner uses it to check that notifications came from B52;
- «API address» — the address the partner sends requests to.
- Click «Copy» to the right of the «API key» field and paste the key into an e-mail or message to the partner.
- Copy the «Webhook secret» the same way.
- Add the «API address» from the third field to the message.
- Click «Done» at the bottom of the window.
Once you close the window, you cannot see the key and the secret again, only replace them. Give them only to the person responsible for the connection at the partner. The key gives access to your orders.
The partner also needs to know: the key is sent in the X-Api-Key header of every request, and no more than 60 requests per minute can be sent.
5. Set up partner orders
The «Partner orders» block under the table applies to all partners.
- «Owner of partner orders» — the employee the order checks are issued to.
- «Standard order time, min» — the order time including delivery, when the dishes have no cooking time.
- «Travel time, min» — added to the cooking time of the dishes.
Fill in the fields and click «Save» at the bottom of the block.
6. Where orders are visible
A partner's orders come to the location's stations. They are started and closed on the station, like regular checks.
In Back office, when there is an active partner, the «Delivery» section appears in the «Setup» group. It holds the register of partner orders with search by number, phone and address. It is view only.
B52 itself sends order statuses, fiscal receipts and stop list changes to the partner's webhook URL.
7. Replace or revoke the key
Click the partner's row in the table. Its card opens.
- The key was lost or got into the wrong hands? In the «API key» block, click «Replace» and confirm. The old key stops working at once. The new one is shown once — give it to the partner.
- To close access, click «Revoke» next to it. A new key can be issued later with the «Issue key» button.
- The webhook secret is changed with the «Replace secret» button under the «Webhook URL» field.
- The name, webhook URL and phone option are edited in the card, then you click «Save».
8. Disable a partner
- Open the partner's card.
- At the bottom left, click «Disable partner» and confirm.
The key stops working, and the status in the table changes to «Disabled». You can bring the partner back with the «Enable partner» button in the same place. The key works again.
Still have questions?
Ask the AI assistant in Back office or contact B52 support.