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

# Add points to customer account



## OpenAPI

````yaml /loyalty/admin-api-swagger.json post /api/external/add-points
openapi: 3.0.1
info:
  description: ''
  title: Admin APIs
  version: 0.0.1
servers:
  - url: https://loyalty-admin.appstle.com
security: []
tags:
  - description: >-
      Admin APIs for enrolling customers into the loyalty program, retrieving
      customer loyalty details, and updating profile information such as birth
      date.
    name: Customer Enrollment & Profile
  - description: >-
      Admin APIs for managing customer point balances, transaction history,
      point earning rules, top customers leaderboard, and approving pending
      transactions.
    name: Points & Earn Rules
  - description: >-
      Admin APIs for redeeming customer points, managing redemption rules, and
      validating or updating discount codes generated through loyalty
      redemptions.
    name: Redemptions & Discount Codes
  - description: >-
      Admin APIs for retrieving storefront widget label translations consumed by
      the loyalty widget on the merchant's storefront.
    name: Storefront Widgets & Labels
paths:
  /api/external/add-points:
    post:
      tags:
        - Points & Earn Rules
      summary: Add points to customer account
      operationId: externalAddPoints
      parameters:
        - description: API key for authentication
          in: header
          name: X-API-Key
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerAddPointsLoyaltyRequestVM'
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                availablePoints: 350
                creditedPoints: 600
                currentVipTier: Gold
                customerStatus: ACTIVE
                pendingPoints: 0
                rewards: []
                spentAmount: 1250.99
                storeCreditBalance: 0
              schema:
                $ref: '#/components/schemas/CustomerLoyaltyResponseVM'
          description: Points successfully added to customer account
        '400':
          content:
            application/json:
              schema:
                example:
                  details: Points must be a positive number
                  error: Invalid request
                type: string
          description: Invalid request
        '401':
          content:
            application/json:
              schema:
                example:
                  error: Invalid API key
                type: string
          description: Unauthorized - Invalid or missing X-API-Key
      security:
        - X-API-Key: []
components:
  schemas:
    CustomerAddPointsLoyaltyRequestVM:
      description: >-
        Request containing customer ID/email, points to add, and optional
        description
      example:
        customerEmail: customer@example.com
        note: 'Compensation for delayed shipping - Order #1234'
        points: 50
      properties:
        customerEmail:
          description: >
            Customer's email address. Alternative to customerId for identifying
            the customer.

            Provide either customerId OR customerEmail, not both.

            Must be a valid email address that exists in your Shopify store.

            Email matching is case-insensitive.

            Example: customer@example.com
          example: customer@example.com
          nullable: true
          type: string
        customerId:
          description: >
            Shopify customer ID (numeric). Identifies which customer receives
            the points.

            Provide either customerId OR customerEmail, not both.

            Customer must be enrolled in the loyalty program.

            Example: 67890
          example: 67890
          format: int64
          nullable: true
          type: integer
        earnRuleId:
          description: >
            Optional: ID of an earn rule to associate with this point addition.

            Used for categorization and reporting purposes only.

            Does not affect point calculation - points parameter takes
            precedence.

            Helps group similar types of point additions in reports.

            Example: 10
          example: 10
          format: int64
          nullable: true
          type: integer
        note:
          description: >
            Optional but strongly recommended: Description of why points are
            being added.

            This note appears in the customer's transaction history and admin
            logs.

            Best practices:

            - Be specific about the reason

            - Include reference numbers (order ID, ticket ID, etc.)

            - Use consistent formatting for easier reporting

            Examples:

            - "Birthday bonus - January 2025"

            - "Compensation for delayed shipping - Order #1234"

            - "Referral bonus from external campaign"

            - "Migration - transferred from old system"

            - "Manual adjustment per support ticket #567"
          example: 'Compensation for delayed shipping - Order #1234'
          maxLength: 500
          nullable: true
          type: string
        points:
          description: >
            Number of points to add to the customer's account. Must be a
            positive number.

            Points are added to availablePoints immediately (not pending).

            Decimal values are supported for fractional points.

            Example: 50.0
          example: 50
          format: double
          minimum: 0.01
          type: number
      required:
        - points
      type: object
    CustomerLoyaltyResponseVM:
      properties:
        achievableTierId:
          format: int64
          type: integer
        availablePoints:
          format: double
          type: number
        createAt:
          format: date-time
          type: string
        creditedPoints:
          format: double
          type: number
        currentVipTier:
          type: string
        customerStatus:
          enum:
            - ACTIVE
            - INACTIVE
            - EXCLUDED
            - EXCLUDED_BY_CUSTOMER
          type: string
        dob:
          format: date
          type: string
        expiringPointsAmount:
          format: double
          type: number
        pendingPoints:
          format: double
          type: number
        pointsExpireAt:
          format: date-time
          type: string
        referralLink:
          type: string
        referredCompleted:
          format: int64
          type: integer
        rewardedForCreatingAccount:
          type: boolean
        rewardedForFacebook:
          type: boolean
        rewardedForInstagram:
          type: boolean
        rewardedForNewsLetter:
          type: boolean
        rewardedForPinterest:
          type: boolean
        rewardedForSharingOnFacebook:
          type: boolean
        rewardedForSharingOnX:
          type: boolean
        rewardedForSms:
          type: boolean
        rewardedForTiktok:
          type: boolean
        rewardedForTwitter:
          type: boolean
        rewardedForYoutube:
          type: boolean
        rewards:
          items:
            $ref: '#/components/schemas/CustomerReward'
          type: array
        spentAmount:
          format: double
          type: number
        storeCreditBalance:
          format: double
          type: number
        storeCreditCurrency:
          type: string
        vipTierExpiredAt:
          format: date-time
          type: string
      type: object
    CustomerReward:
      properties:
        amount:
          format: double
          type: number
        createAt:
          format: date-time
          type: string
        customerId:
          format: int64
          type: integer
        description:
          type: string
        discountCode:
          type: string
        discountCodeId:
          type: string
        expireDate:
          format: date-time
          type: string
        id:
          format: int64
          type: integer
        lastExpiryReminderSentDate:
          format: date-time
          type: string
        orderId:
          format: int64
          type: integer
        orderName:
          type: string
        pointRedeemRuleId:
          format: int64
          type: integer
        pointTransactionId:
          format: int64
          type: integer
        productData:
          type: string
        rewardType:
          enum:
            - STORE_CREDIT
            - DISCOUNT_CODE
            - POINTS
          type: string
        shop:
          type: string
        status:
          enum:
            - USED
            - UNUSED
            - REFUNDED
            - EXPIRED
            - SUBSCRIPTION_ACTIVE
            - CANCELED
          type: string
        usageCount:
          format: int64
          type: integer
        usedAt:
          format: date-time
          type: string
        variantId:
          format: int64
          type: integer
      required:
        - createAt
        - customerId
        - discountCode
        - shop
        - status
      type: object

````