Skip to content

Admin APIs

Languages
Servers
https://loyalty-admin.appstle.com

Admin APIs

Admin APIs for third-party integrations to manage customer loyalty programs, points, rewards, and redemptions. All endpoints require X-API-Key authentication header.

Operations

Update discount code status

Request

Updates the status of a customer's discount code after checkout or subscription events.

Primary use case: Mark a discount code as "USED" after a customer completes checkout with the code. This prevents the code from being used again and keeps reward tracking accurate.

Request body:

  • customerId: Shopify customer ID (required)
  • discountCode: The discount code to update (required)
  • status: New status for the code (required)

Valid status values:

  • USED: Mark code as used after checkout (most common)
  • SUBSCRIPTION_ACTIVE: Mark code as active for subscription renewals
  • UNUSED: Reset code to unused state (use carefully)
  • EXPIRED: Manually expire a code

What happens when you update status:

  1. Validates discount code exists and belongs to customer
  2. Updates the reward status in database
  3. Syncs status to Shopify discount code system
  4. Updates customer metafields in Shopify
  5. Logs activity for audit trail
  6. For subscriptions: manages discount code lifecycle

Subscription handling (SUBSCRIPTION_ACTIVE):

  • When subscription is created: Set to SUBSCRIPTION_ACTIVE
  • System automatically manages code for each renewal
  • When subscription ends: Can revert to USED or delete
  • Code may be deleted/recreated for each billing cycle

Common workflows:

One-time checkout:

  1. Customer applies loyalty code at checkout
  2. Order is created in Shopify
  3. Call this endpoint with status="USED"
  4. Code is now marked as used and can't be reused

Subscription checkout:

  1. Customer applies code to subscription
  2. Subscription is created
  3. Call with status="SUBSCRIPTION_ACTIVE"
  4. Code stays active for renewals
  5. When subscription cancelled, call with status="USED"

Important notes:

  • Marking code as USED is irreversible in normal operations
  • SUBSCRIPTION_ACTIVE codes can be used for recurring orders
  • System prevents using USED codes even if status is reset
  • Activity log tracks all status changes
  • Metafield sync updates customer data in Shopify theme

Error scenarios:

  • Code already USED: Cannot mark as USED again (400 error)
  • Code not found: Invalid discount code or customer (400 error)
  • Wrong customer: Code belongs to different customer (400 error)

Best practices:

  • Always call this after order creation webhooks
  • Use order confirmation webhooks to trigger status update
  • Handle 400 errors gracefully (code may already be marked used)
  • For subscriptions, track subscription lifecycle events
  • Don't call multiple times for same order (idempotency)
Bodyapplication/jsonrequired
customerIdinteger(int64)required

Shopify customer ID (numeric). Identifies which customer owns the discount code. Used to verify the discount code belongs to this customer before updating. Example: 67890

Example: 67890
discountCodestring<= 100 charactersrequired

The discount code to update. Case-insensitive. Must be a valid loyalty discount code that belongs to the specified customer. Examples: "LOYALTY15OFF", "VIP20", "WELCOME10"

Example: "LOYALTY15OFF"
statusstringrequired

New status for the discount code. Valid values:

  • USED: Mark code as used after checkout (most common)
  • SUBSCRIPTION_ACTIVE: Mark code as active for subscription renewals
  • UNUSED: Reset code to unused state (use carefully)
  • EXPIRED: Manually expire a code

Status transitions:

  • UNUSED → USED: Normal checkout flow
  • UNUSED → SUBSCRIPTION_ACTIVE: Subscription created
  • SUBSCRIPTION_ACTIVE → USED: Subscription ended
  • Any → EXPIRED: Manual expiration

Note: Cannot mark already USED codes as USED again.

Enum"USED""UNUSED""REFUNDED""EXPIRED""SUBSCRIPTION_ACTIVE""USED""UNUSED""SUBSCRIPTION_ACTIVE""EXPIRED"
Example: "USED"
curl -i -X PUT \
  https://loyalty-admin.appstle.com/api/external/update-discount \
  -H 'Content-Type: application/json' \
  -d '{
    "customerId": 67890,
    "discountCode": "LOYALTY15OFF",
    "status": "USED"
  }'

Responses

Discount code status successfully updated

Bodyapplication/json
idinteger(int64)
shopstringrequired
customerIdinteger(int64)required
descriptionstring
pointTransactionIdinteger(int64)
pointRedeemRuleIdinteger(int64)
discountCodestringrequired
usedAtstring(date-time)
orderIdinteger(int64)
orderNamestring
statusstringrequired
Enum"USED""UNUSED""REFUNDED""EXPIRED""SUBSCRIPTION_ACTIVE"
createAtstring(date-time)required
expireDatestring(date-time)
variantIdinteger(int64)
discountCodeIdstring
productDatastring
usageCountinteger(int64)
amountnumber(double)
rewardTypestring
Enum"STORE_CREDIT""DISCOUNT_CODE""POINTS"
lastExpiryReminderSentDatestring(date-time)
Response
application/json
{ "id": 12345, "customerId": 67890, "discountCode": "LOYALTY15OFF", "discountType": "PERCENTAGE", "discountValue": 15, "status": "USED", "expiryDate": "2025-06-30T23:59:59Z", "pointsRedeemed": 100, "usedAt": "2025-01-29T10:45:00Z", "createAt": "2025-01-15T10:30:00Z" }

Update discount code status (legacy endpoint)

Request

Updates the status of a customer's discount code. This is a legacy endpoint similar to update-discount but returns full customer loyalty details after update. Commonly used to mark discount codes as USED after checkout.

Headers
X-API-Keystringrequired

API key for authentication

Bodyapplication/jsonrequired
customerIdinteger(int64)
customerEmailstring
discountCodestringrequired
statusstringrequired
curl -i -X PUT \
  https://loyalty-admin.appstle.com/api/external/update-discount-code-status \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: string' \
  -d '{
    "customerId": 0,
    "customerEmail": "string",
    "discountCode": "string",
    "status": "string"
  }'

