Skip to main content

Retailer API (v1)

Download OpenAPI specification:Download

Retailer API for supplier management.

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 URL-encoded 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.

Groups

List available groups.

Every product and supplier belongs to exactly one group.

The response IDs can be used in other endpoints to scope requests.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Invites

Products and supplier invite

Invite a supplier to provide data on relevant products.

The supplier will be requested to provide data on products. The supplier must be the active supplier (aka linked) to each given product.

Sends a platform invite email to supplier contacts. Supplier contacts who have received such an email from previous calls to this endpoint will not be sent an additional email. Once the supplier has registered in the platform no further emails are sent.

If a product data request has been declined then calling invite with that product sends a new data request.

Status 425 indicates some product has not yet finished the necessary background processing. Try again after some time, ideally with increasing backoff.

Request Body schema: application/json
required

Invite request

required
Array of objects (retailerapi.InviteProduct)
supplierId
required
string

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "status": "string"
}

Products

List resold products.

Paginate resold products. The response will be ordered by their ID. Use the optional query parameter to control the pagination.

query Parameters
groupId
required
string

Group UUID to list products of.

from
string

Resold product UUID to start page from (non-inclusive).

limit
integer

Limit on the number of products listed. Defaults to 32. Must be in range [1, 128].

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new resold product.

Create a new product which is bought as it is sold.

Request Body schema: application/json
required

Request body for creating a new product

alcoholPercentage
number
brandName
string
categories
Array of strings
customId
string <= 255 characters
description
string
groupId
required
string
gtin
string <= 14 characters
imageUrl
string
ingredients
string
name
required
string [ 3 .. 255 ] characters
packagingMaterial
string
packagingType
string
packagingWeightUnit
string
packagingWeightValue
number
pickUpLocation
required
string
productNetQuantityUnit
string
productNetQuantityValue
number
productionLocation
required
string
shipToLocation
required
string
object (retailerapi.SalesVolumes)

Sales volumes in tonnes/year. Object with fields like "2025": 123.0,

Responses

Request samples

Content type
application/json
{
  • "alcoholPercentage": 0,
  • "brandName": "string",
  • "categories": [
    ],
  • "customId": "string",
  • "description": "string",
  • "groupId": "string",
  • "gtin": "string",
  • "imageUrl": "string",
  • "ingredients": "string",
  • "name": "string",
  • "packagingMaterial": "string",
  • "packagingType": "string",
  • "packagingWeightUnit": "string",
  • "packagingWeightValue": 0,
  • "pickUpLocation": "string",
  • "productNetQuantityUnit": "string",
  • "productNetQuantityValue": 0,
  • "productionLocation": "string",
  • "shipToLocation": "string",
  • "yearlySalesVolumes": {
    }
}

Response samples

Content type
application/json
{
  • "alcoholPercentage": 0,
  • "brandName": "string",
  • "categories": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "customId": "string",
  • "description": "string",
  • "groupId": "string",
  • "gtin": "string",
  • "id": "string",
  • "imageUrl": "string",
  • "ingredients": "string",
  • "name": "string",
  • "packagingMaterial": "string",
  • "packagingType": "string",
  • "packagingWeightUnit": "string",
  • "packagingWeightValue": 0,
  • "pickUpLocation": "string",
  • "productNetQuantityUnit": "string",
  • "productNetQuantityValue": 0,
  • "productionLocation": "string",
  • "shipToLocation": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "yearlySalesVolumes": {
    }
}

List IDs of products that have updated information.

List IDs of products that have updated 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
groupId
required
string <uuid>

Required groupId.

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.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Delete a resold product.

Delete a resold product.

This will delete the product and any not yet accepted links to suppliers. If a supplier has been connected they will keep their variant of the product but it will no longer be visible from this API.

path Parameters
id
required
string

Product (UUID) ID.

Responses

Response samples

Content type
application/json
{ }

Get a resold product.

Get a resold product.

path Parameters
id
required
string

Product (UUID) ID.

Responses

Response samples

Content type
application/json
{
  • "alcoholPercentage": 0,
  • "brandName": "string",
  • "categories": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "customId": "string",
  • "description": "string",
  • "groupId": "string",
  • "gtin": "string",
  • "id": "string",
  • "imageUrl": "string",
  • "ingredients": "string",
  • "name": "string",
  • "packagingMaterial": "string",
  • "packagingType": "string",
  • "packagingWeightUnit": "string",
  • "packagingWeightValue": 0,
  • "pickUpLocation": "string",
  • "productNetQuantityUnit": "string",
  • "productNetQuantityValue": 0,
  • "productionLocation": "string",
  • "shipToLocation": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "yearlySalesVolumes": {
    }
}

