Skip to content

Getting Started

Sandbox and Live

Two complete, separate environments. Which one a request reaches is decided by its API key and nothing else.

There is no ?env= parameter, no header to set and no separate hostname to remember. Send a sandbox key and you are in sandbox; send a live key and you are in production. Each environment has its own database, its own supplier credentials and its own copy of everything — a sandbox key can never reach live data, and the reverse is equally true.

Chosen by

Sandbox: A key that is not gws_live_…

Live: A gws_live_… key

Data

Sandbox: Staging — its own clients, properties, bookings and markups

Live: Production

Hotel sources

Sandbox: Their test systems

Live: Their production systems

Bookings

Sandbox: Always test bookings — isTest is forced on

Live: Real reservations, with real money behind them

Rates you see

Sandbox: Test inventory, a small fixed set of hotels

Live: The real catalogue

Checking Which One You Are In

Every response carries an x-gws-mode header, and GET /me returns mode in the body. Assert on one of them in your own tests — it costs nothing and it catches the configuration mistake that matters most.

Confirm the mode of a key
curl https://api.gatewaystream.com/api/v1/me \
  -H "x-api-key: $GWS_KEY" -i | grep -i x-gws-mode
# x-gws-mode: sandbox

Test Bookings

Sandbox bookings are always test bookings. The isTest flag on the book request is forced on there, so there is nothing you can send that will reach a supplier's production booking endpoint from a sandbox key.

In live, isTest is yours to set. Sending true asks the supplier for a test booking against production — useful for certification, and worth cancelling straight afterwards.

What Differs in Practice

  • Inventory is thin in sandbox. It holds a small fixed set of test hotels. Search dates that have no inventory simply return no rates, which is not an error.
  • Hotel ids differ between environments. A propertyId from sandbox means nothing in live. So does a rateKey and a bookingId.
  • Sources are switched on per environment. A source that is active in sandbox may be off in live, so a place you can search in one may not be searchable in the other. Compare Destinations in each.

mode_unavailable

If a deployment has no configuration for the environment your key points at, every call with that key returns 503. This is the expected answer when a live key is used against a sandbox-only deployment.

503 mode_unavailable
{
  "error": {
    "code": "mode_unavailable",
    "message": "live mode is not available on this server: no live configuration",
    "requestId": "req_01JD8QD9H1T6B0WZ",
    "details": { "mode": "live" }
  }
}