API: POST Offer Mapping

Overview

An offer mapping 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 mapping must be created with the new card and the existing offer.

Offer mappings are used by Banyan to know which receipts on the Banyan network to assess for offers. If an offer mapping is missing either a consumer token or a card last four, it will not be considered for an offer redemption.

In this POST, the offer id is supplied as part of the path and the body of the call has all of the details in it described above.

URL

api.banyan.com/rest/v1/offer/{{offer_id}}/mapping where offer_id is the byn_offer_id supplied after submitting an offer here

Body

NameDescriptionTypeRequiredNotes
byn_publisher_idThe ID given to your organization from BanyanNumericYesReach out to your Customer Support representative if you are unsure what your byn_publisher_id is
publisher_consumer_tokenThe unique ID your organization has for an accountStringYes
cardsThe cards that are valid for the offerArray of stringsYesRequires that there be at least one card

Example:

POST http://api.banyan.com/rest/v1/6edcde44-f440-5dc2-ad20-5369303a27b0/mapping
Bearer: {token_id}
Content-Type: application/json
Accept: application/json

{
    "byn_publisher_id": 106,
    "publisher_consumer_token": "fe2576ba-f0e3-4256-b700-1035a19d9e7a",
    "cards": ["4003"]
}

Response

NameDescriptionTypeNotes
idBanyan created ID of the offer mapping 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 CodeDescriptionExamples
400Bad Request1. Offer mappings with a null array of "cards"
403Forbidden
404Not Found