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

# Create Loyalty Point Grant

> Create a new loyalty point grant for a patient (manual grant by staff).



## OpenAPI

````yaml post /user/patient/{patient_id}/loyalty-points
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /user/patient/{patient_id}/loyalty-points:
    post:
      tags:
        - Loyalty Points
      summary: Create Loyalty Point Grant
      description: Create a new loyalty point grant for a patient (manual grant by staff).
      operationId: create_loyalty_point_grant_user_patient__patient_id__loyalty_points_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: patient_id
          in: path
          required: true
          schema:
            type: string
            title: Patient Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoyaltyPointGrantCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoyaltyPointMutationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LoyaltyPointGrantCreate:
      properties:
        patientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientid
        amount:
          type: integer
          minimum: 1
          title: Amount
          description: Points to grant
        amountRemaining:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Amountremaining
          description: Points remaining, defaults to amount
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        expiryDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expirydate
        memberId:
          anyOf:
            - type: string
            - type: 'null'
          title: Memberid
        creatorId:
          anyOf:
            - type: string
            - type: 'null'
          title: Creatorid
        sourceType:
          $ref: '#/components/schemas/LoyaltyPointSourceType'
          default: MANUAL
        sourceChargeItemId:
          anyOf:
            - type: string
            - type: 'null'
          title: Sourcechargeitemid
      type: object
      required:
        - amount
      title: LoyaltyPointGrantCreate
    LoyaltyPointMutationResponse:
      properties:
        grant:
          $ref: '#/components/schemas/LoyaltyPointGrantSummary'
        state:
          anyOf:
            - $ref: '#/components/schemas/LoyaltyPointState'
            - type: 'null'
      type: object
      required:
        - grant
      title: LoyaltyPointMutationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LoyaltyPointSourceType:
      type: string
      enum:
        - PURCHASE
        - MEMBERSHIP_CYCLE
        - PROMOTION
        - MANUAL
        - IMPORT
      title: LoyaltyPointSourceType
    LoyaltyPointGrantSummary:
      properties:
        id:
          type: string
          title: Id
        patientId:
          type: string
          title: Patientid
        amount:
          type: integer
          title: Amount
        amountRemaining:
          type: integer
          title: Amountremaining
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        expiryDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expirydate
        memberId:
          anyOf:
            - type: string
            - type: 'null'
          title: Memberid
        sourceType:
          $ref: '#/components/schemas/LoyaltyPointSourceType'
        createdDate:
          type: string
          format: date-time
          title: Createddate
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
        voidedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Voidedat
        creator:
          anyOf:
            - $ref: '#/components/schemas/UserTiny'
            - type: 'null'
      type: object
      required:
        - id
        - patientId
        - amount
        - amountRemaining
        - sourceType
        - createdDate
      title: LoyaltyPointGrantSummary
    LoyaltyPointState:
      properties:
        grants:
          $ref: '#/components/schemas/Page_LoyaltyPointGrantSummary_'
        available:
          $ref: '#/components/schemas/AvailableLoyaltyPointsResponse'
        log:
          items:
            $ref: '#/components/schemas/LoyaltyPointTransactionSummary'
          type: array
          title: Log
      type: object
      required:
        - grants
        - available
        - log
      title: LoyaltyPointState
      description: Complete server state needed to update loyalty-point query caches.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UserTiny:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier for the user.
        firstName:
          anyOf:
            - type: string
            - type: 'null'
          title: Firstname
          description: The user's first name.
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
          description: The user's last name.
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
          description: The user's phone number.
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: The user's email address.
        type:
          $ref: '#/components/schemas/UserType'
          description: The type of user.
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
          description: The location of the user.
      type: object
      required:
        - id
        - type
      title: UserTiny
    Page_LoyaltyPointGrantSummary_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/LoyaltyPointGrantSummary'
          type: array
          title: Data
        total:
          type: integer
          title: Total
      type: object
      required:
        - data
        - total
      title: Page[LoyaltyPointGrantSummary]
    AvailableLoyaltyPointsResponse:
      properties:
        totalAvailable:
          type: integer
          title: Totalavailable
        grants:
          items:
            $ref: '#/components/schemas/AvailableLoyaltyGrant'
          type: array
          title: Grants
        count:
          type: integer
          title: Count
        redemptionRateCentsPerPoint:
          type: integer
          title: Redemptionratecentsperpoint
      type: object
      required:
        - totalAvailable
        - grants
        - count
        - redemptionRateCentsPerPoint
      title: AvailableLoyaltyPointsResponse
    LoyaltyPointTransactionSummary:
      properties:
        id:
          type: string
          title: Id
        balanceId:
          type: string
          title: Balanceid
          description: ID of the loyalty grant this transaction belongs to
        type:
          $ref: '#/components/schemas/BalanceTransactionType'
        amount:
          type: integer
          title: Amount
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
        createdDate:
          type: string
          format: date-time
          title: Createddate
        actor:
          anyOf:
            - $ref: '#/components/schemas/UserTiny'
            - type: 'null'
      type: object
      required:
        - id
        - balanceId
        - type
        - amount
        - createdDate
      title: LoyaltyPointTransactionSummary
      description: One entry in a patient's loyalty-points activity log.
    UserType:
      type: string
      enum:
        - PROVIDER
        - PATIENT
        - ASSISTANT
      title: UserType
    AvailableLoyaltyGrant:
      properties:
        grantId:
          type: string
          title: Grantid
        remainingPoints:
          type: integer
          title: Remainingpoints
        totalPoints:
          type: integer
          title: Totalpoints
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        expiryDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expirydate
        createdDate:
          type: string
          format: date-time
          title: Createddate
      type: object
      required:
        - grantId
        - remainingPoints
        - totalPoints
        - createdDate
      title: AvailableLoyaltyGrant
    BalanceTransactionType:
      type: string
      enum:
        - REDEMPTION
        - REDEMPTION_REVERSAL
        - REFUND
        - ADJUSTMENT_INCREASE
        - ADJUSTMENT_DECREASE
        - EXPIRY
        - PURCHASE_REFUND
        - VOID
        - TRANSFER_OUT
        - TRANSFER_IN
      title: BalanceTransactionType

````