Incentive Code API

Our Incentive Code API allows you to manage, store, and issue unique incentive codes to your end users. You can also use the API to view a code’s status, manually redeem a code, and more.

Before we begin, we’d like to define the three different types of entities that you may see while performing API methods.

An incentive code entity is a record of the individual code delivered to the end user.
A code issuance entity is a record of an incentive code issuance. Each time the code is issued, a new issuance entity will be created.
A code redemption entity is a record of an incentive code being redeemed.

Available API Methods

Incentive Code Entity

Elements & Attributes

Data ElementTypeDescription
incentive_pool_idIntegerThe unique identifier for the incentive pool from which this code is issued. Max 20 characters.
codeStringThe incentive code
activeBooleanWhether issuance of the incentive code is currently allowed.
issuancesObjectAn object describing this code's issuances.
issuances.totalIntegerThe total number of times this code has been issued.
issuances.uniqueIntegerThe number of unique times this code has been issued.
redemptionsObjectAn object describing this code's redemptions.
redemptions.totalIntegerThe total number of times this code has been redeemed.
redemptions.uniqueIntegerThe number of unique times this code has been redeemed.
created_atTimestampThe date this code was created. It should be in the ISO 8601 format - for example: 2017-01-18T17:24Z.
updated_atTimestampThe date this code was last updated. It should be in the ISO 8601 format - for example: 2017-04-18T17:24Z.
urlStringThe URL to access this resource.

Example Entity

The following is the JSON representation of an incentive code entity within the APIs.

{
  "code": "coupon01",
  "active": true,
  "issuances": {
    "total": 2,
    "unique": 1
  },
  "redemptions": {
    "total": 1,
    "unique": 1
  },
  "incentive_pool": {
    "id": 42,
    "url": "/companies/:id/incentives/pools/:pool_id"
  },
  "created_at: "2017-01-18T17:24Z",
  "updated_at: "2017-04-18T17:24Z",
  "url": "/companies/:company_id/incentives/codes/:code"
}

Code Issuance Entity

Elements & Attributes

Data ElementTypeDescription
idIntegerA unique identifier for each incentive pool. This is automatically generated by the Vibes system.
external_issuee_idStringUnique external issuee ID.
issuee_idStringVibes-generated issuee ID.
referring_applicationStringApplication issuing the code.
referring_application_ref_idStringApplication reference ID (campaign ID).
incentive_codeObjectAn object describing this issuance's incentive code.
incentive_code.codeStringIncentive code.
incentive_code.urlStringThe URL to access the incentive pool resource.
created_atTimestampThe date this issuance was created. It should be in the ISO 8601 format - for example: 2017-02-13T18:34Z.
updated_atTimestampThe date this issuance was last updated. It should be in the ISO 8601 format - for example: 2017-04-13T18:34Z.

Entity Example

The following is the JSON representation of a code issuance entity within the APIs.

{
  "id": 8,
  "external_issuee_id": "[email protected]",
  "issuee_id": "0eef8961-7568-485b-9b13-fc7dbd1cf712",
  "referring_application": "system",
  "referring_application_ref_id": "1234",
  "incentive_code": {
    "code": "aabb-ccdd",
    "url": "/companies/:company_id/incentives/codes/:code"
  },
  "incentive_pool": {
    "id": 1,
    "url": "/companies/:company_id/incentives/pools/:pool_id"
  },
  "updated_at": "2017-04-13T18:34Z",
  "created_at": "2017-02-13T18:34Z"
}

Code Redemption Entity

Elements & Attributes

Data ElementTypeDescription
idIntegerVibes-generated unique identifier for each redemption.
external_issuee_idStringUnique external ID for the user to whom the code was issued.
issuee_idStringVibes-generated ID for the user to whom the code was issued.
referring_applicationStringApplication redeeming the code.
referring_application_ref_idStringApplication reference ID (campaign ID).
incentive_codeObjectAn object describing this redemption's incentive code.
incentive_code.codeStringIncentive code.
incentive_code.urlStringIncentive code's URL.
incentive_poolObjectAn object describing the incentive pool this redemption’s code came from.
incentive_pool.idIntegerThe unique identifier for the pool.
incentive_pool.urlStringPool's URL.
created_atTimestampThe date this redemption was created. It should be in the ISO 8601 format - for example: 2017-04-13T18:34Z.
updated_atTimestampThe date this redemption was last updated. It should be in the ISO 8601 format - for example: 2017-02-13T18:34Z.

Example Entity

The following is the JSON representation of a code redemption entity within the APIs.

{
  "id": 8,
  "external_issuee_id": "[email protected]",
  "issuee_id": "0eef8961-7568-485b-9b13-fc7dbd1cf712",
  "referring_application": "system",
  "referring_application_ref_id": "1234",
  "incentive_code": {
    "code": "aabb-ccdd",
    "url": "/companies/:company_id/incentives/codes/:code"
  },
  "incentive_pool": {
    "id": 1,
    "url": "/companies/:company_id/incentives/pools/1"
  },
  "updated_at": "2017-04-13T18:34Z",
  "created_at": "2017-02-13T18:34Z"
}