Create Reward Store and Add Offer

Creates new reward store and then adds an offer to it using a specific offer ID. The API endpoints featured in this task can also support other kinds of maintenance decisions such as deactivating a store.

Sequence Diagram

See the overall flow for this task below.

DEVELOPER DEVELOPER CLIENT MIDDLEWARE CLIENT MIDDLEWARE SESSIONM SESSIONM CREATE REWARD STORE AND ADD OFFER Access platform development environment Create or edit reward store Return success message Add or edit reward store offer Return success message

API Endpoints & Constraints

POST /api/2.0/offers/rewardstores/create_or_edit
POST /api/2.0/offers/rewardstores/add_or_edit_offer

  • For the first endpoint, which creates a reward store, note the following: The call to create the store passes a request object that must contain the GUID for a point account. Without a string specified in the point_account_ids array, a reward store cannot be created.

  • For the second endpoint, which adds an offer to the reward store, note the following: Since the root_offer_id needs to be specified in order to edit the offer, whoever is implementing this function needs to keep track of the IDs of any offers created previously so they can be obtained later.