image of stars in the sky

Products

A product in the context of Kleio is a concept that is meant to map one-to-one to the products you operate with. If you offer an e-commerce store, then the mapping is fairly clear. A road bike in your store maps to a road bike in Kleio. If on the other hand, your site allows users the ability to post classified ads and you want to make it possible for your users to highlight their classified ad, then a product in the Kleio context maps to one of these ads.

In most cases, it's not necessary to manage products explicitly. You can instead create ads using the ads API-endpoint and the products will automatically be created as needed.

The product model

The product model is fairly simple. It's mostly an alternate display of the ads data:

Properties

  • Name
    id
    Type
    string
    Description

    The id of the product being advertised. This should be an id that makes sense to you - typically it is the id you use to reference the product in your system.

  • Name
    ads
    Type
    [ad]
    Description

    A list of ads associated with the product. For more details on the ad data model, please consult the ads resources page.

  • Name
    impressions
    Type
    integer
    Description

    The number of impressions that have been tracked across all ads associated with this product.

  • Name
    conversions
    Type
    integer
    Description

    The number of conversions that have been tracked across all ads associated with this product.

  • Name
    spent
    Type
    integer
    Description

    A running accumulator of the money spent on this product across all the ads associated with it. See the ads resource for more information on how the property is calculated.


GET/api/v1/products

List all products

This endpoint lists all products for which there are ads in Kleio.

Request

GET
/api/v1/products
curl -G https://example.com/api/v1/products

Response

{"data": [
  {
    "id": "1539",
    "ads": [...],
    "impressions": 19200,
    "conversions": 120
  },
  ...
]}

DELETE/api/v1/products/:id

Delete a product

This endpoint allows you to delete a product from Kleio. It will also delete all associated ads.

Required attributes

  • Name
    id
    Type
    string
    Description

    The id of the product being advertised. This should be an id that makes sense to you - typically it is the id you use to reference the product in your system.

    This property should be provided as part of the URL.

Request

DELETE
/api/v1/products/:id
curl -X DELETE \
  https://example.com/api/v1/products/59b05f3c-1397-4135-9e32-cdce5ff17736