Updating Program Memberships for Existing Users
Updating an existing program membership allows you to modify specific fields of a user's membership, such as the external_user_id.
Updating Program Memberships
To update an existing program membership, you can make a PATCH
request to the /v2/program-memberships/:program_membership_id
endpoint.
Request Parameters
external_user_id
(optional): The external user ID you want to update the program membership with.phone
(optional): The phone number to update the program membership with. Note: this should be formatted with area code first like +17891234567. If you send in an unformatted number we will format and set to US as long as there is an area code privided.first_name
(optional): The user's first name.last_name
(optional): The user's last name.birthday
(optional): The user's birthday ("YYYY-MM-DD").family_member_birthdays
(optional): An array of objects, each representing a family member. Each object can include the following fields:first_name
(required): The first name of the family member.last_name
(optional): The last name of the family member.birthday
(required): The birthday ("YYYY-MM-DD") of the family member.status
(required): The status of the family member ("active"/"inactive").
Example Request
Response
If successful, the API will return a 200 OK status along with the details of the updated program membership.
Example Response
Implementing Program Membership Updates in Your Backend
After making the API call, Hang will update the selected program membership fields ( external_user_id
, phone
or a combination of them). Utilize the returned membership data to maintain accurate and up-to-date user information in your loyalty programs.
Error Handling
If the API encounters an error, a relevant error message will be returned to guide you through the troubleshooting process. For example, if there is an issue with the external_user_id
parameters, the API will return an error message describing the problem.
Last updated