> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yorlet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a loyalty program

> Update a loyalty program



## OpenAPI

````yaml openapi-loyalty.json POST /v1/loyalty/programs/{id}
openapi: 3.1.0
info:
  title: Yorlet Loyalty API
  description: APIs for managing loyalty programs, events, residents, and tiers.
  version: 1.0.0
servers:
  - url: https://api.yorlet.com
    description: Production
  - url: https://api.yorlet.io
    description: Sandbox
security: []
paths:
  /v1/loyalty/programs/{id}:
    post:
      tags:
        - Loyalty Programs
      summary: Update a loyalty program
      description: Update a loyalty program
      operationId: loyalty_programs_update
      parameters:
        - schema:
            type: string
            description: The id identifier.
          required: true
          description: The id identifier.
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                archived:
                  type: boolean
                  description: >-
                    Whether the program is archived. Archived programs are not
                    visible to customers.
                budget:
                  type:
                    - object
                    - 'null'
                  properties:
                    maximum_points:
                      type:
                        - number
                        - 'null'
                      minimum: 1
                      description: >-
                        The maximum number of points that can be earned in the
                        time window.
                    time_window:
                      type: string
                      enum:
                        - all_time
                        - year
                        - month
                        - week
                        - day
                      description: The time window for the budget.
                  required:
                    - maximum_points
                    - time_window
                  title: Budget
                  description: The points budget for the loyalty program.
                description:
                  type: string
                  description: >-
                    The description of the loyalty program. This will be
                    displayed to customers.
                discoverable:
                  type: boolean
                  description: Whether the program is discoverable by residents in the app.
                metadata:
                  type:
                    - object
                    - 'null'
                  additionalProperties:
                    type: string
                  description: >-
                    Set of key-value pairs that you can attach to an object.
                    This can be useful for storing additional information about
                    the object in a structured format.
                name:
                  type: string
                  description: >-
                    The name of the loyalty program. Useful for organising your
                    programmes. Not shown to customers.
                statement_descriptor:
                  type:
                    - string
                    - 'null'
                  description: >-
                    The statement descriptor that will appear on the customer's
                    statement.
                tier:
                  type:
                    - string
                    - 'null'
                  pattern: ^[a-zA-Z0-9_]+$
                  description: The ID of the loyalty tier the program is associated with.
      responses:
        '200':
          description: Update a loyalty program
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the object.
                  created:
                    type: number
                    description: >-
                      Time at which the object was created. Measured in seconds
                      since the Unix epoch.
                  account:
                    type: string
                    description: >-
                      The account that the object belongs to. Only returned if
                      the request is made with a valid Yorlet-Context header.
                  deleted:
                    type: boolean
                    default: false
                    description: Only returned if the object has been deleted.
                  object:
                    type: string
                    enum:
                      - loyalty.program
                  archived:
                    type: boolean
                    description: >-
                      Whether the program is archived. Archived programs are not
                      visible to customers.
                  budget:
                    type:
                      - object
                      - 'null'
                    properties:
                      maximum_points:
                        type:
                          - number
                          - 'null'
                        minimum: 1
                        description: >-
                          The maximum number of points that can be earned in the
                          time window.
                      time_window:
                        type: string
                        enum:
                          - all_time
                          - year
                          - month
                          - week
                          - day
                        description: The time window for the budget.
                    required:
                      - maximum_points
                      - time_window
                    title: Budget
                    description: The points budget for the loyalty program.
                  description:
                    type:
                      - string
                      - 'null'
                    description: >-
                      The description of the loyalty program. This will be
                      displayed to customers.
                  discoverable:
                    type: boolean
                    description: >-
                      Whether the program is discoverable by residents in the
                      app.
                  expires_at:
                    type:
                      - integer
                      - 'null'
                    description: The date and time the program expires.
                  in_person:
                    type:
                      - object
                      - 'null'
                    properties:
                      url:
                        type: string
                        description: >-
                          The URL for the in-person check-in page for the
                          loyalty program.
                    required:
                      - url
                    description: The in_person object for the loyalty program.
                  name:
                    type: string
                    description: >-
                      The name of the loyalty program. Useful for organising
                      your programmes. Not shown to customers.
                  priority:
                    type: number
                    minimum: 0
                    maximum: 100
                    description: >-
                      The priority of for sorting loyalty programs. If not
                      specified, it will be set to the default value of 50. The
                      highest priority is 0 and the lowest is 100.
                  recipient_restriction:
                    type: string
                    enum:
                      - none
                      - residents
                    description: >-
                      Restrictions on who can receive points. Set to "none" for
                      no restrictions (any user in the OneMove network can
                      receive points). Set to "residents" to only allow
                      residents in your account to receive points.
                  reward:
                    oneOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - points
                          points:
                            type: number
                            minimum: 1
                            description: >-
                              The number of points to grant when the reward is
                              earned.
                        required:
                          - type
                          - points
                        title: Fixed points
                        description: Grant a fixed number of points to the customer.
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - earn_rate
                          points_per_unit:
                            type: integer
                            minimum: 1
                            description: >-
                              The number of points earned per `currency_unit` of
                              spend.
                          currency_unit:
                            type: integer
                            description: >-
                              The currency unit, in cents, used to calculate the
                              earn rate.
                          minimum_spend:
                            type: integer
                            minimum: 0
                            description: >-
                              The minimum spend, in cents, required to earn any
                              points.
                          maximum_points_per_transaction:
                            type: integer
                            minimum: 1
                            description: >-
                              The maximum number of points that can be earned in
                              a single transaction.
                        required:
                          - type
                          - points_per_unit
                          - currency_unit
                        title: Earn rate
                        description: Earn a rate of points based on the spend amount.
                    description: The reward configuration for the loyalty program.
                  statement_descriptor:
                    type:
                      - string
                      - 'null'
                    description: >-
                      The statement descriptor that will appear on the
                      customer's statement.
                  status:
                    type: string
                    enum:
                      - active
                      - expired
                      - consumed
                    description: The status of the loyalty program.
                  tier:
                    anyOf:
                      - type: string
                      - type: object
                        additionalProperties: {}
                      - type: 'null'
                    description: The tier object for the loyalty program.
                  type:
                    type: string
                    enum:
                      - rent_on_time
                      - tenure_milestone
                      - new_lease
                      - renewal
                      - move_in
                      - referral
                      - in_person
                      - one_time
                      - birthday
                      - custom
                      - onemove_payment
                    description: The type of the loyalty program.
                required:
                  - id
                  - created
                  - object
                  - archived
                  - budget
                  - description
                  - discoverable
                  - expires_at
                  - in_person
                  - name
                  - recipient_restriction
                  - reward
                  - statement_descriptor
                  - status
                  - tier
                  - type
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API Key authentication. Use "Bearer YOUR_API_KEY".

````