Back to top

hiyacar API

Welcome to the hiyacar API

Changes

Date Version Author Change summary
2021-08-10 1.4.0 Marc Roberts Insurance statements for SDH markets
2021-07-07 1.3.1 Marc Roberts New Consent endpoint, consent in user api, new booking data, booking is_checked end point, dynamic pricing on vehicles
2021-01-29 1.3.0 Marc Roberts Stripe PaymentIntents for booking payments
2020-12-01 1.2.3 Marc Roberts Backend will automatically assign a new selfie image as profile picture (if not already present) for any prior API version
2020-10-28 1.2.2 Marc Roberts Driver Intent, vehicle reviews and extra fields, deprecated endpoints
2020-09-01 1.2.2 Marc Roberts New bookings index filters and breaking changes to user verifications object
2020-07-24 1.2.1 Marc Roberts Refactor extras objects
2020-07-08 1.2.0 Marc Roberts Prices added to search results
search results only show vehicle primary image
2020-06-23 1.1.1 Marc Roberts Instant Book updates
2020-06-10 1.1.0 Marc Roberts Import Apiary docs

URL

Unless stated all requests have a base URL of:

https://www.hiyacar.co.uk/api/v1

Rate limiting

The API is subject to rate limits, unless specified differently the limit is 180 requests per minute per IP (anonymous requests) or User (authenticated requests).

All requests will include the following headers in their responses indicated how close you are to your limit

X-RateLimit-Limit: 180
X-RateLimit-Remaining: 179

If you exceed this rate requests will return an HTTP 429 error response until the rate limit resets.

Content types

All requests expect and return JSON data (unless otherwise stated). Requests must include appropriate Accept and Content-type headers.

Unless otherwise noted a successful request will return its data as an object or array within the result field in the following structure

{
    "success":true,
    "result": ....,
    "query": {
        ...
    }
}

An unsuccessful request will return the following structure

{
    "success":false,
    "error":"Description of the error message",
    "details": "A string, array or object of more information for that specific error message"
}

Dates & times

The API returns and expects dates and times to be an ISO8601 formatted string. The timezone is optional, if not supplied it will default to parsing using the Europe/London timezone.

Auth

Unless stated all requests require an OAuth access token supplied in the HTTP header:

Authorization: Bearer xxxxxxxx

OAuth

These API endpoints have a base URL of https://www.hiyacar.co.uk/

Authorize
GET/oauth/authorize{?client_id,redirect_uri,response_type,scope}

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

Request authorization for this client

Example URI

GET https://staging.hiyacar.co.uk/oauth/authorize?client_id=12345&redirect_uri=https:/external-service.com&response_type=code&scope=*
URI Parameters
HideShow
client_id
string (required) Example: 12345

The oauth client request auth for

redirect_uri
string (required) Example: https://external-service.com

Where to redirect to after auth, must begin with the URL we have for the client

response_type
string (required) Example: code

Type of response required, code or token (implicit grant)

scope
string (required) Example: *

Scope requested, no specific scopes are in use currently so use *

Response  302

Token
POST/oauth/token

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

Retrieve an access token for a user.

Requires either an authorization code from a request to the Authorize end point, or the usename/password and client secret.

This API end point is returned exactly as it is, without the success / result wrapper specified above.

Example URI

POST https://staging.hiyacar.co.uk/oauth/token
Request  Code Grant
HideShow
Body
{
  "grant_type": "authorization_token",
  "client_id": "1",
  "client_secret": "JHrwKbCQCSUXb8slHGb0h5ndR0YJbKFsik9BCfLS",
  "redirect_uri": "http://xxxxxxx",
  "code": "xxxxxxx"
}
Request  Password Grant
HideShow
Body
{
  "grant_type": "password",
  "client_id": "1",
  "client_secret": "JHrwKbCQCSUXb8slHGb0h5ndR0YJbKFsik9BCfLS",
  "username": "chuck@hiyacar.co.uk",
  "password": "password",
  "scope": "*"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token_type": "Bearer",
  "expires_in": 31536000,
  "access_token": "eYJ0........",
  "refresh_token": "Gm69........"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "token_type": {
      "type": "string"
    },
    "expires_in": {
      "type": "number"
    },
    "access_token": {
      "type": "string"
    },
    "refresh_token": {
      "type": "string"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "invalid_credentials",
  "message": "The user credentials were incorrect."
}

User

Creation

Check Email availability
POST/api/v1/user/availability

Check the availability of an email address

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

Example URI

POST https://staging.hiyacar.co.uk/api/v1/user/availability
Request
HideShow
Body
{
  "email": "bob@hiyacar.co.uk"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "available": true
}

Resend Email verification
POST/api/v1/user/emailVerification

Resend the email varification email

Example URI

POST https://staging.hiyacar.co.uk/api/v1/user/emailVerification
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "available": true
}

Create an account
POST/api/v1/user

Create a user account

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

Request data:

  • email - The User’s email address, required

  • password - The User’s password

  • first_name - The User’s first name, required

  • last_name - The User’s last name, required

  • profile_image - Base64 encoded profile image data, optional

  • client_id - The client ID to return an OAuth token for, optional

Example URI

POST https://staging.hiyacar.co.uk/api/v1/user
Request
HideShow
Body
{
  "email": "user@hiyacar.co.uk",
  "password": "password123",
  "first_name": "Chuck",
  "last_name": "Norris",
  "profile_image": "xxxx"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Invalid parameters",
  "details": {
    "first_name": [
      "The first name field is required."
    ]
  }
}
Request  with client_id
HideShow
Body
{
  "client_id": 1,
  "email": "user@hiyacar.co.uk",
  "password": "password123",
  "first_name": "Chuck",
  "last_name": "Norris",
  "profile_image": "xxxx"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "result": {
    "access_token": "eyJ0eXAiOiJKV...cZGkvC1dCpCLhh-dY0J9KY",
    "token_type": "bearer",
    "expires_in": "31536000"
  }
}

Details

Retrieve own account details
GET/api/v1/user

Retrieve user account details for the user associated with the access token provided.

Example URI

GET https://staging.hiyacar.co.uk/api/v1/user
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 21094,
  "first_name": "Bob",
  "last_name": "Bobby",
  "dob": "1990",
  "email": "bob@hiyacar.co.uk",
  "email_verified": true,
  "bio": "I love driving cars ...",
  "phone_number": "+447770123456",
  "join_date": "2016-10-08",
  "primary_location": {
    "line1": "17 Church Street",
    "line2": "Boughton Monchelsea",
    "city": "Maidstone",
    "county": "Kent",
    "postcode": "ME17 4HW",
    "lat": 51.23188,
    "lng": 0.53302
  },
  "profile_image": {
    "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "id": 1264,
    "primary": false
  },
  "payment_info": {
    "source": "card",
    "name": "Mr Bob Robertson",
    "brand": "Visa",
    "last4": "0000",
    "expiry_month": 12,
    "expiry_year": 2018
  },
  "bank_details": {
    "type": "uk-bacs",
    "bank_name": "'Natwest'",
    "account_name": "Mr Bob Smith",
    "account_number": 76587651,
    "account_sort_code": "12-34-56"
  },
  "profile_complete": true,
  "referral_code": "HDHDSG",
  "live_cars_count": 1,
  "hiyas": 22,
  "owner_response_time": 5006,
  "badges": [
    {
      "name": "top_owner",
      "detail": "some detail"
    }
  ],
  "licence_details": {
    "licence_type": "eu",
    "licence_number": "ROBER786812MD1LL",
    "licence_issue_date": "2001-01-01",
    "licence_expiry_date": "2010-01-01",
    "eu_licence_for": 40,
    "eu_convictions": true,
    "eu_claims": true
  },
  "notifications": {
    "messages": 0,
    "booking": 0
  },
  "intercom": {
    "ios_hash": "xxxx",
    "android_hash": "xxxx"
  },
  "verification": {
    "verification_status": "REFER",
    "licence_check_result": "PASS",
    "face_rec_result": "PASS",
    "passed_all": false,
    "drivercheck_consent": true,
    "error_codes": {},
    "error": {},
    "errors": []
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "type": "string",
      "description": "Only shows first character for users other than yourself"
    },
    "dob": {
      "type": "string",
      "description": "01-01 (string)"
    },
    "email": {
      "type": "string"
    },
    "email_verified": {
      "type": "boolean"
    },
    "bio": {
      "type": "string"
    },
    "phone_number": {
      "type": "string"
    },
    "join_date": {
      "type": "string"
    },
    "primary_location": {
      "type": "object",
      "properties": {
        "line1": {
          "type": "string"
        },
        "line2": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "county": {
          "type": "string"
        },
        "postcode": {
          "type": "string"
        },
        "lat": {
          "type": "number"
        },
        "lng": {
          "type": "number"
        }
      }
    },
    "profile_image": {
      "type": "object",
      "properties": {
        "300": {
          "type": "string"
        },
        "600": {
          "type": "string"
        },
        "1200": {
          "type": "string"
        },
        "id": {
          "type": "number"
        },
        "primary": {
          "type": "boolean"
        }
      }
    },
    "payment_info": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "card",
            "invoice",
            "none"
          ]
        },
        "name": {
          "type": "string",
          "description": "Card source only"
        },
        "brand": {
          "type": "string",
          "description": "Card source only"
        },
        "last4": {
          "type": "string",
          "description": "Card source only"
        },
        "expiry_month": {
          "type": "number",
          "description": "Card source only"
        },
        "expiry_year": {
          "type": "number",
          "description": "Card source only"
        }
      }
    },
    "bank_details": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of bank payment (currently only `uk-bacs`)"
        },
        "bank_name": {
          "type": "string",
          "description": "The Bank name to pay"
        },
        "account_name": {
          "type": "string",
          "description": "Name of the account holder"
        },
        "account_number": {
          "type": "number",
          "description": "Account number to pay"
        },
        "account_sort_code": {
          "type": "string",
          "description": "Bank sort code to pay"
        }
      }
    },
    "profile_complete": {
      "type": "boolean"
    },
    "referral_code": {
      "type": "string"
    },
    "live_cars_count": {
      "type": "number"
    },
    "hiyas": {
      "type": "number"
    },
    "owner_response_time": {
      "type": "number",
      "description": "Average reponse time in seconds"
    },
    "badges": {
      "type": "array"
    },
    "licence_details": {
      "type": "object",
      "properties": {
        "licence_type": {
          "type": "string",
          "enum": [
            "uk",
            "eu",
            "other"
          ]
        },
        "licence_number": {
          "type": "string"
        },
        "licence_issue_date": {
          "type": "string"
        },
        "licence_expiry_date": {
          "type": "string"
        },
        "eu_licence_for": {
          "type": "number",
          "description": "Number of months an EU licence has been held for"
        },
        "eu_convictions": {
          "type": "boolean"
        },
        "eu_claims": {
          "type": "boolean"
        }
      }
    },
    "notifications": {
      "type": "object",
      "properties": {
        "messages": {
          "type": "number"
        },
        "booking": {
          "type": "number"
        }
      }
    },
    "intercom": {
      "type": "object",
      "properties": {
        "ios_hash": {
          "type": "string",
          "description": "The Intercom user hash for iOS"
        },
        "android_hash": {
          "type": "string",
          "description": "The Intercom user hash for Android"
        }
      }
    },
    "verification": {
      "type": "object",
      "properties": {
        "verification_status": {
          "type": "string"
        },
        "licence_check_result": {
          "type": "string"
        },
        "face_rec_result": {
          "type": "string"
        },
        "passed_all": {
          "type": "boolean"
        },
        "drivercheck_consent": {
          "type": "boolean",
          "description": "Has the member given us consent to use DriverCheck"
        },
        "error_codes": {
          "type": "object",
          "properties": {},
          "description": "Removed from API version 1.2.2"
        },
        "error": {
          "type": "object",
          "properties": {},
          "description": "Removed from API version 1.2.2"
        },
        "errors": {
          "type": "array",
          "description": "List of verficiation errors\nFrom version 1.2.2"
        }
      }
    }
  }
}

Retrieve a user's details
GET/api/v1/user/{user_id}

Retrieve user account details for the user associated with the access token provided.

Example URI

GET https://staging.hiyacar.co.uk/api/v1/user/12345
URI Parameters
HideShow
user_id
number (required) Example: 12345

The user’s ID to retrieve details for

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 21094,
  "first_name": "Bob",
  "last_name": "A",
  "bio": "I love driving cars ...",
  "rating": 4.7,
  "rating_count": 2,
  "join_date": "2016-10-08",
  "primary_location": {
    "id": "873",
    "city": "London",
    "postcode_prefix": "NW8"
  },
  "profile_image": {
    "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "id": 1264,
    "primary": false
  },
  "live_cars_count": 1,
  "hiyas": 22,
  "owner_response_time": 5006,
  "badges": [
    {
      "name": "top_owner",
      "detail": "some detail"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "type": "string",
      "description": "Only shows first character for users other than yourself"
    },
    "bio": {
      "type": "string"
    },
    "rating": {
      "type": "number"
    },
    "rating_count": {
      "type": "number"
    },
    "join_date": {
      "type": "string"
    },
    "primary_location": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "postcode_prefix": {
          "type": "string"
        }
      }
    },
    "profile_image": {
      "type": "object",
      "properties": {
        "300": {
          "type": "string"
        },
        "600": {
          "type": "string"
        },
        "1200": {
          "type": "string"
        },
        "id": {
          "type": "number"
        },
        "primary": {
          "type": "boolean"
        }
      }
    },
    "live_cars_count": {
      "type": "number"
    },
    "hiyas": {
      "type": "number"
    },
    "owner_response_time": {
      "type": "number",
      "description": "Average reponse time in seconds"
    },
    "badges": {
      "type": "array"
    }
  }
}

Retrieve identity documents
GET/api/v1/user/documents

Show the identity documents this user has stored

Example URI

