Loyalty API
UpdateResult1
Describes a tier defined by the shop.
Properties
ok
booleanrequiredIndicates 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.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
andupdated
. Some fields can also returnprovided
and/orcredited
and/orinvalid
and/orfailed
.message
stringrequired for failures, optional for successesA 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_code
stringrequired for failures, omitted for successesA machine-friendly stable error code corresponding to the error condition that has occurred.
Present for
failed
andinvalid
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.
pts
integeroptionalNumber 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.