{
  "components": {
    "schemas": {
      "Customer": {
        "properties": {
          "availablePoints": {
            "format": "double",
            "type": "number"
          },
          "availableStoreCredits": {
            "format": "double",
            "type": "number"
          },
          "createAt": {
            "format": "date-time",
            "type": "string"
          },
          "customerId": {
            "format": "int64",
            "type": "integer"
          },
          "displayName": {
            "type": "string"
          },
          "dob": {
            "format": "date",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "emailBouncedOrFailed": {
            "type": "boolean"
          },
          "emailSetting": {
            "type": "string"
          },
          "enableEmail": {
            "type": "boolean"
          },
          "enableEmailMarketing": {
            "type": "boolean"
          },
          "enableSmsMarketing": {
            "type": "boolean"
          },
          "firstName": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "isDeletedFromShopify": {
            "type": "boolean"
          },
          "lastActivity": {
            "format": "date-time",
            "type": "string"
          },
          "lastMonthlyReminderSentDate": {
            "format": "date-time",
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "lastRewardExpiryReminderSentDate": {
            "format": "date-time",
            "type": "string"
          },
          "loyaltyProgramEnabled": {
            "type": "boolean"
          },
          "ordersCount": {
            "format": "int32",
            "type": "integer"
          },
          "pendingPoints": {
            "format": "double",
            "type": "number"
          },
          "phone": {
            "type": "string"
          },
          "redeemLimit": {
            "format": "int64",
            "type": "integer"
          },
          "redeemLimitOnce": {
            "format": "int64",
            "type": "integer"
          },
          "redeemedPoints": {
            "format": "double",
            "type": "number"
          },
          "shop": {
            "type": "string"
          },
          "skipReview": {
            "type": "boolean"
          },
          "spentAmount": {
            "format": "double",
            "type": "number"
          },
          "status": {
            "enum": [
              "ACTIVE",
              "INACTIVE",
              "EXCLUDED",
              "EXCLUDED_BY_CUSTOMER"
            ],
            "type": "string"
          },
          "storeCreditAccountId": {
            "type": "string"
          },
          "tags": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "updatedSettings": {
            "type": "string"
          },
          "vipAssignType": {
            "enum": [
              "MANUAL",
              "AUTO_RENEWAL",
              "RENEWAL_ON_HIGHER_TIER"
            ],
            "type": "string"
          },
          "vipTier": {
            "type": "string"
          },
          "vipTierAmount": {
            "format": "double",
            "type": "number"
          },
          "vipTierExpiredAt": {
            "format": "date-time",
            "type": "string"
          },
          "vipTierId": {
            "format": "int64",
            "type": "integer"
          },
          "vipTierSummary": {
            "type": "string"
          }
        },
        "required": [
          "availablePoints",
          "createAt",
          "customerId",
          "pendingPoints",
          "shop"
        ],
        "type": "object"
      },
      "CustomerBirthDateRequestVM": {
        "description": "Customer birth date update request containing the date of birth",
        "example": {
          "customerId": 0,
          "dob": "2026-01-12",
          "status": "ACTIVE"
        },
        "properties": {
          "customerId": {
            "description": "Unique identifier of the customer",
            "example": 0,
            "format": "int64",
            "type": "integer"
          },
          "dob": {
            "description": "Customer date of birth",
            "example": "2026-01-12",
            "format": "date",
            "type": "string"
          },
          "status": {
            "description": "Customer loyalty status",
            "enum": [
              "ACTIVE",
              "INACTIVE",
              "EXCLUDED",
              "EXCLUDED_BY_CUSTOMER",
              "ACTIVE",
              "INACTIVE",
              "EXCLUDED",
              "EXCLUDED_BY_CUSTOMER"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerLoyaltyRequestVM": {
        "description": "Point redemption request details including redeem rule ID, points to redeem, and optional variant ID for product rewards",
        "example": {
          "customerId": 67890,
          "points": 100.0,
          "redeemRuleId": 5,
          "variantId": 12345678
        },
        "properties": {
          "customerEmail": {
            "description": "Customer's email address. Alternative to customerId for identifying the customer.\nProvide either customerId OR customerEmail, not both.\nMust be a valid email address that exists in your Shopify store.\nExample: customer@example.com\n",
            "example": "customer@example.com",
            "nullable": true,
            "type": "string"
          },
          "customerId": {
            "description": "Shopify customer ID (numeric). Identifies which customer is redeeming points.\nProvide either customerId OR customerEmail, not both.\nExample: 67890\n",
            "example": 67890,
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "points": {
            "description": "Number of points to redeem. Must be positive.\nIf not provided, uses the default points value from the redemption rule.\nCustomer must have at least this many available points.\nExample: 100.0\n",
            "example": 100.0,
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "redeemRuleId": {
            "description": "ID of the redemption rule to use. Determines what reward the customer receives.\nUse GET /api/external/point-redeem-rules to get available redemption options.\nMust be an active redemption rule configured in your loyalty program.\nExample: 5\n",
            "example": 5,
            "format": "int64",
            "type": "integer"
          },
          "variantId": {
            "description": "Shopify product variant ID. Required when redeeming for product-specific rewards (free product).\nNot required for discount codes or store credit rewards.\nMust be a valid variant ID from your Shopify catalog.\nExample: 12345678\n",
            "example": 12345678,
            "format": "int64",
            "nullable": true,
            "type": "integer"
          }
        },
        "required": [
          "redeemRuleId"
        ],
        "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"
          },
          "vipTierSpentAmount": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "CustomerReferral": {
        "properties": {
          "claimAt": {
            "format": "date-time",
            "type": "string"
          },
          "createAt": {
            "format": "date-time",
            "type": "string"
          },
          "customerId": {
            "format": "int64",
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "pixelData": {
            "type": "string"
          },
          "referralNote": {
            "type": "string"
          },
          "referralRewarded": {
            "type": "boolean"
          },
          "referralRuleId": {
            "format": "int64",
            "type": "integer"
          },
          "referredEmailId": {
            "type": "string"
          },
          "referredNote": {
            "type": "string"
          },
          "referredRewarded": {
            "type": "boolean"
          },
          "shop": {
            "type": "string"
          },
          "status": {
            "enum": [
              "PENDING",
              "CLAIMED",
              "RECURRING"
            ],
            "type": "string"
          }
        },
        "required": [
          "createAt",
          "customerId",
          "referredEmailId",
          "shop",
          "status"
        ],
        "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"
      },
      "EnrollCustomerRequestVM": {
        "description": "Customer enrollment request, optionally containing VIP tier name",
        "properties": {
          "vipTier": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Pageable": {
        "properties": {
          "page": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "size": {
            "format": "int32",
            "minimum": 1,
            "type": "integer"
          },
          "sort": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "PointTransaction": {
        "properties": {
          "autoApprovalDays": {
            "format": "int32",
            "type": "integer"
          },
          "contractId": {
            "type": "string"
          },
          "createAt": {
            "format": "date-time",
            "type": "string"
          },
          "customerId": {
            "format": "int64",
            "type": "integer"
          },
          "displayName": {
            "type": "string"
          },
          "earnRuleId": {
            "format": "int64",
            "type": "integer"
          },
          "earnRuleName": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "imported": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          },
          "orderFinancialStatus": {
            "type": "string"
          },
          "orderFulfillmentStatus": {
            "type": "string"
          },
          "orderId": {
            "format": "int64",
            "type": "integer"
          },
          "orderLineItemId": {
            "format": "int64",
            "type": "integer"
          },
          "orderName": {
            "type": "string"
          },
          "pointType": {
            "enum": [
              "DEBIT",
              "CREDIT"
            ],
            "type": "string"
          },
          "points": {
            "format": "double",
            "type": "number"
          },
          "reason": {
            "type": "string"
          },
          "redeemRuleName": {
            "type": "string"
          },
          "redeemRuleRuleId": {
            "format": "int64",
            "type": "integer"
          },
          "reviewReference": {
            "type": "string"
          },
          "rewardType": {
            "enum": [
              "STORE_CREDIT",
              "DISCOUNT_CODE",
              "POINTS"
            ],
            "type": "string"
          },
          "shop": {
            "type": "string"
          },
          "spentAmount": {
            "format": "double",
            "type": "number"
          },
          "status": {
            "enum": [
              "APPROVED",
              "PENDING",
              "REJECTED"
            ],
            "type": "string"
          },
          "transactionRule": {
            "enum": [
              "ADJUSTMENT",
              "EARN_RULE",
              "REDEEM_RULE",
              "REFERRAL"
            ],
            "type": "string"
          }
        },
        "required": [
          "customerId",
          "pointType",
          "points"
        ],
        "type": "object"
      },
      "ProductReview": {
        "description": "Product review submission containing rating, title, body, product details, and optional uniqueId for order linking",
        "properties": {
          "archived": {
            "type": "boolean"
          },
          "body": {
            "type": "string"
          },
          "carousel": {
            "type": "boolean"
          },
          "createAt": {
            "format": "date-time",
            "type": "string"
          },
          "customerId": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "originalReviewBody": {
            "type": "string"
          },
          "originalReviewTitle": {
            "type": "string"
          },
          "pinned": {
            "type": "boolean"
          },
          "productHandle": {
            "type": "string"
          },
          "productId": {
            "format": "int64",
            "type": "integer"
          },
          "productImage": {
            "type": "string"
          },
          "productTitle": {
            "type": "string"
          },
          "publishedStatus": {
            "type": "boolean"
          },
          "rating": {
            "format": "int32",
            "type": "integer"
          },
          "replayBody": {
            "type": "string"
          },
          "replayDate": {
            "format": "date-time",
            "type": "string"
          },
          "reviewEditReason": {
            "type": "string"
          },
          "reviewSource": {
            "enum": [
              "WEB_PAGE",
              "API",
              "IMPORT"
            ],
            "type": "string"
          },
          "reviewerEmail": {
            "type": "string"
          },
          "reviewerName": {
            "type": "string"
          },
          "shop": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "uniqueId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "createAt",
          "shop"
        ],
        "type": "object"
      },
      "ProductReviewDTO": {
        "properties": {
          "body": {
            "type": "string"
          },
          "createAt": {
            "format": "date-time",
            "type": "string"
          },
          "pinned": {
            "type": "boolean"
          },
          "productHandle": {
            "type": "string"
          },
          "productId": {
            "format": "int64",
            "type": "integer"
          },
          "productImage": {
            "type": "string"
          },
          "productTitle": {
            "type": "string"
          },
          "publishedStatus": {
            "type": "boolean"
          },
          "rating": {
            "format": "int32",
            "type": "integer"
          },
          "replayBody": {
            "type": "string"
          },
          "replayDate": {
            "format": "date-time",
            "type": "string"
          },
          "reviewerName": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "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"
      },
      "SendReferralLinkEmail": {
        "description": "Referral email request containing the recipient's email address",
        "properties": {
          "email": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SocialMediaPoints": {
        "description": "Social media points claim request with earn rule ID",
        "properties": {
          "earnRuleId": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      }
    }
  },
  "info": {
    "description": "",
    "title": "Storefront APIs"
  },
  "openapi": "3.0.1",
  "paths": {
    "/loyalty/cp/api/add-customer-referral-url": {
      "post": {
        "operationId": "addCustomerReferalUrl",
        "responses": {
          "200": {
            "description": "Referral URL generated successfully"
          },
          "401": {
            "description": "Customer not authenticated"
          },
          "500": {
            "description": "Error generating referral URL"
          }
        },
        "summary": "Generate customer referral URL",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/loyalty/cp/api/claim-social-media-points": {
      "post": {
        "operationId": "claimSocialMediaPoints",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SocialMediaPoints"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Social media points claimed successfully"
          },
          "400": {
            "description": "Invalid earn rule ID or already claimed"
          },
          "401": {
            "description": "Customer not authenticated"
          }
        },
        "summary": "Claim social media reward points",
        "tags": [
          "Points & Earn Rules"
        ]
      }
    },
    "/loyalty/cp/api/customer-loyalty": {
      "get": {
        "operationId": "getCustomerLoyalty",
        "parameters": [
          {
            "description": "Filter rewards by status (comma-separated values). Allowed values: UNUSED, USED, EXPIRED",
            "example": "UNUSED,USED",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "availablePoints": 150.5,
                  "creditedPoints": 175.5,
                  "currentVipTier": "Gold",
                  "customerStatus": "ACTIVE",
                  "dob": "1990-05-15",
                  "pendingPoints": 25.0,
                  "referralLink": "https://store.com/referral/abc123",
                  "referredCompleted": 3,
                  "rewardedForFacebook": true,
                  "rewardedForInstagram": false,
                  "rewards": [],
                  "spentAmount": 299.99,
                  "storeCreditBalance": 15.0,
                  "vipTierExpiredAt": "2025-12-31T23:59:59Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/CustomerLoyaltyResponseVM"
                }
              }
            },
            "description": "Customer loyalty information retrieved successfully"
          },
          "400": {
            "description": "Invalid status parameter"
          },
          "401": {
            "description": "Customer not authenticated"
          }
        },
        "summary": "Get customer loyalty information",
        "tags": [
          "Customer Enrollment & Profile"
        ]
      }
    },
    "/loyalty/cp/api/customer-referrals": {
      "get": {
        "operationId": "getAllCustomerReferrals",
        "parameters": [
          {
            "description": "Pagination parameters (page number, size, sort)",
            "in": "query",
            "name": "pageable",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Pageable"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "createAt": "2025-01-15T10:30:00Z",
                    "customerId": 67890,
                    "description": "Referred friend via email",
                    "id": 12345,
                    "referralRuleId": 1,
                    "referredEmailId": "friend@example.com",
                    "shop": "example-store.myshopify.com",
                    "status": "PENDING"
                  }
                ],
                "schema": {
                  "$ref": "#/components/schemas/CustomerReferral"
                }
              }
            },
            "description": "Customer referrals retrieved successfully with pagination headers (X-Total-Count, Link)"
          },
          "401": {
            "description": "Customer not authenticated"
          }
        },
        "summary": "Get customer referral history",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/loyalty/cp/api/customer-visit-store": {
      "post": {
        "operationId": "customerVisitStore",
        "responses": {
          "200": {
            "description": "Store visit recorded successfully"
          },
          "401": {
            "description": "Customer not authenticated"
          },
          "429": {
            "description": "Rate limit exceeded for this customer"
          }
        },
        "summary": "Track customer store visit",
        "tags": [
          "Points & Earn Rules"
        ]
      }
    },
    "/loyalty/cp/api/enable-loyalty-program": {
      "post": {
        "operationId": "EnrollCustomer_1",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": "Customer added successfully.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Loyalty program enabled successfully"
          },
          "401": {
            "description": "Customer not authenticated"
          },
          "500": {
            "description": "Error enabling loyalty program"
          }
        },
        "summary": "Enable loyalty program for customer",
        "tags": [
          "Customer Enrollment & Profile"
        ]
      }
    },
    "/loyalty/cp/api/enroll-customer": {
      "post": {
        "operationId": "EnrollCustomer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnrollCustomerRequestVM"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": "Customer added successfully.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Customer enrolled successfully"
          },
          "400": {
            "description": "Invalid VIP tier or enrollment failed"
          },
          "401": {
            "description": "Customer not authenticated"
          }
        },
        "summary": "Enroll customer in loyalty program",
        "tags": [
          "Customer Enrollment & Profile"
        ]
      }
    },
    "/loyalty/cp/api/logged-in-customer": {
      "get": {
        "operationId": "getLoggedInCustomer",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": 12345,
                "schema": {
                  "format": "int64",
                  "type": "integer"
                }
              }
            },
            "description": "Customer ID retrieved successfully"
          },
          "401": {
            "description": "Customer not authenticated"
          }
        },
        "summary": "Get logged-in customer ID",
        "tags": [
          "Customer Enrollment & Profile"
        ]
      }
    },
    "/loyalty/cp/api/product-review-details/{productId}": {
      "get": {
        "operationId": "getAllProductReviewsByProductId",
        "parameters": [
          {
            "description": "ID of the product to get reviews for",
            "example": 12345,
            "in": "path",
            "name": "productId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Filter reviews by rating (1-5 stars)",
            "example": 5,
            "in": "query",
            "name": "rating",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "description": "Zero-based page index (0..N)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "The size of the page to be returned",
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "default": 20,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "body": "This product exceeded my expectations in every way.",
                    "createAt": "2025-01-15T10:30:00Z",
                    "productId": 12345,
                    "productImage": "https://cdn.shopify.com/image.jpg",
                    "productTitle": "Premium Widget",
                    "publishedStatus": true,
                    "rating": 5,
                    "reviewerName": "John Doe",
                    "title": "Excellent product!"
                  }
                ],
                "schema": {
                  "$ref": "#/components/schemas/ProductReviewDTO"
                }
              }
            },
            "description": "Product reviews retrieved successfully with pagination headers (X-Total-Count, Link)"
          },
          "400": {
            "description": "Invalid product ID"
          }
        },
        "summary": "Get product reviews by product ID",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/loyalty/cp/api/redeem-points": {
      "post": {
        "operationId": "redeemPoints",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerLoyaltyRequestVM"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "availablePoints": 150.0,
                  "creditedPoints": 500.0,
                  "currentVipTier": "Gold",
                  "pendingPoints": 25.0,
                  "rewards": [
                    {
                      "createAt": "2025-01-29T10:30:00Z",
                      "discountCode": "LOYALTY15OFF",
                      "discountType": "PERCENTAGE",
                      "discountValue": 15.0,
                      "expiryDate": "2025-06-30T23:59:59Z",
                      "id": 12346,
                      "pointsRedeemed": 100.0,
                      "status": "UNUSED"
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/CustomerLoyaltyResponseVM"
                }
              }
            },
            "description": "Points redeemed successfully, returns updated customer loyalty information with new reward"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "availablePoints": 50.0,
                    "error": "Insufficient points",
                    "requiredPoints": 100.0
                  },
                  "type": "string"
                }
              }
            },
            "description": "Invalid redemption request or insufficient points"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "error": "Authentication required"
                  },
                  "type": "string"
                }
              }
            },
            "description": "Customer not authenticated - JWT token missing or invalid"
          }
        },
        "summary": "Redeem customer loyalty points",
        "tags": [
          "Redemptions & Discount Codes"
        ]
      }
    },
    "/loyalty/cp/api/referral-rules/accept-offer": {
      "get": {
        "operationId": "acceptReferralOffer",
        "parameters": [
          {
            "description": "Referral token received from the referrer",
            "example": "abc123referraltoken",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Email address of the person accepting the referral",
            "example": "newcustomer@example.com",
            "in": "query",
            "name": "email",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "discountCode": "WELCOME20",
                  "id": 12345,
                  "message": "Referral accepted successfully",
                  "status": "SUCCESS"
                },
                "schema": {
                  "$ref": "#/components/schemas/ReferralAcceptResponse"
                }
              }
            },
            "description": "Referral offer accepted successfully"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralAcceptResponse"
                }
              }
            },
            "description": "Invalid token or email, referral already accepted, or referral program not available"
          }
        },
        "summary": "Accept referral offer (GET)",
        "tags": [
          "Referrals"
        ]
      },
      "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"
          }
        },
        "summary": "Accept referral offer (POST)",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/loyalty/cp/api/send-customer-referral-url": {
      "post": {
        "operationId": "sendCustomerReferralUrl",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendReferralLinkEmail"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Referral email sent successfully"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "details": "Please provide a valid email address",
                    "error": "Invalid email address"
                  },
                  "type": "string"
                }
              }
            },
            "description": "Invalid email address or missing email"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "error": "Authentication required"
                  },
                  "type": "string"
                }
              }
            },
            "description": "Customer not authenticated"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "details": "Maximum 500 referral emails per day. Please try again tomorrow.",
                    "error": "Rate limit exceeded",
                    "retryAfter": "2025-01-30T00:00:00Z"
                  },
                  "type": "string"
                }
              }
            },
            "description": "Rate limit exceeded for sending referral emails"
          }
        },
        "summary": "Send customer referral email",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/loyalty/cp/api/storefront-graphql": {
      "post": {
        "operationId": "proxyCp",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": {
                  "type": "object"
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Proxy a Shopify Storefront GraphQL request from the customer portal",
        "tags": [
          "Product Catalog"
        ]
      }
    },
    "/loyalty/cp/api/submit-review": {
      "post": {
        "operationId": "submitReview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductReview"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": "Review successfully submitted; it will reflect shortly.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Review submitted successfully. Points will be awarded asynchronously if eligible."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "details": "Rating must be between 1 and 5",
                    "error": "Invalid request"
                  },
                  "type": "string"
                }
              }
            },
            "description": "Invalid review data or missing required fields"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "error": "Authentication required"
                  },
                  "type": "string"
                }
              }
            },
            "description": "Customer not authenticated"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "error": "Failed to submit review. Please try again."
                  },
                  "type": "string"
                }
              }
            },
            "description": "Error processing review submission"
          }
        },
        "summary": "Submit product review",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/loyalty/cp/api/transaction-by-shop": {
      "get": {
        "operationId": "getAllPointTransactionsByCustomer",
        "parameters": [
          {
            "description": "Pagination parameters (page number, size, sort)",
            "in": "query",
            "name": "pageable",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Pageable"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "createAt": "2025-01-15T10:30:00Z",
                    "customerId": 67890,
                    "id": 12345,
                    "note": "Points earned for purchase",
                    "pointType": "EARNED",
                    "points": 50.0,
                    "shop": "example-store.myshopify.com",
                    "spentAmount": 99.99,
                    "status": "APPROVED",
                    "transactionRule": "ORDER_PLACED"
                  }
                ],
                "schema": {
                  "$ref": "#/components/schemas/PointTransaction"
                }
              }
            },
            "description": "Point transactions retrieved successfully with pagination headers (X-Total-Count, Link)"
          },
          "401": {
            "description": "Customer not authenticated"
          }
        },
        "summary": "Get customer point transaction history",
        "tags": [
          "Points & Earn Rules"
        ]
      }
    },
    "/loyalty/cp/api/update-customer": {
      "post": {
        "operationId": "updateCustomerMetafield",
        "responses": {
          "200": {
            "description": "Customer data synchronized successfully"
          },
          "401": {
            "description": "Customer not authenticated"
          },
          "500": {
            "description": "Error synchronizing customer data"
          }
        },
        "summary": "Sync customer metafield data",
        "tags": [
          "Customer Enrollment & Profile"
        ]
      }
    },
    "/loyalty/cp/api/update-customer-birth-date": {
      "post": {
        "operationId": "addCustomerBirthDate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerBirthDateRequestVM"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "Customer birth date updated successfully"
          },
          "400": {
            "description": "Invalid birth date format"
          },
          "401": {
            "description": "Customer not authenticated"
          }
        },
        "summary": "Update customer birth date",
        "tags": [
          "Customer Enrollment & Profile"
        ]
      }
    },
    "/loyalty/cp/api/update-customer-status": {
      "post": {
        "operationId": "updateCustomerStatus",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerBirthDateRequestVM"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "Customer status updated successfully"
          },
          "400": {
            "description": "Invalid customer status"
          },
          "401": {
            "description": "Customer not authenticated"
          }
        },
        "summary": "Update customer loyalty status",
        "tags": [
          "Customer Enrollment & Profile"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://loyalty-admin.appstle.com"
    }
  ],
  "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"
    }
  ]
}