younifyd
Menu

Update Coupon

Update coupon

PUT/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}

Use it in a workflow

  1. Add a step and choose the Talon.One connector.
  2. Pick the Update Coupon action (under management).
  3. Fill in the fields below, then reference the result from later steps as {{updateCoupon.response.data}}.

Request

Path parameters

applicationIdinteger (int64)required

The ID of the Application. It is displayed in your Talon.One deployment URL.

campaignIdinteger (int64)required

The ID of the campaign. It is displayed in your Talon.One deployment URL.

couponIdstringrequired

The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response.

Request body

Enter the body as JSON in the step's Body field.

usageLimitinteger (int64)

The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply.

discountLimitnumber

The total discount value that the code can give. Typically used to represent a gift card value.

reservationLimitinteger (int64)

The number of reservations that can be made with this coupon code.

startDatestring (date-time)

Timestamp at which point the coupon becomes valid.

expiryDatestring (date-time)

Expiration date of the coupon. Coupon never expires if this is omitted.

limitsarray<object>

Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured.

actionstringrequired

The limitable action to which this limit applies. For example: - `setDiscount` - `setDiscountEffect` - `redeemCoupon` - `createCoupon`

limitnumberrequired

The value to set for the limit.

periodstring

The period on which the budget limit recurs.

One ofdailyweeklymonthlyyearly

entitiesarray<string>required

The entity that this limit applies to.

recipientIntegrationIdstring

The integration ID for this coupon's beneficiary's profile.

attributesobject

Arbitrary properties associated with this item.

isReservationMandatoryboolean

An indication of whether the code can be redeemed only if it has been reserved first.

Default false

implicitlyReservedboolean

An indication of whether the coupon is implicitly reserved for all customers.

json
{
  "usageLimit": 100,
  "discountLimit": 30,
  "reservationLimit": 45,
  "startDate": {},
  "expiryDate": {},
  "limits": [
    {
      "period": "yearly",
      "entities": [
        "Coupon"
      ],
      "limit": 1000,
      "action": "createCoupon"
    }
  ],
  "recipientIntegrationId": "URNGV8294NV",
  "attributes": {},
  "isReservationMandatory": false,
  "implicitlyReserved": false
}

Response

Returns 200 with an object. Read it in later steps with {{updateCoupon.response.data.<field>}}.

idinteger (int64)

The internal ID of the coupon.

createdstring (date-time)

The time the coupon was created.

campaignIdinteger (int64)

The ID of the campaign that owns this entity.

valuestring

The coupon code.

usageLimitinteger (int64)

The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply.

discountLimitnumber

The total discount value that the code can give. Typically used to represent a gift card value.

reservationLimitinteger (int64)

The number of reservations that can be made with this coupon code.

startDatestring (date-time)

Timestamp at which point the coupon becomes valid.

expiryDatestring (date-time)

Expiration date of the coupon. Coupon never expires if this is omitted.

limitsarray<object>

Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured.

actionstringrequired

The limitable action to which this limit applies. For example: - `setDiscount` - `setDiscountEffect` - `redeemCoupon` - `createCoupon`

limitnumberrequired

The value to set for the limit.

periodstring

The period on which the budget limit recurs.

One ofdailyweeklymonthlyyearly

entitiesarray<string>required

The entity that this limit applies to.

usageCounterinteger (int64)

The number of times the coupon has been successfully redeemed.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

reservationCounternumber

The number of times this coupon has been reserved.

attributesobject

Custom attributes associated with this coupon.

referralIdinteger (int64)

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger (int64)

The ID of the Import which created this coupon.

reservationboolean

Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code.

Default true

batchIdstring

The id of the batch the coupon belongs to.

isReservationMandatoryboolean

An indication of whether the code can be redeemed only if it has been reserved first.

Default false

implicitlyReservedboolean

An indication of whether the coupon is implicitly reserved for all customers.

json
{
  "id": 6,
  "created": {},
  "campaignId": 211,
  "value": "XMAS-20-2021",
  "usageLimit": 100,
  "usageCounter": 10,
  "discountLimit": 30,
  "reservationLimit": 45,
  "startDate": {},
  "expiryDate": {},
  "limits": [
    {
      "period": "yearly",
      "entities": [
        "Coupon"
      ],
      "limit": 1000,
      "action": "createCoupon"
    }
  ],
  "discountCounter": 10
}

Need more? See the Talon.One guide for connection setup and behaviour shared by every action.