Thrust Carbon

Refunds and exchanges

Handle cancelled or exchanged travel segments using the is_cancelled and is_exchanged flags.

Who this guide is for

We strongly recommend you do not use the approach in this guide. This guide is for integrations that do not have the ability to self-identify refunds/exchanges. If your application has the ability to identify the original refunded/exchanged segment, you should instead send us an update/delete request for the original segment.

Introduction

We support refunds, cancellations and exchanges in our API. When storing segments, either storing segments one at a time, or in a batch, you can optionally pass an is_cancelled or is_exchanged flag.

If you would like to use this functionality, it's important that you pass us a unique_id that we can use to match segments. It is this unique_id that we use to link the cancellation to the original travel segment.

Refunds or cancellations

From a carbon perspective, it doesn't matter if the travel is cancelled or refunded, the emission hasn't taken place either way. So, for either a refund or a cancellation, you can use the is_cancelled flag.

Request:

{
  "is_cancelled": true,
  "unique_id": "unique-id-1",

  "type": "air",
  "origin": {
    "iata": "LHR"
  },
  "destination": {
    "iata": "JFK"
  },
  "emitted_at": "2020-01-01"
}

Response:

{
    "id": "3d516a01-a39a-460b-99ad-b62d9b5c1a08",
    "created_at": "2022-10-19T13:12:31.000000Z",
    "updated_at": "2022-10-19T13:12:31.000000Z",
    "emitted_at": "2022-02-09",
    "type": "air",
    "tonnes_of_emissions": 0.819107757,
    "previous_emissions": 0.819107757,
    "unique_id": "unique-id-1",
    "origin": {
        "iata": "LHR"
    },
    "distance": 5539.38,
    "destination": {
        "iata": "JFK"
    },
    "departments": [],
    "grouping": []
}

The response will contain the original segment, which will now be cancelled. Along with the segment, you will see a previous_emissions field, which contains the tonnes of CO₂e that have been cancelled. If you are storing an emissions total for an entity, this is the number that you should deduct due to the cancellation.

Exchanges

Exchanges work much in the same manner, except you should pass is_exchanged, along with the new segment containing the updated travel details.

Request:

{
    "is_exchanged": true,
    "unique_id": "unique-id-2",

    "type": "air",
    "origin": {
        "iata": "LHR"
    },
    "destination": {
        "iata": "JFK"
    },
    // Updating the travel class from first, to economy
    "travel_class": "economy",
    "emitted_at": "2022-02-09"
}

Response:

{
    "id": "a07289a2-4cfa-49b9-9017-cc8bb2d843f3",
    "created_at": "2022-10-19T13:19:06.000000Z",
    "updated_at": "2022-10-19T13:19:06.000000Z",
    "emitted_at": "2022-02-09",
    "type": "air",
    "tonnes_of_emissions": 0.819107757,
    "previous_emissions": 3.276375634,
    "unique_id": "unique-id-2",
    "destination": {
        "iata": "JFK"
    },
    "origin": {
        "iata": "LHR"
    },
    "distance": 5539.38,
    "is_exchanged": true,
    "travel_class": "economy",
    "departments": [],
    "grouping": []
}

The response contains the new segment, along with a previous_emissions value containing the tonnes of CO₂e that have been cancelled in favour of the new exchanged segment. If you are storing an emissions total for an entity, this is the number that you should deduct due to the cancellation.

On this page