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

# Set Referral

> Applies a referral code to the user's cart if the referral code exists and is valid.



## OpenAPI

````yaml POST /cart/setReferral
openapi: 3.0.0
info:
  title: MineStoreCMS REST API
  description: Documentation for MineStoreCMS Frontend REST API.
  version: 3.8.7
servers:
  - url: https://v3.minestorecms.com/api
    description: Example URL of Demo Server
security: []
tags: []
paths:
  /cart/setReferral:
    post:
      tags:
        - cart
      summary: Apply a referral code to the user's cart
      description: >-
        Applies a referral code to the user's cart if the referral code exists
        and is valid.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ref_code
              properties:
                ref_code:
                  type: string
                  description: The referral code to be applied to the cart.
                  example: ABC123
      responses:
        '200':
          description: Successfully applied the referral code to the cart.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates if the referral code was successfully applied.
                  message:
                    type: string
                    description: >-
                      A message indicating the result of the referral code
                      application.
        '400':
          description: Bad Request - Invalid referral code or empty referral code.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates the operation was unsuccessful.
                  message:
                    type: string
                    description: Details about why the referral code was invalid or empty.
        '401':
          description: Unauthorized - Invalid or missing Access Token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates the operation was unsuccessful.
                  message:
                    type: string
                    description: Details about the unauthorized access or error.
      deprecated: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````