Product API (v1)
Download OpenAPI specification:Download
Public product API.
This API uses Bearer token authentication.
To retrieve an access token perform an OAuth2 password grant request to:
https://auth.carboncloud.com/realms/prod/protocol/openid-connect/token
With the following urlencoded parameters in the body:
- client_id:
carboncloud - grant_type:
password - username:
<your username> - password:
<your password>
Pass in the access token to endpoint requests in a header like Authorization: Bearer <access_token>.
Set the x-request-id header to a random value in each request. Include the header value from relevant requests in trouble reports to aid troubleshooting.
List footprints of multiple products.
Get footprints of many products in one request.
Request Body schema: application/jsonrequired
Array of product (UUID) IDs. Zero to 256 elements allowed.
Responses
Request samples
- Payload
[- "string"
]Response samples
- 200
- 400
- 404
- 500
[- {
- "footprint": {
- "calculationMethod": "location",
- "embeddedFossilResources": 0,
- "flag": 0,
- "nonFlag": 0,
- "other": 0,
- "packaging": 0,
- "processing": 0,
- "storage": 0,
- "total": 0,
- "transportation": 0,
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "productId": "string"
}
]List FLAG breakdowns of multiple products.
Get forest, land and agriculture emission breakdown of many products in one request.
Request Body schema: application/jsonrequired
Array of product (UUID) IDs. Zero to 256 elements allowed.
Responses
Request samples
- Payload
[- "string"
]Response samples
- 200
- 400
- 404
- 500
[- {
- "footprint": {
- "calculationMethod": "location",
- "embeddedFossilResources": 0,
- "flag": {
- "carbonRemovals": 0,
- "landManagementCO2": {
- "organicSoilsCO2": 0,
- "total": {
- "ch4": 0,
- "co2": 0,
- "n2o": 0,
- "sum": 0
}
}, - "landManagementNonCO2": {
- "directEmissionsN2O": 0,
- "dryingCO2": 0,
- "farmEnergyCO2": 0,
- "farmMachineryCO2": 0,
- "fertilizerProductionCO2": 0,
- "fertilizerProductionN2O": 0,
- "indirectEmissionsN2O": 0,
- "irrigationCO2": 0,
- "limestoneAndUreaCO2": 0,
- "organicSoilsN2O": 0,
- "pesticideProductionCO2": 0,
- "riceCultivationCH4": 0,
- "total": {
- "ch4": 0,
- "co2": 0,
- "n2o": 0,
- "sum": 0
}
}, - "landUseChange": {
- "deforestationCO2": 0,
- "total": {
- "ch4": 0,
- "co2": 0,
- "n2o": 0,
- "sum": 0
}
}, - "total": {
- "ch4": 0,
- "co2": 0,
- "n2o": 0,
- "sum": 0
}
}, - "other": 0,
- "packaging": 0,
- "pds": {
- "embeddedFossilResources": {
- "primary": 0,
- "secondary": 0
}, - "flag": {
- "primary": 0,
- "secondary": 0
}, - "other": {
- "primary": 0,
- "secondary": 0
}, - "packaging": {
- "primary": 0,
- "secondary": 0
}, - "processing": {
- "primary": 0,
- "secondary": 0
}, - "total": {
- "primary": 0,
- "secondary": 0
}, - "transportation": {
- "primary": 0,
- "secondary": 0
}
}, - "processing": 0,
- "storage": 0,
- "total": 0,
- "transportation": 0,
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "productId": "string"
}
]Get specific product footprint.
Get footprint by product ID.
path Parameters
| product-id required | string Product (UUID) ID. |
Responses
Response samples
- 200
- 400
- 404
- 500
{- "calculationMethod": "location",
- "embeddedFossilResources": 0,
- "flag": 0,
- "nonFlag": 0,
- "other": 0,
- "packaging": 0,
- "processing": 0,
- "storage": 0,
- "total": 0,
- "transportation": 0,
- "updatedAt": "2019-08-24T14:15:22Z"
}Get FLAG breakdown of specific product.
Get forest, land and agriculture emission breakdown of a specific product.
path Parameters
| product-id required | string Product (UUID) ID. |
Responses
Response samples
- 200
- 400
- 404
- 500
{- "calculationMethod": "location",
- "embeddedFossilResources": 0,
- "flag": {
- "carbonRemovals": 0,
- "landManagementCO2": {
- "organicSoilsCO2": 0,
- "total": {
- "ch4": 0,
- "co2": 0,
- "n2o": 0,
- "sum": 0
}
}, - "landManagementNonCO2": {
- "directEmissionsN2O": 0,
- "dryingCO2": 0,
- "farmEnergyCO2": 0,
- "farmMachineryCO2": 0,
- "fertilizerProductionCO2": 0,
- "fertilizerProductionN2O": 0,
- "indirectEmissionsN2O": 0,
- "irrigationCO2": 0,
- "limestoneAndUreaCO2": 0,
- "organicSoilsN2O": 0,
- "pesticideProductionCO2": 0,
- "riceCultivationCH4": 0,
- "total": {
- "ch4": 0,
- "co2": 0,
- "n2o": 0,
- "sum": 0
}
}, - "landUseChange": {
- "deforestationCO2": 0,
- "total": {
- "ch4": 0,
- "co2": 0,
- "n2o": 0,
- "sum": 0
}
}, - "total": {
- "ch4": 0,
- "co2": 0,
- "n2o": 0,
- "sum": 0
}
}, - "other": 0,
- "packaging": 0,
- "pds": {
- "embeddedFossilResources": {
- "primary": 0,
- "secondary": 0
}, - "flag": {
- "primary": 0,
- "secondary": 0
}, - "other": {
- "primary": 0,
- "secondary": 0
}, - "packaging": {
- "primary": 0,
- "secondary": 0
}, - "processing": {
- "primary": 0,
- "secondary": 0
}, - "total": {
- "primary": 0,
- "secondary": 0
}, - "transportation": {
- "primary": 0,
- "secondary": 0
}
}, - "processing": 0,
- "storage": 0,
- "total": 0,
- "transportation": 0,
- "updatedAt": "2019-08-24T14:15:22Z"
}List products.
List products available to your organisation.
query Parameters
| limit | integer Pagination limit on numbers of products to return, default 100, max 100. |
| cursor | string Pagination cursor. Leave blank or exclude in the first request. For subsequent requests, use the |
| groupId | string Optional filter on group. |
| filter | string Optional filter on product category, either 'bought' or 'sold'. Defaults to both. |
| customId | string Optional filter on product customId. |
Responses
Response samples
- 200
- 400
- 500
{- "page": {
- "cursor": "string",
- "next": "string"
}, - "products": [
- {
- "batchSizeKg": 0,
- "categories": [
- "string"
], - "climatehubUrl": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "customId": "string",
- "description": "string",
- "groupId": "eb54e96e-21b8-4f54-9cd4-80fccbd06f55",
- "gtin": "string",
- "id": "string",
- "ingredients": "string",
- "market": "string",
- "name": "string",
- "processingLocation": "string",
- "productionLocation": "string",
- "public": true,
- "updatedAt": "2019-08-24T14:15:22Z",
- "yearlySalesVolumes": {
- "property1": 0,
- "property2": 0
}
}
]
}List IDs of products that have updated footprint information
List IDs products which have updates to their footprint information. Fetch each product to see the relevant information. Use updated_at of the last item in the list to progress the pagination. The since parameter is inclusive, so pages may repeat the last item of the previous page. Avoid a since parameter too close to wall time, since then in flight updates may be missed.
query Parameters
| since | string Example: since=`2018-03-20T09:12:28.999999999Z` List updates since this RFC3339 timestamp (with sub-second resolution). Functions as pagination offset. |
| limit | integer Pagination limit (1-256), default 100. |
| groupId | string <uuid> Optional filter on group. Defaults to all accessible groups. |
| filter | string Optional filter on product category, either 'bought' or 'sold'. Defaults to both. |
Responses
Response samples
- 200
- 400
- 500
[- {
- "productId": "string",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]Get specific product.
Get a product by its unique ID.
path Parameters
| product-id required | string Product (UUID) ID. |
Responses
Response samples
- 200
- 400
- 500
{- "footprint": { },
- "product": {
- "batchSizeKg": 0,
- "categories": [
- "string"
], - "climatehubUrl": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "customId": "string",
- "description": "string",
- "groupId": "eb54e96e-21b8-4f54-9cd4-80fccbd06f55",
- "gtin": "string",
- "id": "string",
- "ingredients": "string",
- "market": "string",
- "name": "string",
- "processingLocation": "string",
- "productionLocation": "string",
- "public": true,
- "updatedAt": "2019-08-24T14:15:22Z",
- "yearlySalesVolumes": {
- "property1": 0,
- "property2": 0
}
}
}List groups.
List available groups. Every products belongs to exactly one group but multiple groups can be allowed to read a single product. The response IDs can be used in other endpoints to narrow down results.
Responses
Response samples
- 200
- 400
- 500
[- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string"
}
]