GET https://staging.hiyacar.co.uk/api/v1/user/documents
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "type": "licence",
    "image": {
      "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "id": 1264,
      "primary": false
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Updates

Update you user account
PUT/api/v1/user

Update the account associate with the supplied auth token

Request data:

  • first_name - optional

  • last_name - optional

  • email - optional

  • phone_number - optional

  • dob - Date of birth (YYYY-mm-dd format), optional

  • licence_number - optional

  • licence_issue_date - (YYYY-mm-dd format), optional

  • licence_type - (‘eu’, ‘uk’, ‘other’), optional

  • eu_licence_for - number of months they have lived in the UK, optional (Yes, it’s confusing, sorry)

  • eu_convictions - any convictions recently, boolean, optional

  • eu_claims - and claims recently, boolean, optional

  • dvla_check_code - optional

  • profile_image - base64 encoded image for profile picture

  • primary_address - array of address fields, optional

  • secondary_address - array of address fields, optional

  • voucher - A valid voucher to add to a user’s account, string, optional

  • referral - How the user heard about us, string, optional

Referral can only be set once, after that the value will not be overwritten.

Voucher code will be stored against the user if it exists and used on their next booking if it is valid and they are eligible at the time

Example URI

PUT https://staging.hiyacar.co.uk/api/v1/user
Request
HideShow
Body
{
  "first_name": "Bob",
  "last_name": "Ericsson",
  "licence_type": "uk",
  "licence_number": "ERICS808132MD9GL",
  "licence_issue_date": "2002-01-01",
  "dvla_check_code": "gx kT j8 s5",
  "phone_number": "07777 123456",
  "profile_image": "nbjxbcjx....",
  "primary_address": {
    "line1": "Flat 4",
    "line2": "1 something road",
    "city": "Lewisham",
    "county": "London",
    "postcode": "E14 1AA",
    "lat": 50.822652,
    "lng": -0.1785738
  },
  "referral": "Social media",
  "voucher": "PUMP1"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 21094,
  "first_name": "Bob",
  "last_name": "Bobby",
  "dob": "1990",
  "email": "bob@hiyacar.co.uk",
  "email_verified": true,
  "bio": "I love driving cars ...",
  "phone_number": "+447770123456",
  "join_date": "2016-10-08",
  "primary_location": {
    "line1": "17 Church Street",
    "line2": "Boughton Monchelsea",
    "city": "Maidstone",
    "county": "Kent",
    "postcode": "ME17 4HW",
    "lat": 51.23188,
    "lng": 0.53302
  },
  "profile_image": {
    "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "id": 1264,
    "primary": false
  },
  "payment_info": {
    "source": "card",
    "name": "Mr Bob Robertson",
    "brand": "Visa",
    "last4": "0000",
    "expiry_month": 12,
    "expiry_year": 2018
  },
  "bank_details": {
    "type": "uk-bacs",
    "bank_name": "'Natwest'",
    "account_name": "Mr Bob Smith",
    "account_number": 76587651,
    "account_sort_code": "12-34-56"
  },
  "profile_complete": true,
  "referral_code": "HDHDSG",
  "live_cars_count": 1,
  "hiyas": 22,
  "owner_response_time": 5006,
  "badges": [
    {
      "name": "top_owner",
      "detail": "some detail"
    }
  ],
  "licence_details": {
    "licence_type": "eu",
    "licence_number": "ROBER786812MD1LL",
    "licence_issue_date": "2001-01-01",
    "licence_expiry_date": "2010-01-01",
    "eu_licence_for": 40,
    "eu_convictions": true,
    "eu_claims": true
  },
  "notifications": {
    "messages": 0,
    "booking": 0
  },
  "intercom": {
    "ios_hash": "xxxx",
    "android_hash": "xxxx"
  },
  "verification": {
    "verification_status": "REFER",
    "licence_check_result": "PASS",
    "face_rec_result": "PASS",
    "passed_all": false,
    "drivercheck_consent": true,
    "error_codes": {},
    "error": {},
    "errors": []
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "type": "string",
      "description": "Only shows first character for users other than yourself"
    },
    "dob": {
      "type": "string",
      "description": "01-01 (string)"
    },
    "email": {
      "type": "string"
    },
    "email_verified": {
      "type": "boolean"
    },
    "bio": {
      "type": "string"
    },
    "phone_number": {
      "type": "string"
    },
    "join_date": {
      "type": "string"
    },
    "primary_location": {
      "type": "object",
      "properties": {
        "line1": {
          "type": "string"
        },
        "line2": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "county": {
          "type": "string"
        },
        "postcode": {
          "type": "string"
        },
        "lat": {
          "type": "number"
        },
        "lng": {
          "type": "number"
        }
      }
    },
    "profile_image": {
      "type": "object",
      "properties": {
        "300": {
          "type": "string"
        },
        "600": {
          "type": "string"
        },
        "1200": {
          "type": "string"
        },
        "id": {
          "type": "number"
        },
        "primary": {
          "type": "boolean"
        }
      }
    },
    "payment_info": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "card",
            "invoice",
            "none"
          ]
        },
        "name": {
          "type": "string",
          "description": "Card source only"
        },
        "brand": {
          "type": "string",
          "description": "Card source only"
        },
        "last4": {
          "type": "string",
          "description": "Card source only"
        },
        "expiry_month": {
          "type": "number",
          "description": "Card source only"
        },
        "expiry_year": {
          "type": "number",
          "description": "Card source only"
        }
      }
    },
    "bank_details": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of bank payment (currently only `uk-bacs`)"
        },
        "bank_name": {
          "type": "string",
          "description": "The Bank name to pay"
        },
        "account_name": {
          "type": "string",
          "description": "Name of the account holder"
        },
        "account_number": {
          "type": "number",
          "description": "Account number to pay"
        },
        "account_sort_code": {
          "type": "string",
          "description": "Bank sort code to pay"
        }
      }
    },
    "profile_complete": {
      "type": "boolean"
    },
    "referral_code": {
      "type": "string"
    },
    "live_cars_count": {
      "type": "number"
    },
    "hiyas": {
      "type": "number"
    },
    "owner_response_time": {
      "type": "number",
      "description": "Average reponse time in seconds"
    },
    "badges": {
      "type": "array"
    },
    "licence_details": {
      "type": "object",
      "properties": {
        "licence_type": {
          "type": "string",
          "enum": [
            "uk",
            "eu",
            "other"
          ]
        },
        "licence_number": {
          "type": "string"
        },
        "licence_issue_date": {
          "type": "string"
        },
        "licence_expiry_date": {
          "type": "string"
        },
        "eu_licence_for": {
          "type": "number",
          "description": "Number of months an EU licence has been held for"
        },
        "eu_convictions": {
          "type": "boolean"
        },
        "eu_claims": {
          "type": "boolean"
        }
      }
    },
    "notifications": {
      "type": "object",
      "properties": {
        "messages": {
          "type": "number"
        },
        "booking": {
          "type": "number"
        }
      }
    },
    "intercom": {
      "type": "object",
      "properties": {
        "ios_hash": {
          "type": "string",
          "description": "The Intercom user hash for iOS"
        },
        "android_hash": {
          "type": "string",
          "description": "The Intercom user hash for Android"
        }
      }
    },
    "verification": {
      "type": "object",
      "properties": {
        "verification_status": {
          "type": "string"
        },
        "licence_check_result": {
          "type": "string"
        },
        "face_rec_result": {
          "type": "string"
        },
        "passed_all": {
          "type": "boolean"
        },
        "drivercheck_consent": {
          "type": "boolean",
          "description": "Has the member given us consent to use DriverCheck"
        },
        "error_codes": {
          "type": "object",
          "properties": {},
          "description": "Removed from API version 1.2.2"
        },
        "error": {
          "type": "object",
          "properties": {},
          "description": "Removed from API version 1.2.2"
        },
        "errors": {
          "type": "array",
          "description": "List of verficiation errors\nFrom version 1.2.2"
        }
      }
    }
  }
}

Update identity documents
POST/api/v1/user/documents

Update one or more identity images

JSON body contains an array of images to store/replace

Example URI

POST https://staging.hiyacar.co.uk/api/v1/user/documents
Request
HideShow
Body
{
  "documents": [
    {
      "type": "licence-front",
      "image": "dfynkeynxx..."
    }
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "type": "licence",
    "image": {
      "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "id": 1264,
      "primary": false
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Other

Request a password reset
POST/api/v1/user/password

Request a password reset email for a given email address

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

Example URI

POST https://staging.hiyacar.co.uk/api/v1/user/password
Request
HideShow
Body
{
  "email": "bob@hiyacar.co.uk"
}
Response  200
HideShow
Headers
Content-Type: application/json

Retrieve users vehicle
GET/api/v1/user/{userId}/vehicles

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

Example URI

GET https://staging.hiyacar.co.uk/api/v1/user/22995/vehicles
URI Parameters
HideShow
userId
number (required) Example: 22995

The user ID of the user to retrieve vehicles for

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 12346,
    "published": true,
    "year": 2014,
    "make": "Audi",
    "model": "A4 Avant TDI",
    "title": "Audi A4 Avant TDI",
    "colour": "red",
    "seats": 4,
    "miles_per_day": 300,
    "insurance_group": 39,
    "engine_cc": 1984,
    "rating": 4.7,
    "rating_count": 3,
    "instant_book": true,
    "instant_book_status": "none",
    "fuel": "Petrol",
    "type": "Executive / Saloon",
    "transmission": "Manual",
    "description": "Economic but quick, you will love this car",
    "vrm": "GC10AAA",
    "prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "suggested_prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "images": [
      {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      }
    ],
    "owner": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Retrieve users reviews
GET/api/v1/user/{userId}/reviews

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

This is also available as /api/v1/user/{userId}/ratings however use of this endpoint is deprecated.

Example URI

GET https://staging.hiyacar.co.uk/api/v1/user/22995/reviews
URI Parameters
HideShow
userId
number (required) Example: 22995

The user ID of the user to retrieve vehicles for

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "514",
    "for": "driver",
    "ratings": 5,
    "review": "They were great",
    "created_at": "2017-01-0T15:30:00",
    "from": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Notificatons

Retrieve notification preferences
GET/api/v1/notifications

Get a list of notification preferences

Example URI

GET https://staging.hiyacar.co.uk/api/v1/notifications
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "marketing": {
    "description": "blah",
    "enabled": true,
    "required": false,
    "type": "toggle",
    "channels": {
      "email": true,
      "sms": true,
      "push": true
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "marketing": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "required": {
          "type": "boolean"
        },
        "type": {
          "type": "string",
          "enum": [
            "toggle",
            "multi"
          ]
        },
        "channels": {
          "type": "object",
          "properties": {
            "email": {
              "type": "boolean"
            },
            "sms": {
              "type": "boolean"
            },
            "push": {
              "type": "boolean"
            }
          }
        }
      }
    }
  }
}

Save a user intent
POST/api/v1/user/intent

Create a new user intent

Request data:

  • for - the key for this intent

  • value - the value

Example URI

POST https://staging.hiyacar.co.uk/api/v1/user/intent
Request
HideShow
Body
{
  "for": "search",
  "value": "asap"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    success: true
}

Save a user's consent
POST/api/v1/user/consent

Create a new user consent

Request data:

  • for - what are they giving consent for

Example URI

POST https://staging.hiyacar.co.uk/api/v1/user/consent
Request
HideShow
Body
{
  "for": "drivercheck",
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    success: true
}

Update notification preferences
POST/api/v1/notifications

Update user notification preferences

Example URI

POST https://staging.hiyacar.co.uk/api/v1/notifications
Request
HideShow
Body
{
  "marketing": {
    "email": true,
    "sms": false,
    "push": true
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "marketing": {
    "description": "blah",
    "enabled": true,
    "required": false,
    "type": "toggle",
    "channels": {
      "email": true,
      "sms": true,
      "push": true
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "marketing": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "required": {
          "type": "boolean"
        },
        "type": {
          "type": "string",
          "enum": [
            "toggle",
            "multi"
          ]
        },
        "channels": {
          "type": "object",
          "properties": {
            "email": {
              "type": "boolean"
            },
            "sms": {
              "type": "boolean"
            },
            "push": {
              "type": "boolean"
            }
          }
        }
      }
    }
  }
}

Vehicles

Vehicle end points

Vehicles

Value vehicle
GET/api/v1/vehicles/value{?identifier}

Get a valuation of a vehicle.

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

Example URI

GET https://staging.hiyacar.co.uk/api/v1/vehicles/value?identifier=NV55GGG
URI Parameters
HideShow
identifier
string (required) Example: NV55GGG

Vehicle registration number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "make": "Ford",
  "model": "Mustang Ecoboost",
  "year": 2016,
  "insurance_group": 43,
  "suggested_prices": {
    "hourly": 8,
    "daily": 29,
    "weekly": 110
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "make": {
      "type": "string"
    },
    "model": {
      "type": "string"
    },
    "year": {
      "type": "number"
    },
    "insurance_group": {
      "type": "number"
    },
    "suggested_prices": {
      "type": "object",
      "properties": {
        "hourly": {
          "type": "number"
        },
        "daily": {
          "type": "number"
        },
        "weekly": {
          "type": "number"
        }
      }
    }
  }
}
Response  406
HideShow
Headers
Content-Type: application/json
Body
{
  error: "Vehicle ineligible: too old"
}
Response  406
HideShow
Headers
Content-Type: application/json
Body
{
  error: "Vehicle ineligible: insurance group too high"
}
Response  406
HideShow
Headers
Content-Type: application/json
Body
{
  error: "Could not fetch car data"
}

List vehicle features
GET/api/v1/vehicles/features

Return all the available vehicle features

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

These values change very very rarely, please cache these with an expiry of at least a week.

system_feature options are options that cannot be chosen by the owner, but can be used for filtering by drivers

Example URI

GET https://staging.hiyacar.co.uk/api/v1/vehicles/features
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 11,
    "title": "Bike Rack",
    "system_feature": false,
    "type": "OTHER"
  },
  {
    "id": 12,
    "title": "Delivery Available",
    "system_feature": false,
    "type": "POPULAR"
  },
  {
    "id": 13,
    "title": "Convertible",
    "system_feature": false,
    "type": "POPULAR"
  },
  {
    "id": 14,
    "title": "No congestion charge (Auto pay)",
    "system_feature": false,
    "type": "POPULAR"
  },
  {
    "id": 15,
    "title": "ULEZ Compliant",
    "system_feature": true,
    "type": "POPULAR"
  }
]

List vehicle types
GET/api/v1/vehicles/types

Return all the available vehicle types

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

These values change very very rarely, please cache these with an expiry of at least a week.

Example URI

GET https://staging.hiyacar.co.uk/api/v1/vehicles/types
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 1,
    "title": "Executive / Saloon"
  },
  {
    "id": 2,
    "title": "Sports / Convertible"
  },
  {
    "id": 3,
    "title": "Estate"
  },
  {
    "id": 4,
    "title": "City / Hatchback"
  },
  {
    "id": 5,
    "title": "4x4"
  },
  {
    "id": 6,
    "title": "FAmily / MPV"
  }
]

Add vehicle
POST/api/v1/vehicles

Add a vehicle to your account

Recommended prices will be used if prices are not supplied

Request data:

  • identifier - the VRM of the vehicle, required

  • description - Description for this vehicle, optional, 1000 chars max

  • miles_per_day - The daily mileage limit of this vehicle, optional

  • price_hourly - The hourly price for this vehicle, optional

  • price_daily - The daily price for this vehicle, optional

  • price_weekly - The weekly price for this vehicle, optional

  • qs_requested - true/false if the owner was interested in QS, optional

  • start_instructions - Instructions for starting this car, optional

  • keys_instructions - Details on where (if needed) to find the keys, optional

  • parking_instructions - Details of how to find the car, optional

  • dropoff_instructions - Details of how to return the car, optional

Example URI

POST https://staging.hiyacar.co.uk/api/v1/vehicles
Request
HideShow
Body
{
  "identifier": "NV55GGG",
  "description": "Some descrption of the car",
  "miles_per_day": 300,
  "qs_requested": true
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 12346,
  "published": true,
  "year": 2014,
  "make": "Audi",
  "model": "A4 Avant TDI",
  "title": "Audi A4 Avant TDI",
  "colour": "red",
  "seats": 4,
  "miles_per_day": 300,
  "insurance_group": 39,
  "engine_cc": 1984,
  "rating": 4.7,
  "rating_count": 3,
  "instant_book": true,
  "instant_book_status": "none",
  "fuel": "Petrol",
  "type": "Executive / Saloon",
  "transmission": "Manual",
  "description": "Economic but quick, you will love this car",
  "vrm": "GC10AAA",
  "prices": {
    "hourly": 8,
    "daily": 29,
    "weekly": 110
  },
  "suggested_prices": {
    "hourly": 8,
    "daily": 29,
    "weekly": 110
  },
  "images": [
    {
      "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "id": 1264,
      "primary": false
    }
  ],
  "owner": {
    "id": 21094,
    "first_name": "Bob",
    "last_name": "A",
    "bio": "I love driving cars ...",
    "rating": 4.7,
    "rating_count": 2,
    "join_date": "2016-10-08",
    "primary_location": {
      "id": "873",
      "city": "London",
      "postcode_prefix": "NW8"
    },
    "profile_image": {
      "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "id": 1264,
      "primary": false
    },
    "live_cars_count": 1,
    "hiyas": 22,
    "owner_response_time": 5006,
    "badges": [
      {
        "name": "top_owner",
        "detail": "some detail"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "published": {
      "type": "boolean",
      "description": "Only visible on your own vehicles"
    },
    "year": {
      "type": "number"
    },
    "make": {
      "type": "string"
    },
    "model": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "colour": {
      "type": "string"
    },
    "seats": {
      "type": "number"
    },
    "miles_per_day": {
      "type": "number"
    },
    "insurance_group": {
      "type": "number"
    },
    "engine_cc": {
      "type": "number"
    },
    "rating": {
      "type": "number"
    },
    "rating_count": {
      "type": "number"
    },
    "instant_book": {
      "type": "boolean"
    },
    "instant_book_status": {
      "type": "string",
      "enum": [
        "none",
        "requested",
        "active",
        "inactive"
      ]
    },
    "fuel": {
      "type": "string",
      "enum": [
        "Petrol",
        "Diesel",
        "Lpg",
        "Electric",
        "Hybrid"
      ]
    },
    "type": {
      "type": "string"
    },
    "transmission": {
      "type": "string",
      "enum": [
        "Manual",
        "Automatic",
        "Semiauto"
      ]
    },
    "description": {
      "type": "string",
      "description": "Owner's description"
    },
    "vrm": {
      "type": "string"
    },
    "prices": {
      "type": "object",
      "properties": {
        "hourly": {
          "type": "number"
        },
        "daily": {
          "type": "number"
        },
        "weekly": {
          "type": "number"
        }
      }
    },
    "suggested_prices": {
      "type": "object",
      "properties": {
        "hourly": {
          "type": "number"
        },
        "daily": {
          "type": "number"
        },
        "weekly": {
          "type": "number"
        }
      }
    },
    "images": {
      "type": "array",
      "description": "In search results this may only contain the vehicles primary image"
    },
    "owner": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string",
          "description": "Only shows first character for users other than yourself"
        },
        "bio": {
          "type": "string"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "join_date": {
          "type": "string"
        },
        "primary_location": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "city": {
              "type": "string"
            },
            "postcode_prefix": {
              "type": "string"
            }
          }
        },
        "profile_image": {
          "type": "object",
          "properties": {
            "300": {
              "type": "string"
            },
            "600": {
              "type": "string"
            },
            "1200": {
              "type": "string"
            },
            "id": {
              "type": "number"
            },
            "primary": {
              "type": "boolean"
            }
          }
        },
        "live_cars_count": {
          "type": "number"
        },
        "hiyas": {
          "type": "number"
        },
        "owner_response_time": {
          "type": "number",
          "description": "Average reponse time in seconds"
        },
        "badges": {
          "type": "array"
        }
      }
    }
  }
}
Response  406
HideShow
Headers
Content-Type: application/json
Body
{
    error: "Vehicle ineligible"
    details: "too old, group too high, etc"
}

