Skip to main content
POST
Get Quote for Train Emissions

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Subaccount-Id
string

If present, the quote is priced for the subaccount with the given id, which means it uses that subaccount's default portfolio if it has one. Pass the same subaccount id when you place the order, so that the price you were quoted is the price you are charged. Sending the header with a blank value is treated the same as leaving it out, and prices for the whole organization. An id that does not belong to your organization is rejected with a 400 invalid-subaccount. See Subaccounts for more info.

Body

application/json

Quote Parameters

distance_km
number
required

Distance of train ride, in km

Example:

5

portfolio_id
string | null

Optional ID of the portfolio to use for the quote. The quote will be for an order fulfilled from this portfolio. If not specified, the account's default portfolio will be used.

Example:

"a23bF6"

source
string | null

Optional source of the quote. Defaults to api if not specified, otherwise must be one of api or checkout. Use api if the eventual order will be placed via the Order API. Use checkout if the order will be placed using the Checkout Session API.

Examples:

"api"

"checkout"

Response

Quote Details

amount_kg
number

Amount of carbon credits the quote is for, in kilograms

Example:

10.5

price_usd_cents
number

Price charged for the credits, in USD cents

Example:

2350