Loyalty API

UpdateResult1

Describes a tier defined by the shop.

Properties

  • okbooleanrequired

    Indicates if the new value has been successfully applied.

    This property summarizes the outcome to help you write code, especially when dealing with outcomes you do not yet know.

  • outcomeUpdateOutcomerequired

    Indicates the outcome of trying to apply this field.

    Possible outcomes depend on the exact field you are updating, and the configuration of the system. All fields support at least unchanged and updated. Some fields can also return provided and/or credited and/or invalid and/or failed.

  • messagestringrequired for failures, optional for successes

    A message to display to the user.

    Will be present for failure outcomes. It is your choice if you want to always display this exact string, or attempt to recognize known values of error_code and display customized messages for those.

    May also be present for successful outcomes, and in that case it is your choice whether you want to display it or not. It will be a confirmation message about updating the relevant field.

  • error_codestringrequired for failures, omitted for successes

    A machine-friendly stable error code corresponding to the error condition that has occurred.

    Present for failed and invalid outcomes (i.e. all failure ones).

    You can ignore this property, or you can recognize some known error codes and display custom messages if you want.

  • ptsintegeroptional

    Number of points that have been granted, if any.

    If the outcome is credited, indicates the number of points that have been added to the customer's account as a result of providing this field's value.

Previous
AvailableReward1