POST /api/public/v1/loyalty/updateSettings

Changed on

Replaces the settings of the organization's launched loyalty program, its tiers included, in one write; without points, tiers or termsDetails it keeps the stored ones. While points.enabled is false nothing earns, spends, welcomes or credits a birthday in points while balances stay, and the points fields are stored as sent, unchecked against one another until Points are switched on. stamps replaces the stamps settings and rows in the same write: a row with an id edits that active row, one without is new, and an active row left out is archived; editing or archiving a row moves no member's stamps or rewards, except that lowering an active row's stampsToCollect queues a fill of the members whose stamps on it now reach the new count. A row imageUrl must be the one that row already holds or a stamp image draft the organization uploaded through mediaDrafts.control, which the save adopts. Without stamps the stored stamps settings and rows stay. Refused with BAD_REQUEST when a stamp row's id is not an active row of the program, more than two rows are sent, a row's stampsToCollect is outside 2 to 10, a sent name is blank or over 30 characters (an edit without one keeps the stored name and a new row is named Reward), or it lacks an earn or a reward target, with BAD_REQUEST and refusal stampTargetUnavailable, publishing the row's position and the target as stampTarget, when a target is not in the organization's catalog or is archived, with BAD_REQUEST and refusal stampImageNotUploaded when a row's imageUrl is neither that row's stored image nor any stamp image draft the organization uploaded, with CONFLICT and refusal mediaDraftImageExpired when it is such a draft that was released or expired and must be uploaded again, and with FORBIDDEN and refusal stampsDisabled when stamps is sent while the stamps flag is off for the organization, and with BAD_REQUEST and refusal loyaltyBlocksOff when points.enabled is false while stamps are off, have no active row or the stamps flag is off for the organization. A save that changes the tiers, or finds a failed re-placement, deletes the failed re-placements and queues the re-placement of the members by the saved ladder unless tiers were off and stay off with no failed one to retry. Refused with NOT_FOUND before the first launch, with BAD_REQUEST and refusal cashbackAboveTier when Points and tiers are on and the cashback is above the first tier's, with BAD_REQUEST and refusal birthdayNeedsDateOfBirth when Points and the birthday bonus are on while signupFields.dateOfBirth is off, with BAD_REQUEST when the settings are otherwise invalid, and with FORBIDDEN and refusal loyaltyDisabled while the business switched Loyalty off, featureRestrictedByPlan while its plan restricts Loyalty, or featureNotEntitled while its plan lacks Loyalty. Refused with FORBIDDEN and refusal billingReadOnly once an overdue subscription's grace has run out, and subscriptionEnded once the business's verified base plan has ended with no eligible base in its place. Either refusal is lifted for this operation's category by an active plan grant whose plan allows it, which does not change the subscription's own standing. Refused with FORBIDDEN as paywallLocked when the caller is an Owner or Manager of a business the merchant Paywall locks: one with no verified subscription that has taken 5 orders while the Paywall's rollout reaches it, an order counting from its first saved line, whether or not it is paid or completed, until it is archived or cancelled before activation. Nothing is read or written; a verified subscription lifts the lock.

Request

  • Base URL
    https://app.fortuneos.ai
  • Auth
    none declared

Request body

object required
organizationId, string required
settings, object required
stamps, object

Response

OK

object required
status, 'draft' | 'live' | 'stopped' required
settings, object required
stamps, object

Changes

    • info

      added the new optional request property stamps/rows/items/name

    • info

      added the required property stamps/rows/items/name to the response with the status

    • info

      added the new optional request property settings/points

    1 more change in this revision