unPLUGDevelopers

Data models

Every object the Management API returns and every request body it accepts, field by field. Each model links to the endpoints that use it. The same models are in openapi-management.yaml, so you can generate types from them.

Fields marked required are always present in responses and must be sent in requests. nullable fields can be null.

Common#

Problem#

RFC 9457 problem details, served as application/problem+json.

  • typestring (uri)Required
    Link to the docs for this error.
  • titlestringRequired
  • statusintegerRequired
  • codeErrorCodeRequired
    Show valuesHide values
    • invalid_request
    • invalid_param
    • missing_param
    • invalid_api_key
    • token_expired
    • missing_scope
    • not_found
    • member_not_found
    • member_deleted
    • external_id_taken
    • phone_in_use
    • idempotency_key_required
    • idempotency_key_reused
    • request_in_progress
    • rate_limited
    • insufficient_points
    • reward_not_found
    • reward_not_applicable
    • reward_expired
    • reward_already_used
    • code_invalid
    • code_expired
    • code_limit_reached
    • redemption_expired
    • redemption_not_reserved
    • one_redemption_per_order
    • order_already_exists
    • refund_exceeds_order
    • location_not_found
    • challenge_not_joinable
    • invalid_state
    • internal_error
    • service_unavailable
  • detailstring
    A sentence about this occurrence.
  • paramstringNullable
    The request field at fault, when there is one.
  • order_idstring (uuid)
    Only on order_already_exists: the order that was already credited.
  • request_idstringRequired
    Same as the Request-Id header.

ErrorCode#

Machine-readable error code. May grow.

One of invalid_request, invalid_param, missing_param, invalid_api_key, token_expired, missing_scope, not_found, member_not_found, member_deleted, external_id_taken, phone_in_use, idempotency_key_required, idempotency_key_reused, request_in_progress, rate_limited, insufficient_points, reward_not_found, reward_not_applicable, reward_expired, reward_already_used, code_invalid, code_expired, code_limit_reached, redemption_expired, redemption_not_reserved, one_redemption_per_order, order_already_exists, refund_exceeds_order, location_not_found, challenge_not_joinable, invalid_state, internal_error, service_unavailable

CursorList#

Cursor-paginated list. ?limit= (1 to 100, default 25) and ?cursor=.

  • dataarray of objectRequired
  • has_morebooleanRequired
    True when another page exists.
  • next_cursorstringRequiredNullable
    Pass as cursor to get the next page.

Program and catalog#

TierRef#

  • idstring (uuid)Required
  • namestringRequired

Rules#

Empty arrays mean no limit.

  • 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)

Discount#

  • typestringRequired
    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

AvailableTime#

  • daysarray of string
    Show valuesHide values
    • mon
    • tue
    • wed
    • thu
    • fri
    • sat
    • sun
  • startstring
    Local time, HH:MM.
  • endstring
    Local time, HH:MM.

Members and tokens#

Member#

  • idstring (uuid)Required
    unPLUG's id for the member. Store it next to your user record.
  • external_idstringNullable
    Your id for the guest, up to 128 characters. null for a guest who has only earned at the register and isn't linked to your login yet.
    Max Length 128
  • statusstringRequired
    active. The member.deleted webhook carries deleted; after that, calls about the member return 410 member_deleted.
    One of active, deleted
  • first_namestringNullable
  • last_namestringNullable
  • emailstring (email)Nullable
    Saved in lowercase.
  • phonestringNullable
    E.164, for example +15125550142.
  • phone_verifiedboolean
    true when you confirmed the guest owns the number, for example with an SMS code. Only verified phones link to existing members.
  • birthdaystring (date)Nullable
    YYYY-MM-DD.
  • points_balanceintegerRequired
    Points the member has now. Never below zero.
  • lifetime_pointsintegerRequired
    All points ever earned, used for tiers. Spending doesn't lower it.
  • tierTierRefRequired
    id and name of the current tier.
    Show attributesTierRef
    • idstring (uuid)Required
    • namestringRequired
  • next_tierobjectNullable
    id, name and points_needed (lifetime points still to earn). null at the top tier.
    Show attributesHide attributes
    • idstring (uuid)
    • namestring
    • points_neededinteger
  • communication_preferencesobject
    Marketing consent: email_marketing, sms_marketing, push_marketing. See communication preferences.
    Show attributesHide attributes
    • email_marketingboolean
    • sms_marketingboolean
    • push_marketingboolean
  • metadataobject
    Your own string values. Up to 20 keys, 500 characters each. Don't put personal data here.
  • linked_existingboolean
    Only on create: true when an existing member was linked by verified phone.
  • enrolled_atstring (date-time)
    When the guest joined the program.
  • created_atstring (date-time)Required
  • updated_atstring (date-time)Required

