POST rest/coupons
Creates a new coupon or coupon book.
Request Information
URI Parameters
None.
Body Parameters
Coupon object.
CouponRequestName | Description | Type | Additional information |
---|---|---|---|
id |
Id of coupon, must be unique. |
globally unique identifier |
None. |
Version |
Coupon version. Default is 0. Use version 2 for the new html template engine. |
byte |
None. |
PartnerId |
Id of Link partner from Partner API. |
integer |
None. |
Type |
COUPON or COUPON_BOOK |
string |
None. |
Username |
Username from login. |
string |
None. |
Name |
Name of coupon. |
string |
None. |
Description |
Description of coupon. |
string |
None. |
start |
When the coupon should start being active. |
date |
None. |
stop |
When the coupon should stop being active. |
date |
None. |
ReceiveOnce |
If coupon codes should be limited to one pr user. |
boolean |
None. |
UsageCount |
How many times user has used coupon. |
integer |
None. |
Usages |
[Version 2 Only] Gets or sets the usages for a coupon. Valid values in the array are: * BulkSending or 1. Bulk sending. * OptInMessage or 2. Opt-in message. |
Collection of CouponUsage |
None. |
validityPeriodMinutes |
How many minutes the coupon is valid. |
integer |
None. |
SiteTemplateId |
Site template id for coupon. |
globally unique identifier |
None. |
CodeGeneratorConfiguration |
Type of codes generated. |
CodeGeneratorConfiguration |
None. |
created |
When the coupon was created. |
date |
None. |
CouponIds |
List of coupon ids if this is a coupon book. |
Collection of globally unique identifier |
None. |
Site |
[Version 1 Only] Coupon web site. |
Site |
None. |
DynamicFields |
[Version 1 Only] Dynamic fields for the site template. |
Dictionary of string [key] and string [value] |
None. |
HeaderText |
[Version 2 Only] Coupon header text. |
string |
None. |
HeaderBackgroundColor |
[Version 2 Only] Coupon header background color. |
string |
None. |
MainTextOpacityBackgroundColor |
[Version 2 Only] Coupon bottom text background color. |
string |
None. |
MainTextOpacityValue |
[Version 2 Only] Coupon bottom text background color opacity value. |
string |
None. |
HeaderTextOpacityBackgroundColor |
[Version 2 Only] Coupon middle text background color. |
string |
None. |
HeaderTextOpacityValue |
[Version 2 Only] Coupon middle text background color opacity value. |
string |
None. |
TextOnImageOpacityBackgroundColor |
[Version 2 Only] Coupon top text background color. |
string |
None. |
TextOnImageOpacityValue |
[Version 2 Only] Coupon top text background color opacity value. |
string |
None. |
MainTextBorderRadius |
[Version 2 Only] Coupon bottom text border radius. |
string |
None. |
HeaderTextBorderRadius |
[Version 2 Only] Coupon middle text border radius. |
string |
None. |
TextOnImageBorderRadius |
[Version 2 Only] Coupon top text border radius. |
string |
None. |
MainTextFontFamily |
[Version 2 Only] Coupon bottom text font family. |
string |
None. |
HeaderTextFontFamily |
[Version 2 Only] Coupon middle text font family. |
string |
None. |
TextOnImageFontFamily |
[Version 2 Only] Coupon top text font family. |
string |
None. |
ThumbnailButtonText |
[Version 2 Only] Coupon or coupon book thumbnail button text. |
string |
None. |
ThumbnailButtonTextColor |
[Version 2 Only] Coupon book coupons button text color. |
string |
None. |
Appearance |
[Version 2 Only] Booklet appearance. |
string |
None. |
ThumbnailButtonBackgroundColor |
[Version 2 Only] Coupon book coupons button background color. |
string |
None. |
MainText |
[Version 2 Only] Coupon main text. |
string |
None. |
ImageText |
[Version 2 Only] Coupon image overlay text. |
string |
None. |
ConditionsText |
[Version 2 Only] Coupon conditions text. |
string |
None. |
RedeemButtonText |
[Version 2 Only] Coupon redeem button text. |
string |
None. |
RedeemButtonTextColor |
[Version 2 Only] Coupon redeem button text color. |
string |
None. |
RedeemButtonBackgroundColor |
[Version 2 Only] Coupon redeem button background color. |
string |
None. |
RedeemWarningMessage |
[Version 2 Only] Coupon redeem-popup warning message. |
string |
None. |
RedeemOkButtonText |
[Version 2 Only] Coupon redeem-popup ok button text. |
string |
None. |
RedeemCancelButtonText |
[Version 2 Only] Coupon redeem-popup cancel button text. |
string |
None. |
RedeemOverlayText |
[Version 2 Only] Coupon overlay text shown when coupon is redeemed. |
string |
None. |
BackgroundColor |
[Version 2 Only] Coupon/couponbook background color. |
string |
None. |
ImageTextColor |
[Version 2 Only] Coupon image text color |
string |
None. |
ValidText |
[Version 2 Only] Valid text |
string |
None. |
ActiveSoonStatusText |
[Version 2 Only] Active soon status text |
string |
None. |
ActiveStatusText |
[Version 2 Only] Active status text |
string |
None. |
ActivationTimeText |
[Version 2 Only] Activation time text |
string |
None. |
ExpirationTimeText |
[Version 2 Only] Expiration time text |
string |
None. |
ExpiredStatusText |
[Version 2 Only] Expired status text |
string |
None. |
Images |
[Version 2 Only] Coupon images. |
Collection of CouponImageRequest |
None. |
BannerText |
[Version 2 Only] Couponbook Banner text. |
string |
None. |
BannerTextColor |
[Version 2 Only] Couponbook Banner text color. |
string |
None. |
Logo |
[Version 2 Only] Coupon book logo image. |
string |
None. |
CouponsButtonText |
WARNING! This property is obsolete. Please use ThumbnailButtonText instead. This field will be removed in a future version of the API. [Version 2 Only] Coupon book coupons button text. |
string |
None. |
ShowLikeButtons |
[Version 2 Only] Couponbook Show like buttons. |
boolean |
None. |
StoreName |
[Version 2 Only] Gets or sets the store name that is sending this coupon. |
string |
None. |
DiscountType |
[Version 2 Only] Gets or sets the type of discount that the property represents. Valid values are: * Percentage or 1. The discount is given in percentages of the sales price. * Price or 2. The discount is given price discount subtracted from the sales price. * Other or 3. Some other type of discount (free, 3 for 2 and so on). |
string |
None. |
DiscountValue |
[Version 2 Only] Gets or sets the value of the discount, as described by . |
decimal number |
None. |
Request Formats
application/json, text/json
{ "id": null, "version": 2, "partnerId": 1, "type": "COUPON", "username": null, "name": "Test Coupon", "description": "A simple test coupon", "start": 1652994502295, "stop": 1653858502295, "receiveOnce": true, "usageCount": 1, "usages": null, "validityPeriodMinutes": 60, "siteTemplateId": "3e9e225c-534e-4a87-b015-ecefa311f18b", "codeGeneratorConfiguration": { "type": "RANDOM_ALPHANUMERIC", "length": "6" }, "created": -62135596800000, "couponIds": null, "site": null, "dynamicFields": null, "headerText": "Header text", "thumbnailButtonText": "thumb button", "thumbnailButtonTextColor": null, "appearance": null, "thumbnailButtonBackgroundColor": null, "mainText": "Main text", "imageText": "25%", "conditionsText": "Conditions text", "redeemButtonText": "redeem button", "redeemWarningMessage": "Redeem warning message", "redeemOkButtonText": "Ok", "redeemCancelButtonText": "Cancel", "redeemOverlayText": "Redeem overlay text", "backgroundColor": "White", "imageTextColor": "Black", "images": [ { "name": "logo", "data": "data:image/png;base64,AAQSkZJRgABAg..." }, { "name": "main", "data": "data:image/png;base64,zNzdhMDAwMDE0N2YwMDAwYTU4NDAwM..." } ], "bannerText": null, "bannerTextColor": null, "logo": null, "couponsButtonText": null, "showLikeButtons": false, "storeName": null, "discountType": null, "discountValue": null }
application/xml, text/xml
<CouponRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.linkmobility.com/common/coupons"> <Appearance i:nil="true" /> <BackgroundColor>White</BackgroundColor> <BannerText i:nil="true" /> <BannerTextColor i:nil="true" /> <CodeGeneratorConfiguration> <Length>6</Length> <Type>RANDOM_ALPHANUMERIC</Type> </CodeGeneratorConfiguration> <ConditionsText>Conditions text</ConditionsText> <CouponIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" /> <CouponsButtonText i:nil="true" /> <Description>A simple test coupon</Description> <DiscountType i:nil="true" /> <DiscountValue i:nil="true" /> <DynamicFields xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" /> <HeaderText>Header text</HeaderText> <ImageText>25%</ImageText> <ImageTextColor>Black</ImageTextColor> <Images> <CouponImageRequest> <Data>data:image/png;base64,AAQSkZJRgABAg...</Data> <Name>logo</Name> </CouponImageRequest> <CouponImageRequest> <Data>data:image/png;base64,zNzdhMDAwMDE0N2YwMDAwYTU4NDAwM...</Data> <Name>main</Name> </CouponImageRequest> </Images> <Logo i:nil="true" /> <MainText>Main text</MainText> <Name>Test Coupon</Name> <PartnerId>1</PartnerId> <ReceiveOnce>true</ReceiveOnce> <RedeemButtonText>redeem button</RedeemButtonText> <RedeemCancelButtonText>Cancel</RedeemCancelButtonText> <RedeemOkButtonText>Ok</RedeemOkButtonText> <RedeemOverlayText>Redeem overlay text</RedeemOverlayText> <RedeemWarningMessage>Redeem warning message</RedeemWarningMessage> <ShowLikeButtons>false</ShowLikeButtons> <Site i:nil="true" /> <SiteTemplateId>3e9e225c-534e-4a87-b015-ecefa311f18b</SiteTemplateId> <StoreName i:nil="true" /> <ThumbnailButtonBackgroundColor i:nil="true" /> <ThumbnailButtonText>thumb button</ThumbnailButtonText> <ThumbnailButtonTextColor i:nil="true" /> <Type>COUPON</Type> <UsageCount>1</UsageCount> <Usages xmlns:d2p1="http://schemas.datacontract.org/2004/07/Common.Coupons.Model.Enums" i:nil="true" /> <Username i:nil="true" /> <Version>2</Version> <created>0001-01-01T00:00:00</created> <id i:nil="true" /> <start>2022-05-19T21:08:22.2952849Z</start> <stop>2022-05-29T21:08:22.2952849Z</stop> <validityPeriodMinutes>60</validityPeriodMinutes> </CouponRequest>
application/x-www-form-urlencoded
Sample not available.
Response Information
Resource Description
None.