Overrides

This resource represents a reason why one might not be able to meet a particular requirement on their booking. By creating an Override, the requirement will no longer be necessary for the passenger to be Good To Go.

XML Schema:

Fields

Name

Type

Description

id read-only

String

href read-only

Field

customer required

Reference Object

The customer for whom this override applies.

booking required

Reference Object

The booking for which this override applies.

services required

Field

The services for which this override applies.

reason required

Nested Object

The override reason that should be used to override.

  • id read-only

String

  • href read-only

Field

  • label read-only

String

The label identifying this override reason.

  • code required

String

The code identifying this override reason.

requirement required

Nested Object

The requirement that is being overridden by this override.

  • code required

String

The code identifying this requirement.

Get an override

GET /overrides/(string: overrides_id)/

Example request:

GET /overrides/1 HTTP/1.1
Host: rest.gadventures.com
Accept: application/json
Content-Type:application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "1",
    "booking": {
        "href": "http://gapiapps.local:5000/bookings/67890",
        "id": "67890"
    },
    "customer": {
        "href": "http://gapiapps.local:5000/customers/234556",
        "id": "234556"
    },
    "reason": {
        "code": "REASON",
        "href": "http://gapiapps.local:5000/override_reasons/1",
        "id": "1",
        "label": "Reason for override"
    },
    "requirement": {
        "code" : "REQUIREMENT"
    },
    "services": [
        {
            "href": "http://gapiapps.local:5000/services/12345",
            "id": "12345"
        },
        {
            "href": "http://gapiapps.local:5000/services/12346",
            "id": "12346"
        }
    ]
}

List overrides

GET /bookings/(string: booking_id)/overrides

Example request:

GET bookings/67890/overrides HTTP/1.1
Host: rest.gadventures.com
Accept: application/json
Content-Type:application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "count": "1",
    "current_page": "1",
    "links": "[]",
    "results": [
        {
            "id": "1",
            "booking": {
                "href": "http://gapiapps.local:5000/bookings/67890",
                "id": "67890"
            },
            "customer": {
                "href": "http://gapiapps.local:5000/customers/234556",
                "id": "234556"
            },
            "reason": {
                "code": "REASON",
                "href": "http://gapiapps.local:5000/override_reasons/1",
                "id": "1",
                "label": "Reason for override"
            },
            "requirement": {
                "code" : "REQUIREMENT"
            },
            "services": [
                {
                    "href": "http://gapiapps.local:5000/services/12345",
                    "id": "12345"
                },
                {
                    "href": "http://gapiapps.local:5000/services/12346",
                    "id": "12346"
                }
            ]
        }
    ]
}

Create an Override

Overrides are created by making HTTP POST request to /overrides/ resource.

Example request:

POST /overrides/ HTTP/1.1
Host: rest.gadventures.com
Accept: application/json
Content-Type:application/json

{
    "booking": {
        "id" : 67890
    },
    "customer": {
        "id" : 234556
    },
    "services": [
        {
            "id" : 12345
        },
        {
            "id" : 12346
        }
    ],
    "reason": {
        "code" : "REASON"
    }
    "requirement": {
        "code" : "REQUIREMENT"
    }
}

Example response:

HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "id": "1",
    "booking": {
        "href": "http://gapiapps.local:5000/bookings/67890",
        "id": "67890"
    },
    "customer": {
        "href": "http://gapiapps.local:5000/customers/234556",
        "id": "234556"
    },
    "reason": {
        "code": "REASON",
        "href": "http://gapiapps.local:5000/override_reasons/1",
        "id": "1",
        "label": "Reason for override"
    },
    "requirement": {
        "code" : "REQUIREMENT"
    },
    "services": [
        {
            "href": "http://gapiapps.local:5000/services/12345",
            "id": "12345"
        },
        {
            "href": "http://gapiapps.local:5000/services/12346",
            "id": "12346"
        }
    ]
}

Update an Override

PATCH /overrides/(string: override_id)/

Example request:

PATCH /bookings/628168/ HTTP/1.1
Host: rest.gadventures.com
Accept: application/json
Content-Type: application/json

{
    "reason": {
        "code" : "NEW_REASON"
    }
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "1",
    "booking": {
        "href": "http://gapiapps.local:5000/bookings/67890",
        "id": "67890"
    },
    "customer": {
        "href": "http://gapiapps.local:5000/customers/234556",
        "id": "234556"
    },
    "reason": {
        "code": "NEW_REASON",
        "href": "http://gapiapps.local:5000/override_reasons/1",
        "id": "1",
        "label": "New Reason for override"
    },
    "requirement": {
        "code" : "REQUIREMENT"
    },
    "services": [
        {
            "href": "http://gapiapps.local:5000/services/12345",
            "id": "12345"
        },
        {
            "href": "http://gapiapps.local:5000/services/12346",
            "id": "12346"
        }
    ]
}

Delete an Override

DELETE /overrides/(string: override_id)/

Example request:

DELETE /overrides/1 HTTP/1.1
Host: rest.gadventures.com
Accept: application/json
Content-Type: application/json

Example response:

HTTP/1.1 204 NO CONTENT
Content-Type: application/json