Skip to main content
PUT
/
api
/
external
/
check-discount
Check discount code validity
curl --request PUT \
  --url https://loyalty-admin.appstle.com/api/external/check-discount \
  --header 'Content-Type: application/json' \
  --data '
{
  "customerId": 67890,
  "discountCode": "LOYALTY15OFF"
}
'
{
  "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"
}

Documentation Index

Fetch the complete documentation index at: https://developers.appstle.com/llms.txt

Use this file to discover all available pages before exploring further.

Body

application/json

Request containing customer ID and discount code to validate

customerId
integer<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

discountCode
string
required

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"
Maximum string length: 100
Example:

"LOYALTY15OFF"

Response

Discount code is valid and reward details returned

shop
string
required
customerId
integer<int64>
required
discountCode
string
required
status
enum<string>
required
Available options:
USED,
UNUSED,
REFUNDED,
EXPIRED,
SUBSCRIPTION_ACTIVE
createAt
string<date-time>
required
id
integer<int64>
description
string
pointTransactionId
integer<int64>
pointRedeemRuleId
integer<int64>
usedAt
string<date-time>
orderId
integer<int64>
orderName
string
expireDate
string<date-time>
variantId
integer<int64>
discountCodeId
string
productData
string
usageCount
integer<int64>
amount
number<double>
rewardType
enum<string>
Available options:
STORE_CREDIT,
DISCOUNT_CODE,
POINTS
lastExpiryReminderSentDate
string<date-time>