Responses

Discount code status updated and customer loyalty details returned

Bodyapplication/json
availablePointsnumber(double)
pendingPointsnumber(double)
creditedPointsnumber(double)
spentAmountnumber(double)
storeCreditBalancenumber(double)
achievableTierIdinteger(int64)
currentVipTierstring
vipTierExpiredAtstring(date-time)
createAtstring(date-time)
rewardedForFacebookboolean
rewardedForPinterestboolean
rewardedForTwitterboolean
rewardedForInstagramboolean
rewardedForYoutubeboolean
rewardedForTiktokboolean
rewardedForNewsLetterboolean
rewardedForSmsboolean
referredCompletedinteger(int64)
referralLinkstring
customerStatusstring
Enum"ACTIVE""INACTIVE""EXCLUDED""EXCLUDED_BY_CUSTOMER"
dobstring(date)
rewardsArray of objects(CustomerReward)
rewardedForCreatingAccountboolean
rewardedForSharingOnFacebookboolean
rewardedForSharingOnXboolean
Response
application/json
{ "availablePoints": 0.1, "pendingPoints": 0.1, "creditedPoints": 0.1, "spentAmount": 0.1, "storeCreditBalance": 0.1, "achievableTierId": 0, "currentVipTier": "string", "vipTierExpiredAt": "2019-08-24T14:15:22Z", "createAt": "2019-08-24T14:15:22Z", "rewardedForFacebook": true, "rewardedForPinterest": true, "rewardedForTwitter": true, "rewardedForInstagram": true, "rewardedForYoutube": true, "rewardedForTiktok": true, "rewardedForNewsLetter": true, "rewardedForSms": true, "referredCompleted": 0, "referralLink": "string", "customerStatus": "ACTIVE", "dob": "2019-08-24", "rewards": [ {} ], "rewardedForCreatingAccount": true, "rewardedForSharingOnFacebook": true, "rewardedForSharingOnX": true }

Update customer birth date

Request

Updates or sets a customer's birth date in the loyalty system. Used for birthday reward programs and customer segmentation. Validates the birth date format and triggers any applicable birthday point earning rules.

Headers
X-API-Keystringrequired

API key for authentication

Bodyapplication/jsonrequired
customerIdinteger(int64)

Unique identifier of the customer

Example: 0
dobstring(date)

Customer date of birth

Example: "2026-01-12"
statusstring

Customer loyalty status

Enum"ACTIVE""INACTIVE""EXCLUDED""EXCLUDED_BY_CUSTOMER""ACTIVE""INACTIVE""EXCLUDED""EXCLUDED_BY_CUSTOMER"
Example: "ACTIVE"
curl -i -X PUT \
  https://loyalty-admin.appstle.com/api/external/update-customer-birth-date \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: string' \
  -d '{
    "customerId": 0,
    "dob": "2026-01-12",
    "status": "ACTIVE"
  }'

Responses

Customer birth date successfully updated

Bodyapplication/json
idinteger(int64)
shopstringrequired
customerIdinteger(int64)required
firstNamestring
lastNamestring
emailstring
statusstring
Enum"ACTIVE""INACTIVE""EXCLUDED""EXCLUDED_BY_CUSTOMER"
createAtstring(date-time)required
dobstring(date)
enableEmailboolean
tokenstring
redeemLimitinteger(int64)
redeemLimitOnceinteger(int64)
vipTierstring
vipTierIdinteger(int64)
vipTierSummarystring
availablePointsnumber(double)required
pendingPointsnumber(double)required
displayNamestring
vipTierExpiredAtstring(date-time)
spentAmountnumber(double)
lastActivitystring(date-time)
ordersCountinteger(int32)
lastMonthlyReminderSentDatestring(date-time)
redeemedPointsnumber(double)
lastRewardExpiryReminderSentDatestring(date-time)
vipAssignTypestring
Enum"MANUAL""AUTO_RENEWAL""RENEWAL_ON_HIGHER_TIER"
phonestring
loyaltyProgramEnabledboolean
emailSettingstring
skipReviewboolean
updatedSettingsstring
storeCreditAccountIdstring
emailBouncedOrFailedboolean
availableStoreCreditsnumber(double)
isDeletedFromShopifyboolean
enableEmailMarketingboolean
enableSmsMarketingboolean
tagsstring
vipTierAmountnumber(double)
Response
application/json
{ "id": 0, "shop": "string", "customerId": 0, "firstName": "string", "lastName": "string", "email": "string", "status": "ACTIVE", "createAt": "2019-08-24T14:15:22Z", "dob": "2019-08-24", "enableEmail": true, "token": "string", "redeemLimit": 0, "redeemLimitOnce": 0, "vipTier": "string", "vipTierId": 0, "vipTierSummary": "string", "availablePoints": 0.1, "pendingPoints": 0.1, "displayName": "string", "vipTierExpiredAt": "2019-08-24T14:15:22Z", "spentAmount": 0.1, "lastActivity": "2019-08-24T14:15:22Z", "ordersCount": 0, "lastMonthlyReminderSentDate": "2019-08-24T14:15:22Z", "redeemedPoints": 0.1, "lastRewardExpiryReminderSentDate": "2019-08-24T14:15:22Z", "vipAssignType": "MANUAL", "phone": "string", "loyaltyProgramEnabled": true, "emailSetting": "string", "skipReview": true, "updatedSettings": "string", "storeCreditAccountId": "string", "emailBouncedOrFailed": true, "availableStoreCredits": 0.1, "isDeletedFromShopify": true, "enableEmailMarketing": true, "enableSmsMarketing": true, "tags": "string", "vipTierAmount": 0.1 }

Check discount code validity

Request

Validates a discount code for a specific customer before checkout.