Update a resold product.

Replace all fields on resold product.

path Parameters
id
required
string

Product (UUID) ID.

Request Body schema: application/json
required

Request body for updating a product

alcoholPercentage
number
brandName
string
categories
Array of strings
customId
string <= 255 characters
description
string

Fields exclusively used for classification.

gtin
string <= 14 characters
imageUrl
string
ingredients
string
name
required
string [ 3 .. 255 ] characters
packagingMaterial
string
packagingType
string
packagingWeightUnit
string
packagingWeightValue
number
pickUpLocation
required
string
productNetQuantityUnit
string
productNetQuantityValue
number
productionLocation
required
string
shipToLocation
required
string
object (retailerapi.SalesVolumes)

Sales volumes in tonnes/year. Object with fields like "2025": 123.0,

Responses

Request samples

Content type
application/json
{
  • "alcoholPercentage": 0,
  • "brandName": "string",
  • "categories": [
    ],
  • "customId": "string",
  • "description": "string",
  • "gtin": "string",
  • "imageUrl": "string",
  • "ingredients": "string",
  • "name": "string",
  • "packagingMaterial": "string",
  • "packagingType": "string",
  • "packagingWeightUnit": "string",
  • "packagingWeightValue": 0,
  • "pickUpLocation": "string",
  • "productNetQuantityUnit": "string",
  • "productNetQuantityValue": 0,
  • "productionLocation": "string",
  • "shipToLocation": "string",
  • "yearlySalesVolumes": {
    }
}

Response samples

Content type
application/json
{
  • "alcoholPercentage": 0,
  • "brandName": "string",
  • "categories": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "customId": "string",
  • "description": "string",
  • "groupId": "string",
  • "gtin": "string",
  • "id": "string",
  • "imageUrl": "string",
  • "ingredients": "string",
  • "name": "string",
  • "packagingMaterial": "string",
  • "packagingType": "string",
  • "packagingWeightUnit": "string",
  • "packagingWeightValue": 0,
  • "pickUpLocation": "string",
  • "productNetQuantityUnit": "string",
  • "productNetQuantityValue": 0,
  • "productionLocation": "string",
  • "shipToLocation": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "yearlySalesVolumes": {
    }
}

Get supplier engagement information

The information about current supplier of the product.

See GET /suppliers/{id}/linked-products for an explanation of the status. Responds status 204 if there is no current supplier of this product.

path Parameters
id
required
string

Product (UUID) ID.

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "status": "created"
}

Footprints

Get FLAG emissions breakdown of many products.

Get forest, land and agriculture emissions breakdown of many products.

query Parameters
groupId
required
string <uuid>

Required groupId.

Request Body schema: application/json
required

Array of resold product (UUID) IDs. Zero to 256 elements allowed.

Array
string

Responses

Request samples

Content type
application/json
[
  • "string"
]

Response samples

Content type
application/json
[
  • {
    }
]

List IDs of products that have updated footprint information.

List IDs of products that have updated 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
groupId
required
string <uuid>

Required groupId.

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.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List IDs of products with updated footprint baseline information.

List IDs of products that have updated footprint baseline 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
groupId
required
string <uuid>

Required groupId.

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.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get FLAG emissions baselines of many products.

Get forest, land and agriculture emissions baselines of many products.

query Parameters
groupId
required
string <uuid>

Required groupId.

Request Body schema: application/json
required

Array of resold product (UUID) IDs. Zero to 256 elements allowed.

Array
string

Responses

Request samples

Content type
application/json
[
  • "string"
]

Response samples

Content type
application/json
[
  • {
    }
]

Get FLAG emissions breakdown of a specific product.

Get forest, land and agriculture emissions breakdown of a specific product.

path Parameters
id
required
string

Resold product ID.

Responses

Response samples

