API: POST Offer Activation
Overview
An offer activation is the relationship between an offer and a user's account or specific card sourced from the publisher of the offer. If an offer is account wide, you must include all cards that belong to the user to ensure that they will receive the offer reward no matter which card is used. If a new card is added to an account later on, a new offer activation must be created with the new card and the existing offer.
Offer activations are used by Banyan to know which receipts on the Banyan network to assess for offers. If an offer activation is missing either a consumer token or a card last four, it will not be considered for an offer redemption.
Banyan has an option on the offer object called always_on
. This flag indicates whether the offer needs a consumer to opt into the offer or whether it automatically applies to a given merchant. If an offer hasalways_on
= TRUE, then the offer automatically applies and activations do not apply to this offer. There is validation on the offer activation endpoint to ensure that none are created for an always on
offer.
Developers, please see the API reference for an interactive experience.
URL
api.banyan.com/rest/v1/offer/activation
Activations can now be sent in a batch. All single activation calls still need to have array brackets []
to be a successful call.
Remember this must be done after the offer has been created. To see those details please go here
Body
Name | Description | Type | Required | Notes |
---|---|---|---|---|
byn_offer_id | The ID of the offer that the activation belongs to | String | Yes | |
publisher_consumer_token | The unique ID your organization has for an account | String | Yes | |
cards | The cards that are valid for the offer | Array of strings | Yes | Requires that there be at least one card |
Example:
POST http://api.banyan.com/rest/v1/offer/activation
Bearer: {token_id}
Content-Type: application/json
Accept: application/json
[{
"byn_offer_id": "442576ba-f0e3-4236-b700-1035a19djd7a",
"publisher_consumer_token": "fe2576ba-f0e3-4256-b700-1035a19d9e7a",
"cards": ["4003"]
}]
Response
Name | Description | Type | Notes |
---|---|---|---|
id | Banyan created ID of the offer activation object. | String |
Example:
{
"data": [
{
"id": "5e811ab5-0be4-5b39-87a9-e2c5423c0cc5",
"byn_offer_id": "6edcde44-f440-5dc2-ad20-5369303a27b0",
"byn_publisher_id": 106,
"publisher_consumer_token": "fe2576ba-f0e3-4256-b700-1035a19d9e7a",
"cards": [
"4003"
],
"created_ts": "2022-12-06T21:44:27.474869Z",
"updated_ts": "2022-12-06T21:44:27.474869Z"
}
],
"errors": []
}
Error Code | Description | Examples |
---|---|---|
400 | Bad Request | 1. Offer activations with a null array of "cards" |
403 | Forbidden | |
404 | Not Found |
Updated 30 days ago