Deutsch DE
API-Referenz
API-Referenz

Rabattcodes

Update coupon

PATCH / v1 / coupons / {coupon_id}

Changes the fields that you send.

  • status archived switches the code off. The Tentary app calls this "delete". active switches it on again.
  • null removes starts_on, ends_on or max_uses.

The fields have the same names and formats as in GET /v1/coupons.

Ändert sofort MCP-Werkzeug update_coupon

Autorisierung

  • Authorization string Header erforderlich

    Bearer tnt_… · A personal API key (tnt_...). Create it in the Tentary app on the page AI & API. Einführung

Pfad-Parameter

  • coupon_id integer erforderlich

    The id from list_coupons.

    min. 1 Beispiel: 702

Body application/json

  • status string

    archived = switched off. active = on again.

    Mögliche Werte: activearchived

  • code string

    The code buyers type, like SUMMER20. Unique in the shop (upper and lower case count as the same).

    min. Länge 1 max. Länge 255

  • percent integer kann null sein

    Discount in percent. Give percent or amount.

    min. 1 max. 100

  • amount number | string kann null sein

    Fixed discount. Amount in the account currency, like 49 or 19.99.

    größer als 0 Muster ^[0-9]{1,9}(\.[0-9]{1,2})?$

  • max_uses integer kann null sein

    How 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_on string kann null sein

    First 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_on string kann null sein

    The 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_ids array of integer kann null sein

    Only 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.

  • id integer

    The ID.

  • code string

    The code buyers type.

  • status string

    What the seller set. archived = deleted.

    Mögliche Werte: activearchived

  • state string

    The result for buyers: valid = buyers can use the code now.

    Mögliche Werte: validscheduledexpiredused_upreservedarchivedno_products

  • percent integer kann null sein

    Discount in percent, or null for a fixed amount.

  • amount string kann null sein

    Decimal string, like "19.90". Fixed discount, or null for a percent discount.

  • currency string

    Currency code, like EUR.

  • used integer

    How often the code was used.

  • max_uses integer kann null sein

    null = no limit.

  • reserved_in_open_checkouts integer

    Uses held by open checkouts of the last hour.

  • starts_on string<date> kann null sein

    Like 2026-01-31. First day the code works.

  • ends_on string<date> kann null sein

    Like 2026-01-31. The code stops at the start of this day.

  • product_ids array of integer kann null sein

    null = all products. [] = no product.

  • products array of object

    The products of product_ids (the first 200).

    3 Felder anzeigen Felder ausblenden
    • id integer

      The ID.

    • name string kann null sein

      The name.

    • status string

      The status.

      Mögliche Werte: livedraftarchiveddeleted

  • created_at string<date-time> kann null sein

    UTC, like 2026-01-31T14:05:00Z.

  • admin_url string<uri>

    The page in the Tentary app.

Tippe, um zu suchen.