Managing variation choices
Add, modify, or delete variation choices
Add a choice of variation
POST https://kash.click/workers/addVariationItem.php
Add a new item to a variation of your catalog
POST parameters
| ?? | ?? | ?? |
|---|---|---|
shopID | ? | Your institution's identifier |
key | ? | Your API key |
data[idVariation] | ?? | Variation ID |
data[title] | ? | Store Name |
data[position] | ?? | Position (on the interface) |
data[deltaPrice] | ?? | Price modification |
data[description] | ?? | ?? |
data[ending] | ?? | Final element |
data[unavailable] | ?? | Disabled element |
Modify a choice of variation
POST https://kash.click/workers/editVariationItem.php
Modify a variation item in your catalog
POST parameters
| ?? | ?? | ?? |
|---|---|---|
shopID | ? | Your institution's identifier |
key | ? | Your API key |
id | ? | Item Variation Identifier |
data[idVariation] | ?? | Variation ID |
data[title] | ?? | Store Name |
data[position] | ?? | Position (on the interface) |
data[deltaPrice] | ?? | Price modification |
data[description] | ?? | ?? |
data[ending] | ?? | Final element |
data[unavailable] | ?? | Disabled element |
Delete a variant selection
POST https://kash.click/workers/delVariationItem.php
Remove a variation from your catalog
POST parameters
| ?? | ?? | ?? |
|---|---|---|
shopID | ? | Your institution's identifier |
key | ? | Your API key |
id | ? | Item Variation Identifier |
JavaScript example
async function editVariation(){
const body = new URLSearchParams({
shopID: SHOPID,
key: 'REMPLACER_PAR_VOTRE_CLE_API_GENEREE',
id: 123,
'data[title]': 'Variation choice name'
});
const res = await fetch("https://kash.click/workers/editVariationItem.php", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body
});
let payload; try{ payload = await res.json(); }catch{ payload = await res.text(); }
console.log(payload);
}