Introduction

The Orbit4 API is a public-facing API intended to be used by Orbit4 partners to enable their customers to use the Orbit4 platform while ensuring seamless data synchronization with their respective systems.

This API is structured according to key RESTful principles, selectively incorporating guidelines from the JSON API Specification. We accept request data for POST and PUT methods in two formats: application/x-www-form-urlencoded and application/json. Every response from the API, including error notifications, is formatted in JSON.

When errors occur, they are signaled through a specific HTTP status code accompanied by an error object in the response. This object contains a distinctive error code as a string and a user-friendly message, designed to be easily understood by end users.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by navigating to the API Tokens section within your profile menu and then clicking on Generate API Token.

Assets

The following set of endpoints are engineered for efficient management of your clubs' asset registers on the Orbit4 platform. They simplify the process of creating, updating, and even deleting assets that are no longer needed within your gym operator accounts. The main purpose of these operations is facilitating the synchronization of your system's assets with Orbit4.

Search for assets.

GET
https://api.orbit4.org
/v1/assets
requires authentication

This endpoint allows you to search for assets within the specified gym operator account. You can filter the results by club specifying the user_id and other optional parameters.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

Query Parameters

user_id
integer
required

The ID of the gym operator the assets belong to.

Example:
2
search
string

Search for assets by qr_code, brand, range, or product name.

qr_code
string

Filter assets by qr code.

sort
string

Results can be sorted by the following fields:

  • id
  • qr_code
  • installation_date
  • manufacturing_date
  • warranty_end_date
  • created_at

The default sorting order is ascending, but the direction can be reversed by prefixing a dash (-) like so: ?sort=-id

metadata[metadata_key]
string

Filter results by metadata. Replace metadata_key with the key of the metadata you want to filter by.

page
integer

The page number of results to be returned.

per_page
integer

The number of results to be returned for each page of results.

Response Fields

Example request:
curl --request GET \
    --get "https://api.orbit4.org/v1/assets?user_id=2" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 53
                                                         
{
    "data": [
        {
            "id": 1,
            "brand": "Precor",
            "range": "C-Line Strength",
            "product": "Chest Press",
            "product_id": 3,
            "qr_code": "O4-643",
            "serial_number": "MSN-028",
            "installation_date": "13/05/2021",
            "manufacturing_date": "13/05/2020",
            "warranty_end_date": "13/05/2026",
            "current_spend": "£0",
            "max_spend": "£4,984.37",
            "fitness_product": 1,
            "has_odometer": 1,
            "residual_price": "£320.28",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 2,
            "brand": "Life Fitness",
            "range": "IC7 Spin Bike",
            "product": "Studio Bike",
            "product_id": 1,
            "qr_code": "O4-785",
            "serial_number": "MSN-716",
            "installation_date": "13/05/2021",
            "manufacturing_date": "13/05/2020",
            "warranty_end_date": "13/05/2026",
            "current_spend": "£0",
            "max_spend": "£9,497.17",
            "fitness_product": 0,
            "has_odometer": 1,
            "residual_price": "£115.75",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 3,
            "brand": "Life Fitness",
            "range": "IC7 Spin Bike",
            "product": "Studio Bike",
            "product_id": 1,
            "qr_code": "O4-510",
            "serial_number": "MSN-838",
            "installation_date": "13/05/2021",
            "manufacturing_date": "13/05/2020",
            "warranty_end_date": "13/05/2026",
            "current_spend": "£0",
            "max_spend": "£9,310.21",
            "fitness_product": 0,
            "has_odometer": 1,
            "residual_price": "£115.75",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 4,
            "brand": "Life Fitness",
            "range": "Signature",
            "product": "Chest Press",
            "product_id": 2,
            "qr_code": "O4-536",
            "serial_number": "MSN-894",
            "installation_date": "13/05/2021",
            "manufacturing_date": "13/05/2020",
            "warranty_end_date": "13/05/2026",
            "current_spend": "£0",
            "max_spend": "£1,052.50",
            "fitness_product": 0,
            "has_odometer": 1,
            "residual_price": "£958.86",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 5,
            "brand": "Life Fitness",
            "range": "IC7 Spin Bike",
            "product": "Studio Bike",
            "product_id": 1,
            "qr_code": "O4-513",
            "serial_number": "MSN-670",
            "installation_date": "13/05/2021",
            "manufacturing_date": "13/05/2020",
            "warranty_end_date": "13/05/2026",
            "current_spend": "£0",
            "max_spend": "£8,117.95",
            "fitness_product": 1,
            "has_odometer": 1,
            "residual_price": "£115.75",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 6,
            "brand": "Technogym",
            "range": "Excite JOG 700 LED",
            "product": "Treadmill",
            "product_id": 4,
            "qr_code": "O4-202",
            "serial_number": "MSN-005",
            "installation_date": "13/05/2021",
            "manufacturing_date": "13/05/2020",
            "warranty_end_date": "13/05/2026",
            "current_spend": "£0",
            "max_spend": "£3,090.21",
            "fitness_product": 0,
            "has_odometer": 0,
            "residual_price": "£371.76",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 7,
            "brand": "Hammer Strength",
            "range": "Plateloaded Iso-Lateral",
            "product": "Seated Leg Press",
            "product_id": 5,
            "qr_code": "O4-592",
            "serial_number": "MSN-134",
            "installation_date": "13/05/2021",
            "manufacturing_date": "13/05/2020",
            "warranty_end_date": "13/05/2026",
            "current_spend": "£0",
            "max_spend": "£7,795.19",
            "fitness_product": 1,
            "has_odometer": 0,
            "residual_price": "£922.46",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 8,
            "brand": "Life Fitness",
            "range": "IC7 Spin Bike",
            "product": "Studio Bike",
            "product_id": 1,
            "qr_code": "O4-693",
            "serial_number": "MSN-340",
            "installation_date": "13/05/2021",
            "manufacturing_date": "13/05/2020",
            "warranty_end_date": "13/05/2026",
            "current_spend": "£0",
            "max_spend": "£3,686.71",
            "fitness_product": 0,
            "has_odometer": 0,
            "residual_price": "£115.75",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 9,
            "brand": "Hammer Strength",
            "range": "Plateloaded Iso-Lateral",
            "product": "Seated Leg Press",
            "product_id": 5,
            "qr_code": "O4-157",
            "serial_number": "MSN-239",
            "installation_date": "13/05/2021",
            "manufacturing_date": "13/05/2020",
            "warranty_end_date": "13/05/2026",
            "current_spend": "£0",
            "max_spend": "£8,107.01",
            "fitness_product": 0,
            "has_odometer": 0,
            "residual_price": "£922.46",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 10,
            "brand": "Technogym",
            "range": "Excite JOG 700 LED",
            "product": "Treadmill",
            "product_id": 4,
            "qr_code": "O4-885",
            "serial_number": "MSN-578",
            "installation_date": "13/05/2021",
            "manufacturing_date": "13/05/2020",
            "warranty_end_date": "13/05/2026",
            "current_spend": "£0",
            "max_spend": "£7,698.92",
            "fitness_product": 1,
            "has_odometer": 1,
            "residual_price": "£371.76",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        }
    ],
    "links": {
        "first": "https://api.orbit4.org/v1/assets?page=1",
        "last": "https://api.orbit4.org/v1/assets?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://api.orbit4.org/v1/assets?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://api.orbit4.org/v1/assets",
        "per_page": 25,
        "to": 10,
        "total": 10
    }
}

Fetch asset details.

GET
https://api.orbit4.org
/v1/assets/{asset}
requires authentication

This endpoint allows you to retrieve details of a specific asset by their ID.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

URL Parameters

asset
string
required

The ID of the asset.

Example:
2

Response Fields

Example request:
curl --request GET \
    --get "https://api.orbit4.org/v1/assets/2" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 52
                                                         
{
    "data": {
        "id": 2,
        "brand": "Life Fitness",
        "range": "IC7 Spin Bike",
        "product": "Studio Bike",
        "product_id": 1,
        "qr_code": "O4-785",
        "serial_number": "MSN-716",
        "installation_date": "13/05/2021",
        "manufacturing_date": "13/05/2020",
        "warranty_end_date": "13/05/2026",
        "current_spend": "£0",
        "max_spend": "£9,497.17",
        "fitness_product": 0,
        "has_odometer": 1,
        "residual_price": "£115.75",
        "image": null,
        "metadata": [],
        "created_at": "2024-05-13T23:14:32+01:00"
    }
}

Create new asset.

POST
https://api.orbit4.org
/v1/assets
requires authentication

This endpoint allows you to add a new asset to the gym operator account. The user_id must be specified when adding a new asset.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

Body Parameters

Response Fields

