Skip to content

API reference

Products numbers

Other routes API

GET/v1/insights/products

What was sold or bought, by product, from the lines of each invoice, by invoice date over 7, 30 or 90 days ending on the company’s today. One currency at a time. A product is the seller’s item id, else its GTIN, else its name. Only the newest version of each invoice counts, and a credit note counts as minus. Rejected invoices, pro formas and suspected duplicates not kept are left out and counted in left. Invoice-level allowances and charges are totals of their own, never added into the lines. Every amount and quantity is a decimal string. The numbers are cipher’s and the API passes cipher’s status and body on unchanged. Cipher’s own refusals have the shape {detail: {code, message}}.

Query parameters

  • daysstring

    The window, in days. Default 30.

    One of 7, 30, 90.
  • sidestring

    sales, the invoices made, or purchases, the invoices received. Default sales.

    One of sales, purchases.
  • currencystring

    An ISO 4217 code. Empty or absent, the currency with the most invoices in the window.

Status codes

Status Meaning
200 {basis, currencies, currency, totals, left, products, more}. basis names the date, the window, the time zone, the side and the definition’s version and date. products lists the hundred largest; more says how many are not listed.
400 Cipher’s answer: the window, side or currency is not one it takes (bad_window, bad_side, bad_currency).
401 No usable credential was sent (invalid_credentials).
403 Cipher’s answer: the company has not switched the insights add-on on (addon_off).
503 Cipher or its database could not answer (insights_unavailable). Invoicing is not affected.
GET/v1/insights/products
Example
curl https://api.certinvo.com/v1/insights/products \
  -H "Authorization: Bearer $CERTINVO_API_KEY"
const response = await fetch(`https://api.certinvo.com/v1/insights/products`, {
  headers: {
    Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
  },
})
console.log(response.status, await response.json())
import os

import requests

response = requests.get(
    "https://api.certinvo.com/v1/insights/products",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}"},
)
print(response.status_code, response.text)
200
No response body.
Success response
GET
/v1/insights/products
Products numbers
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Headers2
›Query Parameters3
›Code Snippet
curl -X GET "https://api.certinvo.com/v1/insights/products" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close