TOWeRS Push API

Overview

This API allows you to push bookings in a TOWeRS system. The API supports two main endpoints:

  • /manager/generic_bookings - for pushing generic/transport service bookings
  • /manager/hotel_bookings - for pushing hotel bookings

All operations are authenticated via API key.

Authentication

Authentication is handled via API key sent in the Authorization header.

Header format:

Authorization: ApiKey YOUR_API_KEY

Replace YOUR_API_KEY with the API key assigned to you.

HTTP Methods

The API supports the following HTTP operations:

  • POST - Insert one or more bookings
  • PUT - Modify an existing booking (requires booking name in the URL path)
  • DELETE - Cancel an existing booking (requires booking name in the URL path)
  • GET - Search or retrieve booking details

Response Format

All responses are returned in JSON format with the following top-level structure:

{
  "name": "booking reference in TOWeRS system",
  "status": "CNF|PND|CXL|SNT|SND|REJ",
  "dossier": "container reference in TOWeRS system",
  "customerreference": "reference in your system",
  "error": "error message if operation failed (optional)",
  "__metadata__": {
    "app_server": "hostname:port",
    "timestamp": "2024-01-31T10:56:27",
    "request_id": "unique request identifier"
  }
}

Response for Multiple Bookings

When inserting multiple bookings in a single request:

{
  "results": [
    { "name": "B001...", "status": "CNF", ... },
    { "name": "B002...", "status": "CNF", ... }
  ],
  "__metadata__": { ... }
}

Booking Status

The status field indicates the booking state:

  • CNF - Confirmed
  • PND - Pending (waiting for supplier confirmation)
  • CXL - Cancelled
  • SNT - Status unknown (request sent but error occurred during processing)
  • SND - Booking stuck (request not sent to supplier)
  • REJ - Rejected
  • WIT - Waiting for confirmation
  • SUP - Supplier status
  • CLI - Client status

Error Responses

Error responses return HTTP status codes and a JSON structure:

{
  "error": "error description",
  "debug_info": "additional error details",
  "__metadata__": {
    "app_server": "hostname:port",
    "timestamp": "2024-01-31T10:56:27",
    "request_id": "unique request identifier"
  }
}

Common HTTP Status Codes

  • 400 - Bad Request (malformed payload, missing mandatory field, invalid field type)
  • 401 - Unauthorized (invalid or missing API key)
  • 403 - Forbidden (API key does not grant access)
  • 405 - Method Not Allowed
  • 429 - Too Many Requests (rate limit exceeded)
  • 500 - Internal Server Error

Request Content Type

Requests accept application/json content type. If no content-type header is provided, the API will attempt to parse the payload as JSON.

Field Naming and Validation

  • All date fields must be in YYYY-MM-DD format
  • All time fields must be in HH:MM format (24-hour)
  • Currency codes must follow ISO 4217 standard (e.g., EUR, USD)
  • Status values must be one of: CNF, PND, CXL, SNT, SND, REJ, WIT, SUP, CLI