unPLUGDevelopers

Test helpers API

Add a wallet item

POST/v1/test/members/{id}/wallet

Puts a reward in the member's wallet as an available item, without an offer or a tier. Use it to test the wallet screen and wallet redemptions at checkout. A reward.issued webhook fires.

Permissions: Sandbox secret key.

Guide

Sandbox

Request headers#

  • Idempotency-Keystring
    Any string up to 255 characters; use a UUID v4. Kept 24 hours per key (or member) and endpoint. Same key and body replays the first response with Idempotent-Replayed: true.
    Max Length 255

Path parameters#

  • idstring (uuid)Required

Request body#

  • reward_idstring (uuid)Required
    The reward to add.

Response fields#

Returns 201 with WalletItem

  • idstring (uuid)
    Send this as wallet_item_id on previews and redemptions.
  • rewardReward
    The reward, in the same shape as the catalog, with kind: "wallet" and no points_cost. Its rules apply at checkout.
    Show attributesReward
    • idstring (uuid)
      Send this as reward_id on previews and redemptions.
    • namestring
      For example Free drip coffee.
    • descriptionstring
      Short text for the guest.
    • image_urlstring (uri)Nullable
      HTTPS image URL.
    • kindstring
      points (catalog) or wallet (given to one member). May grow.
      One of points, wallet
    • points_costinteger
      Points the reward costs. Only on points rewards; wallet rewards don't have it.
    • discountDiscount
      Show attributesDiscount
      • typestring
        One of amount, percent, free_item, bogo
      • amount_centsinteger
        For amount.
      • percentnumber
        For percent.
      • itemsarray of object
        Item scope, by Square variation id.
        Show attributesHide attributes
        • pos_item_idstring
        • namestring
      • categoriesarray of object
        Category scope.
        Show attributesHide attributes
        • pos_category_idstring
        • namestring
      • max_itemsinteger
    • rulesRules
      Show attributesRules
      • min_subtotal_centsinteger
        Integer cents.
        Min 0
      • channelsarray of string
        One of app, web
      • location_idsarray of string (uuid)
      • fulfillmentarray of string
        One of pickup, delivery, curbside, dine_in
      • available_timesarray of AvailableTime
        Show attributesAvailableTime
        • daysarray of string
          Show valuesHide values
          • mon
          • tue
          • wed
          • thu
          • fri
          • sat
          • sun
        • startstring
          Local time, HH:MM.
        • endstring
          Local time, HH:MM.
      • tier_idsarray of string (uuid)
    • starts_atstring (date-time)Nullable
      When the reward becomes available. null means it already is.
    • ends_atstring (date-time)Nullable
      When it stops being available. null means no end date.
  • sourcestring
    How the member got it. See the table below. May grow.
    One of tier, offer, challenge, journey, support, birthday
  • offer_idstring (uuid)Nullable
    The offer, when source is offer.
  • statusstring
    available, reserved, used or expired.
    One of available, reserved, used, expired
  • issued_atstring (date-time)
    When it landed in the wallet.
  • expires_atstring (date-time)Nullable
    After this time it can't be used. null means it doesn't expire.
  • used_atstring (date-time)Nullable
    When an order used it.
  • order_idstring (uuid)Nullable
    The order that used it.

Error descriptions#

404Not found
member_not_found

No member with this id.

404Not found
reward_not_found

No reward with this id.

404Not found
not_found

Called on production.

Any endpoint can also return the common errors.