Redeeming programs
Redeeming program get, list and redeem using custome balance.
The list of redeeming program
Header parameters
X-Joy-Loyalty-App-KeystringOptionalExample:
App ID of your shop which retrieved from the Settings page
{{appKey}}
X-Joy-Loyalty-Secret-KeystringOptionalExample:
Secret Key of your shop which retrieved from the Settings page
{{secretKey}}
Responses
200
OK
application/json
get
GET /rest_api/v1/spending HTTP/1.1
Host: dev-api.joy.so
Accept: */*
200
OK
{
"data": [
{
"id": "aYorhxYUTkUKIDZgL1R5",
"enableRefundPointRedeem": false,
"redeemed": 0,
"prefix": "SW-",
"isLimitIntervalCustomer": false,
"combinedWith": [
"orderDiscounts",
"productDiscounts",
"shippingDiscounts"
],
"type": "spending",
"title": "Free Product Test",
"specificProductIds": [
44438017147115
],
"limitIntervalCustomer": 0,
"appliedDiscountToSaleChannel": "applyOnlineStore",
"variantId": null,
"shopId": "umN0f3GKyQC3XS1AwVWg",
"event": "free_gift",
"redeemIn": "available_in_online_store",
"spendPoint": 200,
"limitRedeem": "redeemWithoutLimit",
"showLoyaltyPage": true,
"isUsePrefixDiscountCode": true,
"userAvailability": "userRedeemed",
"totalLimitationRedeem": 0,
"earnAmount": 700,
"priority": 0,
"appliedCollectionIds": [],
"variantIds": [
44438017147115,
44438017147115,
44438017179883,
44438017245419
],
"redeemType": "fixed",
"appliedTo": "sf_product",
"specificProducts": [
{
"image": {
"src": "https://cdn.shopify.com/s/files/1/0680/3950/8203/products/Main_589fc064-24a2-4236-9eaf-13b2bd35d21d.jpg?v=1703045153"
},
"id": 8209413669099,
"title": "The Complete Snowboard"
}
],
"createdAt": "2024-08-27T08:09:46.757Z",
"expired": false,
"isDraft": false,
"giftStatus": "none",
"status": true,
"listShopifyIdDiscount": [
"1370365395179",
"1370365460715"
],
"translateTitle": "اختبار المنتج مجانا",
"updatedAt": "2024-08-30T09:50:38.967Z",
"friendSpecificProducts": [
{
"image": {
"src": "https://cdn.shopify.com/s/files/1/0680/3950/8203/products/Main_589fc064-24a2-4236-9eaf-13b2bd35d21d.jpg?v=1703045153"
},
"id": 8209413669099,
"title": "The Complete Snowboard"
}
],
"customerSpecificProductIds": [
44438017147115
],
"customerSpecificProducts": [
{
"image": {
"src": "https://cdn.shopify.com/s/files/1/0680/3950/8203/products/Main_589fc064-24a2-4236-9eaf-13b2bd35d21d.jpg?v=1703045153"
},
"id": 8209413669099,
"title": "The Complete Snowboard"
}
],
"friendSpecificProductIds": [
44438017147115
]
}
]
}
Get a specific redeeming program by its ID.
Path parameters
spendingProgramIdstringRequired
Header parameters
X-Joy-Loyalty-App-KeystringOptionalExample:
{{appKey}}
X-Joy-Loyalty-Secret-KeystringOptionalExample:
{{secretKey}}
Responses
200
OK
application/json
get
GET /rest_api/v1/spending/{spendingProgramId} HTTP/1.1
Host: dev-api.joy.so
Accept: */*
200
OK
{
"data": {
"id": "aYorhxYUTkUKIDZgL1R5",
"enableRefundPointRedeem": false,
"redeemed": 0,
"prefix": "SW-",
"isLimitIntervalCustomer": false,
"combinedWith": [
"orderDiscounts",
"productDiscounts",
"shippingDiscounts"
],
"type": "spending",
"title": "Free Product Test",
"specificProductIds": [
44438017147115
],
"limitIntervalCustomer": 0,
"appliedDiscountToSaleChannel": "applyOnlineStore",
"variantId": null,
"shopId": "umN0f3GKyQC3XS1AwVWg",
"event": "free_gift",
"redeemIn": "available_in_online_store",
"spendPoint": 200,
"limitRedeem": "redeemWithoutLimit",
"showLoyaltyPage": true,
"isUsePrefixDiscountCode": true,
"userAvailability": "userRedeemed",
"totalLimitationRedeem": 0,
"earnAmount": 700,
"priority": 0,
"appliedCollectionIds": [],
"variantIds": [
44438017147115,
44438017147115,
44438017179883,
44438017245419
],
"redeemType": "fixed",
"appliedTo": "sf_product",
"specificProducts": [
{
"image": {
"src": "https://cdn.shopify.com/s/files/1/0680/3950/8203/products/Main_589fc064-24a2-4236-9eaf-13b2bd35d21d.jpg?v=1703045153"
},
"id": 8209413669099,
"title": "The Complete Snowboard"
}
],
"createdAt": "2024-08-27T08:09:46.757Z",
"expired": false,
"isDraft": false,
"giftStatus": "none",
"status": true,
"listShopifyIdDiscount": [
"1370365395179",
"1370365460715"
],
"translateTitle": "اختبار المنتج مجانا",
"updatedAt": "2024-08-30T09:50:38.967Z",
"friendSpecificProducts": [
{
"image": {
"src": "https://cdn.shopify.com/s/files/1/0680/3950/8203/products/Main_589fc064-24a2-4236-9eaf-13b2bd35d21d.jpg?v=1703045153"
},
"id": 8209413669099,
"title": "The Complete Snowboard"
}
],
"customerSpecificProductIds": [
44438017147115
],
"customerSpecificProducts": [
{
"image": {
"src": "https://cdn.shopify.com/s/files/1/0680/3950/8203/products/Main_589fc064-24a2-4236-9eaf-13b2bd35d21d.jpg?v=1703045153"
},
"id": 8209413669099,
"title": "The Complete Snowboard"
}
],
"friendSpecificProductIds": [
44438017147115
]
}
}
Redeem customer loyalty points for discounts or rewards.
Header parameters
X-Joy-Loyalty-App-KeystringOptionalExample:
App ID of your shop which is retrieved from the Settings page
{{appKey}}
X-Joy-Loyalty-Secret-KeystringOptionalExample:
Secret Key of your shop which is retrieved from the Settings page
{{secretKey}}
Body
customerIdstringOptional
The unique ID of the customer
programIdstringOptional
The ID of the loyalty program
localestringOptional
The locale of the customer
redeemPointnumberOptional
Number of points the customer wants to redeem
shopifyCustomerIdnumberOptional
The Shopify customer ID
sourcestringOptional
The source of the redemption request
Responses
200
OK
application/json
post
POST /rest_api/v1/redeem HTTP/1.1
Host: dev-api.joy.so
Content-Type: application/json
Accept: */*
Content-Length: 110
{
"customerId": "text",
"programId": "text",
"locale": "text",
"redeemPoint": 1,
"shopifyCustomerId": 1,
"source": "text"
}
200
OK
{
"data": {
"customer": {
"id": "2GEU2AwtJ84twLyrnjCp",
"shopifyCustomerId": 7114710712597,
"totalSpent": 0,
"name": "Joy Redeem",
"state": "enabled",
"shopId": "nDaevBKY0zGCzmJz8mCv",
"type": "member",
"acceptsMarketing": false,
"email": "[email protected]",
"createdAt": "2023-07-14T04:08:59.471Z",
"hasPoint": true,
"urlReferral": "https://avadajoystaging.page.link/wsyg",
"latestActivity": "2023-07-28T07:47:29.598Z",
"point": 98992000,
"updatedAt": "2023-07-28T07:47:29.598Z",
"appliedCollectionIds": []
},
"discount": {
"id": 19360491045141,
"price_rule_id": 1388362170645,
"code": "JOY-Y9XI6N40OLBZ",
"usage_count": 0,
"created_at": "2023-07-28T03:47:43-04:00",
"updated_at": "2023-07-28T03:47:43-04:00"
}
}
}
Last updated