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

# Accept referral offer (POST)



## OpenAPI

````yaml /loyalty/storefront-api-swagger.json post /loyalty/cp/api/referral-rules/accept-offer
openapi: 3.0.1
info:
  description: ''
  title: Storefront APIs
  version: 0.0.1
servers:
  - url: https://loyalty-admin.appstle.com
security: []
tags:
  - description: >-
      Storefront APIs for the signed-in customer to enroll, enable the loyalty
      program, view their loyalty profile, sync metafields, and update profile
      attributes.
    name: Customer Enrollment & Profile
  - description: >-
      Storefront APIs for the signed-in customer to view point transactions,
      claim social-media reward points, and record store visits.
    name: Points & Earn Rules
  - description: >-
      Storefront APIs for the signed-in customer to redeem loyalty points for
      rewards or discount codes.
    name: Redemptions & Discount Codes
  - description: >-
      Storefront APIs for managing the signed-in customer's referral activity:
      generating referral URLs, sending invites, viewing referral history, and
      accepting referral offers.
    name: Referrals
  - description: >-
      Storefront APIs for the signed-in customer to submit product reviews and
      retrieve existing reviews for a product.
    name: Reviews
  - description: >-
      Storefront APIs for retrieving product and collection data, proxied
      through the Shopify Storefront API for loyalty widgets.
    name: Product Catalog
paths:
  /loyalty/cp/api/referral-rules/accept-offer:
    post:
      tags:
        - Referrals
      summary: Accept referral offer (POST)
      operationId: acceptReferralOfferPost
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReferralAcceptRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              example:
                discountCode: WELCOME20
                id: 12345
                message: >-
                  Referral accepted successfully! Use code WELCOME20 for 20% off
                  your first order.
                status: SUCCESS
              schema:
                $ref: '#/components/schemas/ReferralAcceptResponse'
          description: Referral offer accepted successfully
        '400':
          content:
            application/json:
              example:
                discountCode: null
                id: null
                message: This email has already been referred by another customer
                status: ERROR
              schema:
                $ref: '#/components/schemas/ReferralAcceptResponse'
          description: >-
            Invalid token or email, referral already accepted, or referral
            program not available
components:
  schemas:
    ReferralAcceptRequest:
      description: >-
        Referral acceptance request containing referral token and email address
        of the new customer
      properties:
        email:
          type: string
        token:
          type: string
      type: object
    ReferralAcceptResponse:
      properties:
        discountCode:
          type: string
        id:
          format: int64
          type: integer
        message:
          type: string
        status:
          enum:
            - SUCCESS
            - FAILED
          type: string
      type: object

````