Skip to main content

Create calculation

POST 

/calculations

Calculates carbon emission for one or more transactions. If the request contains a transaction with an unsupported merchant category (MCC) the response still contains that item but without any values returned, except the reference which is echoed back.

Request

Header Parameters

    forwarded-partner string

    Partner identification in case the request is proxied by another partner

Body

required

Transaction information required to perform the calculation

    cardTransactions

    object[]

    required

    Possible values: >= 1, <= 5000

  • Array [

  • reference stringrequired

    Possible values: non-empty and <= 100 characters

    Any unique reference to the transaction to be used for mapping back with the result on the response

    mcc stringrequired

    Possible values: non-empty and <= 4 characters, Value must match regular expression [0-9]{1,4}

    Merchant Category Code in ISO 18245 format

    amount

    object

    required

    Expresses a monetary amount

    value numberrequired

    Possible values: >= -1000000000 and <= 1000000000

    currency stringrequired

    Possible values: >= 3 characters and <= 3 characters, Value must match regular expression ^(EUR|GBP|RUB|SEK|USD)$

    Currency in ISO 4217 code format; EUR, GBP, RUB, SEK or USD

  • ]

Responses

Calculation response

Schema

    transactionFootprints

    object[]

  • Array [

  • reference string

    Possible values: non-empty and <= 100 characters

    A reference to the transaction this calculation was based on (from request)

    categoryId integer

    The category ID of the transaction, can be retrieved from /categories

    carbonEmissionInGrams number

    The transaction's CO2 emission in grams

    carbonEmissionInOunces number

    The transaction's CO2 emission in ounces

    carbonSocialCost

    object

    Expresses a monetary amount

    value numberrequired

    Possible values: >= -1000000000 and <= 1000000000

    currency stringrequired

    Possible values: >= 3 characters and <= 3 characters, Value must match regular expression ^(EUR|GBP|RUB|SEK|USD)$

    Currency in ISO 4217 code format; EUR, GBP, RUB, SEK or USD

  • ]

Loading...