Rabattcodes
Create coupon
/ v1 / coupons Creates a coupon (discount code). It works at once, or from starts_on.
The answer is the coupon, as in GET /v1/coupons, with its state.
Autorisierung
-
Authorizationstring Header erforderlichBearer tnt_…· A personal API key (tnt_...). Create it in the Tentary app on the page AI & API. Einführung
Body application/json
-
codestring erforderlichThe code buyers type, like SUMMER20. Unique in the shop (upper and lower case count as the same).
min. Länge
1max. Länge255 -
percentintegerDiscount in percent. Give percent or amount.
min.
1max.100 -
amountnumber | stringFixed discount. Amount in the account currency, like 49 or 19.99.
größer als
0Muster^[0-9]{1,9}(\.[0-9]{1,2})?$ -
max_usesintegerHow often the code can be used in total. 0 = no limit. On create, left out = no limit. On update, left out = no change, null removes the limit.
min.
0 -
starts_onstringFirst day the code works, like 2026-11-27. On create, left out = at once. On update, left out = no change, null removes the date.
Muster
^[0-9]{4}-[0-9]{2}-[0-9]{2}$ -
ends_onstringThe code stops at the start of this day (00:00). On create, left out = no end. On update, left out = no change, null removes the date.
Muster
^[0-9]{4}-[0-9]{2}-[0-9]{2}$ -
product_idsarray of integer kann null seinOnly these products (ids from list_products). null = all products. On create, left out = all products. On update, left out = no change. [] = no product (the code works nowhere).
max. Einträge
200
Antwort
Felder der Antwort mit Status 200. Fehler haben immer dasselbe Format, siehe Fehler.
-
idintegerThe ID.
-
codestringThe code buyers type.
-
statusstringWhat the seller set. archived = deleted.
Mögliche Werte:
activearchived -
statestringThe result for buyers: valid = buyers can use the code now.
Mögliche Werte:
validscheduledexpiredused_upreservedarchivedno_products -
percentinteger kann null seinDiscount in percent, or null for a fixed amount.
-
amountstring kann null seinDecimal string, like "19.90". Fixed discount, or null for a percent discount.
-
currencystringCurrency code, like EUR.
-
usedintegerHow often the code was used.
-
max_usesinteger kann null seinnull = no limit.
-
reserved_in_open_checkoutsintegerUses held by open checkouts of the last hour.
-
starts_onstring<date> kann null seinLike 2026-01-31. First day the code works.
-
ends_onstring<date> kann null seinLike 2026-01-31. The code stops at the start of this day.
-
product_idsarray of integer kann null seinnull = all products. [] = no product.
-
productsarray of objectThe products of product_ids (the first 200).
3 Felder anzeigen Felder ausblenden
-
idintegerThe ID.
-
namestring kann null seinThe name.
-
statusstringThe status.
Mögliche Werte:
livedraftarchiveddeleted
-
-
created_atstring<date-time> kann null seinUTC, like 2026-01-31T14:05:00Z.
-
admin_urlstring<uri>The page in the Tentary app.