Shared wallets for clubs and teams: the customer's groups, members, invitations and group points.
A loyalty group is a shared wallet for a club, team or Shopify B2B company, with its own balance in one of your store credits. Admins (ADMIN) send points from the group balance to members and manage who's in the group; members (MEMBER) can donate points to it or, if you allow it, ask it for points. You create groups and choose who can find and join them in the Toki app; every method acts as the signed-in customer, and amounts are whole points of the group's store credit.
getLoyaltyGroupsLists the customer's loyalty groups and their pending group invitations.getLoyaltyGroupReturns one of the customer's groups with its balance and the customer's role in it.findLoyaltyGroupsSearches the public groups the customer isn't in yet.joinLoyaltyGroupJoins a group, or asks to join one that needs an admin's approval.getLoyaltyGroupJoinRequestsLists the requests to join a group that are waiting for an admin, oldest first.approveLoyaltyGroupJoinRequestApproves a request to join a group, adding the customer who asked as a member.declineLoyaltyGroupJoinRequestDeclines a request to join a group.getLoyaltyGroupMembersLists a group's members, admins first, then in the order they joined.removeLoyaltyGroupMemberRemoves a member from a group.acceptLoyaltyGroupInvitationAccepts an invitation, adding the customer to the group with the invited role.declineLoyaltyGroupInvitationDeclines an invitation to a group.inviteLoyaltyGroupMemberInvites an email address to join a group as a member.resendLoyaltyGroupInvitationSends a pending invitation again, valid for another 7 days.revokeLoyaltyGroupInvitationCancels a pending invitation, so it can no longer be accepted.sendLoyaltyGroupPointsSends points from the group balance to a member.sendLoyaltyGroupPointsBatchSends the same number of points from the group balance to up to 100 members at once.donateLoyaltyGroupPointsMoves points from the customer's own balance to the group balance.requestLoyaltyGroupPointsAsks a group's admins for points from the group balance.getLoyaltyGroupBalanceRequestsLists pending point requests: the whole group's for admins, the customer's own for members.approveLoyaltyGroupBalanceRequestApproves a point request, sending the points from the group balance.declineLoyaltyGroupBalanceRequestDeclines a point request.cancelLoyaltyGroupBalanceRequestCancels the customer's own pending point request.getLoyaltyGroupTransfersLists the points that moved in and out of a group's balance, newest first.Lists the customer's loyalty groups and their pending group invitations.
Groups are sorted by name. Invitations are the pending ones sent to the customer's email address, newest first.
groupsLoyaltyGroup[]group_idstringPass it as groupId to the other methods.
namestringstatus"ACTIVE" | "ARCHIVED"ARCHIVED once you archive the group: it keeps its balance and history, and no longer takes new members, invitations, transfers, donations or point requests.
role"ADMIN" | "MEMBER"The customer's role in the group.
master_balancestring | nullThe group balance in points, as a string such as "12500.000000000000000000". For admins; null for members.
master_balance_displaystring | nullThe group balance formatted for display, such as 12,500 Points or $125. For admins; null for members.
current_user_balancestringThe customer's own balance of the group's store credit, in points, as a string.
current_user_balance_displaystringcurrent_user_balance formatted for display, such as 1,250 Points.
token_idstringThe store credit the group balance is held in.
token_namestring | nullThe store credit's name, such as Points.
settingsLoyaltyGroupSettingsallowPointRequestsbooleanWhether members can ask the group for points with requestLoyaltyGroupPoints.
visibility"PUBLIC" | "PRIVATE"PUBLIC groups show up in findLoyaltyGroups; PRIVATE groups don't.
joinPolicy"OPEN" | "APPROVAL_REQUIRED" | "INVITE_ONLY"How customers join with joinLoyaltyGroup: right away (OPEN), once an admin approves (APPROVAL_REQUIRED), or only by invitation (INVITE_ONLY).
invitationsLoyaltyGroupInvitation[]Answer them with acceptLoyaltyGroupInvitation or declineLoyaltyGroupInvitation.
invitation_idstringgroup_idstringgroup_namestringrole"ADMIN" | "MEMBER"The role the customer gets when they accept.
expires_atstringWhen the invitation expires, as an ISO 8601 date-time.
Returns one of the customer's groups with its balance and the customer's role in it.
Admins also get the group's invitations, which they can resend or revoke while pending. Rejects when the customer isn't in the group.
groupIdstringRequiredThe group's group_id.
groupLoyaltyGroupDetailsgroup_idstringnamestringstatus"ACTIVE" | "ARCHIVED"ARCHIVED once you archive the group: it keeps its balance and history, and no longer takes new members, invitations, transfers, donations or point requests.
role"ADMIN" | "MEMBER"The customer's role in the group.
master_balancestringThe group balance in points, as a string such as "12500.000000000000000000".
master_balance_displaystringThe group balance formatted for display, such as 12,500 Points or $125.
current_user_balancestringThe customer's own balance of the group's store credit, in points, as a string.
current_user_balance_displaystringcurrent_user_balance formatted for display.
token_idstringThe store credit the group balance is held in.
token_namestring | nullThe store credit's name, such as Points.
settingsLoyaltyGroupSettingsallowPointRequestsbooleanWhether members can ask the group for points with requestLoyaltyGroupPoints.
visibility"PUBLIC" | "PRIVATE"PUBLIC groups show up in findLoyaltyGroups; PRIVATE groups don't.
joinPolicy"OPEN" | "APPROVAL_REQUIRED" | "INVITE_ONLY"How customers join with joinLoyaltyGroup: right away (OPEN), once an admin approves (APPROVAL_REQUIRED), or only by invitation (INVITE_ONLY).
invitationsLoyaltyGroupInvitation[]OptionalAdmins only. Every invitation to the group, newest first.
invitation_idstringgroup_idstringemailstringThe invited email address.
role"ADMIN" | "MEMBER"The role the customer gets when they accept.
status"PENDING" | "ACCEPTED" | "DECLINED" | "REVOKED" | "EXPIRED"PENDING until the customer accepts or declines, or the invitation expires or is revoked.
expires_atstringWhen the invitation expires, as an ISO 8601 date-time: 7 days after it was last sent.
Searches the public groups the customer isn't in yet.
Returns up to 50 active groups with visibility PUBLIC, sorted by name. Use join_policy to offer the right action: join, ask to join, or wait for an invitation.
querystringText to look for in group names, up to 100 characters.
groupsAvailableLoyaltyGroup[]group_idstringPass it as groupId to joinLoyaltyGroup.
namestringjoin_policy"OPEN" | "APPROVAL_REQUIRED" | "INVITE_ONLY"How the customer can join: right away (OPEN), by asking an admin (APPROVAL_REQUIRED), or by invitation (INVITE_ONLY).
request_status"PENDING" | nullPENDING while the customer's request to join waits for an admin; otherwise null.
Joins a group, or asks to join one that needs an admin's approval.
With the OPEN join policy, the customer joins right away as a MEMBER and status is JOINED. With APPROVAL_REQUIRED, the request goes to the group's admins and status is PENDING; each admin gets a Toki Loyalty Group Join Requested event in your connected email and SMS tools. INVITE_ONLY groups reject the call, since customers join them by accepting an invitation.
Calling it again resolves with the same status.
groupIdstringRequiredThe group's group_id, from findLoyaltyGroups.
status"JOINED" | "PENDING"JOINED when the customer is in the group; PENDING while their request waits for an admin.
Lists the requests to join a group that are waiting for an admin, oldest first.
Only the group's admins can call it.
groupIdstringRequiredThe group's group_id.
requestsLoyaltyGroupJoinRequest[]request_idstringPass it as requestId to approve or decline the request.
user_idstringThe customer who asked to join.
namestring | nullThe customer's name, when Toki has one.
emailstring | nullcreated_atstringWhen they asked, as an ISO 8601 date-time.
Approves a request to join a group, adding the customer who asked as a member.
Only the group's admins can call it. The customer who asked joins with the MEMBER role.
groupIdstringRequiredThe group's group_id.
requestIdstringRequiredThe request's request_id, from getLoyaltyGroupJoinRequests.
requestobjectrequest_idstringstatus"APPROVED"membershipLoyaltyGroupMembershipThe new member's membership.
membership_idstringuser_idstringThe member's customer ID.
role"ADMIN" | "MEMBER"status"ACTIVE" | "REMOVED"joined_atstringWhen the customer joined, as an ISO 8601 date-time.
Declines a request to join a group.
Only the group's admins can call it. The customer who asked can send a new request later.
groupIdstringRequiredThe group's group_id.
requestIdstringRequiredThe request's request_id, from getLoyaltyGroupJoinRequests.
requestobjectrequest_idstringstatus"DECLINED"Lists a group's members, admins first, then in the order they joined.
Everyone in the group sees names and roles. Admins also get each member's user_id, email address and balance, to send points or remove members, and their query matches email addresses as well as names.
groupIdstringRequiredThe group's group_id.
offsetnumberdefault 0How many to skip.
limitnumberdefault 50How many to return, from 1 to 100.
querystringText to search for, up to 100 characters.
membersLoyaltyGroupMember[]membership_idstringnamestring | nullThe member's name, when Toki has one.
role"ADMIN" | "MEMBER"user_idstringOptionalAdmins only. Pass it as recipientUserId to send points, or as userId to removeLoyaltyGroupMember.
emailstring | nullOptionalAdmins only.
balancestringOptionalAdmins only. The member's own balance of the group's store credit, in points, as a string.
balance_displaystringOptionalAdmins only. balance formatted for display, such as 640 Points.
joined_atstringOptionalAdmins only. When they joined, as an ISO 8601 date-time.
pageInfoPageInfohasNextPagebooleanWhether more come after this page. Get them with offset set to offset + limit.
offsetnumberThe offset this page starts at.
limitnumberThe limit used for this page.
Removes a member from a group.
Only the group's admins can call it, for members with the MEMBER role; you manage admins in the Toki app. Points the member already received stay in their balance.
groupIdstringRequiredThe group's group_id.
userIdstringRequiredThe member's user_id, from getLoyaltyGroupMembers.
membershipLoyaltyGroupMembershipThe membership, now REMOVED.
membership_idstringuser_idstringThe member's customer ID.
role"ADMIN" | "MEMBER"status"ACTIVE" | "REMOVED"joined_atstringWhen the customer joined, as an ISO 8601 date-time.
removed_atstringWhen the member was removed, as an ISO 8601 date-time.
Accepts an invitation, adding the customer to the group with the invited role.
The invitation must be pending and sent to the customer's email address. Toki sends a Toki Loyalty Group Invitation Accepted event to your connected email and SMS tools.
invitationIdstringRequiredThe invitation's invitation_id, from getLoyaltyGroups.
invitationLoyaltyGroupInvitationThe invitation, now ACCEPTED.
invitation_idstringgroup_idstringemailstringThe invited email address.
role"ADMIN" | "MEMBER"The role the customer gets when they accept.
status"PENDING" | "ACCEPTED" | "DECLINED" | "REVOKED" | "EXPIRED"PENDING until the customer accepts or declines, or the invitation expires or is revoked.
expires_atstringWhen the invitation expires, as an ISO 8601 date-time: 7 days after it was last sent.
Declines an invitation to a group.
The invitation must be pending and sent to the customer's email address.
invitationIdstringRequiredThe invitation's invitation_id, from getLoyaltyGroups.
invitationLoyaltyGroupInvitationThe invitation, now DECLINED.
invitation_idstringgroup_idstringemailstringThe invited email address.
role"ADMIN" | "MEMBER"The role the customer gets when they accept.
status"PENDING" | "ACCEPTED" | "DECLINED" | "REVOKED" | "EXPIRED"PENDING until the customer accepts or declines, or the invitation expires or is revoked.
expires_atstringWhen the invitation expires, as an ISO 8601 date-time: 7 days after it was last sent.
Invites an email address to join a group as a member.
Only the group's admins can call it. The invitation is valid for 7 days; inviting an email again renews its pending invitation. If the email isn't in your program yet, Toki creates a member for it, so the invitation is waiting when they sign in.
Toki sends a Toki Loyalty Group Invitation Sent event to your connected email and SMS tools, such as Klaviyo, so you can email the invitation from there. Rejects for an email that's already in the group.
groupIdstringRequiredThe group's group_id.
emailstringRequiredThe email address to invite.
invitationLoyaltyGroupInvitationThe pending invitation.
invitation_idstringgroup_idstringemailstringThe invited email address.
role"ADMIN" | "MEMBER"The role the customer gets when they accept.
status"PENDING" | "ACCEPTED" | "DECLINED" | "REVOKED" | "EXPIRED"PENDING until the customer accepts or declines, or the invitation expires or is revoked.
expires_atstringWhen the invitation expires, as an ISO 8601 date-time: 7 days after it was last sent.
Sends a pending invitation again, valid for another 7 days.
Only the group's admins can call it. Toki sends the Toki Loyalty Group Invitation Sent event again. To invite someone whose invitation is no longer pending, use inviteLoyaltyGroupMember.
groupIdstringRequiredThe group's group_id.
invitationIdstringRequiredThe invitation's invitation_id, from getLoyaltyGroup.
invitationLoyaltyGroupInvitationThe invitation, with its new expires_at.
invitation_idstringgroup_idstringemailstringThe invited email address.
role"ADMIN" | "MEMBER"The role the customer gets when they accept.
status"PENDING" | "ACCEPTED" | "DECLINED" | "REVOKED" | "EXPIRED"PENDING until the customer accepts or declines, or the invitation expires or is revoked.
expires_atstringWhen the invitation expires, as an ISO 8601 date-time: 7 days after it was last sent.
Cancels a pending invitation, so it can no longer be accepted.
Only the group's admins can call it.
groupIdstringRequiredThe group's group_id.
invitationIdstringRequiredThe invitation's invitation_id, from getLoyaltyGroup.
invitationLoyaltyGroupInvitationThe invitation, now REVOKED.
invitation_idstringgroup_idstringemailstringThe invited email address.
role"ADMIN" | "MEMBER"The role the customer gets when they accept.
status"PENDING" | "ACCEPTED" | "DECLINED" | "REVOKED" | "EXPIRED"PENDING until the customer accepts or declines, or the invitation expires or is revoked.
expires_atstringWhen the invitation expires, as an ISO 8601 date-time: 7 days after it was last sent.
Sends points from the group balance to a member.
Only the group's admins can call it. The points move right away to the member's own balance, and Toki sends a Toki Loyalty Group Points Granted event to your connected email and SMS tools. Rejects when the group balance is too low.
groupIdstringRequiredThe group's group_id.
recipientUserIdstringRequiredThe member's user_id, from getLoyaltyGroupMembers.
amountnumberRequiredPoints to send: a whole number above 0.
idempotencyKeystringdefault crypto.randomUUID()A UUID that identifies this transfer. Pass the same key when you retry, and the points are sent once.
transferLoyaltyGroupTransfergroup_transfer_idstringrecipient_user_idstringThe member who received the points.
amountstringThe points sent, as a string such as "500".
created_atstringWhen the points moved, as an ISO 8601 date-time.
Sends the same number of points from the group balance to up to 100 members at once.
Only the group's admins can call it. Each recipient gets amount points, and the transfers go through together or not at all, so the group balance must cover amount times the number of recipients. Toki sends a Toki Loyalty Group Points Granted event for each recipient.
groupIdstringRequiredThe group's group_id.
recipientUserIdsstring[]RequiredFrom 1 to 100 members' user_ids, each listed once.
amountnumberRequiredPoints each recipient gets: a whole number above 0.
idempotencyKeystringdefault crypto.randomUUID()A UUID that identifies this batch. Pass the same key when you retry, and each member gets the points once.
transfersLoyaltyGroupTransfer[]One transfer per recipient, in the order of recipientUserIds.
group_transfer_idstringrecipient_user_idstringThe member who received the points.
amountstringThe points sent, as a string such as "500".
created_atstringWhen the points moved, as an ISO 8601 date-time.
Moves points from the customer's own balance to the group balance.
Anyone in the group can donate, admins included. Rejects when the customer doesn't have enough points.
groupIdstringRequiredThe group's group_id.
amountnumberRequiredPoints to donate: a whole number above 0.
idempotencyKeystringdefault crypto.randomUUID()A UUID that identifies this donation. Pass the same key when you retry, and the points move once.
donationLoyaltyGroupDonationgroup_transfer_idstringamountstringThe points donated, as a string such as "200".
created_atstringWhen the points moved, as an ISO 8601 date-time.
Asks a group's admins for points from the group balance.
Members with the MEMBER role can ask in groups where you allow point requests (settings.allowPointRequests). The request waits until an admin approves or declines it, or the customer cancels it; each admin gets a Toki Loyalty Group Points Requested event in your connected email and SMS tools. A customer has one pending point request at a time.
groupIdstringRequiredThe group's group_id.
amountnumberRequiredPoints to ask for: a whole number above 0.
descriptionstringA note for the admins, up to 500 characters.
idempotencyKeystringdefault crypto.randomUUID()A UUID that identifies this request. Pass the same key when you retry, and one request is created.
requestLoyaltyGroupPointRequestgroup_transfer_idstringPass it as groupTransferId to cancelLoyaltyGroupBalanceRequest.
amountstringThe points asked for, as a string such as "300".
descriptionstring | nullThe customer's note, if they added one.
created_atstringWhen the customer asked, as an ISO 8601 date-time.
Lists pending point requests: the whole group's for admins, the customer's own for members.
Newest first. Approved requests appear in getLoyaltyGroupTransfers.
groupIdstringRequiredThe group's group_id.
offsetnumberdefault 0How many to skip.
limitnumberdefault 50How many to return, from 1 to 100.
requestsLoyaltyGroupPointRequest[]group_transfer_idstringPass it as groupTransferId to approve, decline or cancel the request.
recipient_namestring | nullThe name of the member who asked.
amountstringThe points asked for, as a string such as "300".
amount_displaystringamount formatted for display, such as 300 Points.
descriptionstring | nullThe member's note, if they added one.
created_atstringWhen the member asked, as an ISO 8601 date-time.
recipient_user_idstringOptionalAdmins only. The member who asked.
recipient_emailstring | nullOptionalAdmins only.
pageInfoPageInfohasNextPagebooleanWhether more come after this page. Get them with offset set to offset + limit.
offsetnumberThe offset this page starts at.
limitnumberThe limit used for this page.
Approves a point request, sending the points from the group balance.
Only the group's admins can call it. The points move right away to the member's balance, and Toki sends a Toki Loyalty Group Points Granted event to your connected email and SMS tools. Rejects when the group balance is too low.
groupIdstringRequiredThe group's group_id.
groupTransferIdstringRequiredThe request's group_transfer_id, from getLoyaltyGroupBalanceRequests.
requestobjectgroup_transfer_idstringstatus"APPROVED"Declines a point request.
Only the group's admins can call it. No points move.
groupIdstringRequiredThe group's group_id.
groupTransferIdstringRequiredThe request's group_transfer_id, from getLoyaltyGroupBalanceRequests.
requestobjectgroup_transfer_idstringstatus"DECLINED"Cancels the customer's own pending point request.
Only the member who asked can cancel it. They can then send a new request.
groupIdstringRequiredThe group's group_id.
groupTransferIdstringRequiredThe request's group_transfer_id, from requestLoyaltyGroupPoints or getLoyaltyGroupBalanceRequests.
requestobjectgroup_transfer_idstringLists the points that moved in and out of a group's balance, newest first.
Includes points admins sent and approved point requests (TO_MEMBER), and donations to the group (TO_GROUP). Everyone in the group sees its history; admins also get member IDs, email addresses and request notes.
groupIdstringRequiredThe group's group_id.
offsetnumberdefault 0How many to skip.
limitnumberdefault 50How many to return, from 1 to 100.
transfersLoyaltyGroupTransfer[]group_transfer_idstringdirection"TO_MEMBER" | "TO_GROUP"TO_MEMBER: the group sent points to a member. TO_GROUP: a member donated points.
actor_namestring | nullWho moved the points: the admin who sent them or approved the request, or the member who donated.
recipient_namestring | nullThe member who received the points, for TO_MEMBER transfers.
amountstringThe points moved, as a string such as "500".
amount_displaystringamount formatted for display, such as 500 Points.
created_atstringWhen the points moved, as an ISO 8601 date-time; for a point request, when it was approved.
actor_user_idstringOptionalAdmins only. The customer behind actor_name.
actor_emailstring | nullOptionalAdmins only.
recipient_user_idstringOptionalAdmins only. The member behind recipient_name.
recipient_emailstring | nullOptionalAdmins only.
descriptionstring | nullOptionalAdmins only. The member's note on an approved point request.
pageInfoPageInfohasNextPagebooleanWhether more come after this page. Get them with offset set to offset + limit.
offsetnumberThe offset this page starts at.
limitnumberThe limit used for this page.