Update vehicle details
PUT/api/v1/vehicles/{id}

Update vehicle details

Request data (JSON body) all optional:

  • price_hourly - (integer) The hourly rental price

  • price_daily - (integer) The daily rental price

  • price_weekly - (integer) The weekly rental price

  • description - (string) The description

  • miles_per_day - (integer) Daily mileage cap

  • mileage - (integer) Most recent odometer reading

  • notice_period - (integer) notice required by the owner (in seconds)

  • min_duration - (integer) minimum duration of booking to allow (in seconds)

  • max_duration - (integer) maximum duration of booking to allow (in seconds)

  • features - (integer array) list of feature IDs for this vehicle

  • instant_book - (boolean) request instant book, or if approved enabled/disable it

  • start_instructions - Instructions for starting this car, optional

  • keys_instructions - Details on where (if needed) to find the keys, optional

  • parking_instructions - Details of how to find the car, optional

  • dropoff_instructions - Details of how to return the car, optional

  • dynamic_pricing - (boolean) Is dynamic pricing enabled on this car, optional

  • dynamic_pricing_percent - (integer) What percentage discount to apply to offpeak bookings

Example URI

PUT https://staging.hiyacar.co.uk/api/v1/vehicles/id
URI Parameters
HideShow
id
string (required) 

The vehicle id

Request
HideShow
Body
{
  "price_hourly": 25,
  "price_daily": 150,
  "price_weekly": 500,
  "description": "Some descrption of the car",
  "miles_per_day": 300,
  "features": [
    1,
    2,
    3
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 12346,
  "published": true,
  "year": 2014,
  "make": "Audi",
  "model": "A4 Avant TDI",
  "title": "Audi A4 Avant TDI",
  "colour": "red",
  "seats": 4,
  "miles_per_day": 300,
  "insurance_group": 39,
  "engine_cc": 1984,
  "rating": 4.7,
  "rating_count": 3,
  "instant_book": true,
  "instant_book_status": "none",
  "fuel": "Petrol",
  "type": "Executive / Saloon",
  "transmission": "Manual",
  "description": "Economic but quick, you will love this car",
  "vrm": "GC10AAA",
  "prices": {
    "hourly": 8,
    "daily": 29,
    "weekly": 110
  },
  "suggested_prices": {
    "hourly": 8,
    "daily": 29,
    "weekly": 110
  },
  "images": [
    {
      "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "id": 1264,
      "primary": false
    }
  ],
  "owner": {
    "id": 21094,
    "first_name": "Bob",
    "last_name": "A",
    "bio": "I love driving cars ...",
    "rating": 4.7,
    "rating_count": 2,
    "join_date": "2016-10-08",
    "primary_location": {
      "id": "873",
      "city": "London",
      "postcode_prefix": "NW8"
    },
    "profile_image": {
      "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "id": 1264,
      "primary": false
    },
    "live_cars_count": 1,
    "hiyas": 22,
    "owner_response_time": 5006,
    "badges": [
      {
        "name": "top_owner",
        "detail": "some detail"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "published": {
      "type": "boolean",
      "description": "Only visible on your own vehicles"
    },
    "year": {
      "type": "number"
    },
    "make": {
      "type": "string"
    },
    "model": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "colour": {
      "type": "string"
    },
    "seats": {
      "type": "number"
    },
    "miles_per_day": {
      "type": "number"
    },
    "insurance_group": {
      "type": "number"
    },
    "engine_cc": {
      "type": "number"
    },
    "rating": {
      "type": "number"
    },
    "rating_count": {
      "type": "number"
    },
    "instant_book": {
      "type": "boolean"
    },
    "instant_book_status": {
      "type": "string",
      "enum": [
        "none",
        "requested",
        "active",
        "inactive"
      ]
    },
    "fuel": {
      "type": "string",
      "enum": [
        "Petrol",
        "Diesel",
        "Lpg",
        "Electric",
        "Hybrid"
      ]
    },
    "type": {
      "type": "string"
    },
    "transmission": {
      "type": "string",
      "enum": [
        "Manual",
        "Automatic",
        "Semiauto"
      ]
    },
    "description": {
      "type": "string",
      "description": "Owner's description"
    },
    "vrm": {
      "type": "string"
    },
    "prices": {
      "type": "object",
      "properties": {
        "hourly": {
          "type": "number"
        },
        "daily": {
          "type": "number"
        },
        "weekly": {
          "type": "number"
        }
      }
    },
    "suggested_prices": {
      "type": "object",
      "properties": {
        "hourly": {
          "type": "number"
        },
        "daily": {
          "type": "number"
        },
        "weekly": {
          "type": "number"
        }
      }
    },
    "images": {
      "type": "array",
      "description": "In search results this may only contain the vehicles primary image"
    },
    "owner": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string",
          "description": "Only shows first character for users other than yourself"
        },
        "bio": {
          "type": "string"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "join_date": {
          "type": "string"
        },
        "primary_location": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "city": {
              "type": "string"
            },
            "postcode_prefix": {
              "type": "string"
            }
          }
        },
        "profile_image": {
          "type": "object",
          "properties": {
            "300": {
              "type": "string"
            },
            "600": {
              "type": "string"
            },
            "1200": {
              "type": "string"
            },
            "id": {
              "type": "number"
            },
            "primary": {
              "type": "boolean"
            }
          }
        },
        "live_cars_count": {
          "type": "number"
        },
        "hiyas": {
          "type": "number"
        },
        "owner_response_time": {
          "type": "number",
          "description": "Average reponse time in seconds"
        },
        "badges": {
          "type": "array"
        }
      }
    }
  }
}

List vehicles
GET/api/v1/vehicles

List all vehicles in account

Example URI

GET https://staging.hiyacar.co.uk/api/v1/vehicles
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 12346,
    "published": true,
    "year": 2014,
    "make": "Audi",
    "model": "A4 Avant TDI",
    "title": "Audi A4 Avant TDI",
    "colour": "red",
    "seats": 4,
    "miles_per_day": 300,
    "insurance_group": 39,
    "engine_cc": 1984,
    "rating": 4.7,
    "rating_count": 3,
    "instant_book": true,
    "instant_book_status": "none",
    "fuel": "Petrol",
    "type": "Executive / Saloon",
    "transmission": "Manual",
    "description": "Economic but quick, you will love this car",
    "vrm": "GC10AAA",
    "prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "suggested_prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "images": [
      {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      }
    ],
    "owner": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Retrieve details of a vehicle
GET/api/v1/vehicles/{id}

Retrieve the details of a vehicle

Example URI

GET https://staging.hiyacar.co.uk/api/v1/vehicles/id
URI Parameters
HideShow
id
string (required) 

the vehicle id

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 12346,
  "published": true,
  "year": 2014,
  "make": "Audi",
  "model": "A4 Avant TDI",
  "title": "Audi A4 Avant TDI",
  "colour": "red",
  "seats": 4,
  "miles_per_day": 300,
  "insurance_group": 39,
  "engine_cc": 1984,
  "rating": 4.7,
  "rating_count": 3,
  "instant_book": true,
  "instant_book_status": "none",
  "fuel": "Petrol",
  "type": "Executive / Saloon",
  "transmission": "Manual",
  "description": "Economic but quick, you will love this car",
  "vrm": "GC10AAA",
  "prices": {
    "hourly": 8,
    "daily": 29,
    "weekly": 110
  },
  "suggested_prices": {
    "hourly": 8,
    "daily": 29,
    "weekly": 110
  },
  "images": [
    {
      "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "id": 1264,
      "primary": false
    }
  ],
  "owner": {
    "id": 21094,
    "first_name": "Bob",
    "last_name": "A",
    "bio": "I love driving cars ...",
    "rating": 4.7,
    "rating_count": 2,
    "join_date": "2016-10-08",
    "primary_location": {
      "id": "873",
      "city": "London",
      "postcode_prefix": "NW8"
    },
    "profile_image": {
      "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "id": 1264,
      "primary": false
    },
    "live_cars_count": 1,
    "hiyas": 22,
    "owner_response_time": 5006,
    "badges": [
      {
        "name": "top_owner",
        "detail": "some detail"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "published": {
      "type": "boolean",
      "description": "Only visible on your own vehicles"
    },
    "year": {
      "type": "number"
    },
    "make": {
      "type": "string"
    },
    "model": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "colour": {
      "type": "string"
    },
    "seats": {
      "type": "number"
    },
    "miles_per_day": {
      "type": "number"
    },
    "insurance_group": {
      "type": "number"
    },
    "engine_cc": {
      "type": "number"
    },
    "rating": {
      "type": "number"
    },
    "rating_count": {
      "type": "number"
    },
    "instant_book": {
      "type": "boolean"
    },
    "instant_book_status": {
      "type": "string",
      "enum": [
        "none",
        "requested",
        "active",
        "inactive"
      ]
    },
    "fuel": {
      "type": "string",
      "enum": [
        "Petrol",
        "Diesel",
        "Lpg",
        "Electric",
        "Hybrid"
      ]
    },
    "type": {
      "type": "string"
    },
    "transmission": {
      "type": "string",
      "enum": [
        "Manual",
        "Automatic",
        "Semiauto"
      ]
    },
    "description": {
      "type": "string",
      "description": "Owner's description"
    },
    "vrm": {
      "type": "string"
    },
    "prices": {
      "type": "object",
      "properties": {
        "hourly": {
          "type": "number"
        },
        "daily": {
          "type": "number"
        },
        "weekly": {
          "type": "number"
        }
      }
    },
    "suggested_prices": {
      "type": "object",
      "properties": {
        "hourly": {
          "type": "number"
        },
        "daily": {
          "type": "number"
        },
        "weekly": {
          "type": "number"
        }
      }
    },
    "images": {
      "type": "array",
      "description": "In search results this may only contain the vehicles primary image"
    },
    "owner": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string",
          "description": "Only shows first character for users other than yourself"
        },
        "bio": {
          "type": "string"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "join_date": {
          "type": "string"
        },
        "primary_location": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "city": {
              "type": "string"
            },
            "postcode_prefix": {
              "type": "string"
            }
          }
        },
        "profile_image": {
          "type": "object",
          "properties": {
            "300": {
              "type": "string"
            },
            "600": {
              "type": "string"
            },
            "1200": {
              "type": "string"
            },
            "id": {
              "type": "number"
            },
            "primary": {
              "type": "boolean"
            }
          }
        },
        "live_cars_count": {
          "type": "number"
        },
        "hiyas": {
          "type": "number"
        },
        "owner_response_time": {
          "type": "number",
          "description": "Average reponse time in seconds"
        },
        "badges": {
          "type": "array"
        }
      }
    }
  }
}

Publish vehicle
POST/api/v1/vehicles/{id}/onboard

Onboard a vehicle

ADMIN access requires to perform this

Example URI

POST https://staging.hiyacar.co.uk/api/v1/vehicles/id/onboard
URI Parameters
HideShow
id
string (required) 

The vehicle id

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    success: true
}

Publish vehicle
POST/api/v1/vehicles/{id}/publish

Publish a vehicle

Example URI

POST https://staging.hiyacar.co.uk/api/v1/vehicles/id/publish
URI Parameters
HideShow
id
string (required) 

The vehicle id

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    success: true
}
Response  406
HideShow
Headers
Content-Type: application/json
Body
{
  "success": false,
  "error": "Could not publish vehicle",
  "details": ""
}

Unpublish vehicle
DELETE/api/v1/vehicles/{id}/publish

Unpublish a vehicle

Example URI

DELETE https://staging.hiyacar.co.uk/api/v1/vehicles/id/publish
URI Parameters
HideShow
id
string (required) 

The vehicle id

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    success: true
}
Response  406
HideShow
Headers
Content-Type: application/json
Body
{
  "success": false,
  "error": "Could not publish vehicle",
  "details": ""
}

Fetch vehicle availabilty
GET/api/v1/vehicles/{id}/availability

Get the availability of this vehicle

Example URI

GET https://staging.hiyacar.co.uk/api/v1/vehicles/1419/availability
URI Parameters
HideShow
id
number (required) Example: 1419

