# Handlebars Helper Function: assignCoupon

Claims a coupon row from a marketing object for the current recipient. Use this helper to assign a coupon code from a coupon list.

## Availability

This helper is available in the Winter ’27 release of Marketing Cloud Next.

## Syntax

```handlebars
{{assignCoupon list="CouponCodes"}}
```

## Parameters

| Parameter | Type   | Description                                                               |
| --------- | ------ | ------------------------------------------------------------------------- |
| `list`    | String | Required. The name of the marketing object that contains the coupon rows. |

## Return Value

The function returns the claimed coupon row as an object. Use the [get](/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-objects-references/mcn-handlebars-reference-objects-get.md) helper to retrieve values from the returned row.

For a coupon list that isn't configured to always assign a new coupon, the helper returns the coupon previously assigned to the same recipient.

If no coupon is available, the coupon list isn't valid, or the recipient doesn't have an individual ID, the function throws an exception. You can use the [fallback](/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-utility-references/mcn-handlebars-reference-utility-fallback.md) helper to handle an unavailable coupon.

## Usage Examples

This example assigns a coupon and renders the value in the `CouponCode` field.

```handlebars
{{#with (assignCoupon list="CouponCodes")}}
  Your coupon code is {{get this "CouponCode"}}.
{{/with}}
```

### Providing a Fallback Value

This example renders a fallback message when a coupon isn't available.

```handlebars
{{fallback (get (assignCoupon list="CouponCodes") "CouponCode") "No coupon available"}}
```

## See Also

- [claimRow](/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-data-references/mcn-handlebars-reference-data-claimrow.md)
- [fallback](/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-utility-references/mcn-handlebars-reference-utility-fallback.md)
- [get](/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-objects-references/mcn-handlebars-reference-objects-get.md)
