Loading...

POST   https://api.3seventy.com/api/v2.1/account/{accountId}/campaign/{campaignId}/coupon

Description

Create Coupon Definition

Path Parameters

accountId integer The account to which the coupon will report to. required
campaignId integer The coupon campaign to define required

Request Properties application/json

CouponTypeId number The type of coupon that's being defined, Static or Dynamic. required
Prefix string The prefix code for the coupon. optional
StaticCode string The static code for the coupon. required
ExternalId1 string A user definable ID value. optional
ExternalId2 string A second user definable ID value. optional
ValidFrom string The date we should start allowing coupons to be redeemed. optional
ValidTo string THe date we should stop allowing coupons to be redeemed. optional
MaxUses number The maximum number of allowed uses per customer. optional
ValidDateTypeId number Coupon Code valid DateTypeId i.e. None or Static or Rolling optional
ValidRollingDays integer Number of days that coupon code is valid for the Rolling date type Coupon Code optional
ValidRollingOffSet integer Rolling offset days of the coupon code optional
ExternalListId integer External Coupon List Id value optional
ExternalCouponList object External Coupon List details optional


                    

C#


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using ThreeSeventy.Vector.Client;
using ThreeSeventy.Vector.Client.Enums;
using ThreeSeventy.Vector.Client.Models;

public class Program
{

private static void Main(string[] args)
{

const int accountId = XXXX;

const int campaignId = XXXX;

var context = new T70Context();

var couponOfferRepo = context.Repository<CouponOffer>(new { AccountId = accountId , CampaignId = campaignId});

var item = new CouponOffer()

{

AccountId = accountId,

UrlBase = "",

CampaignId = campaignId

};

couponOfferRepo.Add(item);

}

}