The Vehicle ID

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "location_id": 56,
    "hours": {
      "MO": [
        1
      ],
      "TU": [
        1
      ],
      "WE": [
        1
      ],
      "TH": [
        1
      ],
      "FR": [
        1
      ],
      "SA": [
        1
      ],
      "SU": [
        1
      ]
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Update vehicle availabilty
PUT/api/v1/vehicles/{id}/availability

Update the availability of this vehicle

Example URI

PUT https://staging.hiyacar.co.uk/api/v1/vehicles/1419/availability
URI Parameters
HideShow
id
number (required) Example: 1419

The Vehicle ID

Request
HideShow
Body
{
  "location_id": 67,
  "hours": {
    "MO": [
      9,
      10,
      11,
      12,
      13,
      14,
      15,
      16,
      17
    ],
    "TU": [
      9,
      10,
      11,
      12,
      13,
      14,
      15,
      16,
      17
    ],
    "WE": [
      9,
      10,
      11,
      12,
      13,
      14,
      15,
      16,
      17
    ],
    "TH": [
      9,
      10,
      11,
      12,
      13,
      14,
      15,
      16,
      17
    ],
    "FR": [
      9,
      10,
      11,
      12,
      13,
      14,
      15,
      16,
      17
    ],
    "SA": [],
    "SU": []
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
        success: true
    }

Fetch vehicle calendar data
GET/api/v1/vehicles/{id}/calendar

Get the latest vehicle calendar data

Example URI

GET https://staging.hiyacar.co.uk/api/v1/vehicles/353/calendar
URI Parameters
HideShow
id
number (required) Example: 353

The vehicle ID

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "starts_at": "2018-12-07T12:00:00Z",
    "ends_at": "2018-12-08T12:00:00Z",
    "type": "user"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Update vehicle calendar
POST/api/v1/vehicles/{id}/calendar

Add/Remove blocked periods in the calendar

Example URI

POST https://staging.hiyacar.co.uk/api/v1/vehicles/353/calendar
URI Parameters
HideShow
id
number (required) Example: 353

The vehicle ID

Request  Blocking a day and clearing a day
HideShow
Body
{
    "block": [
        {
            "starts_at": "2018-12-01T00:00:00Z",
            "ends_at": "2018-12-02T00:00:00Z",
        }
    ],
    "clear": [
        {
            "starts_at": "2018-12-02T00:00:00Z",
            "ends_at": "2018-12-03T00:00:00Z",
        }
    ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "starts_at": "2018-12-07T12:00:00Z",
    "ends_at": "2018-12-08T12:00:00Z",
    "type": "user"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Request  Blocking days only
HideShow
Body
{
    "block": [
        {
            "starts_at": "2018-12-01T00:00:00Z",
            "ends_at": "2018-12-02T00:00:00Z",
        },
        {
            "starts_at": "2018-12-02T00:00:00Z",
            "ends_at": "2018-12-03T00:00:00Z",
        }
    ],
    "clear": []
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "starts_at": "2018-12-07T12:00:00Z",
    "ends_at": "2018-12-08T12:00:00Z",
    "type": "user"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Request  Clearing days only
HideShow
Body
{
    "block": [],
    "clear": [
        {
            "starts_at": "2018-12-01T00:00:00Z",
            "ends_at": "2018-12-02T00:00:00Z",
        },
        {
            "starts_at": "2018-12-02T00:00:00Z",
            "ends_at": "2018-12-03T00:00:00Z",
        }
    ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "starts_at": "2018-12-07T12:00:00Z",
    "ends_at": "2018-12-08T12:00:00Z",
    "type": "user"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Remove vehicle
DELETE/api/v1/vehicles/{id}

Remove a vehicle from account

Example URI

DELETE https://staging.hiyacar.co.uk/api/v1/vehicles/1419
URI Parameters
HideShow
id
number (required) Example: 1419

The vehicle ID

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
        success: true
    }
Response  406
HideShow
Headers
Content-Type: application/json
Body
{
  "success": false,
  "error": "Unable to delete vehicle",
  "details": "There are active bookings upcoming"
}

Vehicle Images

Vehicle Images

Add images to a vehicle
POST/api/v1/vehicles/{vehicleId}/images

Upload an images to a vehicle

JSON body parameters:

images - Array of images base64 encoded, required

Example URI

POST https://staging.hiyacar.co.uk/api/v1/vehicles/276/images
URI Parameters
HideShow
vehicleId
number (required) Example: 276
Request
HideShow
Body
{
  "images": [
    "uybtuvsdtuvy",
    "adfnsftjrtj"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "id": 1264,
    "primary": false
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Retrieve the images for a vehicle
GET/api/v1/vehicles/{vehicleId}/images

Retrieve the images for a vehicle.

Example URI

GET https://staging.hiyacar.co.uk/api/v1/vehicles/276/images
URI Parameters
HideShow
vehicleId
number (required) Example: 276

The ID of the vehicle

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "id": 1264,
    "primary": false
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Remove all images from a vehicle
DELETE/api/v1/vehicles/{vehicleId}/images

Remove an image from a vehicle.

Example URI

DELETE https://staging.hiyacar.co.uk/api/v1/vehicles/276/images
URI Parameters
HideShow
vehicleId
number (required) Example: 276

The ID of the vehicle

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "id": 1264,
    "primary": false
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Remove an images from a vehicle
DELETE/api/v1/vehicles/{vehicleId}/images/{imageId}

Remove an image from a vehicle.

Example URI

DELETE https://staging.hiyacar.co.uk/api/v1/vehicles/276/images/1685
URI Parameters
HideShow
vehicleId
number (required) Example: 276

The ID of the vehicle

imageId
number (required) Example: 1685

The ID of the image to remove

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "id": 1264,
    "primary": false
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Make an vehicle image primary
POST/api/v1/vehicles/{vehicleId}/images/{imageId}/primary

Make the given image the primary vehicle for the image

Example URI

POST https://staging.hiyacar.co.uk/api/v1/vehicles/276/images/1546/primary
URI Parameters
HideShow
vehicleId
number (required) Example: 276

The ID of the vehicle

imageId
number (required) Example: 1546

The ID of the vehicle image

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
    "id": 1264,
    "primary": false
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Retrieve vehicle reviews
GET/api/v1/vehicles/{vehicleId}/reviews

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

Example URI

GET https://staging.hiyacar.co.uk/api/v1/vehicles/1125/reviews
URI Parameters
HideShow
vehicleId
number (required) Example: 1125

The vehicle ID of the vehicle to retrieve reviews for

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "514",
    "for": "driver",
    "ratings": 5,
    "review": "They were great",
    "created_at": "2017-01-0T15:30:00",
    "from": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Bookings

Bookings

Booking Quote
POST/api/v1/bookings/quote

Get a Quote for a booking

This end point DOES NOT require authentication, however it IS still subject to rate limiting.

Request data:

  • vehicle_id - The vehicle, required

  • location_id - The location, required

  • start_at - The starting date/time of the booking, ISO 8601 date format, required

  • end_at - The ending date/time of the booking, ISO 8601 date format, required

  • voucher - The voucher code to apply to this booking quote, only valid if logged in, optional

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings/quote
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "rental": 150,
  "fee": 3,
  "insurance": 20.57,
  "total": 153.57,
  "is_insurance_estimate": true,
  "estimate_reason": "Profile is incomplete",
  "extras_cost": -20,
  "extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "optional_extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "insurance_statements": [
    "I have no previous convictions"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "rental": {
      "type": "number"
    },
    "fee": {
      "type": "number"
    },
    "insurance": {
      "type": "number"
    },
    "total": {
      "type": "number"
    },
    "is_insurance_estimate": {
      "type": "boolean",
      "description": "Is this insurance cost an estimate, true if we don't have a completed \nprofile yet for this user to take their age/driving history in to account.\nThe insurance will never be lower, it can only ever increase."
    },
    "estimate_reason": {
      "type": "string",
      "description": "If the quote is an estimate, this is the reason for it being so"
    },
    "extras_cost": {
      "type": "number"
    },
    "extras": {
      "type": "array"
    },
    "optional_extras": {
      "type": "array"
    },
    "insurance_statements": {
      "type": "array"
    }
  }
}

Create a booking request
POST/api/v1/bookings

Request a booking

Request data:

  • vehicle_id - The vehicle, required

  • location_id - The location, required

  • start_at - The starting date/time of the booking, ISO 8601 date format, required

  • end_at - The ending date/time of the booking, ISO 8601 date format, required

  • stripe_token - The stripe token to update payment to update payment details with, optional

  • cardholder_name - The card holder name, if updating the card details, optional

  • voucher - The voucher code to apply to this booking quote, optional

  • message - Message to send the owner when the request is placed

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "ref": "WL62-LC46-TY42",
  "state": 64,
  "state_string": "Cancelled",
  "rental_cost": 130,
  "fees": 3,
  "insurance_cost": 19.348,
  "extras_cost": -20,
  "extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "owner_earnings": 9.6,
  "starts_at": "2017-06-01T12:00:00+00:00",
  "ends_at": "2017-06-02T12:00:00+00:00",
  "picked_up": true,
  "picked_up_at": "2021-06-01T12:00:00+00:00",
  "returned": true,
  "returned_at": "2021-06-01T12:00:00+00:00",
  "vehicle": {
    "id": 12346,
    "published": true,
    "year": 2014,
    "make": "Audi",
    "model": "A4 Avant TDI",
    "title": "Audi A4 Avant TDI",
    "colour": "red",
    "seats": 4,
    "miles_per_day": 300,
    "insurance_group": 39,
    "engine_cc": 1984,
    "rating": 4.7,
    "rating_count": 3,
    "instant_book": true,
    "instant_book_status": "none",
    "fuel": "Petrol",
    "type": "Executive / Saloon",
    "transmission": "Manual",
    "description": "Economic but quick, you will love this car",
    "vrm": "GC10AAA",
    "prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "suggested_prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "images": [
      {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      }
    ],
    "owner": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  },
  "virtual_key": {
    "present": true,
    "type": "ota",
    "id": 130111
  },
  "reviewed_by_driver": false,
  "reviewed_by_owner": false,
  "reviewable": true,
  "accurate_location": {
    "lat": 51.50093,
    "lng": 0.078742
  },
  "payment": {
    "pending": false,
    "intent": "pi_xxxxxx"
  },
  "pickup_fuel_manual": 50,
  "pickup_fuel_tracker": 50,
  "pickup_miles_manual": 8965,
  "pickup_miles_tracker": 8965,
  "pickup_fuel_present": true,
  "pickup_location": {
    "lat": 51.5,
    "ln": 0.078
  },
  "return_fuel_manual": 50,
  "return_fuel_tracker": 50,
  "return_miles_manual": 8965,
  "return_miles_tracker": 8965,
  "miles_driven_manual": 165,
  "miles_driven_tracker": 165,
  "return_location": {
    "lat": 51.5,
    "ln": 0.078
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "ref": {
      "type": "string",
      "description": "The booking reference"
    },
    "state": {
      "type": "number",
      "description": "The state of the booking, as a number"
    },
    "state_string": {
      "type": "string",
      "description": "The state of the booking, as a user friendly string"
    },
    "rental_cost": {
      "type": "number",
      "description": "The cost of the rental"
    },
    "fees": {
      "type": "number",
      "description": "The fees"
    },
    "insurance_cost": {
      "type": "number",
      "description": "The cost of the insurance"
    },
    "extras_cost": {
      "type": "number",
      "description": "The cost of any extras: vouchers, credit, charges etc"
    },
    "extras": {
      "type": "array"
    },
    "owner_earnings": {
      "type": "number",
      "description": "The amount the owner will be paid for this booking"
    },
    "starts_at": {
      "type": "string",
      "description": "The start of the booking, ISO 8601 date format"
    },
    "ends_at": {
      "type": "string",
      "description": "The end of the booking, ISO 8601 date format"
    },
    "vehicle": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "published": {
          "type": "boolean",
          "description": "Only visible on your own vehicles"
        },
        "year": {
          "type": "number"
        },
        "make": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "colour": {
          "type": "string"
        },
        "seats": {
          "type": "number"
        },
        "miles_per_day": {
          "type": "number"
        },
        "insurance_group": {
          "type": "number"
        },
        "engine_cc": {
          "type": "number"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "instant_book": {
          "type": "boolean"
        },
        "instant_book_status": {
          "type": "string",
          "enum": [
            "none",
            "requested",
            "active",
            "inactive"
          ]
        },
        "fuel": {
          "type": "string",
          "enum": [
            "Petrol",
            "Diesel",
            "Lpg",
            "Electric",
            "Hybrid"
          ]
        },
        "type": {
          "type": "string"
        },
        "transmission": {
          "type": "string",
          "enum": [
            "Manual",
            "Automatic",
            "Semiauto"
          ]
        },
        "description": {
          "type": "string",
          "description": "Owner's description"
        },
        "vrm": {
          "type": "string"
        },
        "prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "suggested_prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "images": {
          "type": "array",
          "description": "In search results this may only contain the vehicles primary image"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string",
              "description": "Only shows first character for users other than yourself"
            },
            "bio": {
              "type": "string"
            },
            "rating": {
              "type": "number"
            },
            "rating_count": {
              "type": "number"
            },
            "join_date": {
              "type": "string"
            },
            "primary_location": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "postcode_prefix": {
                  "type": "string"
                }
              }
            },
            "profile_image": {
              "type": "object",
              "properties": {
                "300": {
                  "type": "string"
                },
                "600": {
                  "type": "string"
                },
                "1200": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "primary": {
                  "type": "boolean"
                }
              }
            },
            "live_cars_count": {
              "type": "number"
            },
            "hiyas": {
              "type": "number"
            },
            "owner_response_time": {
              "type": "number",
              "description": "Average reponse time in seconds"
            },
            "badges": {
              "type": "array"
            }
          }
        }
      }
    },
    "virtual_key": {
      "type": "object",
      "properties": {
        "present": {
          "type": "boolean"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "number"
        }
      }
    },
    "reviewed_by_driver": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the driver"
    },
    "reviewed_by_owner": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the owner"
    },
    "reviewable": {
      "type": "boolean",
      "description": "Can this booking be reviewed"
    },
    "accurate_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        },
        "lng": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        }
      }
    },
    "payment": {
      "type": "object",
      "properties": {
        "pending": {
          "type": "boolean",
          "description": "Is the payment for this booking still pending"
        },
        "intent": {
          "type": "string",
          "description": "The Stripe PaymentIntent needed to complete the payment, null if not applicable"
        }
      }
    },
    "pickup_fuel_manual": {
      "type": "number"
    },
    "pickup_fuel_tracker": {
      "type": "number"
    },
    "pickup_miles_manual": {
      "type": "number"
    },
    "pickup_miles_tracker": {
      "type": "number"
    },
    "picked_up": {
      "type": "boolean"
    },
    "picked_up_at": {
      "type": "string"
    },
    "pickup_fuel_present": {
      "type": "boolean"
    },
    "pickup_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    },
    "returned": {
      "type": "boolean"
    },
    "returned_at": {
      "type": "string"
    },
    "return_fuel_manual": {
      "type": "number"
    },
    "return_fuel_tracker": {
      "type": "number"
    },
    "return_miles_manual": {
      "type": "number"
    },
    "return_miles_tracker": {
      "type": "number"
    },
    "miles_driven_manual": {
      "type": "number"
    },
    "miles_driven_tracker": {
      "type": "number"
    },
    "return_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    }
  }
}

Booking payment
POST/api/v1/bookings/{ref}/payment

Accept a booking

