Skip to main content

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.

Products

Get specific product footprint.

Get footprint by product ID.

path Parameters
product-id
required
string

Product (UUID) ID.

Responses

Response samples

Content type
application/json
{
  • "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

Content type
application/json
{
  • "calculationMethod": "location",
  • "embeddedFossilResources": 0,
  • "flag": {
    },
  • "other": 0,
  • "packaging": 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 next value from the previous response.

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

Content type
application/json
{
  • "page": {
    },
  • "products": [
    ]
}

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

Content type
application/json
[
  • {
    }
]

Get specific product.

Get a product by its unique ID.

path Parameters
product-id
required
string

Product (UUID) ID.

Responses

Response samples

Content type
application/json
{
  • "footprint": { },
  • "product": {
    }
}

Groups

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

Content type
application/json
[
  • {
    }
]