Example request:
curl --request POST \
    "https://api.orbit4.org/v1/assets" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json" \
    --data "{
    \"user_id\": 2,
    \"qr_code\": \"O4-123456\",
    \"serial_number\": \"123456\",
    \"installation_date\": \"2024-05-13\",
    \"manufacturing_date\": \"2024-05-13\",
    \"warranty_end_date\": \"2024-05-13\",
    \"brand\": \"Life Fitness\",
    \"range\": \"Signature Series\",
    \"product\": \"Chest Press\",
    \"product_id\": 1,
    \"metadata\": \"{\\\"integration_id\\\":\\\"ABC123\\\"}\"
}"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 51
                                                         
{
    "data": {
        "id": 16,
        "brand": "Life Fitness",
        "range": "IC7 Spin Bike",
        "product": "Studio Bike",
        "product_id": 1,
        "qr_code": "O4-123456",
        "serial_number": "123456",
        "installation_date": "13/05/2024",
        "manufacturing_date": "13/05/2024",
        "warranty_end_date": "13/05/2024",
        "current_spend": "£0",
        "max_spend": "£0",
        "fitness_product": null,
        "has_odometer": null,
        "residual_price": "£918.99",
        "image": null,
        "metadata": {
            "integration_id": "ABC123"
        },
        "created_at": "2024-05-13T23:14:32+01:00"
    }
}

Update asset.

PUT
https://api.orbit4.org
/v1/assets/{asset}
requires authentication

This endpoint allows you to update details of a specific asset by their ID. Only the fields that need to be updated should be provided.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

URL Parameters

asset
string
required

The ID of the asset.

Example:
2

Body Parameters

Response Fields

Example request:
curl --request PUT \
    "https://api.orbit4.org/v1/assets/2" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json" \
    --data "{
    \"qr_code\": \"O4-123456\",
    \"serial_number\": \"123456\",
    \"installation_date\": \"2024-05-13\",
    \"manufacturing_date\": \"2024-05-13\",
    \"warranty_end_date\": \"2024-05-13\",
    \"brand\": \"Life Fitness\",
    \"range\": \"Signature Series\",
    \"product\": \"Chest Press\",
    \"product_id\": 1,
    \"metadata\": \"{\\\"integration_id\\\":\\\"ABC123\\\"}\"
}"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 50
                                                         
{
    "data": {
        "id": 2,
        "brand": "Life Fitness",
        "range": "IC7 Spin Bike",
        "product": "Studio Bike",
        "product_id": 1,
        "qr_code": "O4-123456",
        "serial_number": "123456",
        "installation_date": "13/05/2024",
        "manufacturing_date": "13/05/2024",
        "warranty_end_date": "13/05/2024",
        "current_spend": "£0",
        "max_spend": "£9,497.17",
        "fitness_product": 0,
        "has_odometer": 1,
        "residual_price": "£918.99",
        "image": null,
        "metadata": {
            "integration_id": "ABC123"
        },
        "created_at": "2024-05-13T23:14:32+01:00"
    }
}

Delete asset.

DELETE
https://api.orbit4.org
/v1/assets/{asset}
requires authentication

This endpoint allows you to delete a specific asset from your account by their ID.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

URL Parameters

asset
string
required

The ID of the asset.

Example:
2
Example request:
curl --request DELETE \
    "https://api.orbit4.org/v1/assets/2" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 49
                                                         
[Empty response]

Contracts

The following set of endpoints are designed to facilitate the management of your service contracts between your gym operators and service providers on the Orbit4 platform. They simplify the process of searching and creating contracts.

Search for contracts.

GET
https://api.orbit4.org
/v1/contracts
requires authentication

This endpoint allows you to search for contracts within the specified user account. You can filter the results by gym operator, service provider or a specific asset.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

Query Parameters

gym_operator_id
integer

The ID of the gym operator the service contract belong to.

Example:
2
service_provider_id
integer

The ID of the service provider the service contract belong to.

Example:
4
asset_id
integer

The ID of asset to filter contracts by.

Example:
1
active
boolean

Filter results by active/expired contracts.

Example:
1
sort
string

Results can be sorted by the following fields:

  • id
  • start_date
  • created_at

The default sorting order is ascending, but the direction can be reversed by prefixing a dash (-) like so: ?sort=-id

metadata[metadata_key]
string

Filter results by metadata. Replace metadata_key with the key of the metadata you want to filter by.

page
integer

The page number of results to be returned.

per_page
integer

The number of results to be returned for each page of results.

Response Fields

Example request:
curl --request GET \
    --get "https://api.orbit4.org/v1/contracts?gym_operator_id=2&service_provider_id=4&asset_id=1&active=1" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 48
                                                         
{
    "data": [
        {
            "id": 1,
            "number": "WSGE123",
            "type": "",
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "active": true,
            "start_date": "2024-05-12",
            "end_date": "2025-05-12",
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        }
    ],
    "links": {
        "first": "https://api.orbit4.org/v1/contracts?page=1",
        "last": "https://api.orbit4.org/v1/contracts?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://api.orbit4.org/v1/contracts?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://api.orbit4.org/v1/contracts",
        "per_page": 25,
        "to": 1,
        "total": 1
    }
}

Create new contract.

POST
https://api.orbit4.org
/v1/contracts
requires authentication

This endpoint allows you to create a new contract between a gym operator and a service provider.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

Body Parameters

Response Fields

Example request:
curl --request POST \
    "https://api.orbit4.org/v1/contracts" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json" \
    --data "{
    \"gym_operator_id\": 2,
    \"service_provider_id\": 3,
    \"start_date\": \"2024-05-13\",
    \"type\": \"Full Annual\",
    \"assets\": [
        1
    ],
    \"metadata\": \"{\\\"integration_id\\\":\\\"ABC123\\\"}\"
}"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 47
                                                         
{
    "data": {
        "id": 2,
        "number": "WSGE1",
        "type": "Full Annual",
        "gym_operator": {
            "id": 2,
            "first_name": "Pearl",
            "last_name": "Becker",
            "email": "[email protected]",
            "role": "gym_operator",
            "company_name": "PulseForge Fitness",
            "address": "23397 Sibyl Ridge Suite 221",
            "address_2": null,
            "address_3": null,
            "city": "Lake Peggie",
            "country": "UK",
            "postcode": "62465",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:30+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:30+01:00"
        },
        "service_provider": {
            "id": 3,
            "first_name": "Margret",
            "last_name": "Jenkins",
            "email": "[email protected]",
            "role": "gym_operator",
            "company_name": "PulseForge Fitness",
            "address": "70291 Bednar Roads Apt. 460",
            "address_2": null,
            "address_3": null,
            "city": "Mossieside",
            "country": "UK",
            "postcode": "76555-9044",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:30+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:30+01:00"
        },
        "active": true,
        "start_date": "2024-05-13",
        "end_date": "2025-05-13",
        "metadata": {
            "integration_id": "ABC123"
        },
        "created_at": "2024-05-13T23:14:33+01:00"
    }
}

Fetch contract details.

GET
https://api.orbit4.org
/v1/contracts/{contract}
requires authentication

This endpoint allows you to retrieve details of a specific contract by their ID.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

URL Parameters

contract
string
required

The ID of the contract.

Example:
1

Response Fields

Example request:
curl --request GET \
    --get "https://api.orbit4.org/v1/contracts/1" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 46
                                                         