When to use this:

  • During checkout when customer enters a loyalty discount code
  • Before applying discount to verify it belongs to the customer
  • To check discount status and expiry
  • To retrieve discount details (type, value, restrictions)

Request body:

  • customerId: Shopify customer ID (required)
  • discountCode: The discount code to validate (required, case-insensitive)

What this endpoint checks:

  • Discount code exists in the system
  • Code belongs to the specified customer
  • Code status is "UNUSED" or "ACTIVE"
  • Code has not expired
  • Code is valid for current context

Response includes:

  • Discount type (PERCENTAGE, FIXED_AMOUNT, FREE_SHIPPING, FREE_PRODUCT)
  • Discount value (percentage or fixed amount)
  • Expiry date
  • Usage restrictions (minimum purchase, specific products, etc.)
  • Points that were redeemed for this code
  • Shopify discount code ID for reference

Discount statuses:

  • UNUSED: Code has not been used yet (valid)
  • ACTIVE: Code is being used in an active subscription (valid for renewals)
  • USED: Code has already been redeemed (invalid)
  • EXPIRED: Code has passed expiry date (invalid)

Integration pattern:

  1. Customer enters loyalty code at checkout
  2. Call this endpoint to validate the code
  3. If 200 response, apply discount in checkout
  4. After order is placed, call update-discount to mark as USED
  5. Handle 400/404 by showing error message to customer

Common scenarios:

  • Valid code: 200 with full discount details
  • Wrong customer: 404 (code exists but for different customer)
  • Already used: 400 with "Discount already used" message
  • Expired: 400 with expiry information
  • Invalid code: 404 (code doesn't exist)
Bodyapplication/jsonrequired
customerIdinteger(int64)required

Shopify customer ID (numeric). Identifies which customer is attempting to use the discount code. Used to verify the discount code belongs to this customer. Example: 67890

Example: 67890
discountCodestring<= 100 charactersrequired

The discount code to validate. Case-insensitive. This is the code the customer enters at checkout. System will check if:

  • Code exists in loyalty system
  • Code belongs to this customer
  • Code status is UNUSED or ACTIVE
  • Code has not expired Examples: "LOYALTY15OFF", "VIP20", "WELCOME10"
Example: "LOYALTY15OFF"
curl -i -X PUT \
  https://loyalty-admin.appstle.com/api/external/check-discount \
  -H 'Content-Type: application/json' \
  -d '{
    "customerId": 67890,
    "discountCode": "LOYALTY15OFF"
  }'

Responses

Discount code is valid and reward details returned

Bodyapplication/json
idinteger(int64)
shopstringrequired
customerIdinteger(int64)required
descriptionstring
pointTransactionIdinteger(int64)
pointRedeemRuleIdinteger(int64)
discountCodestringrequired
usedAtstring(date-time)
orderIdinteger(int64)
orderNamestring
statusstringrequired
Enum"USED""UNUSED""REFUNDED""EXPIRED""SUBSCRIPTION_ACTIVE"
createAtstring(date-time)required
expireDatestring(date-time)
variantIdinteger(int64)
discountCodeIdstring
productDatastring
usageCountinteger(int64)
amountnumber(double)
rewardTypestring
Enum"STORE_CREDIT""DISCOUNT_CODE""POINTS"
lastExpiryReminderSentDatestring(date-time)
Response
application/json
{ "id": 12345, "customerId": 67890, "discountCode": "LOYALTY15OFF", "discountType": "PERCENTAGE", "discountValue": 15, "status": "UNUSED", "expiryDate": "2025-06-30T23:59:59Z", "pointsRedeemed": 100, "shopifyDiscountCodeId": "gid://shopify/DiscountCode/123", "minimumPurchaseAmount": 50, "createAt": "2025-01-15T10:30:00Z" }

Approve pending point transactions

Request

Approves pending point transactions and converts them to available points.

When points are pending:

  • Orders with pending fulfillment
  • High-risk transactions requiring manual review
  • Bulk point grants awaiting approval
  • Refund/return waiting periods
  • Custom approval workflows

Two approval modes:

Mode 1: Approve all pending transactions

  • Set approveAllPendingTransactions=true
  • Request body is ignored
  • Approves ALL pending transactions for the shop
  • Use for bulk approvals or automated workflows

Mode 2: Approve specific transactions

  • Set approveAllPendingTransactions=false (or omit parameter)
  • Provide pendingPointsApprovalList in request body
  • Each item needs: customerId, points, transaction details
  • Approves only specified transactions
  • Use for selective/manual approval

