Skip to content

Develop against the StayFn Sandbox

The StayFn Sandbox (https://sandbox.stayfn.com) is a hosted, synthetic OPERA Cloud for building StayFn functions on your own machine without Oracle credentials. Your code runs on your machine (stayfn dev, the VS Code extension), never on our servers; the sandbox only answers the OHIP calls your local StayFn makes.

  • Every OHIP operation of the specifications StayFn ships (OHIP 26.3: about 3,600 method and path pairs, including the HEAD status checks of asynchronous operations). An operation without curated data answers with the synthetic example of its first documented success response: the same example the MCP tool ohip.operation shows.
  • Curated data for the hotels DEMO01, DEMO02 and DEMO03 (chain DEMO), with dates relative to today: the hotel itself (entcfg.getHotel, what stayfn ohip ping --env sandbox --hotel DEMO01 shows), tomorrow’s arrivals (rsv.searchHotelReservations), the restriction history (par.getRestrictionsHistory) and the comp postings journal (csh.getCompPostingJournal). Every name, amount and user is invented. More operations get curated data over time.
  • Writes are accepted and answered (201/204 or the documented status) but not stored: a reservation you create does not appear in a later search.
  • Unknown paths and hotels other than DEMO01–DEMO03 answer 404.

Per account: 5 requests per second and 5,000 per UTC day (429 with Retry-After, like OHIP), request bodies up to 1 MB (413). GET /v1/whoami shows the account’s limits and today’s count.

  1. Create a free account at sandbox.stayfn.com/account: work e-mail, name, optional company, accept the terms. There are no passwords: a one-time link verifies your address (valid 24 hours) and later signs you in (30 minutes).
  2. Verifying shows your first API token (sbx_ + 32 characters) once. StayFn keeps only a hash of it: if you lose it, generate a new one on the account page and revoke the old one. An account holds at most three active tokens.
  3. Revoke takes effect on the next call, also for an access token your StayFn already obtained with it.
  4. Delete account removes the account, its tokens and its activity. Accounts that never verify their address are removed after seven days.

VS Code: run StayFn: Connect to StayFn Sandbox and paste the token. Terminal: in the project folder,

Terminal window
stayfn sandbox connect # hidden prompt
printf '%s\n' "$TOKEN" | stayfn sandbox connect --token-stdin

Both check the token and write these lines into the project’s .env (git-ignored; never commit it):

Terminal window
OHIP_SANDBOX_GATEWAY_URL=https://sandbox.stayfn.com
OHIP_SANDBOX_APP_KEY=<account id>
OHIP_SANDBOX_CLIENT_ID=<account id>
OHIP_SANDBOX_CLIENT_SECRET=<your token>
OHIP_SANDBOX_ENTERPRISE_ID=DEMO
OHIP_SANDBOX_USERNAME=
OHIP_SANDBOX_PASSWORD=
OHIP_SANDBOX_HOTEL_ID=DEMO01
OHIP_SANDBOX_CHAIN_CODE=DEMO

Then stayfn dev (or StayFn: Start Dev Host) and invoke your functions as usual; the dashboard’s invocation timeline shows each call to the sandbox. A different environment name (--env, the setting stayfn.environment) writes OHIP_<ENV>_* instead.

Replace the OHIP_SANDBOX_* values with the gateway URL, app key, client id and secret, and the enterprise id (or integration user) of your Oracle OHIP environment, and the hotel and chain codes. Nothing in your functions changes. Expect real data to differ from the synthetic examples: fields the examples leave out can be present, and lists can be empty.

The sandbox speaks the OHIP protocol StayFn already uses: POST /oauth/v1/tokens with HTTP Basic client credentials (client id = the account id, client secret = the sandbox token) and x-app-key = the account id gives a one-hour bearer; every OHIP call carries that bearer and x-app-key. Your token never needs to leave your .env and VS Code’s secret storage.