Skip to content

API Conventions ​

View as Markdown

Base URLs ​

Base URLs are provided per environment and per location. Refer to the relevant location section for the specific base URL applicable to your integration.

Versioning ​

The CabFare Connect API is versioned. The current version is v0.5.0. The API version is included in the base URL path. When a new version is released, the previous version will remain available for a transition period. CabFare will notify integration partners of version changes with sufficient lead time to update their implementations.

Request Format ​

All requests must:

  • Use HTTPS
  • Include the Content-Type: application/json header
  • Include the X-API-KEY and X-API-SECRET authentication headers
  • Send request bodies as valid JSON

Response Codes ​

CabFare Connect uses standard HTTP status codes to indicate the outcome of every request.

CodeMeaningCommon Cause
200 OKRequest successful, response body contains dataPing, subsidy validation, trip end with subsidy
202 AcceptedRequest accepted with a notable conditionTrip start where driver Subsidy Scheme status is not valid
204 No ContentRequest accepted, no response bodyDriver logout, link request accepted, trip end without subsidy
400 Bad RequestMalformed or invalid request payloadMissing required fields, incorrect data types, invalid enum values
401 UnauthorizedMissing or invalid credentialsMissing or incorrect X-API-KEY or X-API-SECRET
403 ForbiddenAuthenticated but operation not permittedDriver or vehicle not authorised for Subsidy Scheme trips
404 Not FoundReferenced resource not foundUnknown device ID, driver not currently logged in
409 ConflictActive session already existsDuplicate tripId, existing active trip for vehicle
500 Server ErrorInternal CabFare Connect errorContact support@cabfare.com

Error Response Format ​

For 4xx responses, CabFare Connect returns a structured error body to help identify the cause.

json
{
  "status": 400,
  "error": "Bad Request",
  "detail": [
    {
      "field": "driverId",
      "message": "must not be blank"
    }
  ]
}

Inspect the detail array for specific field-level errors when troubleshooting a 400 response.

Currency Format ​

All monetary amounts in CabFare Connect are expressed in cents as integers, not dollars as floats.

A fare of $10.00 must be submitted as 1000

This applies to all fare amounts, subsidy amounts, lifting fees, and payment amounts across all endpoints.

Identifiers ​

The following identifiers must be consistent across all API calls within a session:

IdentifierDescription
taxiMeterIdUnique identifier for the Taxi Meter device or system
terminalIdUnique identifier for the Payment Terminal device or application
driverIdUnique identifier for the accredited driver
vehiclePlateRegistered vehicle plate number
tripIdUnique identifier for a single trip — must be unique per trip
transactionIdUnique identifier for a single payment transaction

Inconsistent identifiers across the Taxi Meter and Payment Terminal are the most common cause of linking failures and session errors.