Content type
application/json
{
  • "calculationMethod": "location",
  • "embeddedFossilCarbon": 0,
  • "flag": {
    },
  • "other": 0,
  • "packaging": 0,
  • "pds": {
    },
  • "processing": 0,
  • "storage": 0,
  • "total": 0,
  • "transportation": 0,
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Get footprint baseline of a specific product.

Get forest, land and agriculture emissions breakdown of a specific product. The returned footprint baseline is modeled using only secondary data. This is not a secondary contribution to the primary footprint.

path Parameters
id
required
string

Resold product ID.

Responses

Response samples

Content type
application/json
{
  • "calculationMethod": "location",
  • "embeddedFossilCarbon": 0,
  • "flag": {
    },
  • "other": 0,
  • "packaging": 0,
  • "pds": {
    },
  • "processing": 0,
  • "storage": 0,
  • "total": 0,
  • "transportation": 0,
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Product Suppliers

Get product suppliers.

Retrieves all supplier periods for a product and their corresponding time ranges. The returned id on each period should be included in PUT requests to preserve existing periods and their internal linkage.

path Parameters
id
required
string

Resold product ID.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Set supplier periods for a product.

Replace the supplier period history for this product.

Each supplier entry may include an optional id field:

  • With id: updates the existing period's dates in place, preserving the supplier and internal linkage.
  • Without id: creates a new period.
  • Any existing period whose id is not present in the request will be removed.

To avoid accidentally deleting periods, first fetch the current list via GET /resold-products/{id}/suppliers and include the returned id values for any periods you wish to keep.

Validation rules:

  • All dates must be today or in the past.
  • validFrom must not be after validTo (same day is allowed).
  • Periods must not overlap in time, not even share a boundary day.

This endpoint only creates data connections. It does not contact or expose any data to suppliers in itself.

path Parameters
id
required
string

Resold product ID.

Request Body schema: application/json
required

Supplier periods to set

required
Array of objects (retailerapi.SupplierPeriodInput)
Array
id
string
supplierId
required
string
validFrom
string <date>
validTo
string <date>

Responses

Request samples

Content type
application/json
{
  • "suppliers": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Suppliers

List suppliers

List suppliers for one or more groups

query Parameters
groupId
required
string

Group ID (UUID) to list suppliers of.

customId
string

Optional filter on suppliers customId. Only relevant if non-empty string.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new supplier

Create a new supplier within an organization. Contacts can optionally be included.

Request Body schema: application/json
required

Request body for creating a new supplier

Array of objects (retailerapi.SupplierContactInput)
customId
string <= 255 characters
groupId
required
string
name
required
string [ 3 .. 255 ] characters

Responses

Request samples

Content type
application/json
{
  • "contacts": [
    ],
  • "customId": "string",
  • "groupId": "string",
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "contacts": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "customId": "string",
  • "groupId": "string",
  • "id": "string",
  • "name": "string",
  • "status": "created",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Delete a supplier

Delete a supplier by its unique ID. Supplier must not be invited or connected.

path Parameters
supplier-id
required
string

Supplier (UUID) ID.

Responses

Response samples

Content type
application/json
{
  • "detail": "string",
  • "error": "string"
}

Get a specific supplier

Get a supplier by its unique ID

path Parameters
supplier-id
required
string

Supplier (UUID) ID.

Responses

Response samples

Content type
application/json
{
  • "contacts": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "customId": "string",
  • "groupId": "string",
  • "id": "string",
  • "name": "string",
  • "status": "created",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Update an existing supplier

Update an existing supplier by its unique ID. Only provided fields will be updated. If contacts are provided, they completely replace all existing contacts.

path Parameters
supplier-id
required
string

Supplier (UUID) ID.

Request Body schema: application/json
required

Request body for updating a supplier

Array of objects (retailerapi.SupplierContact)
customId
string <= 255 characters
name
string [ 3 .. 255 ] characters

Responses

Request samples

Content type
application/json
{
  • "contacts": [
    ],
  • "customId": "string",
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "contacts": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "customId": "string",
  • "groupId": "string",
  • "id": "string",
  • "name": "string",
  • "status": "created",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

List linked products for supplier

List active linked products for a supplier. Use optional status query filter to list only products with a specific status.

Status values:

  • created: Product is linked to the supplier but no invite has been sent.
  • sent: An invite has been sent to the supplier and is awaiting a response.
  • declined: The supplier declined the invite.
  • accepted: The supplier accepted the invite and has ownership of the product, but has not yet submitted any data.
  • active: The supplier has accepted the invite and submitted (published) data at least once.
path Parameters
supplier-id
required
string

Supplier UUID.

query Parameters
status
Array of strings
Items Enum: "created" "sent" "declined" "accepted" "active"

Filter by product status.

Responses

Response samples

Content type
application/json
[
  • {
    }
]