Request data:

  • payment_intent - The payment intent that has been approved via Stripe

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings/PF23-GX99-QD22/payment
URI Parameters
HideShow
ref
string (required) Example: PF23-GX99-QD22
Request  From Driver
HideShow
Body
{
  "payment_intent": "pi_xxxxx_secret_xxxxxx"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "ref": "WL62-LC46-TY42",
  "state": 64,
  "state_string": "Cancelled",
  "rental_cost": 130,
  "fees": 3,
  "insurance_cost": 19.348,
  "extras_cost": -20,
  "extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "owner_earnings": 9.6,
  "starts_at": "2017-06-01T12:00:00+00:00",
  "ends_at": "2017-06-02T12:00:00+00:00",
  "picked_up": true,
  "picked_up_at": "2021-06-01T12:00:00+00:00",
  "returned": true,
  "returned_at": "2021-06-01T12:00:00+00:00",
  "vehicle": {
    "id": 12346,
    "published": true,
    "year": 2014,
    "make": "Audi",
    "model": "A4 Avant TDI",
    "title": "Audi A4 Avant TDI",
    "colour": "red",
    "seats": 4,
    "miles_per_day": 300,
    "insurance_group": 39,
    "engine_cc": 1984,
    "rating": 4.7,
    "rating_count": 3,
    "instant_book": true,
    "instant_book_status": "none",
    "fuel": "Petrol",
    "type": "Executive / Saloon",
    "transmission": "Manual",
    "description": "Economic but quick, you will love this car",
    "vrm": "GC10AAA",
    "prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "suggested_prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "images": [
      {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      }
    ],
    "owner": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  },
  "virtual_key": {
    "present": true,
    "type": "ota",
    "id": 130111
  },
  "reviewed_by_driver": false,
  "reviewed_by_owner": false,
  "reviewable": true,
  "accurate_location": {
    "lat": 51.50093,
    "lng": 0.078742
  },
  "payment": {
    "pending": false,
    "intent": "pi_xxxxxx"
  },
  "pickup_fuel_manual": 50,
  "pickup_fuel_tracker": 50,
  "pickup_miles_manual": 8965,
  "pickup_miles_tracker": 8965,
  "pickup_fuel_present": true,
  "pickup_location": {
    "lat": 51.5,
    "ln": 0.078
  },
  "return_fuel_manual": 50,
  "return_fuel_tracker": 50,
  "return_miles_manual": 8965,
  "return_miles_tracker": 8965,
  "miles_driven_manual": 165,
  "miles_driven_tracker": 165,
  "return_location": {
    "lat": 51.5,
    "ln": 0.078
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "ref": {
      "type": "string",
      "description": "The booking reference"
    },
    "state": {
      "type": "number",
      "description": "The state of the booking, as a number"
    },
    "state_string": {
      "type": "string",
      "description": "The state of the booking, as a user friendly string"
    },
    "rental_cost": {
      "type": "number",
      "description": "The cost of the rental"
    },
    "fees": {
      "type": "number",
      "description": "The fees"
    },
    "insurance_cost": {
      "type": "number",
      "description": "The cost of the insurance"
    },
    "extras_cost": {
      "type": "number",
      "description": "The cost of any extras: vouchers, credit, charges etc"
    },
    "extras": {
      "type": "array"
    },
    "owner_earnings": {
      "type": "number",
      "description": "The amount the owner will be paid for this booking"
    },
    "starts_at": {
      "type": "string",
      "description": "The start of the booking, ISO 8601 date format"
    },
    "ends_at": {
      "type": "string",
      "description": "The end of the booking, ISO 8601 date format"
    },
    "vehicle": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "published": {
          "type": "boolean",
          "description": "Only visible on your own vehicles"
        },
        "year": {
          "type": "number"
        },
        "make": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "colour": {
          "type": "string"
        },
        "seats": {
          "type": "number"
        },
        "miles_per_day": {
          "type": "number"
        },
        "insurance_group": {
          "type": "number"
        },
        "engine_cc": {
          "type": "number"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "instant_book": {
          "type": "boolean"
        },
        "instant_book_status": {
          "type": "string",
          "enum": [
            "none",
            "requested",
            "active",
            "inactive"
          ]
        },
        "fuel": {
          "type": "string",
          "enum": [
            "Petrol",
            "Diesel",
            "Lpg",
            "Electric",
            "Hybrid"
          ]
        },
        "type": {
          "type": "string"
        },
        "transmission": {
          "type": "string",
          "enum": [
            "Manual",
            "Automatic",
            "Semiauto"
          ]
        },
        "description": {
          "type": "string",
          "description": "Owner's description"
        },
        "vrm": {
          "type": "string"
        },
        "prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "suggested_prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "images": {
          "type": "array",
          "description": "In search results this may only contain the vehicles primary image"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string",
              "description": "Only shows first character for users other than yourself"
            },
            "bio": {
              "type": "string"
            },
            "rating": {
              "type": "number"
            },
            "rating_count": {
              "type": "number"
            },
            "join_date": {
              "type": "string"
            },
            "primary_location": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "postcode_prefix": {
                  "type": "string"
                }
              }
            },
            "profile_image": {
              "type": "object",
              "properties": {
                "300": {
                  "type": "string"
                },
                "600": {
                  "type": "string"
                },
                "1200": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "primary": {
                  "type": "boolean"
                }
              }
            },
            "live_cars_count": {
              "type": "number"
            },
            "hiyas": {
              "type": "number"
            },
            "owner_response_time": {
              "type": "number",
              "description": "Average reponse time in seconds"
            },
            "badges": {
              "type": "array"
            }
          }
        }
      }
    },
    "virtual_key": {
      "type": "object",
      "properties": {
        "present": {
          "type": "boolean"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "number"
        }
      }
    },
    "reviewed_by_driver": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the driver"
    },
    "reviewed_by_owner": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the owner"
    },
    "reviewable": {
      "type": "boolean",
      "description": "Can this booking be reviewed"
    },
    "accurate_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        },
        "lng": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        }
      }
    },
    "payment": {
      "type": "object",
      "properties": {
        "pending": {
          "type": "boolean",
          "description": "Is the payment for this booking still pending"
        },
        "intent": {
          "type": "string",
          "description": "The Stripe PaymentIntent needed to complete the payment, null if not applicable"
        }
      }
    },
    "pickup_fuel_manual": {
      "type": "number"
    },
    "pickup_fuel_tracker": {
      "type": "number"
    },
    "pickup_miles_manual": {
      "type": "number"
    },
    "pickup_miles_tracker": {
      "type": "number"
    },
    "picked_up": {
      "type": "boolean"
    },
    "picked_up_at": {
      "type": "string"
    },
    "pickup_fuel_present": {
      "type": "boolean"
    },
    "pickup_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    },
    "returned": {
      "type": "boolean"
    },
    "returned_at": {
      "type": "string"
    },
    "return_fuel_manual": {
      "type": "number"
    },
    "return_fuel_tracker": {
      "type": "number"
    },
    "return_miles_manual": {
      "type": "number"
    },
    "return_miles_tracker": {
      "type": "number"
    },
    "miles_driven_manual": {
      "type": "number"
    },
    "miles_driven_tracker": {
      "type": "number"
    },
    "return_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    }
  }
}

Retrieve list of bookings
GET/api/v1/bookings{?filter,state}

Get the list of booking for this user

Example URI

GET https://staging.hiyacar.co.uk/api/v1/bookings?filter=owner&state=completed
URI Parameters
HideShow
filter
string (optional) Example: owner

Which type of bookings to filter by, default to driver if not specified

Choices: owner driver

state
string (optional) Example: completed

What state bookings to show

Choices: upcoming history completed expired cancelled declined

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "ref": "WL62-LC46-TY42",
    "state": 64,
    "state_string": "Cancelled",
    "rental_cost": 130,
    "fees": 3,
    "insurance_cost": 19.348,
    "extras_cost": -20,
    "extras": [
      {
        "key": "driver_discount",
        "amount": -20,
        "description": "Voucher (TRACKER)"
      }
    ],
    "owner_earnings": 9.6,
    "starts_at": "2017-06-01T12:00:00+00:00",
    "ends_at": "2017-06-02T12:00:00+00:00",
    "picked_up": true,
    "picked_up_at": "2021-06-01T12:00:00+00:00",
    "returned": true,
    "returned_at": "2021-06-01T12:00:00+00:00",
    "vehicle": {
      "id": 12346,
      "published": true,
      "year": 2014,
      "make": "Audi",
      "model": "A4 Avant TDI",
      "title": "Audi A4 Avant TDI",
      "colour": "red",
      "seats": 4,
      "miles_per_day": 300,
      "insurance_group": 39,
      "engine_cc": 1984,
      "rating": 4.7,
      "rating_count": 3,
      "instant_book": true,
      "instant_book_status": "none",
      "fuel": "Petrol",
      "type": "Executive / Saloon",
      "transmission": "Manual",
      "description": "Economic but quick, you will love this car",
      "vrm": "GC10AAA",
      "prices": {
        "hourly": 8,
        "daily": 29,
        "weekly": 110
      },
      "suggested_prices": {
        "hourly": 8,
        "daily": 29,
        "weekly": 110
      },
      "images": [
        {
          "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
          "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
          "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
          "id": 1264,
          "primary": false
        }
      ],
      "owner": {
        "id": 21094,
        "first_name": "Bob",
        "last_name": "A",
        "bio": "I love driving cars ...",
        "rating": 4.7,
        "rating_count": 2,
        "join_date": "2016-10-08",
        "primary_location": {
          "id": "873",
          "city": "London",
          "postcode_prefix": "NW8"
        },
        "profile_image": {
          "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
          "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
          "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
          "id": 1264,
          "primary": false
        },
        "live_cars_count": 1,
        "hiyas": 22,
        "owner_response_time": 5006,
        "badges": [
          {
            "name": "top_owner",
            "detail": "some detail"
          }
        ]
      }
    },
    "virtual_key": {
      "present": true,
      "type": "ota",
      "id": 130111
    },
    "reviewed_by_driver": false,
    "reviewed_by_owner": false,
    "reviewable": true,
    "accurate_location": {
      "lat": 51.50093,
      "lng": 0.078742
    },
    "payment": {
      "pending": false,
      "intent": "pi_xxxxxx"
    },
    "pickup_fuel_manual": 50,
    "pickup_fuel_tracker": 50,
    "pickup_miles_manual": 8965,
    "pickup_miles_tracker": 8965,
    "pickup_fuel_present": true,
    "pickup_location": {
      "lat": 51.5,
      "ln": 0.078
    },
    "return_fuel_manual": 50,
    "return_fuel_tracker": 50,
    "return_miles_manual": 8965,
    "return_miles_tracker": 8965,
    "miles_driven_manual": 165,
    "miles_driven_tracker": 165,
    "return_location": {
      "lat": 51.5,
      "ln": 0.078
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Retrieve a booking
GET/api/v1/bookings/

Get a booking for this user

Example URI

GET https://staging.hiyacar.co.uk/api/v1/bookings/
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "ref": "WL62-LC46-TY42",
  "state": 64,
  "state_string": "Cancelled",
  "rental_cost": 130,
  "fees": 3,
  "insurance_cost": 19.348,
  "extras_cost": -20,
  "extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "owner_earnings": 9.6,
  "starts_at": "2017-06-01T12:00:00+00:00",
  "ends_at": "2017-06-02T12:00:00+00:00",
  "picked_up": true,
  "picked_up_at": "2021-06-01T12:00:00+00:00",
  "returned": true,
  "returned_at": "2021-06-01T12:00:00+00:00",
  "vehicle": {
    "id": 12346,
    "published": true,
    "year": 2014,
    "make": "Audi",
    "model": "A4 Avant TDI",
    "title": "Audi A4 Avant TDI",
    "colour": "red",
    "seats": 4,
    "miles_per_day": 300,
    "insurance_group": 39,
    "engine_cc": 1984,
    "rating": 4.7,
    "rating_count": 3,
    "instant_book": true,
    "instant_book_status": "none",
    "fuel": "Petrol",
    "type": "Executive / Saloon",
    "transmission": "Manual",
    "description": "Economic but quick, you will love this car",
    "vrm": "GC10AAA",
    "prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "suggested_prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "images": [
      {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      }
    ],
    "owner": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  },
  "virtual_key": {
    "present": true,
    "type": "ota",
    "id": 130111
  },
  "reviewed_by_driver": false,
  "reviewed_by_owner": false,
  "reviewable": true,
  "accurate_location": {
    "lat": 51.50093,
    "lng": 0.078742
  },
  "payment": {
    "pending": false,
    "intent": "pi_xxxxxx"
  },
  "pickup_fuel_manual": 50,
  "pickup_fuel_tracker": 50,
  "pickup_miles_manual": 8965,
  "pickup_miles_tracker": 8965,
  "pickup_fuel_present": true,
  "pickup_location": {
    "lat": 51.5,
    "ln": 0.078
  },
  "return_fuel_manual": 50,
  "return_fuel_tracker": 50,
  "return_miles_manual": 8965,
  "return_miles_tracker": 8965,
  "miles_driven_manual": 165,
  "miles_driven_tracker": 165,
  "return_location": {
    "lat": 51.5,
    "ln": 0.078
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "ref": {
      "type": "string",
      "description": "The booking reference"
    },
    "state": {
      "type": "number",
      "description": "The state of the booking, as a number"
    },
    "state_string": {
      "type": "string",
      "description": "The state of the booking, as a user friendly string"
    },
    "rental_cost": {
      "type": "number",
      "description": "The cost of the rental"
    },
    "fees": {
      "type": "number",
      "description": "The fees"
    },
    "insurance_cost": {
      "type": "number",
      "description": "The cost of the insurance"
    },
    "extras_cost": {
      "type": "number",
      "description": "The cost of any extras: vouchers, credit, charges etc"
    },
    "extras": {
      "type": "array"
    },
    "owner_earnings": {
      "type": "number",
      "description": "The amount the owner will be paid for this booking"
    },
    "starts_at": {
      "type": "string",
      "description": "The start of the booking, ISO 8601 date format"
    },
    "ends_at": {
      "type": "string",
      "description": "The end of the booking, ISO 8601 date format"
    },
    "vehicle": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "published": {
          "type": "boolean",
          "description": "Only visible on your own vehicles"
        },
        "year": {
          "type": "number"
        },
        "make": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "colour": {
          "type": "string"
        },
        "seats": {
          "type": "number"
        },
        "miles_per_day": {
          "type": "number"
        },
        "insurance_group": {
          "type": "number"
        },
        "engine_cc": {
          "type": "number"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "instant_book": {
          "type": "boolean"
        },
        "instant_book_status": {
          "type": "string",
          "enum": [
            "none",
            "requested",
            "active",
            "inactive"
          ]
        },
        "fuel": {
          "type": "string",
          "enum": [
            "Petrol",
            "Diesel",
            "Lpg",
            "Electric",
            "Hybrid"
          ]
        },
        "type": {
          "type": "string"
        },
        "transmission": {
          "type": "string",
          "enum": [
            "Manual",
            "Automatic",
            "Semiauto"
          ]
        },
        "description": {
          "type": "string",
          "description": "Owner's description"
        },
        "vrm": {
          "type": "string"
        },
        "prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "suggested_prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "images": {
          "type": "array",
          "description": "In search results this may only contain the vehicles primary image"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string",
              "description": "Only shows first character for users other than yourself"
            },
            "bio": {
              "type": "string"
            },
            "rating": {
              "type": "number"
            },
            "rating_count": {
              "type": "number"
            },
            "join_date": {
              "type": "string"
            },
            "primary_location": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "postcode_prefix": {
                  "type": "string"
                }
              }
            },
            "profile_image": {
              "type": "object",
              "properties": {
                "300": {
                  "type": "string"
                },
                "600": {
                  "type": "string"
                },
                "1200": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "primary": {
                  "type": "boolean"
                }
              }
            },
            "live_cars_count": {
              "type": "number"
            },
            "hiyas": {
              "type": "number"
            },
            "owner_response_time": {
              "type": "number",
              "description": "Average reponse time in seconds"
            },
            "badges": {
              "type": "array"
            }
          }
        }
      }
    },
    "virtual_key": {
      "type": "object",
      "properties": {
        "present": {
          "type": "boolean"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "number"
        }
      }
    },
    "reviewed_by_driver": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the driver"
    },
    "reviewed_by_owner": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the owner"
    },
    "reviewable": {
      "type": "boolean",
      "description": "Can this booking be reviewed"
    },
    "accurate_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        },
        "lng": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        }
      }
    },
    "payment": {
      "type": "object",
      "properties": {
        "pending": {
          "type": "boolean",
          "description": "Is the payment for this booking still pending"
        },
        "intent": {
          "type": "string",
          "description": "The Stripe PaymentIntent needed to complete the payment, null if not applicable"
        }
      }
    },
    "pickup_fuel_manual": {
      "type": "number"
    },
    "pickup_fuel_tracker": {
      "type": "number"
    },
    "pickup_miles_manual": {
      "type": "number"
    },
    "pickup_miles_tracker": {
      "type": "number"
    },
    "picked_up": {
      "type": "boolean"
    },
    "picked_up_at": {
      "type": "string"
    },
    "pickup_fuel_present": {
      "type": "boolean"
    },
    "pickup_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    },
    "returned": {
      "type": "boolean"
    },
    "returned_at": {
      "type": "string"
    },
    "return_fuel_manual": {
      "type": "number"
    },
    "return_fuel_tracker": {
      "type": "number"
    },
    "return_miles_manual": {
      "type": "number"
    },
    "return_miles_tracker": {
      "type": "number"
    },
    "miles_driven_manual": {
      "type": "number"
    },
    "miles_driven_tracker": {
      "type": "number"
    },
    "return_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    }
  }
}

Booking Actions

Retrieve a booking
PUT/api/v1/bookings/

Update attributes of this booking

Request data:

  • is_checked - (boolean) Has this booking been checked, optional

Example URI

