Sandbox and production

What a sandbox provider key isolates and what it does not, how to use your test partner account, and how to test each part of your integration.

Technology Providers work in the Open Network's two environments, sandbox and production. There is one base URL for both: the key you send decides which environment a call runs in.

Key prefixEnvironmentenvironment in /ping
ltp_sbx_SandboxSANDBOX
ltp_live_ProductionPRODUCTION

What each environment separates#

ResourceSeparated?Detail
ConnectionsNoA connection is between your company and a partner, whichever key claimed it. Either key can act for a connected partner.
Catalogue itemsNoA partner has one catalogue. Your sandbox and production keys read and write the same items.
Catalogue webhooksYesSent to your endpoints of the environment of the key that made the change.
Payment sessionsYesA key sees only the sessions of its own environment. Real orders open their sessions in production.
Booking and payment webhooks—Real bookings exist only in production, so these events go only to production endpoints.
Webhook endpointsYesEach endpoint belongs to one environment, which cannot be changed.

The sandbox does not protect real partners

Connections and catalogues are shared between the environments. A sandbox key acting for a real, connected partner writes to that partner's real catalogue. Test with your test partner account only, use externalIds you will never use in production — for example with a test- prefix — and delete them when you are done.

Your test partner account#

Localoy gives you a test partner account when it registers you. It is a partner account on Localoy, set aside for you to play the partner's part. Sign in to the Partner Portal as it to:

  • generate connection codes from your deep link;
  • add and remove the scopes you hold;
  • pause you, resume you and disconnect you;
  • read your calls on its Open Network → Activity page, as a partner would.

Catalogue items are not shown to customers in the Localoy app, so the items you write to the test account's catalogue are seen only by you and by the account.

Testing each part#

PartHow to test it
Your keyGET /ping with the sandbox key.
ConnectingGenerate a code as the test partner and claim it. Claim it again: the answer is 200 and the same connection.
ScopesAs the test partner, remove a scope you use. Your next call that needs it answers 403 open_network_scope_required, and Localoy sends connection.updated.
PausePause yourself as the test partner. Calls answer 403 connection_paused. Resume.
DisconnectDisconnect yourself. Calls answer 404 connection_not_found, the items you created are removed, and Localoy sends connection.revoked. Then connect again with a new code.
CatalogueCreate, link, update and delete items with test externalIds, and watch catalog.item.* reach your sandbox endpoint.
WebhooksPOST /webhooks/{id}/test sends a signed ping to any of your endpoints.
PaymentsSend a test payment as the test partner, then read its session and report a result with the sandbox key — see below.
BookingsProduction only — see below.

Connection events come from the partner's actions, not from a key, so they go to your endpoints subscribed to them in both environments. See Webhooks.

Bookings and payments#

Bookings exist only in production, and so do booking.* and payment.updated events. Build against the documented shapes — booking events and the payment session — and confirm them with the first production partner that grants you BOOKINGS.

The payment exchange itself can be rehearsed in the sandbox. As the test partner, set a sandbox checkout URL in the Partner Portal's Open Network payment settings and send a test payment: it opens a sandbox session with no order behind it. With PAYMENT granted, your sandbox key reads that session and reports its result exactly as it would for a real one. A test session sends no payment.updated.

In production your key sees only the sessions of orders in your modules; any other session answers 404 payment_session_not_found.

Moving to production#

Your connections do not change when you move: a partner connected during testing stays connected. Switch your servers to the production key, register production webhook endpoints, delete your test items, and work through the go-live checklist.