πŸ‘œProduct

Build templates for automating emission estimations

[Secure] - API Key is required to call all Product endpoints.

Create a new product.

POST https://api.carbonlink.io/v1/products

Request Body

NameTypeDescription

name*

string

Name of product to be created

shippable

boolean

Whether this product can be shipped or not. Defaults to false.

skus

string[]

List of IDs to represent this product

factors

object

This attribute computes the unit emission rate for this Product.

Key-value pairs where the key of each pair represents the ID of the Factor to add to this product with a value corresponding to the quantity of the Factor to apply.

Example:

{ "fct_123": 12.3, "fct_456": 3.2 }

{
    message: 'Product created successfully with ID: {...}'
}

Update an existing product.

PATCH https://api.carbonlink.io/v1/products

Path Parameters

NameTypeDescription

id*

string

ID of Product to update

Request Body

NameTypeDescription

name

string

Name of product to be updated

shippable

boolean

Whether this product can be shipped or not. Defaults to false.

skus

string[]

List of IDs to represent this product. Overwrites previous list of IDs.

factors

object

This attribute computes the unit emission rate for this Product.

Key-value pairs where the key of each pair represents the ID of the Factor to add to this product with a value corresponding to the quantity of the Factor to apply. If a new emission factorId is passed through, the Factor is added to the existing Factors. An existing factorId passed through will update the value of the corresponding Product Factor.

{
    message: 'Product updated successfully with ID: {...}'
}

Retrieve a product.

GET https://api.carbonlink.io/v1/products

Path Parameters

NameTypeDescription

id*

string

ID of Product to retrieve

{
  id: "prod_12345678",
  name: "Road Bike - 2023 Model",
  kgCO2e: 123.45,
  shippable: true,
  sector: 'Ground Transportation',
  category: "Bicycle",
  factors: [
    {
        factorId: "fct_123...",
        value: 1.23
    },
    {
        factorId: "fct_456...",
        value: 34.51
    },
    ...
  ],
  active: true,
}

Retrieve all products.

GET https://api.carbonlink.io/v1/products

[
  {
    id: "prod_12345678",
    ...
  },
  {
    id: "prod_ABCDEFGH",
    ...
  },
]

Delete a product.

DELETE https://api.carbonlink.io/v1/products

Path Parameters

NameTypeDescription

id*

string

ID of Product to delete

[
  {
    id: "prod_12345678",
    ...
  },
  {
    id: "prod_ABCDEFGH",
    ...
  },
]

Last updated