HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In


Creates a new coupon block in Optimizely Campaign.

**Type**: long

**Parameters**

NameTypeValue
sessionIdStringID of the current session
couponSourceStringType of the coupon block:<br><ul><li><span class="classLib">static</span>: Contains static coupon codes. These must be added manually (see [add](🔗) or [addAll](🔗)).</li>

<li><span class="classLib">generated</span>: Coupon codes are automatically generated when sending the mailing and are unique.</li> <li><span class="classLib">ean13barcode</span>: Bar code blocks convert a 13-digit code number into a machine-readable bar code and insert it as a graphic into a mailing.</li></ul> | | Name | String | Name of the coupon block |

**Return values**

The ID of the newly created coupon block

**Code structure**