How approval works:

  1. Validates pending transactions exist
  2. Queues approval process (asynchronous via AWS Step Functions)
  3. Returns 204 immediately (doesn't wait for completion)
  4. Background process:
    • Updates transaction status from PENDING to APPROVED
    • Adds points to customer's availablePoints
    • Updates creditedPoints total
    • Syncs to Shopify metafields
    • Logs approval activity
    • Triggers any applicable notifications

Important notes:

  • This is an ASYNCHRONOUS operation
  • Returns 204 immediately, processing happens in background
  • Points may take a few seconds to appear in customer account
  • No rollback after 204 response
  • Cannot approve already-approved transactions
  • Cannot approve rejected transactions

Request body structure (for specific approvals):

[
  {
    "customerId": 12345,
    "points": 50.0,
    "transactionId": 98765,
    "note": "Order fulfilled, approving points"
  }
]

Best practices:

  • Use approveAllPendingTransactions=true for scheduled/automated approvals
  • Use specific approval list for manual review workflows
  • Monitor for completion by checking customer point balance
  • Set up webhooks/polling to detect when approval completes
  • Don't call repeatedly - it's queued asynchronously
  • Consider rate limiting on your side for bulk approvals

Common use cases:

  • Approve points after order fulfillment
  • Batch approval at end of day/week
  • Manual approval after fraud review
  • Approve after return/refund window closes
  • Integration with external approval systems

Error handling:

  • 204: Success, approval queued (this is success, not an error)
  • 400: Invalid request format or missing required data
  • 401: Invalid API key
Query
approveAllPendingTransactionsboolean

Set to true to approve all pending transactions (ignores pendingPointsApprovalList)

Headers
X-API-Keystringrequired

API key for authentication

Bodyapplication/jsonArray [
transactionIdinteger(int64)
customerIdinteger(int64)
]
curl -i -X PUT \
  'https://loyalty-admin.appstle.com/api/external/approve-pending-transactions?approveAllPendingTransactions=true' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: string' \
  -d '[
    {
      "transactionId": 0,
      "customerId": 0
    }
  ]'

Responses

Approval process started successfully (asynchronous operation). Points will be added to customer accounts within a few seconds.

Response
No content

Redeem customer points for rewards

Request

Processes a point redemption request and generates a discount code or reward.

How it works:

  1. Validates customer has sufficient available points
  2. Deducts points from customer's balance
  3. Creates a discount code in Shopify (if applicable)
  4. Creates a reward record with status "UNUSED"
  5. Logs the transaction for audit trail
  6. Returns updated customer loyalty information

Request body fields:

  • customerId OR customerEmail: Identify the customer (provide one, not both)
  • redeemRuleId: ID of the redemption rule to use (required)
  • points: Number of points to redeem (optional - uses rule default if not provided)
  • variantId: Product variant ID for product-specific rewards (optional, required for product rewards)

Redemption rule types:

  • Fixed discount: Creates discount code for fixed amount off
  • Percentage discount: Creates discount code for percentage off
  • Free shipping: Creates free shipping discount code
  • Free product: Creates discount code for free product (requires variantId)
  • Store credit: Adds credit to customer's account

Important validation rules:

  • Customer must have >= points required for redemption
  • Customer must be enrolled in loyalty program
  • Redemption rule must be active
  • For product rewards, variantId is required
  • Points are deducted immediately (transaction is atomic)

Common errors:

  • "Insufficient points": Customer doesn't have enough available points
  • "Redemption rule not found": Invalid redeemRuleId
  • "Customer not found": Invalid customer ID/email
  • "Variant ID required": Missing variantId for product reward
  • "Customer not enrolled": Customer hasn't been enrolled in loyalty program

Best practices:

  • Always check customer's availablePoints before attempting redemption
  • Use GET /api/external/point-redeem-rules to get available redemption options
  • Store the returned discount code for customer to use at checkout
  • Monitor for 400 errors and handle insufficient points gracefully
Headers
X-API-Keystringrequired

API key for authentication

Bodyapplication/jsonrequired
customerIdinteger or null(int64)

Shopify customer ID (numeric). Identifies which customer is redeeming points. Provide either customerId OR customerEmail, not both. Example: 67890

Example: 67890
customerEmailstring or null

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. Example: customer@example.com

Example: "customer@example.com"
redeemRuleIdinteger(int64)required

ID of the redemption rule to use. Determines what reward the customer receives. Use GET /api/external/point-redeem-rules to get available redemption options. Must be an active redemption rule configured in your loyalty program. Example: 5

Example: 5
pointsnumber or null(double)

Number of points to redeem. Must be positive. If not provided, uses the default points value from the redemption rule. Customer must have at least this many available points. Example: 100.0

Example: 100
variantIdinteger or null(int64)

Shopify product variant ID. Required when redeeming for product-specific rewards (free product). Not required for discount codes or store credit rewards. Must be a valid variant ID from your Shopify catalog. Example: 12345678

Example: 12345678
curl -i -X POST \
  https://loyalty-admin.appstle.com/api/external/redeem-points \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: string' \
  -d '{
    "customerId": 67890,
    "redeemRuleId": 5,
    "points": 100,
    "variantId": 12345678
  }'

Responses

Points successfully redeemed and reward generated

Bodyapplication/json
availablePointsnumber(double)
pendingPointsnumber(double)
creditedPointsnumber(double)
spentAmountnumber(double)
storeCreditBalancenumber(double)
achievableTierIdinteger(int64)
currentVipTierstring
vipTierExpiredAtstring(date-time)
createAtstring(date-time)
rewardedForFacebookboolean
rewardedForPinterestboolean
rewardedForTwitterboolean
rewardedForInstagramboolean
rewardedForYoutubeboolean
rewardedForTiktokboolean
rewardedForNewsLetterboolean
rewardedForSmsboolean
referredCompletedinteger(int64)
referralLinkstring
customerStatusstring
Enum"ACTIVE""INACTIVE""EXCLUDED""EXCLUDED_BY_CUSTOMER"
dobstring(date)
rewardsArray of objects(CustomerReward)
rewardedForCreatingAccountboolean
rewardedForSharingOnFacebookboolean
rewardedForSharingOnXboolean
Response
application/json
{ "availablePoints": 150, "pendingPoints": 0, "creditedPoints": 500, "spentAmount": 1250.99, "storeCreditBalance": 0, "currentVipTier": "Gold", "rewards": [ {} ], "customerStatus": "ACTIVE" }

Enroll customer in loyalty program

Request

Enrolls a customer into the loyalty program for a specific shop.

What this endpoint does:

  • Activates loyalty features for the customer
  • Allows the customer to start earning and redeeming points
  • Creates necessary customer records in the loyalty system
  • May trigger welcome rewards if configured

When to use this:

  • After a new customer signs up on your store
  • When enabling loyalty for existing customers
  • During bulk customer migrations

Important notes:

  • Customer must exist in Shopify before enrollment
  • If customer is already enrolled, returns success without error
  • Idempotent operation - safe to call multiple times
  • Customer ID must be the Shopify customer ID (numeric)

Authentication: Requires X-API-Key header. Get your API key from the Loyalty app settings in your Shopify admin.

Query
customer_idinteger(int64)required

Shopify customer ID to enroll in loyalty program