MergeRequest#

Used by
  • source_member_idstring (uuid)Required

Activity and wallet#

ActivityEntry#

  • idstring (uuid)Required
  • typestringRequired
    What happened. See the table below. May grow.
    One of earn, bonus, redeem, adjust, reverse, expire
  • pointsintegerRequired
    Signed change: 62 for an earn, -500 for a redeem.
  • balance_afterintegerRequired
    The member's points_balance right after this entry.
  • descriptionstring
    A short line you can show the guest, for example Visit at South Congress or Free drip coffee.
  • order_idstring (uuid)Nullable
    The order that caused it, for earn, bonus, redeem and reverse.
  • reward_idstring (uuid)Nullable
    The reward bought, for redeem.
  • adjustment_reasonstringNullable
    For adjust: goodwill, correction, migration or other.
    One of goodwill, correction, migration, other
  • created_atstring (date-time)Required
typeMeaningSign
earnPoints from an order, in your app or at the register.+
bonusExtra points from a promotion, a birthday or a tier upgrade.+
redeemPoints spent on a reward, when the order is credited.-
adjustPoints added or removed with a points adjustment.+ or -
reversePoints taken back or returned by a refund.+ or -
expire Coming soonPoints that expired after a period with no activity.-

PointsAdjustmentRequest#

  • pointsintegerRequired
    Signed. Negative values never take the balance below zero.
  • reasonstringRequired
    One of goodwill, correction, migration, other
  • notestring
  • counts_toward_tierboolean
    Default false

Offers#

Offer Coming soon#

Coming soon.

  • idstring (uuid)Required
    The offer.
  • namestringRequired
    Shown to guests on wallet items and in checkout.
  • descriptionstring
    One or two lines for guests.
  • statusstringRequired
    draft, scheduled, live, paused or ended.
    One of draft, scheduled, live, paused, ended
  • versionintegerRequired
    Starts at 1. Goes up each time a scheduled or live offer is edited. Members keep the version they got.
  • discountDiscountRequired
    Same shape as a reward's discount: type is amount (amount_cents), percent (percent), free_item (items or categories, max_items) or bogo.
    Show attributesDiscount
    • typestringRequired
      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
    Same shape as a reward's rules: min_subtotal_cents, channels, location_ids, fulfillment, available_times, tier_ids. Empty lists mean no limit.
    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)
  • distributionstringRequired
    granted (lands in the wallet), shared_code (one code for everyone) or unique_codes (single-use codes from batches).
    One of granted, shared_code, unique_codes
  • shared_codestringNullable
    The code, for shared_code offers. Otherwise null.
  • per_member_limitintegerNullable
    How many times one member can use the offer. null for no limit.
  • budgetBudget
    max_redemptions and max_discount_cents (either can be null), and the running totals used_redemptions and used_discount_cents. Enforced at checkout.
    Show attributesBudget
    • max_redemptionsintegerNullable
    • max_discount_centsintegerNullable
    • used_redemptionsinteger
    • used_discount_centsinteger
  • starts_atstring (date-time)Nullable
    When it goes live. null to go live on publish.
  • ends_atstring (date-time)Nullable
    When it ends. null for no end date.
  • wallet_expiry_daysintegerNullable
    For granted offers: days a wallet item lasts after it's granted.
  • created_bystring
    api, dashboard or campaign.
    One of api, dashboard, campaign