PUT https://staging.hiyacar.co.uk/api/v1/bookings/
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "ref": "WL62-LC46-TY42",
  "state": 64,
  "state_string": "Cancelled",
  "rental_cost": 130,
  "fees": 3,
  "insurance_cost": 19.348,
  "extras_cost": -20,
  "extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "owner_earnings": 9.6,
  "starts_at": "2017-06-01T12:00:00+00:00",
  "ends_at": "2017-06-02T12:00:00+00:00",
  "picked_up": true,
  "picked_up_at": "2021-06-01T12:00:00+00:00",
  "returned": true,
  "returned_at": "2021-06-01T12:00:00+00:00",
  "vehicle": {
    "id": 12346,
    "published": true,
    "year": 2014,
    "make": "Audi",
    "model": "A4 Avant TDI",
    "title": "Audi A4 Avant TDI",
    "colour": "red",
    "seats": 4,
    "miles_per_day": 300,
    "insurance_group": 39,
    "engine_cc": 1984,
    "rating": 4.7,
    "rating_count": 3,
    "instant_book": true,
    "instant_book_status": "none",
    "fuel": "Petrol",
    "type": "Executive / Saloon",
    "transmission": "Manual",
    "description": "Economic but quick, you will love this car",
    "vrm": "GC10AAA",
    "prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "suggested_prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "images": [
      {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      }
    ],
    "owner": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  },
  "virtual_key": {
    "present": true,
    "type": "ota",
    "id": 130111
  },
  "reviewed_by_driver": false,
  "reviewed_by_owner": false,
  "reviewable": true,
  "accurate_location": {
    "lat": 51.50093,
    "lng": 0.078742
  },
  "payment": {
    "pending": false,
    "intent": "pi_xxxxxx"
  },
  "pickup_fuel_manual": 50,
  "pickup_fuel_tracker": 50,
  "pickup_miles_manual": 8965,
  "pickup_miles_tracker": 8965,
  "pickup_fuel_present": true,
  "pickup_location": {
    "lat": 51.5,
    "ln": 0.078
  },
  "return_fuel_manual": 50,
  "return_fuel_tracker": 50,
  "return_miles_manual": 8965,
  "return_miles_tracker": 8965,
  "miles_driven_manual": 165,
  "miles_driven_tracker": 165,
  "return_location": {
    "lat": 51.5,
    "ln": 0.078
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "ref": {
      "type": "string",
      "description": "The booking reference"
    },
    "state": {
      "type": "number",
      "description": "The state of the booking, as a number"
    },
    "state_string": {
      "type": "string",
      "description": "The state of the booking, as a user friendly string"
    },
    "rental_cost": {
      "type": "number",
      "description": "The cost of the rental"
    },
    "fees": {
      "type": "number",
      "description": "The fees"
    },
    "insurance_cost": {
      "type": "number",
      "description": "The cost of the insurance"
    },
    "extras_cost": {
      "type": "number",
      "description": "The cost of any extras: vouchers, credit, charges etc"
    },
    "extras": {
      "type": "array"
    },
    "owner_earnings": {
      "type": "number",
      "description": "The amount the owner will be paid for this booking"
    },
    "starts_at": {
      "type": "string",
      "description": "The start of the booking, ISO 8601 date format"
    },
    "ends_at": {
      "type": "string",
      "description": "The end of the booking, ISO 8601 date format"
    },
    "vehicle": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "published": {
          "type": "boolean",
          "description": "Only visible on your own vehicles"
        },
        "year": {
          "type": "number"
        },
        "make": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "colour": {
          "type": "string"
        },
        "seats": {
          "type": "number"
        },
        "miles_per_day": {
          "type": "number"
        },
        "insurance_group": {
          "type": "number"
        },
        "engine_cc": {
          "type": "number"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "instant_book": {
          "type": "boolean"
        },
        "instant_book_status": {
          "type": "string",
          "enum": [
            "none",
            "requested",
            "active",
            "inactive"
          ]
        },
        "fuel": {
          "type": "string",
          "enum": [
            "Petrol",
            "Diesel",
            "Lpg",
            "Electric",
            "Hybrid"
          ]
        },
        "type": {
          "type": "string"
        },
        "transmission": {
          "type": "string",
          "enum": [
            "Manual",
            "Automatic",
            "Semiauto"
          ]
        },
        "description": {
          "type": "string",
          "description": "Owner's description"
        },
        "vrm": {
          "type": "string"
        },
        "prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "suggested_prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "images": {
          "type": "array",
          "description": "In search results this may only contain the vehicles primary image"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string",
              "description": "Only shows first character for users other than yourself"
            },
            "bio": {
              "type": "string"
            },
            "rating": {
              "type": "number"
            },
            "rating_count": {
              "type": "number"
            },
            "join_date": {
              "type": "string"
            },
            "primary_location": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "postcode_prefix": {
                  "type": "string"
                }
              }
            },
            "profile_image": {
              "type": "object",
              "properties": {
                "300": {
                  "type": "string"
                },
                "600": {
                  "type": "string"
                },
                "1200": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "primary": {
                  "type": "boolean"
                }
              }
            },
            "live_cars_count": {
              "type": "number"
            },
            "hiyas": {
              "type": "number"
            },
            "owner_response_time": {
              "type": "number",
              "description": "Average reponse time in seconds"
            },
            "badges": {
              "type": "array"
            }
          }
        }
      }
    },
    "virtual_key": {
      "type": "object",
      "properties": {
        "present": {
          "type": "boolean"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "number"
        }
      }
    },
    "reviewed_by_driver": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the driver"
    },
    "reviewed_by_owner": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the owner"
    },
    "reviewable": {
      "type": "boolean",
      "description": "Can this booking be reviewed"
    },
    "accurate_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        },
        "lng": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        }
      }
    },
    "payment": {
      "type": "object",
      "properties": {
        "pending": {
          "type": "boolean",
          "description": "Is the payment for this booking still pending"
        },
        "intent": {
          "type": "string",
          "description": "The Stripe PaymentIntent needed to complete the payment, null if not applicable"
        }
      }
    },
    "pickup_fuel_manual": {
      "type": "number"
    },
    "pickup_fuel_tracker": {
      "type": "number"
    },
    "pickup_miles_manual": {
      "type": "number"
    },
    "pickup_miles_tracker": {
      "type": "number"
    },
    "picked_up": {
      "type": "boolean"
    },
    "picked_up_at": {
      "type": "string"
    },
    "pickup_fuel_present": {
      "type": "boolean"
    },
    "pickup_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    },
    "returned": {
      "type": "boolean"
    },
    "returned_at": {
      "type": "string"
    },
    "return_fuel_manual": {
      "type": "number"
    },
    "return_fuel_tracker": {
      "type": "number"
    },
    "return_miles_manual": {
      "type": "number"
    },
    "return_miles_tracker": {
      "type": "number"
    },
    "miles_driven_manual": {
      "type": "number"
    },
    "miles_driven_tracker": {
      "type": "number"
    },
    "return_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    }
  }
}

Accept a booking
POST/api/v1/bookings/{ref}/accept

Accept a booking

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings/PF23-GX99-QD22/accept
URI Parameters
HideShow
ref
string (required) Example: PF23-GX99-QD22
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "ref": "WL62-LC46-TY42",
  "state": 64,
  "state_string": "Cancelled",
  "rental_cost": 130,
  "fees": 3,
  "insurance_cost": 19.348,
  "extras_cost": -20,
  "extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "owner_earnings": 9.6,
  "starts_at": "2017-06-01T12:00:00+00:00",
  "ends_at": "2017-06-02T12:00:00+00:00",
  "picked_up": true,
  "picked_up_at": "2021-06-01T12:00:00+00:00",
  "returned": true,
  "returned_at": "2021-06-01T12:00:00+00:00",
  "vehicle": {
    "id": 12346,
    "published": true,
    "year": 2014,
    "make": "Audi",
    "model": "A4 Avant TDI",
    "title": "Audi A4 Avant TDI",
    "colour": "red",
    "seats": 4,
    "miles_per_day": 300,
    "insurance_group": 39,
    "engine_cc": 1984,
    "rating": 4.7,
    "rating_count": 3,
    "instant_book": true,
    "instant_book_status": "none",
    "fuel": "Petrol",
    "type": "Executive / Saloon",
    "transmission": "Manual",
    "description": "Economic but quick, you will love this car",
    "vrm": "GC10AAA",
    "prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "suggested_prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "images": [
      {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      }
    ],
    "owner": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  },
  "virtual_key": {
    "present": true,
    "type": "ota",
    "id": 130111
  },
  "reviewed_by_driver": false,
  "reviewed_by_owner": false,
  "reviewable": true,
  "accurate_location": {
    "lat": 51.50093,
    "lng": 0.078742
  },
  "payment": {
    "pending": false,
    "intent": "pi_xxxxxx"
  },
  "pickup_fuel_manual": 50,
  "pickup_fuel_tracker": 50,
  "pickup_miles_manual": 8965,
  "pickup_miles_tracker": 8965,
  "pickup_fuel_present": true,
  "pickup_location": {
    "lat": 51.5,
    "ln": 0.078
  },
  "return_fuel_manual": 50,
  "return_fuel_tracker": 50,
  "return_miles_manual": 8965,
  "return_miles_tracker": 8965,
  "miles_driven_manual": 165,
  "miles_driven_tracker": 165,
  "return_location": {
    "lat": 51.5,
    "ln": 0.078
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "ref": {
      "type": "string",
      "description": "The booking reference"
    },
    "state": {
      "type": "number",
      "description": "The state of the booking, as a number"
    },
    "state_string": {
      "type": "string",
      "description": "The state of the booking, as a user friendly string"
    },
    "rental_cost": {
      "type": "number",
      "description": "The cost of the rental"
    },
    "fees": {
      "type": "number",
      "description": "The fees"
    },
    "insurance_cost": {
      "type": "number",
      "description": "The cost of the insurance"
    },
    "extras_cost": {
      "type": "number",
      "description": "The cost of any extras: vouchers, credit, charges etc"
    },
    "extras": {
      "type": "array"
    },
    "owner_earnings": {
      "type": "number",
      "description": "The amount the owner will be paid for this booking"
    },
    "starts_at": {
      "type": "string",
      "description": "The start of the booking, ISO 8601 date format"
    },
    "ends_at": {
      "type": "string",
      "description": "The end of the booking, ISO 8601 date format"
    },
    "vehicle": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "published": {
          "type": "boolean",
          "description": "Only visible on your own vehicles"
        },
        "year": {
          "type": "number"
        },
        "make": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "colour": {
          "type": "string"
        },
        "seats": {
          "type": "number"
        },
        "miles_per_day": {
          "type": "number"
        },
        "insurance_group": {
          "type": "number"
        },
        "engine_cc": {
          "type": "number"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "instant_book": {
          "type": "boolean"
        },
        "instant_book_status": {
          "type": "string",
          "enum": [
            "none",
            "requested",
            "active",
            "inactive"
          ]
        },
        "fuel": {
          "type": "string",
          "enum": [
            "Petrol",
            "Diesel",
            "Lpg",
            "Electric",
            "Hybrid"
          ]
        },
        "type": {
          "type": "string"
        },
        "transmission": {
          "type": "string",
          "enum": [
            "Manual",
            "Automatic",
            "Semiauto"
          ]
        },
        "description": {
          "type": "string",
          "description": "Owner's description"
        },
        "vrm": {
          "type": "string"
        },
        "prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "suggested_prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "images": {
          "type": "array",
          "description": "In search results this may only contain the vehicles primary image"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string",
              "description": "Only shows first character for users other than yourself"
            },
            "bio": {
              "type": "string"
            },
            "rating": {
              "type": "number"
            },
            "rating_count": {
              "type": "number"
            },
            "join_date": {
              "type": "string"
            },
            "primary_location": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "postcode_prefix": {
                  "type": "string"
                }
              }
            },
            "profile_image": {
              "type": "object",
              "properties": {
                "300": {
                  "type": "string"
                },
                "600": {
                  "type": "string"
                },
                "1200": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "primary": {
                  "type": "boolean"
                }
              }
            },
            "live_cars_count": {
              "type": "number"
            },
            "hiyas": {
              "type": "number"
            },
            "owner_response_time": {
              "type": "number",
              "description": "Average reponse time in seconds"
            },
            "badges": {
              "type": "array"
            }
          }
        }
      }
    },
    "virtual_key": {
      "type": "object",
      "properties": {
        "present": {
          "type": "boolean"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "number"
        }
      }
    },
    "reviewed_by_driver": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the driver"
    },
    "reviewed_by_owner": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the owner"
    },
    "reviewable": {
      "type": "boolean",
      "description": "Can this booking be reviewed"
    },
    "accurate_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        },
        "lng": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        }
      }
    },
    "payment": {
      "type": "object",
      "properties": {
        "pending": {
          "type": "boolean",
          "description": "Is the payment for this booking still pending"
        },
        "intent": {
          "type": "string",
          "description": "The Stripe PaymentIntent needed to complete the payment, null if not applicable"
        }
      }
    },
    "pickup_fuel_manual": {
      "type": "number"
    },
    "pickup_fuel_tracker": {
      "type": "number"
    },
    "pickup_miles_manual": {
      "type": "number"
    },
    "pickup_miles_tracker": {
      "type": "number"
    },
    "picked_up": {
      "type": "boolean"
    },
    "picked_up_at": {
      "type": "string"
    },
    "pickup_fuel_present": {
      "type": "boolean"
    },
    "pickup_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    },
    "returned": {
      "type": "boolean"
    },
    "returned_at": {
      "type": "string"
    },
    "return_fuel_manual": {
      "type": "number"
    },
    "return_fuel_tracker": {
      "type": "number"
    },
    "return_miles_manual": {
      "type": "number"
    },
    "return_miles_tracker": {
      "type": "number"
    },
    "miles_driven_manual": {
      "type": "number"
    },
    "miles_driven_tracker": {
      "type": "number"
    },
    "return_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    }
  }
}

Decline a booking
POST/api/v1/bookings/{ref}/decline

Decline a booking

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings/PF23-GX99-QD22/decline
URI Parameters
HideShow
ref
string (required) Example: PF23-GX99-QD22
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "ref": "WL62-LC46-TY42",
  "state": 64,
  "state_string": "Cancelled",
  "rental_cost": 130,
  "fees": 3,
  "insurance_cost": 19.348,
  "extras_cost": -20,
  "extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "owner_earnings": 9.6,
  "starts_at": "2017-06-01T12:00:00+00:00",
  "ends_at": "2017-06-02T12:00:00+00:00",
  "picked_up": true,
  "picked_up_at": "2021-06-01T12:00:00+00:00",
  "returned": true,
  "returned_at": "2021-06-01T12:00:00+00:00",
  "vehicle": {
    "id": 12346,
    "published": true,
    "year": 2014,
    "make": "Audi",
    "model": "A4 Avant TDI",
    "title": "Audi A4 Avant TDI",
    "colour": "red",
    "seats": 4,
    "miles_per_day": 300,
    "insurance_group": 39,
    "engine_cc": 1984,
    "rating": 4.7,
    "rating_count": 3,
    "instant_book": true,
    "instant_book_status": "none",
    "fuel": "Petrol",
    "type": "Executive / Saloon",
    "transmission": "Manual",
    "description": "Economic but quick, you will love this car",
    "vrm": "GC10AAA",
    "prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "suggested_prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "images": [
      {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      }
    ],
    "owner": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  },
  "virtual_key": {
    "present": true,
    "type": "ota",
    "id": 130111
  },
  "reviewed_by_driver": false,
  "reviewed_by_owner": false,
  "reviewable": true,
  "accurate_location": {
    "lat": 51.50093,
    "lng": 0.078742
  },
  "payment": {
    "pending": false,
    "intent": "pi_xxxxxx"
  },
  "pickup_fuel_manual": 50,
  "pickup_fuel_tracker": 50,
  "pickup_miles_manual": 8965,
  "pickup_miles_tracker": 8965,
  "pickup_fuel_present": true,
  "pickup_location": {
    "lat": 51.5,
    "ln": 0.078
  },
  "return_fuel_manual": 50,
  "return_fuel_tracker": 50,
  "return_miles_manual": 8965,
  "return_miles_tracker": 8965,
  "miles_driven_manual": 165,
  "miles_driven_tracker": 165,
  "return_location": {
    "lat": 51.5,
    "ln": 0.078
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "ref": {
      "type": "string",
      "description": "The booking reference"
    },
    "state": {
      "type": "number",
      "description": "The state of the booking, as a number"
    },
    "state_string": {
      "type": "string",
      "description": "The state of the booking, as a user friendly string"
    },
    "rental_cost": {
      "type": "number",
      "description": "The cost of the rental"
    },
    "fees": {
      "type": "number",
      "description": "The fees"
    },
    "insurance_cost": {
      "type": "number",
      "description": "The cost of the insurance"
    },
    "extras_cost": {
      "type": "number",
      "description": "The cost of any extras: vouchers, credit, charges etc"
    },
    "extras": {
      "type": "array"
    },
    "owner_earnings": {
      "type": "number",
      "description": "The amount the owner will be paid for this booking"
    },
    "starts_at": {
      "type": "string",
      "description": "The start of the booking, ISO 8601 date format"
    },
    "ends_at": {
      "type": "string",
      "description": "The end of the booking, ISO 8601 date format"
    },
    "vehicle": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "published": {
          "type": "boolean",
          "description": "Only visible on your own vehicles"
        },
        "year": {
          "type": "number"
        },
        "make": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "colour": {
          "type": "string"
        },
        "seats": {
          "type": "number"
        },
        "miles_per_day": {
          "type": "number"
        },
        "insurance_group": {
          "type": "number"
        },
        "engine_cc": {
          "type": "number"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "instant_book": {
          "type": "boolean"
        },
        "instant_book_status": {
          "type": "string",
          "enum": [
            "none",
            "requested",
            "active",
            "inactive"
          ]
        },
        "fuel": {
          "type": "string",
          "enum": [
            "Petrol",
            "Diesel",
            "Lpg",
            "Electric",
            "Hybrid"
          ]
        },
        "type": {
          "type": "string"
        },
        "transmission": {
          "type": "string",
          "enum": [
            "Manual",
            "Automatic",
            "Semiauto"
          ]
        },
        "description": {
          "type": "string",
          "description": "Owner's description"
        },
        "vrm": {
          "type": "string"
        },
        "prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "suggested_prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "images": {
          "type": "array",
          "description": "In search results this may only contain the vehicles primary image"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string",
              "description": "Only shows first character for users other than yourself"
            },
            "bio": {
              "type": "string"
            },
            "rating": {
              "type": "number"
            },
            "rating_count": {
              "type": "number"
            },
            "join_date": {
              "type": "string"
            },
            "primary_location": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "postcode_prefix": {
                  "type": "string"
                }
              }
            },
            "profile_image": {
              "type": "object",
              "properties": {
                "300": {
                  "type": "string"
                },
                "600": {
                  "type": "string"
                },
                "1200": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "primary": {
                  "type": "boolean"
                }
              }
            },
            "live_cars_count": {
              "type": "number"
            },
            "hiyas": {
              "type": "number"
            },
            "owner_response_time": {
              "type": "number",
              "description": "Average reponse time in seconds"
            },
            "badges": {
              "type": "array"
            }
          }
        }
      }
    },
    "virtual_key": {
      "type": "object",
      "properties": {
        "present": {
          "type": "boolean"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "number"
        }
      }
    },
    "reviewed_by_driver": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the driver"
    },
    "reviewed_by_owner": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the owner"
    },
    "reviewable": {
      "type": "boolean",
      "description": "Can this booking be reviewed"
    },
    "accurate_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        },
        "lng": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        }
      }
    },
    "payment": {
      "type": "object",
      "properties": {
        "pending": {
          "type": "boolean",
          "description": "Is the payment for this booking still pending"
        },
        "intent": {
          "type": "string",
          "description": "The Stripe PaymentIntent needed to complete the payment, null if not applicable"
        }
      }
    },
    "pickup_fuel_manual": {
      "type": "number"
    },
    "pickup_fuel_tracker": {
      "type": "number"
    },
    "pickup_miles_manual": {
      "type": "number"
    },
    "pickup_miles_tracker": {
      "type": "number"
    },
    "picked_up": {
      "type": "boolean"
    },
    "picked_up_at": {
      "type": "string"
    },
    "pickup_fuel_present": {
      "type": "boolean"
    },
    "pickup_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    },
    "returned": {
      "type": "boolean"
    },
    "returned_at": {
      "type": "string"
    },
    "return_fuel_manual": {
      "type": "number"
    },
    "return_fuel_tracker": {
      "type": "number"
    },
    "return_miles_manual": {
      "type": "number"
    },
    "return_miles_tracker": {
      "type": "number"
    },
    "miles_driven_manual": {
      "type": "number"
    },
    "miles_driven_tracker": {
      "type": "number"
    },
    "return_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    }
  }
}