Headers
X-API-Keystringrequired

API key for authentication

curl -i -X POST \
  'https://loyalty-admin.appstle.com/api/external/enroll-customer?customer_id=0' \
  -H 'X-API-Key: string'

Responses

Customer successfully enrolled in loyalty program

Bodyapplication/json
string
Response
application/json
{ "message": "Customer added successfully" }

Add points to customer account

Request

Manually adds loyalty points to a customer's account.

Common use cases:

  • Grant bonus points for special promotions
  • Compensate customers for issues or complaints
  • Award points for actions tracked in external systems
  • Bulk point adjustments during migrations
  • Manual loyalty program adjustments

Request body fields:

  • customerId OR customerEmail: Identify the customer (required, provide one)
  • points: Number of points to add (required, must be positive)
  • note: Description/reason for points addition (optional but recommended)
  • earnRuleId: Associate with an earn rule (optional, for tracking purposes)

How it works:

  1. Validates customer exists and is enrolled
  2. Adds points to customer's available balance immediately
  3. Creates a point transaction record with status "APPROVED"
  4. Logs the activity with the provided note
  5. Updates customer's total credited points
  6. Syncs updated points to Shopify metafields
  7. Returns updated customer loyalty information

Important notes:

  • Points are added to availablePoints immediately (not pending)
  • Points do NOT expire unless you have expiration rules configured
  • Negative points not allowed (use separate remove points endpoint if available)
  • Transaction is logged with source "MANUAL_ADJUSTMENT"
  • Note field appears in customer's transaction history
  • earnRuleId is optional and for categorization only

Best practices:

  • Always include a descriptive note explaining why points were added
  • Use consistent note format for easier reporting
  • Consider using earnRuleId to group similar point additions
  • Verify customer ID/email before making API call
  • Points are added in real-time - no undo functionality

Example notes:

  • "Bonus points for email signup - January promotion"
  • "Compensation for delayed shipping - Order #1234"
  • "Referral bonus from external system"
  • "Migration - transferred from old loyalty system"
  • "Birthday bonus - 2025"
Headers
X-API-Keystringrequired

API key for authentication

Bodyapplication/jsonrequired
customerIdinteger or null(int64)

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
customerEmailstring or null

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"
pointsnumber(double)>= 0.01required

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
earnRuleIdinteger or null(int64)

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
notestring or null<= 500 characters

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"
curl -i -X POST \
  https://loyalty-admin.appstle.com/api/external/add-points \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: string' \
  -d '{
    "customerEmail": "customer@example.com",
    "points": 50,
    "note": "Compensation for delayed shipping - Order #1234"
  }'

Responses

Points successfully added to customer account

Bodyapplication/json
availablePointsnumber(double)
pendingPointsnumber(double)
creditedPointsnumber(double)
spentAmountnumber(double)
storeCreditBalancenumber(double)
achievableTierIdinteger(int64)
currentVipTierstring
vipTierExpiredAtstring(date-time)
createAtstring(date-time)
rewardedForFacebookboolean
rewardedForPinterestboolean
rewardedForTwitterboolean
rewardedForInstagramboolean
rewardedForYoutubeboolean
rewardedForTiktokboolean
rewardedForNewsLetterboolean
rewardedForSmsboolean
referredCompletedinteger(int64)
referralLinkstring
customerStatusstring
Enum"ACTIVE""INACTIVE""EXCLUDED""EXCLUDED_BY_CUSTOMER"
dobstring(date)
rewardsArray of objects(CustomerReward)
rewardedForCreatingAccountboolean
rewardedForSharingOnFacebookboolean
rewardedForSharingOnXboolean
Response
application/json
{ "availablePoints": 350, "pendingPoints": 0, "creditedPoints": 600, "spentAmount": 1250.99, "storeCreditBalance": 0, "currentVipTier": "Gold", "customerStatus": "ACTIVE", "rewards": [] }

Add store credits to customer account

Request

Adds store credits (monetary value) to a customer's loyalty account. Store credits are different from points and can be used directly as payment. Supports custom descriptions and automatically logs the transaction.

Headers
X-API-Keystringrequired

API key for authentication

Bodyapplication/jsonrequired
customerIdinteger(int64)
customerEmailstring
creditsnumber(double)
earnRuleIdinteger(int64)
notestring
curl -i -X POST \
  https://loyalty-admin.appstle.com/api/external/add-credits \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: string' \
  -d '{
    "customerId": 0,
    "customerEmail": "string",
    "credits": 0.1,
    "earnRuleId": 0,
    "note": "string"
  }'

Responses

Store credits successfully added to customer account

Bodyapplication/json
availablePointsnumber(double)
pendingPointsnumber(double)
creditedPointsnumber(double)
spentAmountnumber(double)
storeCreditBalancenumber(double)
achievableTierIdinteger(int64)
currentVipTierstring
vipTierExpiredAtstring(date-time)
createAtstring(date-time)
rewardedForFacebookboolean
rewardedForPinterestboolean
rewardedForTwitterboolean
rewardedForInstagramboolean
rewardedForYoutubeboolean
rewardedForTiktokboolean
rewardedForNewsLetterboolean
rewardedForSmsboolean
referredCompletedinteger(int64)
referralLinkstring
customerStatusstring
Enum"ACTIVE""INACTIVE""EXCLUDED""EXCLUDED_BY_CUSTOMER"
dobstring(date)
rewardsArray of objects(CustomerReward)
rewardedForCreatingAccountboolean
rewardedForSharingOnFacebookboolean
rewardedForSharingOnXboolean
Response
application/json
{ "availablePoints": 0.1, "pendingPoints": 0.1, "creditedPoints": 0.1, "spentAmount": 0.1, "storeCreditBalance": 0.1, "achievableTierId": 0, "currentVipTier": "string", "vipTierExpiredAt": "2019-08-24T14:15:22Z", "createAt": "2019-08-24T14:15:22Z", "rewardedForFacebook": true, "rewardedForPinterest": true, "rewardedForTwitter": true, "rewardedForInstagram": true, "rewardedForYoutube": true, "rewardedForTiktok": true, "rewardedForNewsLetter": true, "rewardedForSms": true, "referredCompleted": 0, "referralLink": "string", "customerStatus": "ACTIVE", "dob": "2019-08-24", "rewards": [ {} ], "rewardedForCreatingAccount": true, "rewardedForSharingOnFacebook": true, "rewardedForSharingOnX": true }