OfferWrite#

Coming soon.

Used by
  • namestring
  • descriptionstring
  • discountDiscount
    Show attributesDiscount
    • typestringRequired
      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)
  • distributionstring
    One of granted, shared_code, unique_codes
  • shared_codestring
  • per_member_limitinteger
  • budgetobject
    Show attributesHide attributes
    • max_redemptionsinteger
    • max_discount_centsinteger
  • starts_atstring (date-time)
  • ends_atstring (date-time)
  • wallet_expiry_daysinteger

OfferPreview#

  • eligible_membersinteger
  • expected_redemptionsinteger
  • expected_cost_centsinteger
  • warningsarray of string

Budget#

  • max_redemptionsintegerNullable
  • max_discount_centsintegerNullable
  • used_redemptionsinteger
  • used_discount_centsinteger

GrantRequest#

Used by
  • grant_refstringRequired
  • member_idsarray of string (uuid)Required
    Max Items 500

GrantResult#

  • grantedinteger
  • skippedarray of Skipped
    Show attributesSkipped
    • member_idstring (uuid)
    • reasonstring

Skipped#

  • member_idstring (uuid)
  • reasonstring

CodeBatchRequest#

  • prefixstringRequired
  • quantityintegerRequired

CodeBatch#

  • idstring (uuid)
  • offer_idstring (uuid)
  • prefixstring
  • quantityinteger
  • statusstring
  • created_atstring (date-time)

PromoCode#

  • codestring
  • statusstring

Challenges#

Challenge Coming soon#

Coming soon.

  • idstring (uuid)Required
    The challenge.
  • namestringRequired
    Shown to guests.
  • descriptionstring
    One or two lines for guests.
  • image_urlstring (uri)Nullable
    HTTPS image for the challenge card.
  • typestringRequired
    visits, streak, spend or menu_discovery.
    One of visits, streak, spend, menu_discovery
  • goalobjectRequired
    target (number to reach) and unit (visits, periods, cents or items). Streaks add period (day or week) and grace_periods. Menu discovery adds item_set: items (pos_item_id, name) or categories (pos_category_id, name). Fields that don't apply are null or empty.
    Show attributesHide attributes
    • targetinteger
    • unitstring
      One of visits, periods, cents, items
    • periodstringNullable
      One of day, week
    • grace_periodsintegerNullable
    • item_setarray of object
  • qualifyingobject
    Which orders count: min_subtotal_cents, channels, location_ids, fulfillment, available_times (same shapes as reward rules; empty lists mean no limit) and max_counted_per_day (default 1).
    Show attributesHide attributes
    • min_subtotal_centsinteger
      Integer cents.
      Min 0
    • channelsarray of string
    • 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.
    • max_counted_per_dayinteger
  • windowobject or objectRequired
    { "kind": "fixed", "starts_at", "ends_at" } for the same dates for everyone, or { "kind": "rolling", "days" } for a window per member that starts when they join.
  • enrollmentstringRequired
    automatic or opt_in.
    One of automatic, opt_in
  • rewardobject or objectRequired
    { "kind": "points", "points" } for bonus points, or { "kind": "reward", "reward_id" } for a catalog reward that lands in the wallet.
  • max_completions_per_memberinteger
    Usually 1.
  • budgetobject
    max_completions across all members, or null for no limit.
    Show attributesHide attributes
    • max_completionsintegerNullable
  • statusstringRequired
    draft, scheduled, live, paused or ended.
    One of draft, scheduled, live, paused, ended
  • versioninteger
    Goes up each time a scheduled or live challenge is edited. Members keep the rules of the version they joined.

