How it works

The three parties, the difference between your keys and your connections, the scopes partners grant, the modules you serve, and the life of a connection.

Three parties#

PartyWhoRole
LocaloyRuns the Open Network.Registers your company as a Technology Provider and issues your keys. Decides which scopes you may ask for and which modules you serve. Can suspend you.
PartnerA business on Localoy that uses your platform.Connects you from its Partner Portal and chooses the scopes it grants. Can pause you, change your access or disconnect you at any time.
Technology ProviderYour company.Claims the partner's connection code, then calls the Open Network API for that partner, within what it granted.

The partner stays in charge of its own account. Every call you make for a partner appears on its Open Network → Activity page, under your name.

Keys and connections#

Your keyA connection
AnswersWho is calling: your company.For whom: one partner, and what it allowed.
Created byLocaloy, when you ask for it.The partner's consent — you claim the code it generates.
Sent asAuthorization: Bearer ltp_…X-Localoy-Partner-Id: {partnerId}
How manyUp to 5 live keys per environment.One live connection per partner.
Ends whenLocaloy revokes it, or it expires.The partner disconnects you.

A call for a partner needs both. Your key alone can do nothing for a partner, and a partnerId alone is only an identifier.

A connection has no environment. It is between your company and the partner, whichever key claimed it; the key you send on each call decides whether that call runs in the sandbox or in production. See Sandbox and production.

Scopes#

A partner grants you scopes. Four are the scopes of the Open Network API. The fifth, BOOKINGS, exists only for Technology Providers: a partner's own API key cannot hold it.

The partner reads the text below, word for word, when it chooses. Two scopes share customers' personal data, and their text says so.

ScopeThe partner readsPersonal dataIt lets you
REGISTRATIONAdd items to your catalogue. Create catalogue items on Localoy for you, and link them to your tickets, activities or tables.NoCreate items.
UPDATEChange and remove its items. Update the price, stock and details of the items it created for you, or remove them. It cannot touch items you or another provider created.NoUpdate and delete your items.
INVENTORYRead its items and your bookables. See the catalogue items it manages for you, and the tickets, activities and tables it can link them to.NoList and read your items; list bookables.
PAYMENTHandle payments for your bookings. Read payment sessions — including the customer's name, phone and email — and report whether a customer paid or was refunded.YesRead sessions, report results and record refunds.
BOOKINGSSee your bookings. Receive your bookings as they happen, including each customer's name, phone and email.YesReceive booking.* webhooks; with PAYMENT, payment.updated.

Localoy decides which of the five you may ask for. The partner sees only those, ticks the ones it grants, and can add or remove scopes later without a new code.

Ask only for what your integration uses, and tell partners which scopes you need before they connect: they choose from the list, and you cannot tick anything for them.

Effective scopes#

What you can do for a partner at any moment is its effective scopes: the scopes it granted that Localoy still allows you.

Rule
effective scopes = scopes the partner granted ∩ scopes Localoy allows you

For example, if Localoy withdraws PAYMENT from your allowed scopes after a partner granted it:

REGISTRATIONUPDATEINVENTORYPAYMENT
Localoy allows youYesYesYesNo
The partner grantedYesNoYesYes
EffectiveYesNoYesNo

The connection's scopes, GET /ping with a partner header, and the details.grantedScopes of a 403 open_network_scope_required all report effective scopes. The connection's grantedScopes is what the partner ticked. A change to either side applies from the next call.

Modules#

Localoy registers the modules you serve. Whatever a partner grants, they narrow what you see of it:

ModulePartners seeBookables you can linkPayment sessions you can readBookings you receive
EVENTEventsevent_ticketEVENT_TICKET_ORDERmodule event
DININGDiningdiningDINING_RESERVATIONmodule dining
ACTIVITYActivitiesactivity_itemACTIVITY_BOOKINGmodule activity

Outside your modules, GET /bookables leaves a bookable out, a payment session answers 404, and a booking sends you no webhook. Catalogue items themselves belong to no module.

The life of a connection#

A connection from code to disconnect
A connection from code to disconnectPartnerLocaloyYour server1. Grant scopes, generate code2. Hand over the code3. POST /connections/claim4. 201 status ACTIVE5. Calls for the partnerThe partner pauses you6. connection.updated · paused7. Call for the partner8. 403 connection_pausedThe partner resumes9. connection.updated · resumedThe partner disconnects you10. Remove the items you created11. connection.revoked12. Call for the partner13. 404 connection_not_found
  1. Partner → Localoy: Grant scopes, generate code
  2. Partner → Your server: Hand over the code
  3. Your server → Localoy: POST /connections/claim
  4. Localoy → Your server: 201 status ACTIVE
  5. Your server → Localoy: Calls for the partner
  6. — The partner pauses you —
  7. Localoy → Your server: connection.updated · paused
  8. Your server → Localoy: Call for the partner
  9. Localoy → Your server: 403 connection_paused
  10. — The partner resumes —
  11. Localoy → Your server: connection.updated · resumed
  12. — The partner disconnects you —
  13. Localoy → Localoy: Remove the items you created
  14. Localoy → Your server: connection.revoked
  15. Your server → Localoy: Call for the partner
  16. Localoy → Your server: 404 connection_not_found
StatusWhat it meansYour calls for the partnerIts webhooks
ACTIVEConnected.Allowed, within effective scopes.Delivered.
PAUSEDThe partner paused you.403 connection_pausedNone after the connection.updated that announces it.
REVOKEDThe partner disconnected you.404 connection_not_foundNone after connection.revoked.

A code the partner generated but you have not claimed is not a connection yet: calls for that partner answer 404 connection_not_found until you claim it. See Connecting partners.