Get the business
GET /v1/commerce returns the profile of the business linked to the key and the rules of its loyalty card.
/v1/commerceReturns the business the key belongs to: its name, currency, time zone and card rules (mode, goal, rewards, amount rule). Handy to check a key, or to show the card rule in your POS.
Example
curl https://app.stampywallet.com/v1/commerce \
-H "Authorization: Bearer sw_live_your_key"const r = await fetch('https://app.stampywallet.com/v1/commerce', {
headers: { Authorization: `Bearer ${process.env.STAMPY_CLE}` },
});
const commerce = await r.json();Response
{
"id": "5f0c8e2a-3b1d-4c9e-9a51-2d7f3e8b6a10",
"nom": "Boulangerie Lemaire",
"mode": "tampons",
"tampons_requis": 10,
"recompense": "A free baguette",
"recompenses": [ { "seuil": 10, "libelle": "A free baguette" } ],
"devise": "EUR",
"montant_par_tampon": 10,
"points_par_unite": null,
"tampons_bienvenue": 1,
"conditions_exigees": false,
"premium": null,
"fuseau": "Europe/Paris",
"langue": "fr"
}| Field | Meaning |
|---|---|
mode | tampons, paliers or points (card types) |
recompenses | Each reward with its seuil (threshold) |
montant_par_tampon | The "€10 = 1 stamp" rule, or null |
points_par_unite | In points mode: how many points for 1 unit of currency |
conditions_exigees | true if the business requires acceptance of its terms: then pass conditions_acceptees: true when creating a customer |
premium | The second counter, when the business has opened it, otherwise null |
Updated