Cancel a booking
POST/api/v1/bookings/{ref}/cancel

Cancel a booking

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings/PF23-GX99-QD22/cancel
URI Parameters
HideShow
ref
string (required) Example: PF23-GX99-QD22
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "ref": "WL62-LC46-TY42",
  "state": 64,
  "state_string": "Cancelled",
  "rental_cost": 130,
  "fees": 3,
  "insurance_cost": 19.348,
  "extras_cost": -20,
  "extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "owner_earnings": 9.6,
  "starts_at": "2017-06-01T12:00:00+00:00",
  "ends_at": "2017-06-02T12:00:00+00:00",
  "picked_up": true,
  "picked_up_at": "2021-06-01T12:00:00+00:00",
  "returned": true,
  "returned_at": "2021-06-01T12:00:00+00:00",
  "vehicle": {
    "id": 12346,
    "published": true,
    "year": 2014,
    "make": "Audi",
    "model": "A4 Avant TDI",
    "title": "Audi A4 Avant TDI",
    "colour": "red",
    "seats": 4,
    "miles_per_day": 300,
    "insurance_group": 39,
    "engine_cc": 1984,
    "rating": 4.7,
    "rating_count": 3,
    "instant_book": true,
    "instant_book_status": "none",
    "fuel": "Petrol",
    "type": "Executive / Saloon",
    "transmission": "Manual",
    "description": "Economic but quick, you will love this car",
    "vrm": "GC10AAA",
    "prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "suggested_prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "images": [
      {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      }
    ],
    "owner": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  },
  "virtual_key": {
    "present": true,
    "type": "ota",
    "id": 130111
  },
  "reviewed_by_driver": false,
  "reviewed_by_owner": false,
  "reviewable": true,
  "accurate_location": {
    "lat": 51.50093,
    "lng": 0.078742
  },
  "payment": {
    "pending": false,
    "intent": "pi_xxxxxx"
  },
  "pickup_fuel_manual": 50,
  "pickup_fuel_tracker": 50,
  "pickup_miles_manual": 8965,
  "pickup_miles_tracker": 8965,
  "pickup_fuel_present": true,
  "pickup_location": {
    "lat": 51.5,
    "ln": 0.078
  },
  "return_fuel_manual": 50,
  "return_fuel_tracker": 50,
  "return_miles_manual": 8965,
  "return_miles_tracker": 8965,
  "miles_driven_manual": 165,
  "miles_driven_tracker": 165,
  "return_location": {
    "lat": 51.5,
    "ln": 0.078
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "ref": {
      "type": "string",
      "description": "The booking reference"
    },
    "state": {
      "type": "number",
      "description": "The state of the booking, as a number"
    },
    "state_string": {
      "type": "string",
      "description": "The state of the booking, as a user friendly string"
    },
    "rental_cost": {
      "type": "number",
      "description": "The cost of the rental"
    },
    "fees": {
      "type": "number",
      "description": "The fees"
    },
    "insurance_cost": {
      "type": "number",
      "description": "The cost of the insurance"
    },
    "extras_cost": {
      "type": "number",
      "description": "The cost of any extras: vouchers, credit, charges etc"
    },
    "extras": {
      "type": "array"
    },
    "owner_earnings": {
      "type": "number",
      "description": "The amount the owner will be paid for this booking"
    },
    "starts_at": {
      "type": "string",
      "description": "The start of the booking, ISO 8601 date format"
    },
    "ends_at": {
      "type": "string",
      "description": "The end of the booking, ISO 8601 date format"
    },
    "vehicle": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "published": {
          "type": "boolean",
          "description": "Only visible on your own vehicles"
        },
        "year": {
          "type": "number"
        },
        "make": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "colour": {
          "type": "string"
        },
        "seats": {
          "type": "number"
        },
        "miles_per_day": {
          "type": "number"
        },
        "insurance_group": {
          "type": "number"
        },
        "engine_cc": {
          "type": "number"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "instant_book": {
          "type": "boolean"
        },
        "instant_book_status": {
          "type": "string",
          "enum": [
            "none",
            "requested",
            "active",
            "inactive"
          ]
        },
        "fuel": {
          "type": "string",
          "enum": [
            "Petrol",
            "Diesel",
            "Lpg",
            "Electric",
            "Hybrid"
          ]
        },
        "type": {
          "type": "string"
        },
        "transmission": {
          "type": "string",
          "enum": [
            "Manual",
            "Automatic",
            "Semiauto"
          ]
        },
        "description": {
          "type": "string",
          "description": "Owner's description"
        },
        "vrm": {
          "type": "string"
        },
        "prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "suggested_prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "images": {
          "type": "array",
          "description": "In search results this may only contain the vehicles primary image"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string",
              "description": "Only shows first character for users other than yourself"
            },
            "bio": {
              "type": "string"
            },
            "rating": {
              "type": "number"
            },
            "rating_count": {
              "type": "number"
            },
            "join_date": {
              "type": "string"
            },
            "primary_location": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "postcode_prefix": {
                  "type": "string"
                }
              }
            },
            "profile_image": {
              "type": "object",
              "properties": {
                "300": {
                  "type": "string"
                },
                "600": {
                  "type": "string"
                },
                "1200": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "primary": {
                  "type": "boolean"
                }
              }
            },
            "live_cars_count": {
              "type": "number"
            },
            "hiyas": {
              "type": "number"
            },
            "owner_response_time": {
              "type": "number",
              "description": "Average reponse time in seconds"
            },
            "badges": {
              "type": "array"
            }
          }
        }
      }
    },
    "virtual_key": {
      "type": "object",
      "properties": {
        "present": {
          "type": "boolean"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "number"
        }
      }
    },
    "reviewed_by_driver": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the driver"
    },
    "reviewed_by_owner": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the owner"
    },
    "reviewable": {
      "type": "boolean",
      "description": "Can this booking be reviewed"
    },
    "accurate_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        },
        "lng": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        }
      }
    },
    "payment": {
      "type": "object",
      "properties": {
        "pending": {
          "type": "boolean",
          "description": "Is the payment for this booking still pending"
        },
        "intent": {
          "type": "string",
          "description": "The Stripe PaymentIntent needed to complete the payment, null if not applicable"
        }
      }
    },
    "pickup_fuel_manual": {
      "type": "number"
    },
    "pickup_fuel_tracker": {
      "type": "number"
    },
    "pickup_miles_manual": {
      "type": "number"
    },
    "pickup_miles_tracker": {
      "type": "number"
    },
    "picked_up": {
      "type": "boolean"
    },
    "picked_up_at": {
      "type": "string"
    },
    "pickup_fuel_present": {
      "type": "boolean"
    },
    "pickup_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    },
    "returned": {
      "type": "boolean"
    },
    "returned_at": {
      "type": "string"
    },
    "return_fuel_manual": {
      "type": "number"
    },
    "return_fuel_tracker": {
      "type": "number"
    },
    "return_miles_manual": {
      "type": "number"
    },
    "return_miles_tracker": {
      "type": "number"
    },
    "miles_driven_manual": {
      "type": "number"
    },
    "miles_driven_tracker": {
      "type": "number"
    },
    "return_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    }
  }
}

Price an extension for a booking
GET/api/v1/bookings/extend?{new_end}

Price an extension

Example URI

GET https://staging.hiyacar.co.uk/api/v1/bookings/extend?2018-10-01T12:00:00Z
URI Parameters
HideShow
new_end
string (required) Example: 2018-10-01T12:00:00Z

The new end time, in ISO8601 format

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "rental": 150,
  "fee": 3,
  "insurance": 20.57,
  "total": 153.57,
  "is_insurance_estimate": true,
  "estimate_reason": "Profile is incomplete",
  "extras_cost": -20,
  "extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "optional_extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "insurance_statements": [
    "I have no previous convictions"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "rental": {
      "type": "number"
    },
    "fee": {
      "type": "number"
    },
    "insurance": {
      "type": "number"
    },
    "total": {
      "type": "number"
    },
    "is_insurance_estimate": {
      "type": "boolean",
      "description": "Is this insurance cost an estimate, true if we don't have a completed \nprofile yet for this user to take their age/driving history in to account.\nThe insurance will never be lower, it can only ever increase."
    },
    "estimate_reason": {
      "type": "string",
      "description": "If the quote is an estimate, this is the reason for it being so"
    },
    "extras_cost": {
      "type": "number"
    },
    "extras": {
      "type": "array"
    },
    "optional_extras": {
      "type": "array"
    },
    "insurance_statements": {
      "type": "array"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "success": false,
  "error": "Booking cannot be extended"
}

Request an extension for a booking
POST/api/v1/bookings/extend?{new_end}

Request an extension

If the vehicle is instant book the extension will be instantly accepted

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings/extend?2018-10-01T12:00:00Z
URI Parameters
HideShow
new_end
string (required) Example: 2018-10-01T12:00:00Z

The new end time, in ISO8601 format

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "ref": "WL62-LC46-TY42",
  "state": 64,
  "state_string": "Cancelled",
  "rental_cost": 130,
  "fees": 3,
  "insurance_cost": 19.348,
  "extras_cost": -20,
  "extras": [
    {
      "key": "driver_discount",
      "amount": -20,
      "description": "Voucher (TRACKER)"
    }
  ],
  "owner_earnings": 9.6,
  "starts_at": "2017-06-01T12:00:00+00:00",
  "ends_at": "2017-06-02T12:00:00+00:00",
  "picked_up": true,
  "picked_up_at": "2021-06-01T12:00:00+00:00",
  "returned": true,
  "returned_at": "2021-06-01T12:00:00+00:00",
  "vehicle": {
    "id": 12346,
    "published": true,
    "year": 2014,
    "make": "Audi",
    "model": "A4 Avant TDI",
    "title": "Audi A4 Avant TDI",
    "colour": "red",
    "seats": 4,
    "miles_per_day": 300,
    "insurance_group": 39,
    "engine_cc": 1984,
    "rating": 4.7,
    "rating_count": 3,
    "instant_book": true,
    "instant_book_status": "none",
    "fuel": "Petrol",
    "type": "Executive / Saloon",
    "transmission": "Manual",
    "description": "Economic but quick, you will love this car",
    "vrm": "GC10AAA",
    "prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "suggested_prices": {
      "hourly": 8,
      "daily": 29,
      "weekly": 110
    },
    "images": [
      {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      }
    ],
    "owner": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  },
  "virtual_key": {
    "present": true,
    "type": "ota",
    "id": 130111
  },
  "reviewed_by_driver": false,
  "reviewed_by_owner": false,
  "reviewable": true,
  "accurate_location": {
    "lat": 51.50093,
    "lng": 0.078742
  },
  "payment": {
    "pending": false,
    "intent": "pi_xxxxxx"
  },
  "pickup_fuel_manual": 50,
  "pickup_fuel_tracker": 50,
  "pickup_miles_manual": 8965,
  "pickup_miles_tracker": 8965,
  "pickup_fuel_present": true,
  "pickup_location": {
    "lat": 51.5,
    "ln": 0.078
  },
  "return_fuel_manual": 50,
  "return_fuel_tracker": 50,
  "return_miles_manual": 8965,
  "return_miles_tracker": 8965,
  "miles_driven_manual": 165,
  "miles_driven_tracker": 165,
  "return_location": {
    "lat": 51.5,
    "ln": 0.078
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "ref": {
      "type": "string",
      "description": "The booking reference"
    },
    "state": {
      "type": "number",
      "description": "The state of the booking, as a number"
    },
    "state_string": {
      "type": "string",
      "description": "The state of the booking, as a user friendly string"
    },
    "rental_cost": {
      "type": "number",
      "description": "The cost of the rental"
    },
    "fees": {
      "type": "number",
      "description": "The fees"
    },
    "insurance_cost": {
      "type": "number",
      "description": "The cost of the insurance"
    },
    "extras_cost": {
      "type": "number",
      "description": "The cost of any extras: vouchers, credit, charges etc"
    },
    "extras": {
      "type": "array"
    },
    "owner_earnings": {
      "type": "number",
      "description": "The amount the owner will be paid for this booking"
    },
    "starts_at": {
      "type": "string",
      "description": "The start of the booking, ISO 8601 date format"
    },
    "ends_at": {
      "type": "string",
      "description": "The end of the booking, ISO 8601 date format"
    },
    "vehicle": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "published": {
          "type": "boolean",
          "description": "Only visible on your own vehicles"
        },
        "year": {
          "type": "number"
        },
        "make": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "colour": {
          "type": "string"
        },
        "seats": {
          "type": "number"
        },
        "miles_per_day": {
          "type": "number"
        },
        "insurance_group": {
          "type": "number"
        },
        "engine_cc": {
          "type": "number"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "instant_book": {
          "type": "boolean"
        },
        "instant_book_status": {
          "type": "string",
          "enum": [
            "none",
            "requested",
            "active",
            "inactive"
          ]
        },
        "fuel": {
          "type": "string",
          "enum": [
            "Petrol",
            "Diesel",
            "Lpg",
            "Electric",
            "Hybrid"
          ]
        },
        "type": {
          "type": "string"
        },
        "transmission": {
          "type": "string",
          "enum": [
            "Manual",
            "Automatic",
            "Semiauto"
          ]
        },
        "description": {
          "type": "string",
          "description": "Owner's description"
        },
        "vrm": {
          "type": "string"
        },
        "prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "suggested_prices": {
          "type": "object",
          "properties": {
            "hourly": {
              "type": "number"
            },
            "daily": {
              "type": "number"
            },
            "weekly": {
              "type": "number"
            }
          }
        },
        "images": {
          "type": "array",
          "description": "In search results this may only contain the vehicles primary image"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string",
              "description": "Only shows first character for users other than yourself"
            },
            "bio": {
              "type": "string"
            },
            "rating": {
              "type": "number"
            },
            "rating_count": {
              "type": "number"
            },
            "join_date": {
              "type": "string"
            },
            "primary_location": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "postcode_prefix": {
                  "type": "string"
                }
              }
            },
            "profile_image": {
              "type": "object",
              "properties": {
                "300": {
                  "type": "string"
                },
                "600": {
                  "type": "string"
                },
                "1200": {
                  "type": "string"
                },
                "id": {
                  "type": "number"
                },
                "primary": {
                  "type": "boolean"
                }
              }
            },
            "live_cars_count": {
              "type": "number"
            },
            "hiyas": {
              "type": "number"
            },
            "owner_response_time": {
              "type": "number",
              "description": "Average reponse time in seconds"
            },
            "badges": {
              "type": "array"
            }
          }
        }
      }
    },
    "virtual_key": {
      "type": "object",
      "properties": {
        "present": {
          "type": "boolean"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "number"
        }
      }
    },
    "reviewed_by_driver": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the driver"
    },
    "reviewed_by_owner": {
      "type": "boolean",
      "description": "Has this booking been reviewed by the owner"
    },
    "reviewable": {
      "type": "boolean",
      "description": "Can this booking be reviewed"
    },
    "accurate_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        },
        "lng": {
          "type": "number",
          "description": "'null' if driver shouldn't be able to see the location right now"
        }
      }
    },
    "payment": {
      "type": "object",
      "properties": {
        "pending": {
          "type": "boolean",
          "description": "Is the payment for this booking still pending"
        },
        "intent": {
          "type": "string",
          "description": "The Stripe PaymentIntent needed to complete the payment, null if not applicable"
        }
      }
    },
    "pickup_fuel_manual": {
      "type": "number"
    },
    "pickup_fuel_tracker": {
      "type": "number"
    },
    "pickup_miles_manual": {
      "type": "number"
    },
    "pickup_miles_tracker": {
      "type": "number"
    },
    "picked_up": {
      "type": "boolean"
    },
    "picked_up_at": {
      "type": "string"
    },
    "pickup_fuel_present": {
      "type": "boolean"
    },
    "pickup_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    },
    "returned": {
      "type": "boolean"
    },
    "returned_at": {
      "type": "string"
    },
    "return_fuel_manual": {
      "type": "number"
    },
    "return_fuel_tracker": {
      "type": "number"
    },
    "return_miles_manual": {
      "type": "number"
    },
    "return_miles_tracker": {
      "type": "number"
    },
    "miles_driven_manual": {
      "type": "number"
    },
    "miles_driven_tracker": {
      "type": "number"
    },
    "return_location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "ln": {
          "type": "number"
        }
      }
    }
  }
}

