Thrust Carbon

Suggestions: Journey

POST
/suggestions/journey

ALPHA ENDPOINT

Please contact your account manager for access.

This endpoint will fetch sustainability suggestions for a given journey. Depending on the segments supplied, there will be one or more suggestion:

  • Carbon budget suggestions: provides information about the usage of a user's carbon budget, and the remaining carbon budget.
  • Alternative suggestions: which will tell you lower carbon alternativest to reach the same destination.
  • Summary of emissions: which will tell you the amount emitted and give 'equivalencies' to the CO2 impact.

A Summary of emissions will be provided with every request, however other suggestion types may not be. You should use descending priority if you receive two or more suggestion types (e.g. display carbon tax, rather than summary of emissions).

Testing

White the Summary of emissions is always provided, the Alternate suggestions depends on the route searched, and the Summary of emissions depends on the end-client. For this reason, you can force these suggestions by supplying the following input:

  • To test Alternative Suggestions please pass through a flight segment, with locations LHR and CDG. This will return a high speed rail suggestion
  • To test Carbon budget suggestions please pass through an employee_id and/or department_id of THRUST_CARBON_TEST.

Notes

  • Please ensure you only provide a maximum of 2 locations for each segment. If you have a return journey, please create two segments, one for the outbound leg, and one for the return leg.
AuthorizationBearer <token>

Your API key can be found in your account. To learn how to use your token, please see

In: header

Header Parameters

Accept-Language*string

Enables us to return responses in the client's language and localisation. This header is very important to providing a great end-user experience. More info at: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language

Default"en-US"

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/suggestions/journey" \  -H "Accept-Language: en-US" \  -H "Content-Type: application/json" \  -d '{}'
{  "emission_summary": {    "tonnes_of_emissions": 14.28420582,    "equivalencies": [      {        "type": "string",        "values": [          "string"        ]      }    ],    "invalid_segments": [      {        "3": [          "The class of travel was invalid."        ],        "5": [          "The locations[1] was invalid."        ]      }    ]  },  "alternative_suggestions": [    {      "type": "rail",      "order": 1,      "heading": "Have you considered high speed rail?",      "body": "You can take the same journey with less stress, and far less polution, using a high speed train.",      "links": [        {          "uri": "https://example.com",          "order": 1,          "title": "Explore high speed rail options"        }      ]    }  ],  "carbon_budget": {    "budget_available": 38,    "budget_remaining": 23.71579418,    "links": [      {        "title": "View your carbon budget",        "uri": "https://example.com",        "order": 1      }    ]  }}