{
    "data": {
        "id": 1,
        "number": "WSGE123",
        "type": "",
        "gym_operator": {
            "id": 2,
            "first_name": "Pearl",
            "last_name": "Becker",
            "email": "[email protected]",
            "role": "gym_operator",
            "company_name": "PulseForge Fitness",
            "address": "23397 Sibyl Ridge Suite 221",
            "address_2": null,
            "address_3": null,
            "city": "Lake Peggie",
            "country": "UK",
            "postcode": "62465",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:30+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:30+01:00"
        },
        "service_provider": {
            "id": 4,
            "first_name": "Rafael",
            "last_name": "Wolf",
            "email": "[email protected]",
            "role": "service_provider",
            "company_name": "The Gym Fixers",
            "address": "5543 Parisian Cliffs",
            "address_2": null,
            "address_3": null,
            "city": "Lake Annamarieville",
            "country": "UK",
            "postcode": "75123",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:31+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:31+01:00"
        },
        "active": true,
        "start_date": "2024-05-12",
        "end_date": "2025-05-12",
        "assets": [
            {
                "id": 1,
                "brand": "Precor",
                "range": "C-Line Strength",
                "product": "Chest Press",
                "product_id": 3,
                "qr_code": "O4-643",
                "serial_number": "MSN-028",
                "installation_date": "13/05/2021",
                "manufacturing_date": "13/05/2020",
                "warranty_end_date": "13/05/2026",
                "current_spend": "£0",
                "max_spend": "£4,984.37",
                "fitness_product": 1,
                "has_odometer": 1,
                "residual_price": "£320.28",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            {
                "id": 2,
                "brand": "Life Fitness",
                "range": "IC7 Spin Bike",
                "product": "Studio Bike",
                "product_id": 1,
                "qr_code": "O4-785",
                "serial_number": "MSN-716",
                "installation_date": "13/05/2021",
                "manufacturing_date": "13/05/2020",
                "warranty_end_date": "13/05/2026",
                "current_spend": "£0",
                "max_spend": "£9,497.17",
                "fitness_product": 0,
                "has_odometer": 1,
                "residual_price": "£115.75",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            {
                "id": 3,
                "brand": "Life Fitness",
                "range": "IC7 Spin Bike",
                "product": "Studio Bike",
                "product_id": 1,
                "qr_code": "O4-510",
                "serial_number": "MSN-838",
                "installation_date": "13/05/2021",
                "manufacturing_date": "13/05/2020",
                "warranty_end_date": "13/05/2026",
                "current_spend": "£0",
                "max_spend": "£9,310.21",
                "fitness_product": 0,
                "has_odometer": 1,
                "residual_price": "£115.75",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            {
                "id": 4,
                "brand": "Life Fitness",
                "range": "Signature",
                "product": "Chest Press",
                "product_id": 2,
                "qr_code": "O4-536",
                "serial_number": "MSN-894",
                "installation_date": "13/05/2021",
                "manufacturing_date": "13/05/2020",
                "warranty_end_date": "13/05/2026",
                "current_spend": "£0",
                "max_spend": "£1,052.50",
                "fitness_product": 0,
                "has_odometer": 1,
                "residual_price": "£958.86",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            {
                "id": 5,
                "brand": "Life Fitness",
                "range": "IC7 Spin Bike",
                "product": "Studio Bike",
                "product_id": 1,
                "qr_code": "O4-513",
                "serial_number": "MSN-670",
                "installation_date": "13/05/2021",
                "manufacturing_date": "13/05/2020",
                "warranty_end_date": "13/05/2026",
                "current_spend": "£0",
                "max_spend": "£8,117.95",
                "fitness_product": 1,
                "has_odometer": 1,
                "residual_price": "£115.75",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            {
                "id": 6,
                "brand": "Technogym",
                "range": "Excite JOG 700 LED",
                "product": "Treadmill",
                "product_id": 4,
                "qr_code": "O4-202",
                "serial_number": "MSN-005",
                "installation_date": "13/05/2021",
                "manufacturing_date": "13/05/2020",
                "warranty_end_date": "13/05/2026",
                "current_spend": "£0",
                "max_spend": "£3,090.21",
                "fitness_product": 0,
                "has_odometer": 0,
                "residual_price": "£371.76",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            {
                "id": 7,
                "brand": "Hammer Strength",
                "range": "Plateloaded Iso-Lateral",
                "product": "Seated Leg Press",
                "product_id": 5,
                "qr_code": "O4-592",
                "serial_number": "MSN-134",
                "installation_date": "13/05/2021",
                "manufacturing_date": "13/05/2020",
                "warranty_end_date": "13/05/2026",
                "current_spend": "£0",
                "max_spend": "£7,795.19",
                "fitness_product": 1,
                "has_odometer": 0,
                "residual_price": "£922.46",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            {
                "id": 8,
                "brand": "Life Fitness",
                "range": "IC7 Spin Bike",
                "product": "Studio Bike",
                "product_id": 1,
                "qr_code": "O4-693",
                "serial_number": "MSN-340",
                "installation_date": "13/05/2021",
                "manufacturing_date": "13/05/2020",
                "warranty_end_date": "13/05/2026",
                "current_spend": "£0",
                "max_spend": "£3,686.71",
                "fitness_product": 0,
                "has_odometer": 0,
                "residual_price": "£115.75",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            {
                "id": 9,
                "brand": "Hammer Strength",
                "range": "Plateloaded Iso-Lateral",
                "product": "Seated Leg Press",
                "product_id": 5,
                "qr_code": "O4-157",
                "serial_number": "MSN-239",
                "installation_date": "13/05/2021",
                "manufacturing_date": "13/05/2020",
                "warranty_end_date": "13/05/2026",
                "current_spend": "£0",
                "max_spend": "£8,107.01",
                "fitness_product": 0,
                "has_odometer": 0,
                "residual_price": "£922.46",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            {
                "id": 10,
                "brand": "Technogym",
                "range": "Excite JOG 700 LED",
                "product": "Treadmill",
                "product_id": 4,
                "qr_code": "O4-885",
                "serial_number": "MSN-578",
                "installation_date": "13/05/2021",
                "manufacturing_date": "13/05/2020",
                "warranty_end_date": "13/05/2026",
                "current_spend": "£0",
                "max_spend": "£7,698.92",
                "fitness_product": 1,
                "has_odometer": 1,
                "residual_price": "£371.76",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            }
        ],
        "metadata": [],
        "created_at": "2024-05-13T23:14:32+01:00"
    }
}

Media

The following set of endpoints are designed to facilitate the management of media files within the different resources.

Upload media.

POST
https://api.orbit4.org
/v1/media
requires authentication

This endpoint allows you to upload media files to the specified resource. Some media types are single-use, meaning that only one media file can be uploaded for that type on that resource. If a media file already exists for the specified type, it will be replaced with the new one.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
multipart/form-data

Body Parameters

Response Fields

Example request:
curl --request POST \
    "https://api.orbit4.org/v1/media" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --form "type=image"\
    --form "resource_id=1"\
    --form "resource_type=ticket"\
    --form "file=@/tmp/phpm2tesZ" 
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 40
                                                         
{
    "data": {
        "id": 3,
        "url": "https://cdn.orbit4.org/uploads/47753664290c95c9b04.13295162.jpg",
        "type": "image",
        "extra_properties": null,
        "created_at": "2024-05-13T23:14:33+01:00"
    }
}

Update media extra properties.

PUT
https://api.orbit4.org
/v1/media/{media}
requires authentication

This endpoint allows you to upload media metadata to the specified resource.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json

URL Parameters

media
string
required

The ID of the media file.

Example:
2

Body Parameters

Response Fields

Example request:
curl --request PUT \
    "https://api.orbit4.org/v1/media/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"extra_properties\": \"{\\\"approved\\\":true}\"
}"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 39
                                                         
{
    "data": {
        "id": 2,
        "url": "https://cdn.orbit4.org/uploads/quote.pdf",
        "type": "quote",
        "extra_properties": {
            "approved": true
        },
        "created_at": "2024-05-13T23:14:32+01:00"
    }
}

Notes

The following set of endpoints are designed to facilitate the management of ticket notes. accounts.

Create ticket note.

POST
https://api.orbit4.org
/v1/notes
requires authentication

This endpoint allows you to create a new note for the specified ticket.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

Body Parameters

Response Fields

Example request:
curl --request POST \
    "https://api.orbit4.org/v1/notes" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json" \
    --data "{
    \"user_id\": 2,
    \"ticket_id\": 1,
    \"note\": \"Can you please provide more details about the issue?\"
}"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 41
                                                         
{
    "data": {
        "id": 3,
        "user": {
            "id": 2,
            "first_name": "Pearl",
            "last_name": "Becker",
            "email": "[email protected]",
            "role": "gym_operator",
            "company_name": "PulseForge Fitness",
            "address": "23397 Sibyl Ridge Suite 221",
            "address_2": null,
            "address_3": null,
            "city": "Lake Peggie",
            "country": "UK",
            "postcode": "62465",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:30+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:30+01:00"
        },
        "note": "Can you please provide more details about the issue?",
        "is_system": false,
        "created_at": "2024-05-13T23:14:33+01:00"
    }
}

Tickets

The following set of endpoints are designed to facilitate the management of tickets within your different user accounts. They allow you to search for tickets, fetch specific ticket details, create new tickets, update ticket details, and even change tickets' status. The main purpose of these operations is facilitating the synchronization of your system's tickets with Orbit4.

Search for tickets.

GET
https://api.orbit4.org
/v1/tickets
requires authentication

This endpoint allows you to search for tickets based on specified criteria. The search results will include all tickets that match the criteria.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

Query Parameters

user_id
integer

The ID of the user for whom the tickets are being fetched.

Example:
2
search
string

Search for tickets by ticket_number or description.

type
string

Filter tickets by their type.

Must be one of:
  • standard
  • ad-hoc
  • internal
  • service
status
string

Filter tickets by their status.

Must be one of:
  • open
  • parts_required
  • engineer_deployed
  • closed
sort
string

Results can be sorted by the following fields:

  • id
  • ticket_number
  • status
  • created_at

The default sorting order is ascending, but the direction can be reversed by prefixing a dash (-) like so: ?sort=-id

metadata[metadata_key]
string

Filter results by metadata. Replace metadata_key with the key of the metadata you want to filter by.

page
integer

The page number of results to be returned.

per_page
integer

The number of results to be returned for each page of results.

Response Fields

Example request:
curl --request GET \
    --get "https://api.orbit4.org/v1/tickets?user_id=2" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 45
                                                         
{
    "data": [
        {
            "id": 1,
            "number": "WSGE123-001",
            "type": "standard",
            "description": null,
            "priority": "Faulty",
            "status": "open",
            "engineer_arrived_at": null,
            "engineer_deployed_at": null,
            "closed_at": null,
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "ticket_admin": null,
            "engineer": null,
            "caretaker": null,
            "asset": null,
            "contract": {
                "id": 1,
                "number": "WSGE123",
                "type": "",
                "gym_operator": {
                    "id": 2,
                    "first_name": "Pearl",
                    "last_name": "Becker",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": "23397 Sibyl Ridge Suite 221",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Peggie",
                    "country": "UK",
                    "postcode": "62465",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:30+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:30+01:00"
                },
                "service_provider": {
                    "id": 4,
                    "first_name": "Rafael",
                    "last_name": "Wolf",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": "5543 Parisian Cliffs",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Annamarieville",
                    "country": "UK",
                    "postcode": "75123",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:31+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:31+01:00"
                },
                "active": true,
                "start_date": "2024-05-12",
                "end_date": "2025-05-12",
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            "images": [],
            "notes": [],
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 2,
            "number": "WSGE123-002",
            "type": "standard",
            "description": null,
            "priority": "Faulty",
            "status": "open",
            "engineer_arrived_at": null,
            "engineer_deployed_at": null,
            "closed_at": null,
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "ticket_admin": null,
            "engineer": null,
            "caretaker": null,
            "asset": null,
            "contract": {
                "id": 1,
                "number": "WSGE123",
                "type": "",
                "gym_operator": {
                    "id": 2,
                    "first_name": "Pearl",
                    "last_name": "Becker",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": "23397 Sibyl Ridge Suite 221",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Peggie",
                    "country": "UK",
                    "postcode": "62465",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:30+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:30+01:00"
                },
                "service_provider": {
                    "id": 4,
                    "first_name": "Rafael",
                    "last_name": "Wolf",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": "5543 Parisian Cliffs",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Annamarieville",
                    "country": "UK",
                    "postcode": "75123",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:31+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:31+01:00"
                },
                "active": true,
                "start_date": "2024-05-12",
                "end_date": "2025-05-12",
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            "images": [
                {
                    "id": 1,
                    "url": "https://cdn.orbit4.org/uploads/image.jpg",
                    "type": "image",
                    "extra_properties": null,
                    "created_at": "2024-05-13T23:14:32+01:00"
                }
            ],
            "notes": [
                {
                    "id": 1,
                    "user": {
                        "id": 2,
                        "first_name": "Pearl",
                        "last_name": "Becker",
                        "email": "[email protected]",
                        "role": "gym_operator",
                        "company_name": "PulseForge Fitness",
                        "address": "23397 Sibyl Ridge Suite 221",
                        "address_2": null,
                        "address_3": null,
                        "city": "Lake Peggie",
                        "country": "UK",
                        "postcode": "62465",
                        "language": "en",
                        "email_verified_at": "2024-05-13T23:14:30+01:00",
                        "metadata": [],
                        "created_at": "2024-05-13T23:14:30+01:00"
                    },
                    "note": "Hey, this machine is now totally out of use. Can you come today?",
                    "is_system": false,
                    "created_at": "2024-05-13T23:14:32+01:00"
                },
                {
                    "id": 2,
                    "user": {
                        "id": 4,
                        "first_name": "Rafael",
                        "last_name": "Wolf",
                        "email": "[email protected]",
                        "role": "service_provider",
                        "company_name": "The Gym Fixers",
                        "address": "5543 Parisian Cliffs",
                        "address_2": null,
                        "address_3": null,
                        "city": "Lake Annamarieville",
                        "country": "UK",
                        "postcode": "75123",
                        "language": "en",
                        "email_verified_at": "2024-05-13T23:14:31+01:00",
                        "metadata": [],
                        "created_at": "2024-05-13T23:14:31+01:00"
                    },
                    "note": "Sure, no problem, I'll deploy one of my technicians out to you now.",
                    "is_system": false,
                    "created_at": "2024-05-13T23:14:32+01:00"
                }
            ],
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 3,
            "number": "WSGE123-003",
            "type": "standard",
            "description": null,
            "priority": "Faulty",
            "status": "open",
            "engineer_arrived_at": null,
            "engineer_deployed_at": null,
            "closed_at": null,
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "ticket_admin": null,
            "engineer": null,
            "caretaker": null,
            "asset": null,
            "contract": {
                "id": 1,
                "number": "WSGE123",
                "type": "",
                "gym_operator": {
                    "id": 2,
                    "first_name": "Pearl",
                    "last_name": "Becker",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": "23397 Sibyl Ridge Suite 221",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Peggie",
                    "country": "UK",
                    "postcode": "62465",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:30+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:30+01:00"
                },
                "service_provider": {
                    "id": 4,
                    "first_name": "Rafael",
                    "last_name": "Wolf",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": "5543 Parisian Cliffs",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Annamarieville",
                    "country": "UK",
                    "postcode": "75123",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:31+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:31+01:00"
                },
                "active": true,
                "start_date": "2024-05-12",
                "end_date": "2025-05-12",
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            "images": [],
            "notes": [],
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 4,
            "number": "WSGE123-004",
            "type": "standard",
            "description": null,
            "priority": "Faulty",
            "status": "engineer_deployed",
            "engineer_arrived_at": null,
            "engineer_deployed_at": "2024-05-13T23:14:32+01:00",
            "closed_at": null,
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "ticket_admin": null,
            "engineer": null,
            "caretaker": null,
            "asset": null,
            "contract": {
                "id": 1,
                "number": "WSGE123",
                "type": "",
                "gym_operator": {
                    "id": 2,
                    "first_name": "Pearl",
                    "last_name": "Becker",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": "23397 Sibyl Ridge Suite 221",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Peggie",
                    "country": "UK",
                    "postcode": "62465",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:30+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:30+01:00"
                },
                "service_provider": {
                    "id": 4,
                    "first_name": "Rafael",
                    "last_name": "Wolf",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": "5543 Parisian Cliffs",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Annamarieville",
                    "country": "UK",
                    "postcode": "75123",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:31+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:31+01:00"
                },
                "active": true,
                "start_date": "2024-05-12",
                "end_date": "2025-05-12",
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            "images": [],
            "notes": [],
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 5,
            "number": "WSGE123-005",
            "type": "standard",
            "description": null,
            "priority": "Faulty",
            "status": "parts_required",
            "engineer_arrived_at": null,
            "engineer_deployed_at": null,
            "closed_at": null,
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "ticket_admin": null,
            "engineer": null,
            "caretaker": null,
            "asset": null,
            "contract": {
                "id": 1,
                "number": "WSGE123",
                "type": "",
                "gym_operator": {
                    "id": 2,
                    "first_name": "Pearl",
                    "last_name": "Becker",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": "23397 Sibyl Ridge Suite 221",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Peggie",
                    "country": "UK",
                    "postcode": "62465",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:30+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:30+01:00"
                },
                "service_provider": {
                    "id": 4,
                    "first_name": "Rafael",
                    "last_name": "Wolf",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": "5543 Parisian Cliffs",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Annamarieville",
                    "country": "UK",
                    "postcode": "75123",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:31+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:31+01:00"
                },
                "active": true,
                "start_date": "2024-05-12",
                "end_date": "2025-05-12",
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            "images": [],
            "notes": [],
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 6,
            "number": "WSGE123-006",
            "type": "standard",
            "description": null,
            "priority": "Faulty",
            "status": "closed",
            "engineer_arrived_at": null,
            "engineer_deployed_at": null,
            "closed_at": "2024-05-13T23:14:32+01:00",
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "ticket_admin": null,
            "engineer": null,
            "caretaker": null,
            "asset": null,
            "contract": {
                "id": 1,
                "number": "WSGE123",
                "type": "",
                "gym_operator": {
                    "id": 2,
                    "first_name": "Pearl",
                    "last_name": "Becker",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": "23397 Sibyl Ridge Suite 221",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Peggie",
                    "country": "UK",
                    "postcode": "62465",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:30+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:30+01:00"
                },
                "service_provider": {
                    "id": 4,
                    "first_name": "Rafael",
                    "last_name": "Wolf",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": "5543 Parisian Cliffs",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Annamarieville",
                    "country": "UK",
                    "postcode": "75123",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:31+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:31+01:00"
                },
                "active": true,
                "start_date": "2024-05-12",
                "end_date": "2025-05-12",
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            "images": [],
            "notes": [],
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        {
            "id": 7,
            "number": "WSGE123-007",
            "type": "standard",
            "description": null,
            "priority": "Faulty",
            "status": "closed",
            "engineer_arrived_at": null,
            "engineer_deployed_at": null,
            "closed_at": "2024-05-13T23:14:32+01:00",
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "ticket_admin": null,
            "engineer": null,
            "caretaker": null,
            "asset": null,
            "contract": {
                "id": 1,
                "number": "WSGE123",
                "type": "",
                "gym_operator": {
                    "id": 2,
                    "first_name": "Pearl",
                    "last_name": "Becker",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": "23397 Sibyl Ridge Suite 221",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Peggie",
                    "country": "UK",
                    "postcode": "62465",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:30+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:30+01:00"
                },
                "service_provider": {
                    "id": 4,
                    "first_name": "Rafael",
                    "last_name": "Wolf",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": "5543 Parisian Cliffs",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Annamarieville",
                    "country": "UK",
                    "postcode": "75123",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:31+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:31+01:00"
                },
                "active": true,
                "start_date": "2024-05-12",
                "end_date": "2025-05-12",
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            "images": [],
            "notes": [],
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        }
    ],
    "links": {
        "first": "https://api.orbit4.org/v1/tickets?page=1",
        "last": "https://api.orbit4.org/v1/tickets?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://api.orbit4.org/v1/tickets?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://api.orbit4.org/v1/tickets",
        "per_page": 25,
        "to": 7,
        "total": 7
    }
}

Create new ticket.

POST
https://api.orbit4.org
/v1/tickets
requires authentication

This endpoint allows you to raise a new ticket from the specified sender to the specified recipient account. The ticket will be created with the provided details and assigned to the specified user.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
multipart/form-data

Body Parameters

Response Fields

Example request:
curl --request POST \
    "https://api.orbit4.org/v1/tickets" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: multipart/form-data" \
    --form "sender_id=2"\
    --form "recipient_id=4"\
    --form "asset_id=1"\
    --form "type=standard"\
    --form "description=The treadmill is broken. Please fix it."\
    --form "priority=Faulty"\
    --form "metadata={"integration_id":"ABC123"}"\
    --form "images[]=@/tmp/phpAWWUwW" 
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 44
                                                         
{
    "data": {
        "id": 8,
        "number": "WSGE123-008",
        "type": "standard",
        "description": "The treadmill is broken. Please fix it.",
        "priority": "Faulty",
        "status": "open",
        "engineer_arrived_at": null,
        "engineer_deployed_at": null,
        "closed_at": null,
        "service_provider": {
            "id": 4,
            "first_name": "Rafael",
            "last_name": "Wolf",
            "email": "[email protected]",
            "role": "service_provider",
            "company_name": "The Gym Fixers",
            "address": "5543 Parisian Cliffs",
            "address_2": null,
            "address_3": null,
            "city": "Lake Annamarieville",
            "country": "UK",
            "postcode": "75123",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:31+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:31+01:00"
        },
        "gym_operator": {
            "id": 2,
            "first_name": "Pearl",
            "last_name": "Becker",
            "email": "[email protected]",
            "role": "gym_operator",
            "company_name": "PulseForge Fitness",
            "address": "23397 Sibyl Ridge Suite 221",
            "address_2": null,
            "address_3": null,
            "city": "Lake Peggie",
            "country": "UK",
            "postcode": "62465",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:30+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:30+01:00"
        },
        "ticket_admin": null,
        "engineer": null,
        "caretaker": null,
        "asset": {
            "id": 1,
            "brand": "Precor",
            "range": "C-Line Strength",
            "product": "Chest Press",
            "product_id": 3,
            "qr_code": "O4-643",
            "serial_number": "MSN-028",
            "installation_date": "13/05/2021",
            "manufacturing_date": "13/05/2020",
            "warranty_end_date": "13/05/2026",
            "current_spend": "£0",
            "max_spend": "£4,984.37",
            "fitness_product": 1,
            "has_odometer": 1,
            "residual_price": "£320.28",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        "contract": {
            "id": 1,
            "number": "WSGE123",
            "type": "",
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "active": true,
            "start_date": "2024-05-12",
            "end_date": "2025-05-12",
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        "images": [
            {
                "id": 3,
                "url": "https://cdn.orbit4.org/uploads/68301664290c92774e1.50199467.jpg",
                "type": "image",
                "extra_properties": null,
                "created_at": "2024-05-13T23:14:33+01:00"
            }
        ],
        "notes": [],
        "metadata": {
            "integration_id": "ABC123"
        },
        "created_at": "2024-05-13T23:14:33+01:00"
    }
}

Fetch ticket details.

GET
https://api.orbit4.org
/v1/tickets/{ticket}
requires authentication

This endpoint allows you to retrieve details of a specific ticket by their ID. The returned details include the ticket's status, assigned user, and other relevant information.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

URL Parameters

ticket
string
required

The ID of the ticket.

Example:
2

Response Fields

Example request:
curl --request GET \
    --get "https://api.orbit4.org/v1/tickets/2" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 43
                                                         
{
    "data": {
        "id": 2,
        "number": "WSGE123-002",
        "type": "standard",
        "description": null,
        "priority": "Faulty",
        "status": "open",
        "engineer_arrived_at": null,
        "engineer_deployed_at": null,
        "closed_at": null,
        "service_provider": {
            "id": 4,
            "first_name": "Rafael",
            "last_name": "Wolf",
            "email": "[email protected]",
            "role": "service_provider",
            "company_name": "The Gym Fixers",
            "address": "5543 Parisian Cliffs",
            "address_2": null,
            "address_3": null,
            "city": "Lake Annamarieville",
            "country": "UK",
            "postcode": "75123",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:31+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:31+01:00"
        },
        "gym_operator": {
            "id": 2,
            "first_name": "Pearl",
            "last_name": "Becker",
            "email": "[email protected]",
            "role": "gym_operator",
            "company_name": "PulseForge Fitness",
            "address": "23397 Sibyl Ridge Suite 221",
            "address_2": null,
            "address_3": null,
            "city": "Lake Peggie",
            "country": "UK",
            "postcode": "62465",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:30+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:30+01:00"
        },
        "ticket_admin": null,
        "engineer": null,
        "caretaker": null,
        "asset": null,
        "contract": {
            "id": 1,
            "number": "WSGE123",
            "type": "",
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "active": true,
            "start_date": "2024-05-12",
            "end_date": "2025-05-12",
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        "images": [
            {
                "id": 1,
                "url": "https://cdn.orbit4.org/uploads/image.jpg",
                "type": "image",
                "extra_properties": null,
                "created_at": "2024-05-13T23:14:32+01:00"
            }
        ],
        "notes": [
            {
                "id": 1,
                "user": {
                    "id": 2,
                    "first_name": "Pearl",
                    "last_name": "Becker",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": "23397 Sibyl Ridge Suite 221",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Peggie",
                    "country": "UK",
                    "postcode": "62465",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:30+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:30+01:00"
                },
                "note": "Hey, this machine is now totally out of use. Can you come today?",
                "is_system": false,
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            {
                "id": 2,
                "user": {
                    "id": 4,
                    "first_name": "Rafael",
                    "last_name": "Wolf",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": "5543 Parisian Cliffs",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Annamarieville",
                    "country": "UK",
                    "postcode": "75123",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:31+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:31+01:00"
                },
                "note": "Sure, no problem, I'll deploy one of my technicians out to you now.",
                "is_system": false,
                "created_at": "2024-05-13T23:14:32+01:00"
            }
        ],
        "metadata": [],
        "created_at": "2024-05-13T23:14:32+01:00"
    }
}

Update ticket.

PUT
https://api.orbit4.org
/v1/tickets/{ticket}
requires authentication

This endpoint allows you to update details of a specific ticket by their ID. Only the fields that need to be updated should be provided.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

URL Parameters

ticket
string
required

The ID of the ticket.

Example:
2

Body Parameters

Response Fields

Example request:
curl --request PUT \
    "https://api.orbit4.org/v1/tickets/2" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json" \
    --data "{
    \"status\": \"closed\",
    \"priority\": \"Faulty\",
    \"metadata\": \"{\\\"integration_id\\\":\\\"ABC123\\\"}\"
}"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 42
                                                         
{
    "data": {
        "id": 2,
        "number": "WSGE123-002",
        "type": "standard",
        "description": null,
        "priority": "Faulty",
        "status": "closed",
        "engineer_arrived_at": null,
        "engineer_deployed_at": null,
        "closed_at": "2024-05-13T23:14:33+01:00",
        "service_provider": {
            "id": 4,
            "first_name": "Rafael",
            "last_name": "Wolf",
            "email": "[email protected]",
            "role": "service_provider",
            "company_name": "The Gym Fixers",
            "address": "5543 Parisian Cliffs",
            "address_2": null,
            "address_3": null,
            "city": "Lake Annamarieville",
            "country": "UK",
            "postcode": "75123",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:31+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:31+01:00"
        },
        "gym_operator": {
            "id": 2,
            "first_name": "Pearl",
            "last_name": "Becker",
            "email": "[email protected]",
            "role": "gym_operator",
            "company_name": "PulseForge Fitness",
            "address": "23397 Sibyl Ridge Suite 221",
            "address_2": null,
            "address_3": null,
            "city": "Lake Peggie",
            "country": "UK",
            "postcode": "62465",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:30+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:30+01:00"
        },
        "ticket_admin": null,
        "engineer": null,
        "caretaker": null,
        "asset": null,
        "contract": {
            "id": 1,
            "number": "WSGE123",
            "type": "",
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "active": true,
            "start_date": "2024-05-12",
            "end_date": "2025-05-12",
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        "images": [
            {
                "id": 1,
                "url": "https://cdn.orbit4.org/uploads/image.jpg",
                "type": "image",
                "extra_properties": null,
                "created_at": "2024-05-13T23:14:32+01:00"
            }
        ],
        "notes": [
            {
                "id": 1,
                "user": {
                    "id": 2,
                    "first_name": "Pearl",
                    "last_name": "Becker",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": "23397 Sibyl Ridge Suite 221",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Peggie",
                    "country": "UK",
                    "postcode": "62465",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:30+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:30+01:00"
                },
                "note": "Hey, this machine is now totally out of use. Can you come today?",
                "is_system": false,
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            {
                "id": 2,
                "user": {
                    "id": 4,
                    "first_name": "Rafael",
                    "last_name": "Wolf",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": "5543 Parisian Cliffs",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Annamarieville",
                    "country": "UK",
                    "postcode": "75123",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:31+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:31+01:00"
                },
                "note": "Sure, no problem, I'll deploy one of my technicians out to you now.",
                "is_system": false,
                "created_at": "2024-05-13T23:14:32+01:00"
            }
        ],
        "metadata": {
            "integration_id": "ABC123"
        },
        "created_at": "2024-05-13T23:14:32+01:00"
    }
}

Users

The following set of endpoints provide a comprehensive suite of tools for managing your users within your account. They are designed to handle a variety of operations, from searching for users based on specific roles, fetching detailed information about individual users, creating new users, updating existing user details, and even removing users from your account when no longer needed. The main purpose of these operations is facilitating the synchronization of your system's users with Orbit4.

Search for users.

GET
https://api.orbit4.org
/v1/users
requires authentication

This endpoint retrieves users associated with your account. The user role must be specified to fetch users of a specific role in the system. For users that are part of a parent account (like engineers and ticket admins), the parent_id parameter must be provided.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

Query Parameters

search
string

Search for users by first name, last name, company name, site name or email address.

parent_id
integer

Filter users by their parent account. This field is required when querying engineers or ticket admins.

role
string
required

Filter users by role.

Must be one of:
  • gym_operator
  • service_provider
  • engineer
  • ticket_admin
Example:
gym_operator
sort
string

Results can be sorted by the following fields:

  • id
  • first_name
  • last_name
  • company_name
  • site_name
  • email
  • role
  • created_at

The default sorting order is ascending, but the direction can be reversed by prefixing a dash (-) like so: ?sort=-id

metadata[metadata_key]
string

Filter results by metadata. Replace metadata_key with the key of the metadata you want to filter by.

page
integer

The page number of results to be returned.

per_page
integer

The number of results to be returned for each page of results.

Response Fields

Example request:
curl --request GET \
    --get "https://api.orbit4.org/v1/users?role=gym_operator" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 59
                                                         
{
    "data": [
        {
            "id": 2,
            "first_name": "Pearl",
            "last_name": "Becker",
            "email": "[email protected]",
            "role": "gym_operator",
            "company_name": "PulseForge Fitness",
            "address": "23397 Sibyl Ridge Suite 221",
            "address_2": null,
            "address_3": null,
            "city": "Lake Peggie",
            "country": "UK",
            "postcode": "62465",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:30+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:30+01:00"
        },
        {
            "id": 3,
            "first_name": "Margret",
            "last_name": "Jenkins",
            "email": "[email protected]",
            "role": "gym_operator",
            "company_name": "PulseForge Fitness",
            "address": "70291 Bednar Roads Apt. 460",
            "address_2": null,
            "address_3": null,
            "city": "Mossieside",
            "country": "UK",
            "postcode": "76555-9044",
            "language": "en",
            "email_verified_at": "2024-05-13T23:14:30+01:00",
            "metadata": [],
            "created_at": "2024-05-13T23:14:30+01:00"
        }
    ],
    "links": {
        "first": "https://api.orbit4.org/v1/users?page=1",
        "last": "https://api.orbit4.org/v1/users?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://api.orbit4.org/v1/users?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://api.orbit4.org/v1/users",
        "per_page": 25,
        "to": 2,
        "total": 2
    }
}

Fetch user details.

GET
https://api.orbit4.org
/v1/users/{user}
requires authentication

This endpoint allows you to retrieve details of a specific user by their ID.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

URL Parameters

user
string
required

The ID of the user.

Example:
2

Response Fields

Example request:
curl --request GET \
    --get "https://api.orbit4.org/v1/users/2" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 59
                                                         
{
    "data": {
        "id": 2,
        "first_name": "Pearl",
        "last_name": "Becker",
        "email": "[email protected]",
        "role": "gym_operator",
        "company_name": "PulseForge Fitness",
        "address": "23397 Sibyl Ridge Suite 221",
        "address_2": null,
        "address_3": null,
        "city": "Lake Peggie",
        "country": "UK",
        "postcode": "62465",
        "language": "en",
        "email_verified_at": "2024-05-13T23:14:30+01:00",
        "metadata": [],
        "created_at": "2024-05-13T23:14:30+01:00"
    }
}

Create new user.

POST
https://api.orbit4.org
/v1/users
requires authentication

This endpoint allows you to add a new user to your account. The user role must be specified when creating a new user.

And the parent_id parameter must be provided for users that are part of a parent account (like engineers and ticket admins).

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

Body Parameters

Response Fields

Example request:
curl --request POST \
    "https://api.orbit4.org/v1/users" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json" \
    --data "{
    \"first_name\": \"bfdoraazctfvpyixqczijuq\",
    \"last_name\": \"gmlhqrhicwtuepdwjupfep\",
    \"email\": \"[email protected]\",
    \"company_name\": \"ep\",
    \"site_name\": \"amcqnrifs\",
    \"address\": \"pcpkzutknucro\",
    \"address_2\": \"okychfabhkcqpvilgfigzaptr\",
    \"address_3\": \"aokgxbkuebsvxibzfeadr\",
    \"city\": \"oiacinqotbkzxg\",
    \"county\": \"fflk\",
    \"postcode\": \"xbcoongnbzbxoybaactuudkuo\",
    \"language\": \"pt\",
    \"role\": \"gym_operator\",
    \"metadata\": \"{\\\"integration_id\\\":\\\"ABC123\\\"}\"
}"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 58
                                                         
{
    "data": {
        "id": 17,
        "first_name": "bfdoraazctfvpyixqczijuq",
        "last_name": "gmlhqrhicwtuepdwjupfep",
        "email": "[email protected]",
        "role": "gym_operator",
        "company_name": "ep",
        "address": "pcpkzutknucro",
        "address_2": "okychfabhkcqpvilgfigzaptr",
        "address_3": "aokgxbkuebsvxibzfeadr",
        "city": "oiacinqotbkzxg",
        "country": "UK",
        "postcode": "xbcoongnbzbxoybaactuudkuo",
        "language": "pt",
        "email_verified_at": null,
        "metadata": {
            "integration_id": "ABC123"
        },
        "created_at": "2024-05-13T23:14:32+01:00"
    }
}

Update user.

PUT
https://api.orbit4.org
/v1/users/{user}
requires authentication

This endpoint allows you to update details of a specific user by their ID. Only the fields that need to be updated should be provided.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

URL Parameters

user
string
required

The ID of the user.

Example:
2

Body Parameters

Response Fields

Example request:
curl --request PUT \
    "https://api.orbit4.org/v1/users/2" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json" \
    --data "{
    \"first_name\": \"bxucuteqbdzu\",
    \"last_name\": \"usdjmrvpshrpwpzhumskj\",
    \"company_name\": \"dyek\",
    \"site_name\": \"otrtmwqqrztegrzxuxflhx\",
    \"address\": \"n\",
    \"address_2\": \"naba\",
    \"address_3\": \"ioenhaceaix\",
    \"city\": \"nglzbffrm\",
    \"postcode\": \"ygrxpxifcztewrsmclefl\",
    \"language\": \"es\",
    \"metadata\": \"{\\\"integration_id\\\":\\\"ABC123\\\"}\"
}"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 57
                                                         
{
    "data": {
        "id": 2,
        "first_name": "bxucuteqbdzu",
        "last_name": "usdjmrvpshrpwpzhumskj",
        "email": "[email protected]",
        "role": "gym_operator",
        "company_name": "dyek",
        "address": "n",
        "address_2": "naba",
        "address_3": "ioenhaceaix",
        "city": "nglzbffrm",
        "country": "UK",
        "postcode": "ygrxpxifcztewrsmclefl",
        "language": "es",
        "email_verified_at": "2024-05-13T23:14:30+01:00",
        "metadata": {
            "integration_id": "ABC123"
        },
        "created_at": "2024-05-13T23:14:30+01:00"
    }
}

Delete user.

DELETE
https://api.orbit4.org
/v1/users/{user}
requires authentication

This endpoint allows you to delete a specific user from your account by their ID.

Headers

Authorization
Example:
Bearer client-admin-test-token
Content-Type
Example:
application/json

URL Parameters

user
string
required

The ID of the user.

Example:
2
Example request:
curl --request DELETE \
    "https://api.orbit4.org/v1/users/2" \
    --header "Authorization: Bearer client-admin-test-token" \
    --header "Content-Type: application/json"
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    x-ratelimit-limit
                                                            : 60
                                                                                                                    x-ratelimit-remaining
                                                            : 56
                                                         
[Empty response]
POST
https://api.orbit4.org
/v1/users/{user}/link
requires authentication

This endpoint allows you to link a user to a parent user account. i.e. link an engineer to a service provider account.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json

URL Parameters

user
string
required

The ID of the parent user.

Example:
3

Body Parameters

Example request:
curl --request POST \
    "https://api.orbit4.org/v1/users/3/link" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"child_id\": 5
}"
Example response:
POST
https://api.orbit4.org
/v1/users/{user}/unlink
requires authentication

This endpoint allows you to unlink a user from a parent user account. i.e. unlink a ticket admin from a gym operator account.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json

URL Parameters

user
string
required

The ID of the parent user.

Example:
3

Body Parameters

Example request:
curl --request POST \
    "https://api.orbit4.org/v1/users/3/unlink" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --data "{
    \"child_id\": 7
}"
Example response:

Webhooks

Webhooks are a way to provide Orbit4 partners with real-time information. When a specific event happens in Orbit4, we'll send a HTTP POST payload to the webhook's configured URL. In conjunction with our public API endpoints, Orbit4 supports fluid, two-way communication, ensuring that systems are kept in perfect sync.

Configuring Webhooks

To configure webhooks you need to navigate to the Webhooks section within your profile menu and then clicking on Create Webhook.
In this section, you can specify the URL to which the webhook will send the event payload. You also have the option to subscribe to specific events. When these events take place, the webhook will automatically dispatch an event payload to the designated URL. Upon creation, a unique secret key is generated. This key serves as a tool for verifying the webhook signature when it is processed on your end, ensuring that the request was genuinely initiated by Orbit4.

Events

These are the list of events you can subscribe to:

asset.created

This event is fired when a new asset is created. The payload contains the asset that was created.

Payload example:
{
    "event": "asset.created",
    "data": {
        "asset": {
            "id": 1,
            "brand": "Technogym",
            "range": "Excite JOG 700 LED",
            "product": "Treadmill",
            "product_id": 4,
            "qr_code": "O4-12345",
            "serial_number": "1234567890",
            "installation_date": null,
            "manufacturing_date": null,
            "warranty_end_date": null,
            "current_spend": "£0",
            "max_spend": "£0",
            "fitness_product": null,
            "has_odometer": null,
            "residual_price": "£0",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:33+01:00"
        }
    }
}

asset.updated

This event is fired when an asset is updated. The payload contains the asset that was updated.

Payload example:
{
    "event": "asset.updated",
    "data": {
        "asset": {
            "id": 1,
            "brand": "Technogym",
            "range": "Excite JOG 700 LED",
            "product": "Treadmill",
            "product_id": 4,
            "qr_code": "O4-12345",
            "serial_number": "1234567890",
            "installation_date": null,
            "manufacturing_date": null,
            "warranty_end_date": null,
            "current_spend": "£0",
            "max_spend": "£0",
            "fitness_product": null,
            "has_odometer": null,
            "residual_price": "£0",
            "image": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:33+01:00"
        }
    }
}

note.created

This event is fired when a new note is created. The payload contains the ticket that the note was created on and the note itself.

Payload example:
{
    "event": "note.created",
    "data": {
        "ticket": {
            "id": 1,
            "number": "WSGE123-001",
            "type": "standard",
            "description": null,
            "priority": "Faulty",
            "status": "open",
            "engineer_arrived_at": null,
            "engineer_deployed_at": null,
            "closed_at": null,
            "service_provider": {
                "id": 4,
                "first_name": "Rafael",
                "last_name": "Wolf",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": "5543 Parisian Cliffs",
                "address_2": null,
                "address_3": null,
                "city": "Lake Annamarieville",
                "country": "UK",
                "postcode": "75123",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:31+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:31+01:00"
            },
            "gym_operator": {
                "id": 2,
                "first_name": "Pearl",
                "last_name": "Becker",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": "23397 Sibyl Ridge Suite 221",
                "address_2": null,
                "address_3": null,
                "city": "Lake Peggie",
                "country": "UK",
                "postcode": "62465",
                "language": "en",
                "email_verified_at": "2024-05-13T23:14:30+01:00",
                "metadata": [],
                "created_at": "2024-05-13T23:14:30+01:00"
            },
            "ticket_admin": null,
            "engineer": null,
            "caretaker": null,
            "asset": null,
            "contract": {
                "id": 1,
                "number": "WSGE123",
                "type": "",
                "gym_operator": {
                    "id": 2,
                    "first_name": "Pearl",
                    "last_name": "Becker",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": "23397 Sibyl Ridge Suite 221",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Peggie",
                    "country": "UK",
                    "postcode": "62465",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:30+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:30+01:00"
                },
                "service_provider": {
                    "id": 4,
                    "first_name": "Rafael",
                    "last_name": "Wolf",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": "5543 Parisian Cliffs",
                    "address_2": null,
                    "address_3": null,
                    "city": "Lake Annamarieville",
                    "country": "UK",
                    "postcode": "75123",
                    "language": "en",
                    "email_verified_at": "2024-05-13T23:14:31+01:00",
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:31+01:00"
                },
                "active": true,
                "start_date": "2024-05-12",
                "end_date": "2025-05-12",
                "metadata": [],
                "created_at": "2024-05-13T23:14:32+01:00"
            },
            "images": [],
            "notes": [],
            "metadata": [],
            "created_at": "2024-05-13T23:14:32+01:00"
        },
        "note": {
            "id": 1,
            "user": {
                "id": 1,
                "first_name": "John",
                "last_name": "Doe",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": null,
                "address_2": null,
                "address_3": null,
                "city": null,
                "country": null,
                "postcode": null,
                "language": "en",
                "email_verified_at": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "note": "The treadmill is broken. Please fix it.",
            "is_system": false,
            "created_at": "2024-05-13T23:14:33+01:00"
        }
    }
}

ticket.closed

This event is fired when a ticket is closed. The payload contains the ticket that was closed.

Payload example:
{
    "event": "ticket.closed",
    "data": {
        "ticket": {
            "id": 1,
            "number": "WSGE123-001",
            "type": "standard",
            "description": "The treadmill is broken. Please fix it.",
            "priority": null,
            "status": "closed",
            "engineer_arrived_at": null,
            "engineer_deployed_at": null,
            "closed_at": "2024-05-13T23:14:33+01:00",
            "service_provider": {
                "id": 2,
                "first_name": "Tom",
                "last_name": "Baker",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": null,
                "address_2": null,
                "address_3": null,
                "city": null,
                "country": null,
                "postcode": null,
                "language": "en",
                "email_verified_at": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "gym_operator": {
                "id": 1,
                "first_name": "John",
                "last_name": "Doe",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": null,
                "address_2": null,
                "address_3": null,
                "city": null,
                "country": null,
                "postcode": null,
                "language": "en",
                "email_verified_at": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "ticket_admin": null,
            "engineer": null,
            "caretaker": null,
            "asset": {
                "id": 1,
                "brand": "Technogym",
                "range": "Excite JOG 700 LED",
                "product": "Treadmill",
                "product_id": 4,
                "qr_code": "O4-12345",
                "serial_number": "1234567890",
                "installation_date": null,
                "manufacturing_date": null,
                "warranty_end_date": null,
                "current_spend": "£0",
                "max_spend": "£0",
                "fitness_product": null,
                "has_odometer": null,
                "residual_price": "£0",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "contract": {
                "id": 1,
                "number": "WSGE123",
                "type": "Full Annual",
                "gym_operator": {
                    "id": 1,
                    "first_name": "John",
                    "last_name": "Doe",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": null,
                    "address_2": null,
                    "address_3": null,
                    "city": null,
                    "country": null,
                    "postcode": null,
                    "language": "en",
                    "email_verified_at": null,
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:33+01:00"
                },
                "service_provider": {
                    "id": 2,
                    "first_name": "Tom",
                    "last_name": "Baker",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": null,
                    "address_2": null,
                    "address_3": null,
                    "city": null,
                    "country": null,
                    "postcode": null,
                    "language": "en",
                    "email_verified_at": null,
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:33+01:00"
                },
                "active": true,
                "start_date": "2024-05-13",
                "end_date": "2025-05-13",
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "images": [],
            "notes": [],
            "metadata": [],
            "created_at": "2024-05-13T23:14:33+01:00"
        }
    }
}

ticket.created

This event is fired when a ticket is created. The payload contains the ticket that was created.

Payload example:
{
    "event": "ticket.created",
    "data": {
        "ticket": {
            "id": 1,
            "number": "WSGE123-001",
            "type": "standard",
            "description": "The treadmill is broken. Please fix it.",
            "priority": null,
            "status": "open",
            "engineer_arrived_at": null,
            "engineer_deployed_at": null,
            "closed_at": null,
            "service_provider": {
                "id": 2,
                "first_name": "Tom",
                "last_name": "Baker",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": null,
                "address_2": null,
                "address_3": null,
                "city": null,
                "country": null,
                "postcode": null,
                "language": "en",
                "email_verified_at": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "gym_operator": {
                "id": 1,
                "first_name": "John",
                "last_name": "Doe",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": null,
                "address_2": null,
                "address_3": null,
                "city": null,
                "country": null,
                "postcode": null,
                "language": "en",
                "email_verified_at": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "ticket_admin": null,
            "engineer": null,
            "caretaker": null,
            "asset": {
                "id": 1,
                "brand": "Technogym",
                "range": "Excite JOG 700 LED",
                "product": "Treadmill",
                "product_id": 4,
                "qr_code": "O4-12345",
                "serial_number": "1234567890",
                "installation_date": null,
                "manufacturing_date": null,
                "warranty_end_date": null,
                "current_spend": "£0",
                "max_spend": "£0",
                "fitness_product": null,
                "has_odometer": null,
                "residual_price": "£0",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "contract": {
                "id": 1,
                "number": "WSGE123",
                "type": "Full Annual",
                "gym_operator": {
                    "id": 1,
                    "first_name": "John",
                    "last_name": "Doe",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": null,
                    "address_2": null,
                    "address_3": null,
                    "city": null,
                    "country": null,
                    "postcode": null,
                    "language": "en",
                    "email_verified_at": null,
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:33+01:00"
                },
                "service_provider": {
                    "id": 2,
                    "first_name": "Tom",
                    "last_name": "Baker",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": null,
                    "address_2": null,
                    "address_3": null,
                    "city": null,
                    "country": null,
                    "postcode": null,
                    "language": "en",
                    "email_verified_at": null,
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:33+01:00"
                },
                "active": true,
                "start_date": "2024-05-13",
                "end_date": "2025-05-13",
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "images": [],
            "notes": [],
            "metadata": [],
            "created_at": "2024-05-13T23:14:33+01:00"
        }
    }
}

ticket.updated

This event is fired when a ticket is updated. The payload contains the ticket that was updated.

Payload example:
{
    "event": "ticket.updated",
    "data": {
        "ticket": {
            "id": 1,
            "number": "WSGE123-001",
            "type": "standard",
            "description": "The treadmill is broken. Please fix it.",
            "priority": null,
            "status": "open",
            "engineer_arrived_at": null,
            "engineer_deployed_at": null,
            "closed_at": null,
            "service_provider": {
                "id": 2,
                "first_name": "Tom",
                "last_name": "Baker",
                "email": "[email protected]",
                "role": "service_provider",
                "company_name": "The Gym Fixers",
                "address": null,
                "address_2": null,
                "address_3": null,
                "city": null,
                "country": null,
                "postcode": null,
                "language": "en",
                "email_verified_at": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "gym_operator": {
                "id": 1,
                "first_name": "John",
                "last_name": "Doe",
                "email": "[email protected]",
                "role": "gym_operator",
                "company_name": "PulseForge Fitness",
                "address": null,
                "address_2": null,
                "address_3": null,
                "city": null,
                "country": null,
                "postcode": null,
                "language": "en",
                "email_verified_at": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "ticket_admin": null,
            "engineer": null,
            "caretaker": null,
            "asset": {
                "id": 1,
                "brand": "Technogym",
                "range": "Excite JOG 700 LED",
                "product": "Treadmill",
                "product_id": 4,
                "qr_code": "O4-12345",
                "serial_number": "1234567890",
                "installation_date": null,
                "manufacturing_date": null,
                "warranty_end_date": null,
                "current_spend": "£0",
                "max_spend": "£0",
                "fitness_product": null,
                "has_odometer": null,
                "residual_price": "£0",
                "image": null,
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "contract": {
                "id": 1,
                "number": "WSGE123",
                "type": "Full Annual",
                "gym_operator": {
                    "id": 1,
                    "first_name": "John",
                    "last_name": "Doe",
                    "email": "[email protected]",
                    "role": "gym_operator",
                    "company_name": "PulseForge Fitness",
                    "address": null,
                    "address_2": null,
                    "address_3": null,
                    "city": null,
                    "country": null,
                    "postcode": null,
                    "language": "en",
                    "email_verified_at": null,
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:33+01:00"
                },
                "service_provider": {
                    "id": 2,
                    "first_name": "Tom",
                    "last_name": "Baker",
                    "email": "[email protected]",
                    "role": "service_provider",
                    "company_name": "The Gym Fixers",
                    "address": null,
                    "address_2": null,
                    "address_3": null,
                    "city": null,
                    "country": null,
                    "postcode": null,
                    "language": "en",
                    "email_verified_at": null,
                    "metadata": [],
                    "created_at": "2024-05-13T23:14:33+01:00"
                },
                "active": true,
                "start_date": "2024-05-13",
                "end_date": "2025-05-13",
                "metadata": [],
                "created_at": "2024-05-13T23:14:33+01:00"
            },
            "images": [],
            "notes": [],
            "metadata": [],
            "created_at": "2024-05-13T23:14:33+01:00"
        }
    }
}

user.created

This event is fired when a new user is created. The payload contains the user that was created.

Payload example:
{
    "event": "user.created",
    "data": {
        "user": {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "[email protected]",
            "role": "gym_operator",
            "company_name": "PulseForge Fitness",
            "address": null,
            "address_2": null,
            "address_3": null,
            "city": null,
            "country": null,
            "postcode": null,
            "language": "en",
            "email_verified_at": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:33+01:00"
        }
    }
}

user.updated

This event is fired when a user is updated. The payload contains the user that was updated.

Payload example:
{
    "event": "user.updated",
    "data": {
        "user": {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "[email protected]",
            "role": "gym_operator",
            "company_name": "PulseForge Fitness",
            "address": null,
            "address_2": null,
            "address_3": null,
            "city": null,
            "country": null,
            "postcode": null,
            "language": "en",
            "email_verified_at": null,
            "metadata": [],
            "created_at": "2024-05-13T23:14:33+01:00"
        }
    }
}

Security

To ensure the integrity of the request, each webhook call is signed using the secret key provided when the webhook was configured. You should validate the secret to make sure the request is from Orbit4.

To verify the signature, you need to implement a verification process on the receiving end of the webhook call. This process should take the payload and the signature from the headers, and use the SHA256 algorithm to calculate the signature from the payload. If the calculated signature matches the signature from the headers, the request is verified.

Here's an example of how to do this:

Example verify webhook signature Function:
def handle_webhook():
    payload = request.get_data()
    signature_from_headers = request.headers.get('X-Signature')

    secret = 'my-webhook-secret'
    calculated_signature = hmac.new(secret.encode(), payload, hashlib.sha256).hexdigest()

    if not hmac.compare_digest(signature_from_headers, calculated_signature):
        # 403, Invalid signature.
        return;

    if payload.event == 'ticket.created':
        # Handle ticket created event...

    # 200, Webhook received.
    return;

Handling Webhooks

Your server should respond to the webhook's POST request with a 2XX status code immediately after receiving the request. If the webhook request isn't acknowledged with a 2XX status code, Orbit4 will consider the webhook delivery a failure. In such cases, Orbit4 will try to send the webhook again.

As a best practice, we recommend storing the event payload upon receipt and processing it asynchronously. This approach prevents Orbit4 from repeatedly attempting to deliver the webhook due to immediate processing failures. By decoupling the receipt and processing of the webhook, you can enhance the reliability and efficiency of your webhook handling system.

Retries

If the delivery of a webhook fails, Orbit4 will attempt to resend the webhook. This process is known as a retry. The retry mechanism uses an exponential backoff strategy to determine the wait time between each retry attempt.

The exponential backoff strategy works by doubling the wait time after each failed attempt. This means that for the first retry, the wait time is 10 seconds (10^1). If the second attempt fails, the wait time before the third attempt is 100 seconds (10^2). This pattern continues until the fourth attempt, after which the wait time becomes a constant 100,000 seconds for any further attempts.

The system will make a maximum of 5 retry attempts. If all 5 attempts fail, the webhook delivery is considered a permanent failure and will not be retried again.