Redemptions & Discount Codes
Update discount code status (legacy endpoint)
PUT
/
api
/
external
/
update-discount-code-status
Update discount code status (legacy endpoint)
curl --request PUT \
--url https://loyalty-admin.appstle.com/api/external/update-discount-code-status \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"discountCode": "<string>",
"status": "<string>"
}
'import requests
url = "https://loyalty-admin.appstle.com/api/external/update-discount-code-status"
payload = {
"discountCode": "<string>",
"status": "<string>"
}
headers = {
"X-API-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({discountCode: '<string>', status: '<string>'})
};
fetch('https://loyalty-admin.appstle.com/api/external/update-discount-code-status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://loyalty-admin.appstle.com/api/external/update-discount-code-status';
const options = {
method: 'PUT',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({discountCode: '<string>', status: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://loyalty-admin.appstle.com/api/external/update-discount-code-status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'discountCode' => '<string>',
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://loyalty-admin.appstle.com/api/external/update-discount-code-status"
payload := strings.NewReader("{\n \"discountCode\": \"<string>\",\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://loyalty-admin.appstle.com/api/external/update-discount-code-status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"discountCode\": \"<string>\",\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"achievableTierId": 123,
"availablePoints": 123,
"createAt": "2023-11-07T05:31:56Z",
"creditedPoints": 123,
"currentVipTier": "<string>",
"dob": "2023-12-25",
"expiringPointsAmount": 123,
"pendingPoints": 123,
"pointsExpireAt": "2023-11-07T05:31:56Z",
"referralLink": "<string>",
"referredCompleted": 123,
"rewardedForCreatingAccount": true,
"rewardedForFacebook": true,
"rewardedForInstagram": true,
"rewardedForNewsLetter": true,
"rewardedForPinterest": true,
"rewardedForSharingOnFacebook": true,
"rewardedForSharingOnX": true,
"rewardedForSms": true,
"rewardedForTiktok": true,
"rewardedForTwitter": true,
"rewardedForYoutube": true,
"rewards": [
{
"createAt": "2023-11-07T05:31:56Z",
"customerId": 123,
"discountCode": "<string>",
"shop": "<string>",
"amount": 123,
"description": "<string>",
"discountCodeId": "<string>",
"expireDate": "2023-11-07T05:31:56Z",
"id": 123,
"lastExpiryReminderSentDate": "2023-11-07T05:31:56Z",
"orderId": 123,
"orderName": "<string>",
"pointRedeemRuleId": 123,
"pointTransactionId": 123,
"productData": "<string>",
"usageCount": 123,
"usedAt": "2023-11-07T05:31:56Z",
"variantId": 123
}
],
"spentAmount": 123,
"storeCreditBalance": 123,
"storeCreditCurrency": "<string>",
"vipTierExpiredAt": "2023-11-07T05:31:56Z"
}Headers
API key for authentication
Body
application/json
Response
Discount code status updated and customer loyalty details returned
Available options:
ACTIVE, INACTIVE, EXCLUDED, EXCLUDED_BY_CUSTOMER Show child attributes
Show child attributes
⌘I
Update discount code status (legacy endpoint)
curl --request PUT \
--url https://loyalty-admin.appstle.com/api/external/update-discount-code-status \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"discountCode": "<string>",
"status": "<string>"
}
'import requests
url = "https://loyalty-admin.appstle.com/api/external/update-discount-code-status"
payload = {
"discountCode": "<string>",
"status": "<string>"
}
headers = {
"X-API-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({discountCode: '<string>', status: '<string>'})
};
fetch('https://loyalty-admin.appstle.com/api/external/update-discount-code-status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://loyalty-admin.appstle.com/api/external/update-discount-code-status';
const options = {
method: 'PUT',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({discountCode: '<string>', status: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://loyalty-admin.appstle.com/api/external/update-discount-code-status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'discountCode' => '<string>',
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://loyalty-admin.appstle.com/api/external/update-discount-code-status"
payload := strings.NewReader("{\n \"discountCode\": \"<string>\",\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://loyalty-admin.appstle.com/api/external/update-discount-code-status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"discountCode\": \"<string>\",\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"achievableTierId": 123,
"availablePoints": 123,
"createAt": "2023-11-07T05:31:56Z",
"creditedPoints": 123,
"currentVipTier": "<string>",
"dob": "2023-12-25",
"expiringPointsAmount": 123,
"pendingPoints": 123,
"pointsExpireAt": "2023-11-07T05:31:56Z",
"referralLink": "<string>",
"referredCompleted": 123,
"rewardedForCreatingAccount": true,
"rewardedForFacebook": true,
"rewardedForInstagram": true,
"rewardedForNewsLetter": true,
"rewardedForPinterest": true,
"rewardedForSharingOnFacebook": true,
"rewardedForSharingOnX": true,
"rewardedForSms": true,
"rewardedForTiktok": true,
"rewardedForTwitter": true,
"rewardedForYoutube": true,
"rewards": [
{
"createAt": "2023-11-07T05:31:56Z",
"customerId": 123,
"discountCode": "<string>",
"shop": "<string>",
"amount": 123,
"description": "<string>",
"discountCodeId": "<string>",
"expireDate": "2023-11-07T05:31:56Z",
"id": 123,
"lastExpiryReminderSentDate": "2023-11-07T05:31:56Z",
"orderId": 123,
"orderName": "<string>",
"pointRedeemRuleId": 123,
"pointTransactionId": 123,
"productData": "<string>",
"usageCount": 123,
"usedAt": "2023-11-07T05:31:56Z",
"variantId": 123
}
],
"spentAmount": 123,
"storeCreditBalance": 123,
"storeCreditCurrency": "<string>",
"vipTierExpiredAt": "2023-11-07T05:31:56Z"
}