Get top customers by points earned

Request

Retrieves a paginated list of top customers ranked by loyalty points earned. Useful for generating leaderboards, identifying VIP customers, and analyzing customer engagement.

Query
pageableobject(Pageable)required

Pagination parameters (page number, size, sort)

pageable.​pageinteger(int32)>= 0
pageable.​sizeinteger(int32)>= 1
pageable.​sortArray of strings
Headers
X-API-Keystringrequired

API key for authentication

curl -i -X GET \
  'https://loyalty-admin.appstle.com/api/external/top-customers?page=0&size=1&sort=string' \
  -H 'X-API-Key: string'

Responses

Successfully retrieved top customers with pagination headers

Headers
X-Total-Countinteger

Total number of customers

Linkstring

Pagination links for navigating results

Bodyapplication/json
customerIdinteger(int64)
firstNamestring
lastNamestring
pointsEarnednumber(double)
activitiesCompletedinteger(int64)
Response
application/json
{ "customerId": 0, "firstName": "string", "lastName": "string", "pointsEarned": 0.1, "activitiesCompleted": 0 }

Get customer point transaction history

Request

Retrieves the complete point transaction history for a specific customer. Includes all point earning and redemption transactions with timestamps, amounts, and descriptions.

Path
customer_idinteger(int64)required

Shopify customer ID to retrieve transaction history for

Headers
X-API-Keystringrequired

API key for authentication

curl -i -X GET \
  'https://loyalty-admin.appstle.com/api/external/point-transaction-history/{customer_id}' \
  -H 'X-API-Key: string'

Responses

Successfully retrieved point transaction history

Bodyapplication/json
idinteger(int64)
shopstring
customerIdinteger(int64)required
pointsnumber(double)required
pointTypestringrequired
Enum"DEBIT""CREDIT"
notestring
statusstring
Enum"APPROVED""PENDING""REJECTED"
transactionRulestring
Enum"ADJUSTMENT""EARN_RULE""REDEEM_RULE""REFERRAL"
earnRuleIdinteger(int64)
earnRuleNamestring
redeemRuleRuleIdinteger(int64)
redeemRuleNamestring
autoApprovalDaysinteger(int32)
orderIdinteger(int64)
orderNamestring
createAtstring(date-time)
importedboolean
spentAmountnumber(double)
contractIdstring
orderFinancialStatusstring
orderFulfillmentStatusstring
orderLineItemIdinteger(int64)
rewardTypestring
Enum"STORE_CREDIT""DISCOUNT_CODE""POINTS"
displayNamestring
Response
application/json
{ "id": 0, "shop": "string", "customerId": 0, "points": 0.1, "pointType": "DEBIT", "note": "string", "status": "APPROVED", "transactionRule": "ADJUSTMENT", "earnRuleId": 0, "earnRuleName": "string", "redeemRuleRuleId": 0, "redeemRuleName": "string", "autoApprovalDays": 0, "orderId": 0, "orderName": "string", "createAt": "2019-08-24T14:15:22Z", "imported": true, "spentAmount": 0.1, "contractId": "string", "orderFinancialStatus": "string", "orderFulfillmentStatus": "string", "orderLineItemId": 0, "rewardType": "STORE_CREDIT", "displayName": "string" }

Get all point redemption rules

Request

Retrieves all active point redemption rules configured for the shop. These rules define what rewards customers can redeem their points for (discounts, free products, etc.). Only returns active, non-referral redemption rules.

Headers
X-API-Keystringrequired

API key for authentication

curl -i -X GET \
  https://loyalty-admin.appstle.com/api/external/point-redeem-rules \
  -H 'X-API-Key: string'

Responses

Successfully retrieved point redemption rules

