Data models
Every object the App 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.yaml, so you can generate types from them.
Model names are what you'll see in the OpenAPI file and in generated code. 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)RequiredLink to the docs for this error.titlestringRequiredstatusintegerRequiredShow valuesHide values
invalid_requestinvalid_parammissing_paraminvalid_api_keytoken_expiredmissing_scopenot_foundmember_not_foundmember_deletedexternal_id_takenphone_in_useidempotency_key_requiredidempotency_key_reusedrequest_in_progressrate_limitedinsufficient_pointsreward_not_foundreward_not_applicablereward_expiredreward_already_usedcode_invalidcode_expiredcode_limit_reachedredemption_expiredredemption_not_reservedone_redemption_per_orderorder_already_existsrefund_exceeds_orderlocation_not_foundchallenge_not_joinableinvalid_stateinternal_errorservice_unavailable
detailstringA sentence about this occurrence.paramstringNullableThe request field at fault, when there is one.order_idstring (uuid)Only onorder_already_exists: the order that was already credited.request_idstringRequiredSame as theRequest-Idheader.
ErrorCode#
Machine-readable error code. May grow.
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_unavailableReasonCode#
Why a reward or code doesn't apply. May grow.
below_minimum_subtotal, wrong_channel, wrong_location, wrong_fulfillment, outside_available_times, item_not_in_cart, tier_required, not_enough_points, per_member_limit_reached, budget_exhausted, not_started, expired, already_usedCursorList#
Cursor-paginated list. ?limit= (1 to 100, default 25) and ?cursor=.
dataarray of objectRequiredhas_morebooleanRequiredTrue when another page exists.next_cursorstringRequiredNullablePass ascursorto get the next page.
Address#
line1stringline2stringNullablecitystringregionstringpostal_codestringcountrystringISO 3166-1 alpha-2.
Program and catalog#
Program#
- GET
/v1/programresponse
brand_idstring (uuid)RequiredYour brand.namestringRequiredThe program name guests see, for exampleRewards.point_nameobjectRequiredsingularandplural, for exampleBeanandBeans. Use these in your UI instead of the word "points".Show attributesHide attributes
singularstringRequiredpluralstringRequired
earningobjectRequiredShow attributesHide attributes
typestringRequiredOne ofspend,visitpoints_per_dollarintegerWhentypeisspend.points_per_visitintegerWhentypeisvisit.roundingstringRequiredOne ofdownearn_onstringRequiredPoints are earned on the subtotal after discounts.One ofsubtotal
- Tiers from lowest to highest. Each has
id,name,min_lifetime_pointsand, when the tier gives one,upgrade_bonus_points(points added once when a member moves up into it). Tiers are based on lifetime points, so spending points never drops a member's tier.Show attributesTier
idstring (uuid)RequirednamestringRequiredmin_lifetime_pointsintegerRequiredupgrade_bonus_pointsintegerPoints added when a member reaches this tier.
default_time_zonestringRequiredIANA time zone used for anything that has no location, such as birthdays.currencystringRequiredISO 4217 code.USD.points_expiryobjectNullableComing soonComing soon{ "days_inactive": 365 }when points expire after a period with no activity. Points don't expire at launch, and the field is absent.Show attributesHide attributes
days_inactiveinteger
Tier#
idstring (uuid)RequirednamestringRequiredmin_lifetime_pointsintegerRequiredupgrade_bonus_pointsintegerPoints added when a member reaches this tier.
TierRef#
idstring (uuid)RequirednamestringRequired
Location#
- GET
/v1/locationsresponse
idstring (uuid)RequiredSend this aslocation_idon previews, redemptions and orders.namestringRequiredFor exampleSouth Congress.addressAddressline1,line2(ornull),city,region,postal_code,country(ISO 3166-1 alpha-2).Show attributesAddress
line1stringline2stringNullablecitystringregionstringpostal_codestringcountrystringISO 3166-1 alpha-2.
time_zonestringRequiredIANA time zone. Reward times and visit days at this location use it.posstringThe location's point of sale.square.One ofsquarepos_location_idstringThe Square location id. Match it against your own ordering system's location ids.statusstringRequiredliveornot_live. Only offer ordering atlivelocations.One oflive,not_live
Reward#
A reward is a discount a member can get. The catalog holds points rewards, which members buy with points at checkout. Rewards given to one member (from a tier, an offer, a birthday or support) have kind: "wallet" and appear only inside that member's wallet, in this same shape.
- GET
/v1/rewardsresponse - GET
/v1/rewards/{id}response
idstring (uuid)RequiredSend this asreward_idon previews and redemptions.namestringRequiredFor exampleFree drip coffee.descriptionstringShort text for the guest.image_urlstring (uri)NullableHTTPS image URL.kindstringRequiredpoints(catalog) orwallet(given to one member). May grow.One ofpoints,walletpoints_costintegerPoints the reward costs. Only onpointsrewards; wallet rewards don't have it.Show attributesDiscount
typestringRequiredOne ofamount,percent,free_item,bogoamount_centsintegerForamount.percentnumberForpercent.itemsarray of objectItem scope, by Square variation id.Show attributesHide attributes
pos_item_idstringnamestring
categoriesarray of objectCategory scope.Show attributesHide attributes
pos_category_idstringnamestring
max_itemsinteger
Show attributesRules
min_subtotal_centsintegerInteger cents.Min 0channelsarray of stringOne ofapp,weblocation_idsarray of string (uuid)fulfillmentarray of stringOne ofpickup,delivery,curbside,dine_inavailable_timesarray of AvailableTimeShow attributesAvailableTime
daysarray of stringShow valuesHide values
montuewedthufrisatsun
startstringLocal time, HH:MM.endstringLocal time, HH:MM.
tier_idsarray of string (uuid)
starts_atstring (date-time)NullableWhen the reward becomes available.nullmeans it already is.ends_atstring (date-time)NullableWhen it stops being available.nullmeans no end date.
An empty array in rules means no limit: "location_ids": [] works at every location. A reward limited to weekday mornings for pickup in the app looks like this:
Discount types#
type | Fields | What the guest gets |
|---|---|---|
amount | amount_cents | A fixed amount off the subtotal, or off the matching items when the reward has an item scope. |
percent | percent | A percentage off the subtotal, or off the matching items when the reward has an item scope. |
free_item | items or categories, max_items | Up to max_items matching items free. |
bogo | items or categories | Buy one matching item, get a second matching item free. |
The API works out the actual discount on a given cart. Show the discount_cents from a checkout preview rather than calculating it yourself.
Rules#
Empty arrays mean no limit.
min_subtotal_centsintegerInteger cents.Min 0channelsarray of stringOne ofapp,weblocation_idsarray of string (uuid)fulfillmentarray of stringOne ofpickup,delivery,curbside,dine_inavailable_timesarray of AvailableTimeShow attributesAvailableTime
daysarray of stringShow valuesHide values
montuewedthufrisatsun
startstringLocal time, HH:MM.endstringLocal time, HH:MM.
tier_idsarray of string (uuid)
Discount#
typestringRequiredOne ofamount,percent,free_item,bogoamount_centsintegerForamount.percentnumberForpercent.itemsarray of objectItem scope, by Square variation id.Show attributesHide attributes
pos_item_idstringnamestring
categoriesarray of objectCategory scope.Show attributesHide attributes
pos_category_idstringnamestring
max_itemsinteger
AvailableTime#
daysarray of stringShow valuesHide values
montuewedthufrisatsun
startstringLocal time, HH:MM.endstringLocal time, HH:MM.
Members and tokens#
Member#
- POST
/v1/membersresponse - GET
/v1/members/{id}response - GET
/v1/membersresponse - PATCH
/v1/members/{id}response
idstring (uuid)RequiredunPLUG's id for the member. Store it next to your user record.external_idstringNullableYour id for the guest, up to 128 characters.nullfor a guest who has only earned at the register and isn't linked to your login yet.Max Length 128statusstringRequiredactive. Themember.deletedwebhook carriesdeleted; after that, calls about the member return410 member_deleted.One ofactive,deletedfirst_namestringNullablelast_namestringNullableemailstring (email)NullableSaved in lowercase.phonestringNullableE.164, for example+15125550142.phone_verifiedbooleantruewhen you confirmed the guest owns the number, for example with an SMS code. Only verified phones link to existing members.birthdaystring (date)NullableYYYY-MM-DD.points_balanceintegerRequiredPoints the member has now. Never below zero.lifetime_pointsintegerRequiredAll points ever earned, used for tiers. Spending doesn't lower it.idandnameof the current tier.Show attributesTierRef
idstring (uuid)RequirednamestringRequired
next_tierobjectNullableid,nameandpoints_needed(lifetime points still to earn).nullat the top tier.Show attributesHide attributes
idstring (uuid)namestringpoints_neededinteger
communication_preferencesobjectShow attributesHide attributes
email_marketingbooleansms_marketingbooleanpush_marketingboolean
metadataobjectYour own string values. Up to 20 keys, 500 characters each. Don't put personal data here.linked_existingbooleanOnly 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)Requiredupdated_atstring (date-time)Required
MemberCreate#
- POST
/v1/membersrequest body
external_idstringRequiredMax Length 128first_namestringlast_namestringemailstring (email)phonestringE.164.phone_verifiedbooleanbirthdaystring (date)communication_preferencesobjectShow attributesHide attributes
email_marketingbooleansms_marketingbooleanpush_marketingboolean
metadataobject
MemberUpdate#
- PATCH
/v1/members/{id}request body
first_namestringlast_namestringemailstring (email)phonestringE.164. Secret key only.phone_verifiedbooleanSecret key only.birthdaystring (date)Set once from the app; a secret key can correct it.metadataobject
CommunicationPreferences#
email_marketingbooleanRequiredsms_marketingbooleanRequiredpush_marketingbooleanRequiredupdated_atstring (date-time)RequiredsourcestringRequiredSet automatically.One ofapp,web,api,unsubscribe_link
CommunicationPreferencesUpdate#
- PATCH
/v1/members/{id}/communication_preferencesrequest body
email_marketingbooleansms_marketingbooleanpush_marketingboolean
MemberTokenRequest#
Send member_id or external_id.
- POST
/v1/member_tokensrequest body
member_idstring (uuid)external_idstring
MemberToken#
- POST
/v1/member_tokensresponse
tokenstringRequiredOpaque, starts withmt_.expires_atstring (date-time)Requiredmember_idstring (uuid)Required
HostedTokenResponse#
Coming soon.
access_tokenstringA member token,mt_....token_typestringexpires_inintegerrefresh_tokenstringRotates on every use.member_idstring (uuid)
IdentificationCode Coming soon#
Coming soon. Valid for 5 minutes.
codestringRequiredqr_payloadstringRequiredexpires_atstring (date-time)Required
Activity and wallet#
ActivityEntry#
- GET
/v1/members/{id}/activityresponse
idstring (uuid)RequiredtypestringRequiredWhat happened. See the table below. May grow.One ofearn,bonus,redeem,adjust,reverse,expirepointsintegerRequiredSigned change:62for an earn,-500for a redeem.balance_afterintegerRequiredThe member'spoints_balanceright after this entry.descriptionstringA short line you can show the guest, for exampleVisit at South CongressorFree drip coffee.order_idstring (uuid)NullableThe order that caused it, forearn,bonus,redeemandreverse.reward_idstring (uuid)NullableThe reward bought, forredeem.adjustment_reasonstringNullableForadjust:goodwill,correction,migrationorother.One ofgoodwill,correction,migration,othercreated_atstring (date-time)Required
type | Meaning | Sign |
|---|---|---|
earn | Points from an order, in your app or at the register. | + |
bonus | Extra points from a promotion, a birthday or a tier upgrade. | + |
redeem | Points spent on a reward, when the order is credited. | - |
adjust | Points added or removed with a points adjustment. | + or - |
reverse | Points taken back or returned by a refund. | + or - |
expire Coming soon | Points that expired after a period with no activity. | - |
WalletItem#
- GET
/v1/members/{id}/walletresponse - POST
/v1/test/members/{id}/walletresponse
idstring (uuid)RequiredSend this aswallet_item_idon previews and redemptions.- The reward, in the same shape as the catalog, with
kind: "wallet"and nopoints_cost. Itsrulesapply at checkout.Show attributesReward
idstring (uuid)RequiredSend this asreward_idon previews and redemptions.namestringRequiredFor exampleFree drip coffee.descriptionstringShort text for the guest.image_urlstring (uri)NullableHTTPS image URL.kindstringRequiredpoints(catalog) orwallet(given to one member). May grow.One ofpoints,walletpoints_costintegerPoints the reward costs. Only onpointsrewards; wallet rewards don't have it.Show attributesDiscount
typestringRequiredOne ofamount,percent,free_item,bogoamount_centsintegerForamount.percentnumberForpercent.itemsarray of objectItem scope, by Square variation id.Show attributesHide attributes
pos_item_idstringnamestring
categoriesarray of objectCategory scope.Show attributesHide attributes
pos_category_idstringnamestring
max_itemsinteger
Show attributesRules
min_subtotal_centsintegerInteger cents.Min 0channelsarray of stringOne ofapp,weblocation_idsarray of string (uuid)fulfillmentarray of stringOne ofpickup,delivery,curbside,dine_inavailable_timesarray of AvailableTimeShow attributesAvailableTime
daysarray of stringShow valuesHide values
montuewedthufrisatsun
startstringLocal time, HH:MM.endstringLocal time, HH:MM.
tier_idsarray of string (uuid)
starts_atstring (date-time)NullableWhen the reward becomes available.nullmeans it already is.ends_atstring (date-time)NullableWhen it stops being available.nullmeans no end date.
sourcestringRequiredHow the member got it. See the table below. May grow.One oftier,offer,challenge,journey,support,birthdayoffer_idstring (uuid)NullableThe offer, whensourceisoffer.statusstringRequiredavailable,reserved,usedorexpired.One ofavailable,reserved,used,expiredissued_atstring (date-time)RequiredWhen it landed in the wallet.expires_atstring (date-time)NullableAfter this time it can't be used.nullmeans it doesn't expire.used_atstring (date-time)NullableWhen an order used it.order_idstring (uuid)NullableThe order that used it.
Statuses#
status | Meaning | Moves to |
|---|---|---|
available | The member can use it. | reserved when a redemption holds it, expired at expires_at. |
reserved | Held by a redemption while the guest pays. | used when the order is credited, available when the redemption is canceled or its 15-minute hold expires. |
used | An order used it. | available again if the order is fully refunded before expires_at. |
expired | Past expires_at without being used. | Nothing. Final. |
Sources#
source | Where it came from |
|---|---|
tier | A reward that comes with the member's tier. |
offer | A targeted offer sent to this member. offer_id is set. |
birthday | The program's birthday reward. |
journey | An unPLUG journey, for example a win-back message. |
support | Given by your team in the unPLUG dashboard, or by unPLUG support. |
challenge Coming soon | Completing a challenge. |
A reward.issued webhook fires when an item lands in a wallet, and reward.expiring fires 3 days before it expires. See Webhook event types.
Checkout and orders#
Cart#
Checkout preview request. Omit member_id for a guest with a code.
- POST
/v1/checkouts/previewrequest body
member_idstring (uuid)The member. Leave it out for a guest checkout with a code. With a member token it is always the token's member.location_idstring (uuid)RequiredFrom GET /v1/locations.channelstringRequiredapporweb.One ofapp,webfulfillmentstringRequiredpickup,delivery,curbsideordine_in. May grow.One ofpickup,delivery,curbside,dine_incurrencystringRequiredUSD.subtotal_centsintegerRequiredThe sum of every line (unit price plus modifiers, times quantity), before discounts, tax and tip.Min 0- The cart lines. See below.
Show attributesCartItem
line_idstringRequiredYour id for the line, unique within the cart.pos_item_idstringSquare catalog item variation id.namestringRequiredquantityintegerRequiredMin 1unit_price_centsintegerRequiredInteger cents.Min 0pos_category_idsarray of stringmodifiersarray of objectShow attributesHide attributes
pos_modifier_idstringnamestringprice_centsintegerInteger cents.Min 0
codesarray of stringreward_idsarray of string (uuid)wallet_item_idsarray of string (uuid)
Cart line#
CartItem#
line_idstringRequiredYour id for the line, unique within the cart.pos_item_idstringSquare catalog item variation id.namestringRequiredquantityintegerRequiredMin 1unit_price_centsintegerRequiredInteger cents.Min 0pos_category_idsarray of stringmodifiersarray of objectShow attributesHide attributes
pos_modifier_idstringnamestringprice_centsintegerInteger cents.Min 0
Preview#
- POST
/v1/checkouts/previewresponse
member_idstring (uuid)Nullablepoints_balanceintegerNullablepoints_to_earnintegerShow attributesPreviewEntry
typestringRequiredOne ofreward,wallet_item,codereward_idstring (uuid)wallet_item_idstring (uuid)codestringnamestringRequiredpoints_costintegerForreward.discount_centsintegerApplicable entries only.affected_line_idsarray of stringApplicable entries only.reasonReasonCodeShow valuesHide values
below_minimum_subtotalwrong_channelwrong_locationwrong_fulfillmentoutside_available_timesitem_not_in_carttier_requirednot_enough_pointsper_member_limit_reachedbudget_exhaustednot_startedexpiredalready_used
messagestringNot-applicable entries only. Safe to show guests.
Show attributesPreviewEntry
typestringRequiredOne ofreward,wallet_item,codereward_idstring (uuid)wallet_item_idstring (uuid)codestringnamestringRequiredpoints_costintegerForreward.discount_centsintegerApplicable entries only.affected_line_idsarray of stringApplicable entries only.reasonReasonCodeShow valuesHide values
below_minimum_subtotalwrong_channelwrong_locationwrong_fulfillmentoutside_available_timesitem_not_in_carttier_requirednot_enough_pointsper_member_limit_reachedbudget_exhaustednot_startedexpiredalready_used
messagestringNot-applicable entries only. Safe to show guests.
challenge_progressarray of objectFilled when challenges ship (coming soon).
PreviewEntry#
typestringRequiredOne ofreward,wallet_item,codereward_idstring (uuid)wallet_item_idstring (uuid)codestringnamestringRequiredpoints_costintegerForreward.discount_centsintegerApplicable entries only.affected_line_idsarray of stringApplicable entries only.reasonReasonCodeShow valuesHide values
below_minimum_subtotalwrong_channelwrong_locationwrong_fulfillmentoutside_available_timesitem_not_in_carttier_requirednot_enough_pointsper_member_limit_reachedbudget_exhaustednot_startedexpiredalready_used
messagestringNot-applicable entries only. Safe to show guests.
RedemptionRequest#
Send exactly one of reward_id, wallet_item_id or code.
- POST
/v1/redemptionsrequest body
member_idstring (uuid)location_idstring (uuid)RequiredchannelstringRequiredapporweb.One ofapp,webfulfillmentstringRequiredOne ofpickup,delivery,curbside,dine_incurrencystringRequiredISO 4217 code.USD.subtotal_centsintegerRequiredInteger cents.Min 0Show attributesCartItem
line_idstringRequiredYour id for the line, unique within the cart.pos_item_idstringSquare catalog item variation id.namestringRequiredquantityintegerRequiredMin 1unit_price_centsintegerRequiredInteger cents.Min 0pos_category_idsarray of stringmodifiersarray of objectShow attributesHide attributes
pos_modifier_idstringnamestringprice_centsintegerInteger cents.Min 0
reward_idstring (uuid)wallet_item_idstring (uuid)codestring
Redemption#
- POST
/v1/redemptionsresponse - GET
/v1/redemptions/{id}response - POST
/v1/redemptions/{id}/cancelresponse
idstring (uuid)RequiredSend it inredemption_idson the order.statusstringRequiredSee Redemption statuses.One ofreserved,captured,canceled,expired,reversedmember_idstring (uuid)Nullablenullfor a guest code.reward_idstring (uuid)NullableWhat was redeemed. One is set.wallet_item_idstring (uuid)NullableWhat was redeemed. One is set.codestringNullableWhat was redeemed. One is set.discount_centsintegerRequiredThe discount on the cart it was created for.Min 0points_costintegerRequiredPoints held, then spent on capture.0for wallet items and codes.affected_line_idsarray of stringCart lines the discount applies to.order_idstring (uuid)NullableThe order that captured it.expires_atstring (date-time)RequiredEnd of the hold, 15 minutes after creation.created_atstring (date-time)
OrderRequest#
- POST
/v1/ordersrequest body
external_order_idstringRequiredMax Length 128member_idstring (uuid)location_idstring (uuid)RequiredchannelstringRequiredapporweb.One ofapp,webfulfillmentstringRequiredOne ofpickup,delivery,curbside,dine_incurrencystringRequiredISO 4217 code.USD.subtotal_centsintegerRequiredInteger cents.Min 0Show attributesCartItem
line_idstringRequiredYour id for the line, unique within the cart.pos_item_idstringSquare catalog item variation id.namestringRequiredquantityintegerRequiredMin 1unit_price_centsintegerRequiredInteger cents.Min 0pos_category_idsarray of stringmodifiersarray of objectShow attributesHide attributes
pos_modifier_idstringnamestringprice_centsintegerInteger cents.Min 0
placed_atstring (date-time)Requireddiscount_centsintegerRequiredInteger cents.Min 0tax_centsintegerRequiredInteger cents.Min 0tip_centsintegerRequiredInteger cents.Min 0total_centsintegerRequiredInteger cents.Min 0redemption_idsarray of string (uuid)One at launch.Max Items 1attributionobjectComing soonComing soon.Show attributesHide attributes
link_idstring
Order#
- POST
/v1/ordersresponse - GET
/v1/orders/{id}response - GET
/v1/ordersresponse - POST
/v1/test/in_store_ordersresponse
idstring (uuid)RequiredunPLUG's id for the order.external_order_idstringNullableYour order id. Unique in your brand, forever.statusstringRequiredOne ofcredited,partially_refunded,refundedmember_idstring (uuid)Nullablenullfor a guest order, which earns nothing.location_idstring (uuid)RequiredchannelstringRequiredapporwebfor orders you send. Points earned at the register also show up, as orders within_store. May grow.One ofapp,web,in_storefulfillmentstringNullablepickup,delivery,curbsideordine_in.placed_atstring (date-time)When the guest placed the order. The earn rate and bonuses in force at this time apply.currencystringRequiredUSD.subtotal_centsintegerRequiredSum of the lines, before discounts, tax and tip.Min 0discount_centsintegerAll discounts on the order, including the unPLUG redemption.Min 0tax_centsintegerRecorded for reports. They never earn.Min 0tip_centsintegerRecorded for reports. They never earn.Min 0total_centsintegerWhat the guest paid: subtotal minus discount, plus tax and tip.Min 0itemsarray of CartItemThe cart lines, same shape as preview.Show attributesCartItem
line_idstringRequiredYour id for the line, unique within the cart.pos_item_idstringSquare catalog item variation id.namestringRequiredquantityintegerRequiredMin 1unit_price_centsintegerRequiredInteger cents.Min 0pos_category_idsarray of stringmodifiersarray of objectShow attributesHide attributes
pos_modifier_idstringnamestringprice_centsintegerInteger cents.Min 0
points_earnedintegerRequiredPoints from the earn rate, on the subtotal after discounts, rounded down.bonus_pointsintegerExtra points from promotions in force atplaced_at.redemptionsarray of object[{ "id", "status" }]for each redemption the order used.Show attributesHide attributes
idstring (uuid)statusstring
memberobjectNullable{ "points_balance", "tier" }right after the order was credited. Only on the create response and theorder.creditedwebhook.Show attributesHide attributes
points_balanceintegertierTierRefShow attributesTierRef
idstring (uuid)RequirednamestringRequired
created_atstring (date-time)RequiredWhen unPLUG recorded the order.
RefundRequest#
- POST
/v1/orders/{id}/refundsrequest body
external_refund_idstringRequiredamount_centsintegerPart of the subtotal refunded. Send this orfull.Min 1fullbooleanreasonstring
Refund#
- POST
/v1/orders/{id}/refundsresponse
idstring (uuid)Requiredorder_idstring (uuid)Requiredexternal_refund_idstringRequiredYour refund id.amount_centsintegerRequiredThe part of the subtotal after discounts that was refunded. For a full refund, everything not refunded before.Min 0fullbooleanRequiredtruefor a full refund.reasonstringNullableAs you sent it.points_reversedintegerRequiredEarned points taken back.points_shortfallintegerRequiredPoints that couldn't be taken back because the member had already spent them. The balance stops at zero.order_statusstringRequiredThe order's status after this refund:partially_refundedorrefunded.One ofpartially_refunded,refundedmember_idstring (uuid)NullableThe order's member.nullfor a guest order.memberobjectNullable{ "points_balance" }after the refund.nullfor a guest order.Show attributesHide attributes
points_balanceinteger
created_atstring (date-time)Required
Challenges#
Challenge Coming soon#
Coming soon.
- GET
/v1/challengesresponse
idstring (uuid)RequiredThe challenge.namestringRequiredShown to guests.descriptionstringOne or two lines for guests.image_urlstring (uri)NullableHTTPS image for the challenge card.typestringRequiredvisits,streak,spendormenu_discovery.One ofvisits,streak,spend,menu_discoverygoalobjectRequiredtarget(number to reach) andunit(visits,periods,centsoritems). Streaks addperiod(dayorweek) andgrace_periods. Menu discovery addsitem_set: items (pos_item_id,name) or categories (pos_category_id,name). Fields that don't apply arenullor empty.Show attributesHide attributes
targetintegerunitstringOne ofvisits,periods,cents,itemsperiodstringNullableOne ofday,weekgrace_periodsintegerNullableitem_setarray of object
qualifyingobjectWhich orders count:min_subtotal_cents,channels,location_ids,fulfillment,available_times(same shapes as reward rules; empty lists mean no limit) andmax_counted_per_day(default 1).Show attributesHide attributes
min_subtotal_centsintegerInteger cents.Min 0channelsarray of stringlocation_idsarray of string (uuid)fulfillmentarray of stringOne ofpickup,delivery,curbside,dine_inavailable_timesarray of AvailableTimeShow attributesAvailableTime
daysarray of stringShow valuesHide values
montuewedthufrisatsun
startstringLocal time, HH:MM.endstringLocal 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.enrollmentstringRequiredautomaticoropt_in.One ofautomatic,opt_inrewardobject 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_memberintegerUsually 1.budgetobjectmax_completionsacross all members, ornullfor no limit.Show attributesHide attributes
max_completionsintegerNullable
statusstringRequireddraft,scheduled,live,pausedorended.One ofdraft,scheduled,live,paused,endedversionintegerGoes up each time a scheduled or live challenge is edited. Members keep the rules of the version they joined.
MemberChallenge Coming soon#
Coming soon. A member's progress on a challenge. member_id appears in webhooks.
challenge_idstring (uuid)RequiredThe challenge.member_idstring (uuid)statusstringRequiredeligible(can join, not joined),enrolled,completedorexpired.One ofeligible,enrolled,completed,expiredprogressobjectRequiredcurrent,targetandunit. For streaks,periodslists each day or week withstarts_at,ends_atandmet; it's empty for other types.Show attributesHide attributes
currentintegertargetintegerunitstringOne ofvisits,periods,cents,itemsperiodsarray of objectShow attributesHide attributes
starts_atstring (date-time)ends_atstring (date-time)metboolean
window_ends_atstring (date-time)NullableWhen this member's window ends. For a rolling challenge they haven't joined,null.completed_atstring (date-time)NullableWhen they completed it, ornull.reward_wallet_item_idstring (uuid)NullableThe wallet item paid on completion, for catalog rewards.nullotherwise.
Devices, messages and app events#
Device#
device_idstringRequiredYour id for this install, up to 128 characters. Use a UUID you generate once and keep in app storage.member_idstring (uuid)RequiredThe member signed in on the device.platformstringRequirediosorandroid.One ofios,androidpush_tokenstringNullableThe push token from Firebase or APNs.nullif the app has none yet.token_typestringRequiredfcm(from the Firebase SDK) orapns(a raw APNs token, iOS only).One offcm,apnsapp_idstringiOS bundle id or Android package name. Must be an app support set up for your brand.push_enabledbooleanRequiredThe OS notification permission. Marketing consent is separate:communication_preferences.push_marketingon the member.app_versionstringYour app's version, for example4.2.0.os_versionstringFor example18.1.localestringBCP 47 tag, for exampleen-US.time_zonestringIANA name, for exampleAmerica/Chicago. unPLUG uses it for quiet hours.created_atstring (date-time)First registration.updated_atstring (date-time)Last change.
DeviceWrite#
- PUT
/v1/members/me/devices/{device_id}request body
platformstringRequiredOne ofios,androidpush_tokenstringNullableNull until the app has a token.token_typestringRequired withpush_token.One offcm,apnsapp_idstringRequiredpush_enabledbooleanRequiredOS notification permission.app_versionstringos_versionstringlocalestringtime_zonestring
Message#
A full-screen in-app message. Your app draws it.
- GET
/v1/members/me/messages/nextresponse - GET
/v1/members/me/messages/{id}response - GET
/v1/members/{id}/messages/nextresponse
idstring (uuid)RequiredSame asmessage_idin the push that carried it.layoutstringRequiredfull_image(the image fills the screen and carries the words) orimage_and_text(image on top, then title, body and buttons).One offull_image,image_and_textimage_urlstring (uri)HTTPS image.titlestringNullableHeading. Forfull_image, use it as the image's accessibility label.bodystringNullableText under the title.- The main button:
label,actionandurl.actionisopen_screen(a link in your scheme or on your link domain),open_url(https, open in a browser) orclose(urlisnull).Show attributesMessageButton
labelstringactionstringOne ofopen_screen,open_url,closeurlstringNullable
- Second button, same shape, or
null. offerobjectNullableAn offer to show with the message, ornull.codeis a promo code to show;wallet_item_idis an offer already in the member's wallet;textis one line to show next to it.Show attributesHide attributes
codestringNullablewallet_item_idstring (uuid)Nullabletextstring
displayobjectRequirednever_during: screens where the message must not appear. Always includescheckout.Show attributesHide attributes
never_duringarray of string
created_atstring (date-time)RequiredWhen unPLUG created it.expires_atstring (date-time)NullableDon't show it after this.
Your app always shows its own close button, whatever the buttons say.
MessageButton#
labelstringactionstringOne ofopen_screen,open_url,closeurlstringNullable
MessageEventRequest#
- POST
/v1/members/me/messages/{id}/eventsrequest body - POST
/v1/members/{id}/messages/{message_id}/eventsrequest body
typestringRequiredOne ofimpression,button_tap,closebuttonstringOne ofprimary,secondary
PushOpenRequest#
- POST
/v1/members/me/push_opensrequest body
message_idstring (uuid)Requiredopened_atstring (date-time)RequiredbuttonstringOne ofprimary,secondary
AppEvent#
event_idstring (uuid)RequirednamestringRequiredoccurred_atstring (date-time)Requiredmember_idstring (uuid)anonymous_idstringdevice_idstringRequiredsession_idstringRequiredpropertiesobjectNo personal data.
AppEventBatch#
- POST
/v1/app_eventsrequest body
- Min Items 1Max Items 100
Show attributesAppEvent
event_idstring (uuid)RequirednamestringRequiredoccurred_atstring (date-time)Requiredmember_idstring (uuid)anonymous_idstringdevice_idstringRequiredsession_idstringRequiredpropertiesobjectNo personal data.
Webhooks#
WebhookEndpoint#
- POST
/v1/webhook_endpointsresponse - GET
/v1/webhook_endpointsresponse - GET
/v1/webhook_endpoints/{id}response - PATCH
/v1/webhook_endpoints/{id}response - POST
/v1/webhook_endpoints/{id}/rotate_secretresponse
idstring (uuid)RequiredThe endpoint's id.urlstring (uri)RequiredWhere events are sent. HTTPS on a public hostname.descriptionstringNullableYour label, up to 255 characters.Max Length 255event_typesarray of stringRequiredTypes this endpoint gets, or["*"]for all types, including types added later. See Webhook event types.statusstringRequiredenabledordisabled. unPLUG setsdisabledafter 3 days of failed deliveries.One ofenabled,disabledsecretstringThe signing secret,whsec_followed by base64. Returned only when you create the endpoint or rotate the secret.created_atstring (date-time)RequiredWhen the endpoint was created.updated_atstring (date-time)RequiredWhen the endpoint last changed.
WebhookEndpointCreate#
- POST
/v1/webhook_endpointsrequest body
urlstring (uri)RequiredHTTPS on a public hostname.event_typesarray of stringRequiredMin Items 1descriptionstringMax Length 255
WebhookEndpointUpdate#
- PATCH
/v1/webhook_endpoints/{id}request body
urlstring (uri)event_typesarray of stringMin Items 1descriptionstringMax Length 255statusstringOne ofenabled,disabled
RotateSecretRequest#
- POST
/v1/webhook_endpoints/{id}/rotate_secretrequest body
expire_current_in_hoursintegerDefault 24. 0 stops the current secret now.Min 0Default 24
Event#
The same object is the body of every webhook and what the event log returns. Payloads for each type are on Webhook event types.
- POST
/v1/webhook_endpoints/{id}/testresponse - GET
/v1/eventsresponse - GET
/v1/events/{id}response
idstring (uuid)RequiredThe event's id. Same value as thewebhook-idheader, on every attempt and redelivery.typestringRequiredFor examplepoints.changed. The list may grow.Show valuesHide values
member.createdmember.updatedmember.deletedpoints.changedtier.changedreward.issuedreward.redeemedreward.expiringorder.creditedorder.refundedcommunication_preferences.updatedwebhook.testpoints.expiringchallenge.joinedchallenge.progressedchallenge.completedreferral.completed
created_atstring (date-time)RequiredWhen the change happened. Use it to order events.api_versionstringRequiredv1.livemodebooleanRequiredtruein production,falsein the sandbox.brand_idstring (uuid)RequiredYour brand.dataobjectRequiredShow attributesHide attributes
objectobjectRequiredSnapshot of the resource.previous_attributesobjectRequired
Delivery#
One attempt to send one event to one endpoint.
- GET
/v1/events/{id}/deliveriesresponse - POST
/v1/events/{id}/redeliverresponse
idstring (uuid)RequiredThe delivery attempt's id.event_idstring (uuid)RequiredThe event that was sent.webhook_endpoint_idstring (uuid)RequiredWhere it was sent.attemptintegerRequired1 for the first attempt, then counting up through the retries.Min 1statusstringRequiredpending,succeededorfailed.One ofpending,succeeded,failedstatus_codeintegerNullableHTTP status your server returned. Null if there was no response.response_msintegerNullableHow long your server took to respond, in milliseconds.errorstringNullableWhy it failed when there was no HTTP status, for exampletimeout,connection_refused,tls_errorordns_error.attempted_atstring (date-time)NullableWhen the attempt was made.next_retry_atstring (date-time)NullableWhen the next retry is scheduled. Null after a success or when retries have run out.
ActivityEntryEvent#
idstring (uuid)RequiredtypestringRequiredMay grow.expireis coming soon.One ofearn,bonus,redeem,adjust,reverse,expirepointsintegerRequiredSigned.balance_afterintegerRequireddescriptionstringorder_idstring (uuid)Nullablereward_idstring (uuid)Nullableadjustment_reasonstringNullableOne ofgoodwill,correction,migration,othercreated_atstring (date-time)Requiredmember_idstring (uuid)Required
WalletItemEvent#
idstring (uuid)RequiredShow attributesReward
idstring (uuid)RequiredSend this asreward_idon previews and redemptions.namestringRequiredFor exampleFree drip coffee.descriptionstringShort text for the guest.image_urlstring (uri)NullableHTTPS image URL.kindstringRequiredpoints(catalog) orwallet(given to one member). May grow.One ofpoints,walletpoints_costintegerPoints the reward costs. Only onpointsrewards; wallet rewards don't have it.Show attributesDiscount
typestringRequiredOne ofamount,percent,free_item,bogoamount_centsintegerForamount.percentnumberForpercent.itemsarray of objectItem scope, by Square variation id.Show attributesHide attributes
pos_item_idstringnamestring
categoriesarray of objectCategory scope.Show attributesHide attributes
pos_category_idstringnamestring
max_itemsinteger
Show attributesRules
min_subtotal_centsintegerInteger cents.Min 0channelsarray of stringOne ofapp,weblocation_idsarray of string (uuid)fulfillmentarray of stringOne ofpickup,delivery,curbside,dine_inavailable_timesarray of AvailableTimeShow attributesAvailableTime
daysarray of stringShow valuesHide values
montuewedthufrisatsun
startstringLocal time, HH:MM.endstringLocal time, HH:MM.
tier_idsarray of string (uuid)
starts_atstring (date-time)NullableWhen the reward becomes available.nullmeans it already is.ends_atstring (date-time)NullableWhen it stops being available.nullmeans no end date.
sourcestringRequiredOne oftier,offer,challenge,journey,support,birthdayoffer_idstring (uuid)NullablestatusstringRequiredOne ofavailable,reserved,used,expiredissued_atstring (date-time)Requiredexpires_atstring (date-time)Nullableused_atstring (date-time)Nullableorder_idstring (uuid)Nullablemember_idstring (uuid)Required
DeletedMember#
idstring (uuid)Requiredexternal_idstringNullablestatusstringRequireddeleted_atstring (date-time)Required
CommunicationPreferencesEvent#
email_marketingbooleanRequiredsms_marketingbooleanRequiredpush_marketingbooleanRequiredupdated_atstring (date-time)RequiredsourcestringRequiredSet automatically.One ofapp,web,api,unsubscribe_linkmember_idstring (uuid)Required
PointsExpiring#
Coming soon.
member_idstring (uuid)pointsintegerpoints_balanceintegerlast_activity_atstring (date-time)expires_atstring (date-time)
ReferralCompleted#
Coming soon.
idstring (uuid)referrer_member_idstring (uuid)referred_member_idstring (uuid)qualifying_order_idstring (uuid)Nullablecompleted_atstring (date-time)
WebhookTest#
webhook_endpoint_idstring (uuid)messagestring
Test helpers#
TestInStoreOrderRequest#
- POST
/v1/test/in_store_ordersrequest body
member_idstring (uuid)Requiredlocation_idstring (uuid)Requiredsubtotal_centsintegerRequiredInteger cents.Min 0
TestWebhookRequest#
- POST
/v1/test/webhooksrequest body
typestringRequiredEvent type. May grow.Show valuesHide values
member.createdmember.updatedmember.deletedpoints.changedtier.changedreward.issuedreward.redeemedreward.expiringorder.creditedorder.refundedcommunication_preferences.updatedwebhook.testpoints.expiringchallenge.joinedchallenge.progressedchallenge.completedreferral.completed