An Incentive Code Issuance entity is a record of an issuance of an incentive code.
Incentive Code Issuance Entity
The following is the JSON representation of an Incentive Code entity within the APIs.
Elements
{ "id" : 8 , "issuee_id" : "0eef8961-7568-485b-9b13-fc7dbd1cf712" , "referring_application" : "system" , "referring_application_ref_id" : "1234" , "incentive_code" : { "code" : "aabb-ccdd" , "url" : "/companies/:id/incentives/codes/:code" }, "incentive_pool" : { "id" : 1 , "url" : "/companies/:id/incentives/pools/:pool_id" }, "updated_at" : "2017-02-13T18:34:36Z" , "created_at" : "2017-02-13T18:34:36Z" } | ||
id | Integer | Vibes unique identifier for each issuance. |
external_issuee_id | String | Unique external issuee ID. |
issuee_id | String | Vibes generated issuee ID. |
referring_application | String | Application issuing the code. |
referring_application_ref_id | String | Application reference ID (campaign ID). |
incentive_code | Object | An object describing this issuance's incentive code. |
incentive_code.code | String | Incentive code. |
incentive_code.url | String | Incentive code's URL. |
incentive_pool | Object | An object describing this issuance's pool. |
incentive_pool.id | Integer | The unique identifier for the pool. |
incentive_pool.url | String | The URL to access the incentive pool resource. |
created_at | Timestamp | Issuance date. |
updated_at | Timestamp | The date this issuance was last updated. |
Get Issuances for an Incentive Code
GET /companies/:id/incentives/codes/:code/issuances
Response
An array of all issuances for the given code.
Issue an Incentive Code
POST /companies/:id/incentives/pools/:pool_id/issuances { "external_issuee_id": "312", "code": "aabb-ccdd", "referring_application": "system", "referring_application_ref_id" : "1234" }
Request Elements
Data Element | Required | Description |
---|---|---|
external_issuee_id | No | Unique external issuee ID. |
code | No | If provided, a specific code is issued. |
referring_application | Only in pools requiring a campaign_registration. | Application issuing the code. |
referring_application_ref_id | Only in pools requiring a campaign_registration. | Application reference ID. |
Response
It returns an issuance entity if there was an available code.
Note: An HTTP error code 422 is returned if there are not enough available codes to issue.
Code Issuance
The same code is issued when using the same issuee_id. An issuance entity is created after each successful issuance request.