Bodyapplication/json
idinteger(int64)
shopstring
namestringrequired
typestringrequired
Enum"DISCOUNT_CODE""FREE_PRODUCT""FREE_SHIPPING""PRODUCT_DISCOUNT""COLLECTION_DISCOUNT""BIRTHDAY_REWARD""DYNAMIC_DISCOUNT""STATIC_REDEEM_RULE""STORE_CREDIT"
referralTypestring
Enum"EXISTING_CUSTOMER_REWARD""NEW_CUSTOMER_REWARD""VIP"
statusstringrequired
Enum"ACTIVE""INACTIVE"
redeemPointsnumber(double)required
discountTypestringrequired
Enum"PERCENTAGE""FIXED"
discountnumber(double)required
minimumPurchaseAmountnumber(double)required
createAtstring(date-time)
updateAtstring(date-time)
maximumShippingRatenumber(double)
productIdinteger(int64)
variantIdinteger(int64)
productDatastring
collectionIdinteger(int64)
collectionDatastring
customerFacingLabelstring
restrictCustomersstring
restrictCustomersWithTagsstring
rewardIntervalstring
Enum"DAY""WEEK""MONTH""YEAR""LIFETIME"
appliesOnstring
Enum"ONE_TIME""SUBSCRIPTION""BOTH"
combinedWithProductDiscountboolean
combinedWithShippingDiscountboolean
combinedWithOrderDiscountboolean
triggeredCountinteger(int64)
pointsCostnumber(double)
enableIntervalboolean
redeemLimitinteger(int32)
enableNumberOfUsagesLimitboolean
numberOfUsagesLimitinteger(int32)
allowedCustomerTagsstring
earnRuleIdinteger(int64)
vipTierIdinteger(int64)
redeemLabelstring
customerFacingIconUrlstring
serialinteger(int32)
discountCodeForAllCustomerboolean
allowedCountriesstring
showInPosOnlyboolean
redeemAllPointsboolean
enableMinimumPointsToRedeemboolean
requiredMinimumPointsToRedeemnumber(double)
enableMaximumPointsToRedeemboolean
requiredMaximumPointsToRedeemnumber(double)
enablePOSboolean
minimumPointsLabelstring
maximumPointsLabelstring
applyDiscountOnceboolean
enableDiscountPrefixboolean
discountPrefixTextstring
discountCodeNodeIdstring
translationsstring
quantityinteger(int32)
Response
application/json
{ "id": 0, "shop": "string", "name": "string", "type": "DISCOUNT_CODE", "referralType": "EXISTING_CUSTOMER_REWARD", "status": "ACTIVE", "redeemPoints": 0.1, "discountType": "PERCENTAGE", "discount": 0.1, "minimumPurchaseAmount": 0.1, "createAt": "2019-08-24T14:15:22Z", "updateAt": "2019-08-24T14:15:22Z", "maximumShippingRate": 0.1, "productId": 0, "variantId": 0, "productData": "string", "collectionId": 0, "collectionData": "string", "customerFacingLabel": "string", "restrictCustomers": "string", "restrictCustomersWithTags": "string", "rewardInterval": "DAY", "appliesOn": "ONE_TIME", "combinedWithProductDiscount": true, "combinedWithShippingDiscount": true, "combinedWithOrderDiscount": true, "triggeredCount": 0, "pointsCost": 0.1, "enableInterval": true, "redeemLimit": 0, "enableNumberOfUsagesLimit": true, "numberOfUsagesLimit": 0, "allowedCustomerTags": "string", "earnRuleId": 0, "vipTierId": 0, "redeemLabel": "string", "customerFacingIconUrl": "string", "serial": 0, "discountCodeForAllCustomer": true, "allowedCountries": "string", "showInPosOnly": true, "redeemAllPoints": true, "enableMinimumPointsToRedeem": true, "requiredMinimumPointsToRedeem": 0.1, "enableMaximumPointsToRedeem": true, "requiredMaximumPointsToRedeem": 0.1, "enablePOS": true, "minimumPointsLabel": "string", "maximumPointsLabel": "string", "applyDiscountOnce": true, "enableDiscountPrefix": true, "discountPrefixText": "string", "discountCodeNodeId": "string", "translations": "string", "quantity": 0 }

Get all point earning rules

Request

Retrieves all configured point earning rules for the shop. These rules define how customers can earn points (purchases, sign-ups, referrals, etc.). Optionally includes inactive rules when includeInactive=true.

Query
includeInactiveboolean

Include inactive rules in response (default: false)

Default false
Headers
X-API-Keystringrequired

API key for authentication

curl -i -X GET \
  'https://loyalty-admin.appstle.com/api/external/point-earn-rules?includeInactive=false' \
  -H 'X-API-Key: string'

Responses

Successfully retrieved point earning rules

Bodyapplication/json
idinteger(int64)
shopstring
typestringrequired
Enum"PURCHASE""VISIT_SHOP""REFERRAL""CREATE_ACCOUNT""FACEBOOK_PAGE_LIKE""FOLLOW_TWITTER""FOLLOW_INSTAGRAM""BIRTHDAY""LEAVE_REVIEW""SUBSCRIBE_NEWSLETTER"
statusstringrequired
Enum"ACTIVE""INACTIVE"
historicPurchaseDurationstring
Enum"NONE""ALL""ONE_HOUR""ONE_DAY""ONE_MONTH""THREE_MONTH""ONE_YEAR"
basePointsnumber(double)required
includeSubtotalbooleanrequired
includeTaxbooleanrequired
excludeCollectionsstring
namestringrequired
customerNotificationstringrequired
createAtstring(date-time)
updateAtstring(date-time)
rewardIntervalstring
Enum"DAY""WEEK""MONTH""YEAR""LIFETIME"
productIdinteger(int64)
collectionIdinteger(int64)
variantIdinteger(int64)
productDatastring
triggeredCountinteger(int64)
pointsProvidednumber(double)
collectionDatastring
customerFacingLabelstring
socialUrlstring
disableForOnSellProductboolean
autoApprovalDaysinteger(int32)
enableIntervalboolean
earnLimitinteger(int32)
activityTypestring
Enum"REGULAR""REFERRAL""VIP"
allowedCustomerTagsstring
includeShippingPointsbooleanrequired
eligibleForFirstOrderboolean
maximumPointsinteger(int32)
restrictCustomerTagsstring
customerFacingIconUrlstring
serialinteger(int32)
excludeOrderTagsstring
pointBasedOnstring
Enum"QUANTITY""AMOUNT_SPEND""FLAT_PURCHASE"
excludeProductsstring
givePointsToGuestCustomersboolean
allowedProductTagsstring
restrictProductTagsstring
rollBackPointsOnUnsubscribeboolean
addAdditionalPointsboolean
additionalPointsnumber(double)
refundNotificationLabelstring
disablePointsForDiscountedProductboolean
platformTypestring
Enum"POS_ONLY""ONLINE_STORE""BOTH"
vipTierIdinteger(int64)
earnTypestring
Enum"STORE_CREDIT""DISCOUNT_CODE""POINTS"
minimumOrderValuenumber(double)
allowedOrderTagsstring
excludeVariantIdsstring
rewardAssignTypestring
Enum"DYNAMIC""FIXED"
applyOnImportedCustomerboolean
enableBirthdayPromoboolean
promoPointsMultipliernumber(double)
ruleStartDatestring(date-time)
ruleEndDatestring(date-time)
translationsstring
Response
application/json
{ "id": 0, "shop": "string", "type": "PURCHASE", "status": "ACTIVE", "historicPurchaseDuration": "NONE", "basePoints": 0.1, "includeSubtotal": true, "includeTax": true, "excludeCollections": "string", "name": "string", "customerNotification": "string", "createAt": "2019-08-24T14:15:22Z", "updateAt": "2019-08-24T14:15:22Z", "rewardInterval": "DAY", "productId": 0, "collectionId": 0, "variantId": 0, "productData": "string", "triggeredCount": 0, "pointsProvided": 0.1, "collectionData": "string", "customerFacingLabel": "string", "socialUrl": "string", "disableForOnSellProduct": true, "autoApprovalDays": 0, "enableInterval": true, "earnLimit": 0, "activityType": "REGULAR", "allowedCustomerTags": "string", "includeShippingPoints": true, "eligibleForFirstOrder": true, "maximumPoints": 0, "restrictCustomerTags": "string", "customerFacingIconUrl": "string", "serial": 0, "excludeOrderTags": "string", "pointBasedOn": "QUANTITY", "excludeProducts": "string", "givePointsToGuestCustomers": true, "allowedProductTags": "string", "restrictProductTags": "string", "rollBackPointsOnUnsubscribe": true, "addAdditionalPoints": true, "additionalPoints": 0.1, "refundNotificationLabel": "string", "disablePointsForDiscountedProduct": true, "platformType": "POS_ONLY", "vipTierId": 0, "earnType": "STORE_CREDIT", "minimumOrderValue": 0.1, "allowedOrderTags": "string", "excludeVariantIds": "string", "rewardAssignType": "DYNAMIC", "applyOnImportedCustomer": true, "enableBirthdayPromo": true, "promoPointsMultiplier": 0.1, "ruleStartDate": "2019-08-24T14:15:22Z", "ruleEndDate": "2019-08-24T14:15:22Z", "translations": "string" }

