Our v3 API is now available! Learn more by visiting the v3 developer portal.

Promocode Collection Endpoint

Promo codes are used to create various discounts for event fees. Use this API endpoint to create (POST) a new promo code for an event, or to retrieve (GET) all existing promo codes for an event.

Methods:

Click a method to view its documentation

GET POST

DescriptionTOP

Privileges required: campaign:write

Create a promotional code for an existing event (specified using eventId). Promotional codes can be:

  • a percentage discount off a fee or set of fees
  • a fixed discount amount off a fee
  • a special promotional fee available by entering the promo code

POST: https://api.constantcontact.com/v2/eventspot/events/{event_id}/promocodes

Test API

name

type

default

description

api_key

query

REQUIRED; The API key for the application

eventId

path

Unique ID of the event for which to create the promocode

Example JSON Request BodyTOP

{
    "code_type": "DISCOUNT",
    "code_name": "Reduced_fee",
    "quantity_total": -1,
    "is_paused": false,
    "discount_amount":15,  
    "discount_scope": "FEE_LIST",
    "fee_ids": [
        "MIT4bfRPOntYqxSKs2ui9oPJUvBGM9P1V53KQcYO8Aw"
         ]
}

Response CodesTOP

code

description

201

Promocode was successfully created

400

Bad Request: Either JSON was malformed or there was a data validation error

401

Authentication failure

404

An event or fee with specified ID not found

406

Unsupported accept header value, must be application/json

409

Promocode name already in use

415

Unsupported content-type in the header, use application/json

500

Internal server error occurred

StructureTOP

property

type(max length)

description

code_name

string (12)

REQUIRED. Name of the promotional code visible to registrants, between 4 - 12 characters, cannot contain spaces or special character (_ is OK); each code_name must be unique

code_type

string

REQUIRED. Type of promocode:

  • ACCESS - applies to a specific fee with has_restricted_access = true, fee_list must include only a single fee_id. See Event Fees.
  • DISCOUNT - when set to DISCOUNT, you must specify either a discount_percent or a discount_amount

discount_amount

number

Specifies a fixed discount amount, minimum of 0.01, is required when code_type = DISCOUNT, but not using discount_percent

discount_percent

integer

Specifies a discount percentage, from 1% - 100%, is required when code_type = DISCOUNT, but not using discount_amount

discount_scope

string

Required when code_type = DISCOUNT;

  • FEE_LIST - discount is applied only to those fees listed in the fee_ids array
  • ORDER_TOTAL - discount is applied to the order total

discount_type

string

Discount types:

  • PERCENT - discount is a percentage specified by discount_percent
  • AMOUNT - discount is a fixed amount, specified by discount_amount (Read Only)

fee_ids

array

Identifies the fees to which the promocode applies;

  • If code_type = ACCESS promocode applies to a single fee with has_restricted_access = true, include only 1 fee id
  • If code_type = DISCOUNT and discount_scope = ORDER_TOTAL, do not include any fee_ids
  • If code_type = DISCOUNT and discount_scope = FEE_LIST, then include all fee_ids to which the discount applies

id

string (50)

Unique ID for the event promotional code (Read Only)

is_paused

boolean

REQUIRED. When set to true, promocode cannot be redeemed; when false, promocode can be redeemed; default = false.

quantity_available

integer

Number of promocodes available for redemption; -1 = unlimited. (Read Only)

quantity_total

integer

REQUIRED. Total number of promocodes available for redemption; -1 = unlimited.

quantity_used

integer

Number of promocodes that have been redeemed; starts at 0. (Read Only)

status

string

Status of the promocode:

  • LIVE - promocode is available to be redeemed
  • PAUSED - promocode is not available for redemption
  • DEPLETED - no more promocodes remain, quantity_available = 0
(Read Only)

Example ResponseTOP

{
    "id":"MIT4bfRPOntYqxSKs2ui9oPJUvBGM9P1V53KQcYO8Aw",
    "status":"LIVE",
    "code_name":"REDUCED_FEE",
    "is_paused":false,
    "fee_ids":[
        "MIT4bfRPOntYqxSKs2ui9oPJUvBGM9P1V53KQcYO8Aw"
        ],
    "quantity_total":-1,
    "quantity_used":0,
    "quantity_available":-1,
    "code_type":"DISCOUNT",
    "discount_scope":"FEE_LIST",
    "discount_type":"AMOUNT",
    "discount_amount":15.0
}