ChallengeWrite#

Coming soon.

Used by
  • namestring
  • descriptionstring
  • image_urlstring (uri)Nullable
  • typestring
    One of visits, streak, spend, menu_discovery
  • goalobject
    Show attributesHide attributes
    • targetinteger
    • unitstring
      One of visits, periods, cents, items
    • periodstringNullable
      One of day, week
    • grace_periodsintegerNullable
    • item_setarray of object
  • qualifyingobject
    Show attributesHide attributes
    • min_subtotal_centsinteger
      Integer cents.
      Min 0
    • channelsarray of string
    • 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.
    • max_counted_per_dayinteger
  • windowobject or object
  • enrollmentstring
    One of automatic, opt_in
  • rewardobject or object
  • max_completions_per_memberinteger
  • budgetobject
    Show attributesHide attributes
    • max_completionsintegerNullable

ChallengePreview#

  • audience_membersinteger
  • expected_completionsinteger
  • expected_pointsinteger
  • expected_cost_centsinteger
  • warningsarray of string

EnrollmentRequest#

  • member_idsarray of string (uuid)Required
    Max Items 500

EnrollmentResult#

  • enrolledinteger
  • skippedarray of Skipped
    Show attributesSkipped
    • member_idstring (uuid)
    • reasonstring

ChallengeTemplate#

  • idstring
  • namestring
  • descriptionstring
  • typestring
  • goalobject
  • qualifyingobject
  • window_kindstring
    One of fixed, rolling
  • window_daysinteger
  • enrollmentstring
    One of automatic, opt_in
  • suggested_rewardstring

Reports#

ReportFigures#

  • membersobject
    Show attributesHide attributes
    • totalinteger
    • newinteger
    • activeinteger
  • pointsobject
    Show attributesHide attributes
    • issuedinteger
    • redeemedinteger
    • adjustedinteger
    • outstandinginteger
  • rewardsobject
    Show attributesHide attributes
    • issuedinteger
    • redeemedinteger
    • discount_centsinteger
  • ordersobject
    Show attributesHide attributes
    • member_ordersinteger
    • member_sales_centsinteger
    • non_member_ordersinteger
    • non_member_sales_centsinteger

ProgramSummaryReport Coming soon#

Coming soon.

  • fromstring (date)
  • tostring (date)
  • location_idstring (uuid)Nullable
  • time_zonestring
  • currencystring
    ISO 4217 code. USD.
  • Show attributesReportFigures
    • membersobject
      Show attributesHide attributes
      • totalinteger
      • newinteger
      • activeinteger
    • pointsobject
      Show attributesHide attributes
      • issuedinteger
      • redeemedinteger
      • adjustedinteger
      • outstandinginteger
    • rewardsobject
      Show attributesHide attributes
      • issuedinteger
      • redeemedinteger
      • discount_centsinteger
    • ordersobject
      Show attributesHide attributes
      • member_ordersinteger
      • member_sales_centsinteger
      • non_member_ordersinteger
      • non_member_sales_centsinteger
  • daysarray of object + ReportFigures

RewardReportRow#

  • reward_idstring (uuid)
  • namestring
  • kindstring
    One of points, wallet
  • points_costintegerNullable
  • issuedinteger
  • redeemedinteger
  • points_spentinteger
  • discount_centsinteger

RewardsReport Coming soon#

Coming soon.

Used by
  • fromstring (date)
  • tostring (date)
  • time_zonestring
  • currencystring
    ISO 4217 code. USD.
  • dataarray of RewardReportRow
    Show attributesRewardReportRow
    • reward_idstring (uuid)
    • namestring
    • kindstring
      One of points, wallet
    • points_costintegerNullable
    • issuedinteger
    • redeemedinteger
    • points_spentinteger
    • discount_centsinteger