Review a booking
POST/api/v1/bookings/{ref}/review

Submit a review for a booking

Reqeust data:

  • vehicle - The ratings for the vehicle, 1-5, required for driver

  • owner - The ratings for the owner, 1-5, required for driver

  • driver - The ratings for the driver, 1-5, required for owner

  • hiyacar - The ratings for HiyaCar, 1-5, required

  • review - The text review, 1,000 characters max, optional

  • private_review - Private feedback for hiyacar only, optional

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings/`PF23-GX99-QD22` {string}/review
URI Parameters
HideShow
ref
string (required) Example: `PF23-GX99-QD22` {string}
Request  From Driver
HideShow
Body
{
    "vehicle": 5,
    "owner": 5,
    "hiyacar": 5,
    "review": "The experience was great".
    "private_review": "The app worked great"
}
Request  From Owner
HideShow
Body
{
  "driver": 5,
  "hiyacar": 5,
  "review": "The experience was great",
  "private_review": "The app worked great"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    success: true
}

Booking Agreement

Retrive latest condition images
GET/api/v1/bookings/{ref}/agreement/images

Return the latest condition images for this vehicle

Example URI

GET https://staging.hiyacar.co.uk/api/v1/bookings/`PF23-GX99-QD22` {string}/agreement/images
URI Parameters
HideShow
ref
string (required) Example: `PF23-GX99-QD22` {string}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 1,
    "type": "front",
    "created_at": "2017-06-01T12:00:00+00:00",
    "urls": {
      "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg"
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Add a new condition image
POST/api/v1/bookings/{ref}/agreement/images

Upload a new vehicle condition image

Multipart form fields:

  • image - The image, required

  • type - one of front, left, right, rear, interior, odometer, fuel, or detail), required

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings/`AB12-CD34-EF45` {string,required}/agreement/images
URI Parameters
HideShow
ref
string (required) Example: `AB12-CD34-EF45` {string,required}
Request
HideShow
Headers
Content-Type: multipart/form-data
Content-Length: $requestlen
Body
--AaB03x
content-disposition: form-data; name="type"

odometer
--AaB03x
content-disposition: form-data; name="image"; filename="$filename"
Content-Type: $mimetype
Content-Transfer-Encoding: binary

$binarydata
--AaB03x--
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    success: true
    result: {
        id: 66
    }
}

Complete pickup of this vehicle
POST/api/v1/bookings/{ref}/agreement/pickup

Submit the condition of this vehicle and complete the pickup process

Request data:

  • miles - the odometer reading at pickup, required

  • condition - free-form text field describing any other detail, optional

  • images - array of condition images, each object must either contain and id field, or a type (one of front, left, right, rear, interior, odometer, fuel, or detail) and data (base64 encoded image data) field, required

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings/`PF23-GX99-QD22` {string}/agreement/pickup
URI Parameters
HideShow
ref
string (required) Example: `PF23-GX99-QD22` {string}
Request
HideShow
Body
{
  "miles": 17656,
  "condition": "small scratch on bonnet above number plate",
  "images": [
    {
      "id": 57
    },
    {
      "type": "front",
      "data": "xjhdbgtjksdtg"
    }
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    success: true
}

Complete dropoff of this vehicle
POST/api/v1/bookings/{ref}/agreement/dropoff

Submit the condition of this vehicle and complete the dropoff process

Request data:

  • miles - the odometer reading at pickup, required

  • condition - free-form text field describing any other detail, optional

  • images - array of condition images, each object must either contain and id field, or a type (one of front, left, right, rear, interior, odometer, fuel, or detail) and data (base64 encoded image data) field, required

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings/`PF23-GX99-QD22` {string}/agreement/dropoff
URI Parameters
HideShow
ref
string (required) Example: `PF23-GX99-QD22` {string}
Request
HideShow
Body
{
  "miles": 17656,
  "condition": "small scratch on bonnet above number plate",
  "images": [
    {
      "id": 57
    },
    {
      "type": "front",
      "data": "xjhdbgtjksdtg"
    }
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    success: true
}

Download signed hiya agreement
GET/api/v1/bookings/agreement/pdf

Download the signed hiya agreement.

Will only download a signed agreement. A 404 will be thrown if the agreement isn’t signed

Example URI

GET https://staging.hiyacar.co.uk/api/v1/bookings/agreement/pdf
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "success": false,
  "error": "Not Found",
  "details": "No signed agreement available"
}
Response  200
HideShow
Headers
Content-Type: application/pdf

Messaging

Messaging

Message Threads

Get list of message threads
GET/api/v1/message_threads{?archived}

Get list of message threads

Example URI

GET https://staging.hiyacar.co.uk/api/v1/message_threads?archived=true
URI Parameters
HideShow
archived
string (required) Example: true

Whether to include archived messages in the response, defaults to false, optional

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 771,
    "created_at": "2017-06-01T12:00:00+00:00",
    "last_message_at": "2017-06-01T12:00:00+00:00",
    "last_message": "truncated content of last message",
    "is_unread": true,
    "members": [
      {
        "id": 21094,
        "first_name": "Bob",
        "last_name": "A",
        "bio": "I love driving cars ...",
        "rating": 4.7,
        "rating_count": 2,
        "join_date": "2016-10-08",
        "primary_location": {
          "id": "873",
          "city": "London",
          "postcode_prefix": "NW8"
        },
        "profile_image": {
          "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
          "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
          "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
          "id": 1264,
          "primary": false
        },
        "live_cars_count": 1,
        "hiyas": 22,
        "owner_response_time": 5006,
        "badges": [
          {
            "name": "top_owner",
            "detail": "some detail"
          }
        ]
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get a thread of messages
GET/api/v1/message_threads/{id}{?since}

Get the thread

Example URI

GET https://staging.hiyacar.co.uk/api/v1/message_threads/777?since=1400
URI Parameters
HideShow
id
number (required) Example: 777
since
number (required) Example: 1400

The Message ID to begin to show messages from

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 1425,
    "thread_id": 383,
    "body": "the message text here",
    "created_at": "2017-06-01T12:00:00+00:00",
    "sender": {
      "id": 21094,
      "first_name": "Bob",
      "last_name": "A",
      "bio": "I love driving cars ...",
      "rating": 4.7,
      "rating_count": 2,
      "join_date": "2016-10-08",
      "primary_location": {
        "id": "873",
        "city": "London",
        "postcode_prefix": "NW8"
      },
      "profile_image": {
        "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
        "id": 1264,
        "primary": false
      },
      "live_cars_count": 1,
      "hiyas": 22,
      "owner_response_time": 5006,
      "badges": [
        {
          "name": "top_owner",
          "detail": "some detail"
        }
      ]
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Archive a message thread
DELETE/api/v1/message_threads/{id}

Archive the thread

Example URI

DELETE https://staging.hiyacar.co.uk/api/v1/message_threads/777
URI Parameters
HideShow
id
number (required) Example: 777
Response  403
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    success: true
}

Get a single message
GET/api/v1/messages/{id}

Get a single message

Example URI

GET https://staging.hiyacar.co.uk/api/v1/messages/1499
URI Parameters
HideShow
id
number (required) Example: 1499
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 1425,
  "thread_id": 383,
  "body": "the message text here",
  "created_at": "2017-06-01T12:00:00+00:00",
  "sender": {
    "id": 21094,
    "first_name": "Bob",
    "last_name": "A",
    "bio": "I love driving cars ...",
    "rating": 4.7,
    "rating_count": 2,
    "join_date": "2016-10-08",
    "primary_location": {
      "id": "873",
      "city": "London",
      "postcode_prefix": "NW8"
    },
    "profile_image": {
      "300": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "600": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "1200": "https://images.hiyacar.co.uk/xxxxx/xxxxx.jpg",
      "id": 1264,
      "primary": false
    },
    "live_cars_count": 1,
    "hiyas": 22,
    "owner_response_time": 5006,
    "badges": [
      {
        "name": "top_owner",
        "detail": "some detail"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "thread_id": {
      "type": "number"
    },
    "body": {
      "type": "string"
    },
    "created_at": {
      "type": "string",
      "description": "Created date/time of this message, ISO 8601 date format"
    },
    "sender": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string",
          "description": "Only shows first character for users other than yourself"
        },
        "bio": {
          "type": "string"
        },
        "rating": {
          "type": "number"
        },
        "rating_count": {
          "type": "number"
        },
        "join_date": {
          "type": "string"
        },
        "primary_location": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "city": {
              "type": "string"
            },
            "postcode_prefix": {
              "type": "string"
            }
          }
        },
        "profile_image": {
          "type": "object",
          "properties": {
            "300": {
              "type": "string"
            },
            "600": {
              "type": "string"
            },
            "1200": {
              "type": "string"
            },
            "id": {
              "type": "number"
            },
            "primary": {
              "type": "boolean"
            }
          }
        },
        "live_cars_count": {
          "type": "number"
        },
        "hiyas": {
          "type": "number"
        },
        "owner_response_time": {
          "type": "number",
          "description": "Average reponse time in seconds"
        },
        "badges": {
          "type": "array"
        }
      }
    }
  }
}

Post a message to a thread
POST/api/v1/messages

Post a message to a thread

thread_id - The thread to post a message to, optional, required without booking_ref or user_id booking_ref - The booking ref to create a message from from, required without thread_id or user_id user_id - The user id to create a message from from, required without thread_id or booking_ref body parameter is required in the JSON body

Example URI

POST https://staging.hiyacar.co.uk/api/v1/messages
Request  from booking
HideShow
Body
{
  "booking_ref": "UU76-RD54-PC34",
  "body": "The message text here"
}
Request  from thread
HideShow
Body
{
  "thread_id": 775,
  "body": "The message text here"
}
Request  for user
HideShow
Body
{
  "user_id": 22222,
  "body": "The message text here"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}

Push Notification Tokens

Register a device token

Register a device token
POST/api/v1/push/token

Register a push notification device token against this user

Request data:

  • device_token - The device token. String, required

  • device_type - What kind of device is this. String (‘ios’ or ‘android’), required

Example URI

POST https://staging.hiyacar.co.uk/api/v1/push/token
Request
HideShow
Body
{
  "device_token": "kajegnviuehmvinhsdrkgunysdkrkjhgkjgkjhgkjgkgykjjbuymsrkbdyruybnjsdrbdrurysdfhdfj",
  "device_type": "android"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}

Remove a push token

Remove a push token
DELETE/api/v1/push/token

Delete a push token

Request data:

  • device_token - The device token. String, required

  • device_type - What kind of device is this. String (‘ios’ or ‘android’), required

Example URI

DELETE https://staging.hiyacar.co.uk/api/v1/push/token
Request
HideShow
Body
{
  "device_token": "kajegnviuehmvinhsdrkgunysdkrkjhgkjgkjhgkjgkgykjjbuymsrkbdyruybnjsdrbdrurysdfhdfj",
  "device_type": "android"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}

Misc

Quickstart

All things QuickStart

Acquire a device access token

Acquire a device access token
POST/api/v1/quickstart/token

Convert a KC1 deviceToken in to a device accessToken

Request data:

  • access_device_token - The mobile device token, required

Example URI

POST https://staging.hiyacar.co.uk/api/v1/quickstart/token
Request
HideShow
Body
{
  "access_device_token": "xxxx"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "device_token": "xxx"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "device_token": {
      "type": "string"
    }
  }
}

Open a new session

Open a new session
POST/api/v1/quickstart/session

Open a new device session with KC2

Request data:

  • session_request_token - The session request token, required

Example URI

POST https://staging.hiyacar.co.uk/api/v1/quickstart/session
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "session_request_token": "xxx"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "session_request_token": {
      "type": "string"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "session_request_token": "xxx"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "session_request_token": {
      "type": "string"
    }
  }
}

Fetch key for this booking

Fetch key for this booking
POST/api/v1/bookings/virtualKey

Fetch a key for this booking

Example URI

POST https://staging.hiyacar.co.uk/api/v1/bookings/virtualKey
Request
HideShow
Body
{
  "access_device_token": "xxxxxxxx"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "present": true,
  "type": "ota",
  "id": 130111
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "present": {
      "type": "boolean"
    },
    "type": {
      "type": "string"
    },
    "id": {
      "type": "number"
    }
  }
}

Face Recognition

Check a face image

Check a face image
POST/api/v1/faces/recognition

Check a face image against licence/profile

Request data:

  • booking_ref - The booking reference. String, optional

  • action - The action that triggered this recognition. String, required

  • image - Base64 encoded profile image data. String required

Example URI

POST https://staging.hiyacar.co.uk/api/v1/faces/recognition
Request
HideShow
Body
{
  "booking_ref": "AA11-BB22-CC33",
  "action": "pickup",
  "image": "/...."
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "result": {
    "faces_id": 4,
    "scores": {
      "licence": "pass",
      "profile": "pass"
    },
    "override": false
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "result": {
    "faces_id": 4,
    "scores": {
      "licence": "fail",
      "profile": "fail"
    },
    "override": true
  }
}

Generated by aglio on 10 Aug 2021