Get customer loyalty details

Request

Retrieves comprehensive loyalty program details for a customer.

What you'll get:

  • Current point balance (available, pending, credited)
  • Store credit balance
  • VIP tier information and expiration date
  • List of rewards/discount codes with their status
  • Social media engagement status
  • Referral statistics
  • Customer enrollment date

Query options:

  • By customer ID: Use customerId parameter with Shopify customer ID
  • By email: Use customerEmail parameter with customer's email address
  • You must provide either customerId OR customerEmail (not both)

Filtering rewards:

  • Use status parameter to filter rewards: "ACTIVE", "USED", "UNUSED", "EXPIRED"
  • Comma-separated for multiple statuses: "UNUSED,ACTIVE"
  • Omit status parameter to get all rewards

Common use cases:

  • Display customer's loyalty dashboard
  • Check point balance before redemption
  • Verify discount code availability
  • Show VIP tier progress
  • Display referral achievements

Response field explanations:

  • availablePoints: Points customer can redeem right now
  • pendingPoints: Points awaiting approval (e.g., from pending orders)
  • creditedPoints: Total points earned all-time
  • spentAmount: Total monetary value of purchases
  • storeCreditBalance: Store credit in shop currency
  • currentVipTier: Name of customer's current VIP tier (null if not in a tier)
  • vipTierExpiredAt: When the VIP tier expires (null if permanent or not in tier)
  • rewardedForFacebook/Instagram/etc: Whether customer claimed social media points
  • referredCompleted: Count of successful referrals
  • referralLink: Unique referral URL for this customer
  • rewards: Array of discount codes/rewards with status, expiry, and value
Query
customerIdinteger(int64)

Shopify customer ID (optional if customerEmail provided)

customerEmailstring

Customer email address (optional if customerId provided)

statusstring

Filter rewards by status (comma-separated: ACTIVE, USED, UNUSED)

Headers
X-API-Keystringrequired

API key for authentication

curl -i -X GET \
  'https://loyalty-admin.appstle.com/api/external/customer-loyalty?customerId=0&customerEmail=string&status=string' \
  -H 'X-API-Key: string'

Responses

Successfully retrieved customer loyalty details

Bodyapplication/json
availablePointsnumber(double)
pendingPointsnumber(double)
creditedPointsnumber(double)
spentAmountnumber(double)
storeCreditBalancenumber(double)
achievableTierIdinteger(int64)
currentVipTierstring
vipTierExpiredAtstring(date-time)
createAtstring(date-time)
rewardedForFacebookboolean
rewardedForPinterestboolean
rewardedForTwitterboolean
rewardedForInstagramboolean
rewardedForYoutubeboolean
rewardedForTiktokboolean
rewardedForNewsLetterboolean
rewardedForSmsboolean
referredCompletedinteger(int64)
referralLinkstring
customerStatusstring
Enum"ACTIVE""INACTIVE""EXCLUDED""EXCLUDED_BY_CUSTOMER"
dobstring(date)
rewardsArray of objects(CustomerReward)
rewardedForCreatingAccountboolean
rewardedForSharingOnFacebookboolean
rewardedForSharingOnXboolean
Response
application/json
{ "availablePoints": 250, "pendingPoints": 50, "creditedPoints": 500, "spentAmount": 1250.99, "storeCreditBalance": 25, "currentVipTier": "Gold", "vipTierExpiredAt": "2025-12-31T23:59:59Z", "achievableTierId": 2, "createAt": "2024-01-15T10:00:00Z", "rewardedForFacebook": true, "rewardedForInstagram": false, "rewardedForTwitter": false, "rewardedForPinterest": false, "rewardedForYoutube": false, "rewardedForTiktok": false, "rewardedForNewsLetter": true, "rewardedForSms": false, "rewardedForCreatingAccount": true, "rewardedForSharingOnFacebook": false, "rewardedForSharingOnX": false, "referredCompleted": 3, "referralLink": "https://yourstore.com/r/abc123", "customerStatus": "ACTIVE", "dob": "1990-05-15", "rewards": [ {} ] }