Connecting partners

Send partners to Localoy with a deep link, take the one-time connection code they generate, claim it, and follow the connection as the partner changes it.

A partner connects you itself, in its Partner Portal. Your part is to send it there, and to claim the code it brings back.

Connecting a partner
Connecting a partnerPartnerLocaloyYour platform1. Connect to Localoy (deep link)2. Open ?connect=example-pos3. Your details and scopes4. Tick scopes, generate code5. LCC-7K2M-… shown once6. Paste the code7. POST /connections/claim8. 201 connection9. Connected
  1. Your platform → Partner: Connect to Localoy (deep link)
  2. Partner → Localoy: Open ?connect=example-pos
  3. Localoy → Partner: Your details and scopes
  4. Partner → Localoy: Tick scopes, generate code
  5. Localoy → Partner: LCC-7K2M-… shown once
  6. Partner → Your platform: Paste the code
  7. Your platform → Localoy: POST /connections/claim
  8. Localoy → Your platform: 201 connection
  9. Your platform → Partner: Connected
Deep link
https://partner.localoy.app/dashboard/open-network/providers?connect={providerKey}

{providerKey} is your permanent provider key — GET /ping returns it as provider.key. The link takes the partner to you on its Open Network → Technology Providers page. It works whether or not Localoy lists you, as long as you are not suspended.

Put it behind a Connect to Localoy button in your product's settings, beside the field where the partner will paste its code.

2. The partner generates a code#

On that page the partner sees your name, logo, description, website, support email and the modules you serve, and one choice for each scope Localoy allows you to ask for, with its consent text. It ticks what it grants and generates a connection code.

Rule on the partner's sideDetail
Partner+Generating a code needs an active Partner+ subscription with the Open Network benefit.
Its own consentLocaloy staff signed in as the partner cannot generate a code or add a scope.
One live connectionA partner already connected to you changes your access instead of generating a new code.
Rate10 codes per 15 minutes per partner.

Tell partners which scopes you need before they start. They choose; you cannot tick anything for them.

The connection code#

Connection code
LCC-7K2M-9QXT-4VBN-H3WP
PropertyValue
FormatLCC- and four groups of four characters.
Lifetime15 minutes from when the partner generates it.
UseOnce.
ShownOnce, to the partner. Localoy keeps only a hash of it.
ReplacedGenerating a new code stops the previous one from working.

When you send a code, case, spaces and hyphens do not matter, and the LCC- prefix is optional. These are the same code:

Equivalent forms
LCC-7K2M-9QXT-4VBN-H3WP
lcc 7k2m 9qxt 4vbn h3wp
7K2M9QXT4VBNH3WP

Accept whatever the partner pastes and send it as it is. Never store a code, and never log it.

3. Claim the code#

cURL
curl -X POST "$LOCALOY_BASE_URL/connections/claim" \
  -H "Authorization: Bearer $LOCALOY_PROVIDER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "code": "LCC-7K2M-9QXT-4VBN-H3WP" }'
AnswerMeaning
201Claimed. data is the new connection.
200You had already claimed this code, and it has not expired. data is the same connection.
404 connection_code_invalidThe code is unknown, expired or already used, belongs to another provider, or its connection was disconnected — one answer for all. Ask the partner for a new code.
429 connection_claim_rate_limitedMore than 20 claims in 15 minutes with this key. Wait for Retry-After.

A claim needs no partner header: the code says which partner it is for.

Claiming is idempotent for you. If a claim's response is lost, send the same code again:

Retrying a claim
Retrying a claimYour serverLocaloy1. POST /connections/claim code CClaimed — but the response is lost2. The same code C again3. 200 — the same connectionAfter the code's 15 minutes4. The same code C again5. 404 connection_code_invalid6. GET /connections7. The connection is listed
  1. Your server → Localoy: POST /connections/claim code C
  2. Note: Claimed — but the response is lost
  3. Your server → Localoy: The same code C again
  4. Localoy → Your server: 200 — the same connection
  5. — After the code's 15 minutes —
  6. Your server → Localoy: The same code C again
  7. Localoy → Your server: 404 connection_code_invalid
  8. Your server → Localoy: GET /connections
  9. Localoy → Your server: The connection is listed

What to store#

FieldWhy
partnerIdSend it as X-Localoy-Partner-Id on every call for this partner, and route its webhooks by it. Keep it against the partner's account in your system.
idThe connection's ID, for support conversations.
scopesWhat you may do for this partner now. Refresh it on every connection.updated.
modulesWhich bookables, payment sessions and bookings you will see.
partner.nameTo show which Localoy account was connected.

After the claim, compare scopes with what your integration needs. If something is missing, ask the partner to add it on its Open Network → Technology Providers page. That needs no new code, but adding a scope needs the partner's Partner+ subscription and its own sign-in.

Connection statuses#

StatusMeansYour 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 for you: calls for that partner answer 404 connection_not_found, and it is not listed.

When the partner changes the connection#

Pause, scope change and disconnect
Pause, scope change and disconnectPartnerLocaloyYour server1. Pause2. connection.updated · paused3. Call for the partner4. 403 connection_paused5. Resume6. connection.updated · resumed7. Remove UPDATE8. connection.updated · scopes_changed9. Disconnect10. Remove your items for it11. connection.revoked · itemsRemoved12. Call for the partner13. 404 connection_not_found
  1. Partner → Localoy: Pause
  2. Localoy → Your server: connection.updated · paused
  3. Your server → Localoy: Call for the partner
  4. Localoy → Your server: 403 connection_paused
  5. Partner → Localoy: Resume
  6. Localoy → Your server: connection.updated · resumed
  7. Partner → Localoy: Remove UPDATE
  8. Localoy → Your server: connection.updated · scopes_changed
  9. Partner → Localoy: Disconnect
  10. Localoy → Localoy: Remove your items for it
  11. Localoy → Your server: connection.revoked · itemsRemoved
  12. Your server → Localoy: Call for the partner
  13. Localoy → Your server: 404 connection_not_found
The partnerNeeds Partner+You receiveThen
Pauses youNoconnection.updated, reason pausedCalls answer 403 connection_paused, and nothing else is delivered for the partner.
Resumes youYesconnection.updated, reason resumedCalls and deliveries work again.
Adds a scopeYesconnection.updated, reason scopes_changedThe scope works from the next call.
Removes a scopeNoconnection.updated, reason scopes_changedCalls that need it answer 403 open_network_scope_required.
Disconnects youNoconnection.revoked, reason disconnected_by_partnerAccess ends at once, any outstanding code stops working, and the items you created for the partner are removed.

A scopes_changed event carries previousScopes, and connection.revoked carries itemsRemoved. See Connection events.

To connect again after a disconnect, the partner generates a new code and you claim it, as the first time.

Keeping your records in step#

GET /connections lists your active and paused connections; add ?status=revoked for the ones that ended. Use it to reconcile with your own records — for example after your webhook endpoint has been down.