Free cash register

Kash.click, free online POS software since 2011

Follow Us

L’aide, à portée de main

Comment pouvons-nous vous aider ?

Un réglage, une question, un geste du quotidien. Trouvez le bon guide et avancez simplement.

API / Web services

Download your reports

Download your daily reports in HTML, PDF, XLS, CSV format...

GET /workers/getSales.php

Base URL: https://kash.click/workers/getSales.php

Settings

NameTypeRequiredDescription
shopIDstringYesShop Account ID (SHOPID)
keystringYesYour token (APIKEY)
dintNoDaily (If not specified, the report covers the entire month.)
mintNoMonthly (If the day and month are not specified, the report covers the entire year.)
yintNoYear (If day, month, and year are not specified, the report refers to yesterday.)
formatExportstringYesStd (HTML report), PDF, XLS, CSV, frafec (FEC), saft

JavaScript Examples

// Aide pour construire une URL GET
function buildUrl(path, params){
  const qs = new URLSearchParams(params);
  return `${path}?${qs.toString()}`;
}

const SHOPID = SHOPID;
const APIKEY = 'REMPLACER_PAR_VOTRE_CLE_API_GENEREE';

// 1) Export CSV pour date précise
const urlCsv = buildUrl("https://kash.click/workers/getSales.php", {
  shopID: SHOPID,
  key: APIKEY,
  d: 16, m: 10, y: 2025,
  formatExport: "CSV"
});
fetch(urlCsv).then(r=>r.text()).then(csv=>console.log(csv));

// 2) Rapport HTML (Std) pour la veille (sans date)
const urlStd = buildUrl("https://kash.click/workers/getSales.php", {
  shopID: SHOPID,
  key: APIKEY,
  formatExport: "Std"
});
fetch(urlStd).then(r=>r.text()).then(html=>{
  document.getElementById("rapport").innerHTML = html;
});

// 3) Rapport PDF (Blob)
const urlPdf = buildUrl("https://kash.click/workers/getSales.php", {
  shopID: SHOPID,
  key: APIKEY,
  d: 16, m: 10, y: 2025,
  formatExport: "PDF"
});
fetch(urlPdf).then(r=>r.blob()).then(pdf=>{
  const a = document.createElement("a");
  a.href = URL.createObjectURL(pdf);
  a.download = "rapport-ventes.pdf";
  a.click();
});

This document is made available under the terms of the licence Creative Commons Attribution 4.0 International (CC BY 4.0).