Loyalty API endpoints specifics

This article is aimed at explaining a few of the Loyalty API endpoints. Understanding their behavior and requirements can help a lot during implementation. We will begin by some golden rules, and then, a parameter common to many endpoints.

Golden rules

When changing validity period, always put the end of validity after the beginning. It’s logical, but if you forget, it will create problems.

If you want to delete a value, please put null without quotes.

Cursor-based pagination

This new search method replaces the paging, and is more reliable: you can’t get twice the same item in the results, and it helps to compare.

The values for:

  • before and after:
    base64 array. Example: WyJWMDAxIiwxMF0=["V001",10]
    Here you use the extID and the internalId
  • previous and next:
    Values: URLs containing parameters + cursor. You only need to use these urls to go over the list.
    You only need to use these urls to go over the list.

Here is the list of the API endpoints working with cursor-based pagination:

# Update a member (PATCH)

This API call is used to modify the Loyalty member system and custom fields. Here is a list you should and should not modify:

This API call is used to modify the Loyalty member system and custom fields. Here is a list you should and should not modify:

FieldsSpecifics
card_codeDon’t modify
program_joined_atDon’t modify
card_expire_atIf the date is in the past, and you change to null or a date in the future, the cardcode is valid again
q_point and nq_pointSpecific endpoint to change the balance
BirthdayYou can modify
IndividualCan be modified once if the card is not currently linked to a contact.
custom fieldsYou can modify
tierSpecific endpoint to modify it (see next paragraph)

Change the tier (POST)

This API call is used to modify the tier (regular or VIP) of a Loyalty member.

The force_point parameter will attribute the missing amount of qpoints to reach the tier you specified in the body. If you don’t use this parameter, the member will be in the tier without the needed amount of qpoints.

# Rule completion (GET)

This API call is used to retreive the completion of a member of any rule.

FieldsSpecifics
completion_ratethe current percentage of completion of the rule by the member
already_matchedThe number of times the member has completed the rule

The completion rate can be displayed in the personal space of the member (website or app) to encourage to complete the rule to get the outcome.

# Create / edit a master reward (POST)

Once a Master Reward is created, only a few of its fields can be modified. The others need to stay the same.

Fields you can’t modifyFields you can modify
external_idlimited
priceauto_generated
nqp_valuepicture_path
holding_daysCustom fields
validity_interval_count

# Get a member’s eligible rewards

This API call is used by POS to check if a member is eligible to be granted a reward.