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.
What it answers
Section titled “What it answers”- Every OHIP operation of the specifications StayFn ships (OHIP 26.3: about 3,600 method and path pairs, including the
HEADstatus 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 toolohip.operationshows. - Curated data for the hotels
DEMO01,DEMO02andDEMO03(chainDEMO), with dates relative to today: the hotel itself (entcfg.getHotel, whatstayfn ohip ping --env sandbox --hotel DEMO01shows), 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/204or the documented status) but not stored: a reservation you create does not appear in a later search. - Unknown paths and hotels other than
DEMO01–DEMO03answer404.
Limits
Section titled “Limits”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.
Account and tokens
Section titled “Account and tokens”- 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).
- 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. - Revoke takes effect on the next call, also for an access token your StayFn already obtained with it.
- Delete account removes the account, its tokens and its activity. Accounts that never verify their address are removed after seven days.
Connect a project
Section titled “Connect a project”VS Code: run StayFn: Connect to StayFn Sandbox and paste the token. Terminal: in the project folder,
stayfn sandbox connect # hidden promptprintf '%s\n' "$TOKEN" | stayfn sandbox connect --token-stdinBoth check the token and write these lines into the project’s .env (git-ignored; never commit it):
OHIP_SANDBOX_GATEWAY_URL=https://sandbox.stayfn.comOHIP_SANDBOX_APP_KEY=<account id>OHIP_SANDBOX_CLIENT_ID=<account id>OHIP_SANDBOX_CLIENT_SECRET=<your token>OHIP_SANDBOX_ENTERPRISE_ID=DEMOOHIP_SANDBOX_USERNAME=OHIP_SANDBOX_PASSWORD=OHIP_SANDBOX_HOTEL_ID=DEMO01OHIP_SANDBOX_CHAIN_CODE=DEMOThen 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.
Moving to your own OHIP environment
Section titled “Moving to your own OHIP environment”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.
Protocol (for the curious)
Section titled “Protocol (for the curious)”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.