Create transactions
POST/transactions
Calculates carbon emission for one or more transactions. If the request contains a transaction with an unsupported classification the response still contains that item but without any values returned, except the reference which is echoed back.
Request
Header Parameters
Partner identification in case the request is proxied by another partner
- application/json
Body
required
Transaction information required to perform the calculation
Array [
Array [
]
]
transactions
object[]
required
Possible values: >= 1
, <= 5000
Possible values: non-empty
and <= 100 characters
A reference to the transaction this calculation was based on (from request)
classifications
object[]
required
Expresses the type of classification. Check /classifications for a list of supported types
The identifier for the classification within a specific type
amount
object
required
Expresses a monetary amount
Possible values: >= -1000000000
and <= 1000000000
Possible values: >= 3 characters
and <= 3 characters
, Value must match regular expression ^[A-Z]{3}$
Currency in ISO 4217 code format
Possible values: Value must match regular expression [A-Z]{2}
The country in which the transaction took place following the ISO-3166 alpha-2 convention
Possible values: Value must match regular expression ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
The date when the transaction occurred in YYYY-MM-DD format
Responses
- 200
- 400
- 401
- 403
- 405
- 415
- 500
Transaction response
- application/json
- Schema
- Example (from schema)
Schema
Array [
- TransactionCarbonFootprint
- MissingTransactionFootPrint
]
transactionImpacts
object[]
oneOf
CO2e impact for a transaction
co2eEmission
object
required
Expresses the carbon foot print
The total carbon footprint
socialCostOfCarbon
object
required
The transaction's social cost of carbon (SCC)
The total social cost for carbon footprint
Possible values: >= 3 characters
and <= 3 characters
, Value must match regular expression ^[A-Z]{3}$
Currency in ISO 4217 code format
Possible values: non-empty
and <= 100 characters
A reference to the transaction this calculation was based on (from request)
classification
object
required
Expresses the classification with an identifier
Expresses the type of classification. Check /classifications for a list of supported types
The identifier for the classification within a specific type
The spending category ID of the transaction, can be retrieved from /categories
The Doconomy Category Code used in calculating the footprint
Expresses why a certain footprint could not be calculated
Possible values: [INVALID_CLASSIFICATION
, CLASSIFICATION_IDENTIFIER_NOT_FOUND
, INTERNAL_MAPPING_ERROR
]
A technical code expressing the type of failure
A more verbose explanation why the calculation of the transaction failed
Possible values: non-empty
and <= 100 characters
A reference to the transaction this calculation was based on (from request)
{
"transactionImpacts": [
{},
{}
]
}
Bad request
- application/json
- Schema
- Example (from schema)
Schema
Array [
BAD_REQUEST
- Malformed request, please advice the description and details fields for more informationFORBIDDEN
- Insufficient scope to access the resourceINTERNAL_SERVER_ERROR
- Unexpected server errorMETHOD_NOT_ALLOWED
- Method not allowedUNSUPPORTED_MEDIA_TYPE
- Unsupported media typeSERVICE_UNAVAILABLE
- Service is unavailable]
errors
object[]
required
Errors
Possible values: non-empty
and <= 100 characters
The application name that generated this error.
Possible values: non-empty
and <= 100 characters
A unique constant identifying the error case encountered during request processing.
Possible values: <= 1000 characters
Short description of the reasonCode field.
Indicates whether this error will always be returned for this request, or retrying could change the outcome.
{
"errors": [
{
"source": "string",
"reasonCode": "string",
"description": "string",
"recoverable": false
}
]
}
Unauthorized client
Insufficient scope for accessing this resource
- application/json
- Schema
- Example (from schema)
Schema
Array [
BAD_REQUEST
- Malformed request, please advice the description and details fields for more informationFORBIDDEN
- Insufficient scope to access the resourceINTERNAL_SERVER_ERROR
- Unexpected server errorMETHOD_NOT_ALLOWED
- Method not allowedUNSUPPORTED_MEDIA_TYPE
- Unsupported media typeSERVICE_UNAVAILABLE
- Service is unavailable]
errors
object[]
required
Errors
Possible values: non-empty
and <= 100 characters
The application name that generated this error.
Possible values: non-empty
and <= 100 characters
A unique constant identifying the error case encountered during request processing.
Possible values: <= 1000 characters
Short description of the reasonCode field.
Indicates whether this error will always be returned for this request, or retrying could change the outcome.
{
"errors": [
{
"source": "string",
"reasonCode": "string",
"description": "string",
"recoverable": false
}
]
}
Method not allowed
- application/json
- Schema
- Example (from schema)
Schema
Array [
BAD_REQUEST
- Malformed request, please advice the description and details fields for more informationFORBIDDEN
- Insufficient scope to access the resourceINTERNAL_SERVER_ERROR
- Unexpected server errorMETHOD_NOT_ALLOWED
- Method not allowedUNSUPPORTED_MEDIA_TYPE
- Unsupported media typeSERVICE_UNAVAILABLE
- Service is unavailable]
errors
object[]
required
Errors
Possible values: non-empty
and <= 100 characters
The application name that generated this error.
Possible values: non-empty
and <= 100 characters
A unique constant identifying the error case encountered during request processing.
Possible values: <= 1000 characters
Short description of the reasonCode field.
Indicates whether this error will always be returned for this request, or retrying could change the outcome.
{
"errors": [
{
"source": "string",
"reasonCode": "string",
"description": "string",
"recoverable": false
}
]
}
Unsupported media type
- application/json
- Schema
- Example (from schema)
Schema
Array [
BAD_REQUEST
- Malformed request, please advice the description and details fields for more informationFORBIDDEN
- Insufficient scope to access the resourceINTERNAL_SERVER_ERROR
- Unexpected server errorMETHOD_NOT_ALLOWED
- Method not allowedUNSUPPORTED_MEDIA_TYPE
- Unsupported media typeSERVICE_UNAVAILABLE
- Service is unavailable]
errors
object[]
required
Errors
Possible values: non-empty
and <= 100 characters
The application name that generated this error.
Possible values: non-empty
and <= 100 characters
A unique constant identifying the error case encountered during request processing.
Possible values: <= 1000 characters
Short description of the reasonCode field.
Indicates whether this error will always be returned for this request, or retrying could change the outcome.
{
"errors": [
{
"source": "string",
"reasonCode": "string",
"description": "string",
"recoverable": false
}
]
}
Unexpected server error
- application/json
- Schema
- Example (from schema)
Schema
Array [
BAD_REQUEST
- Malformed request, please advice the description and details fields for more informationFORBIDDEN
- Insufficient scope to access the resourceINTERNAL_SERVER_ERROR
- Unexpected server errorMETHOD_NOT_ALLOWED
- Method not allowedUNSUPPORTED_MEDIA_TYPE
- Unsupported media typeSERVICE_UNAVAILABLE
- Service is unavailable]
errors
object[]
required
Errors
Possible values: non-empty
and <= 100 characters
The application name that generated this error.
Possible values: non-empty
and <= 100 characters
A unique constant identifying the error case encountered during request processing.
Possible values: <= 1000 characters
Short description of the reasonCode field.
Indicates whether this error will always be returned for this request, or retrying could change the outcome.
{
"errors": [
{
"source": "string",
"reasonCode": "string",
"description": "string",
"recoverable": false
}
]
}