> ## 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.

# Create a loyalty program event

> Create a loyalty program event



## OpenAPI

````yaml openapi-loyalty.json POST /v1/loyalty/program_events
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/program_events:
    post:
      tags:
        - Loyalty Program Events
      summary: Create a loyalty program event
      description: Create a loyalty program event
      operationId: loyalty_program_events_create
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                earn_rate:
                  type: object
                  properties:
                    spend_amount:
                      type: number
                      description: >-
                        The amount spent that will be used to calculate the
                        points earnt.
                  required:
                    - spend_amount
                  description: >-
                    Spend details used to calculate points earned for an
                    earn-rate reward.
                expires_at:
                  type:
                    - integer
                    - 'null'
                  description: The date and time the points expire.
                loyalty_program:
                  type: string
                  description: The loyalty program ID.
                loyalty_program_override:
                  type:
                    - object
                    - 'null'
                  properties:
                    points:
                      type: integer
                      description: >-
                        The number of points to award. If provided, this will
                        override the default points set on the loyalty program.
                  required:
                    - points
                  description: >-
                    The number of points to award. If provided, this will
                    override the default points set on the loyalty program.
                recipient:
                  oneOf:
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - customer
                        customer:
                          type: string
                          minLength: 1
                          description: The customer ID
                      required:
                        - type
                        - customer
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - email
                        email:
                          type: string
                          format: email
                          description: The email address
                      required:
                        - type
                        - email
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - resident
                        resident:
                          type: string
                          minLength: 1
                          description: The resident ID
                      required:
                        - type
                        - resident
                  description: The recipient of the loyalty program event.
                statement_descriptor:
                  type:
                    - string
                    - 'null'
                  description: >-
                    The statement descriptor. This appears on the customer's
                    statement. If provided, this overrides the statement
                    descriptor set on the loyalty program.
              required:
                - loyalty_program
                - recipient
      responses:
        '200':
          description: Create a loyalty program event
          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_event
                  earn_rate:
                    type: object
                    properties:
                      spend_amount:
                        type: number
                        description: >-
                          The amount spent that will be used to calculate the
                          points earnt.
                    required:
                      - spend_amount
                    description: >-
                      Spend details used to calculate points earned for an
                      earn-rate reward.
                  expires_at:
                    type:
                      - integer
                      - 'null'
                    description: The date and time the points expire.
                  loyalty_program:
                    type: string
                    description: The loyalty program ID.
                  loyalty_program_override:
                    type:
                      - object
                      - 'null'
                    properties:
                      points:
                        type: integer
                        description: >-
                          The number of points to award. If provided, this will
                          override the default points set on the loyalty
                          program.
                    required:
                      - points
                    description: >-
                      The number of points to award. If provided, this will
                      override the default points set on the loyalty program.
                  recipient:
                    oneOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - customer
                          customer:
                            type: string
                            minLength: 1
                            description: The customer ID
                        required:
                          - type
                          - customer
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - email
                          email:
                            type: string
                            format: email
                            description: The email address
                        required:
                          - type
                          - email
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - resident
                          resident:
                            type: string
                            minLength: 1
                            description: The resident ID
                        required:
                          - type
                          - resident
                    description: The recipient of the loyalty program event.
                  statement_descriptor:
                    type:
                      - string
                      - 'null'
                    description: >-
                      The statement descriptor. This appears on the customer's
                      statement. If provided, this overrides the statement
                      descriptor set on the loyalty program.
                  status:
                    type: string
                    enum:
                      - expired
                      - pending
                      - succeeded
                    description: The status of the event.
                  value:
                    type:
                      - number
                      - 'null'
                    description: The points value of the event.
                required:
                  - id
                  - created
                  - object
                  - expires_at
                  - loyalty_program
                  - loyalty_program_override
                  - recipient
                  - statement_descriptor
                  - status
                  - value
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API Key authentication. Use "Bearer YOUR_API_KEY".

````