Deactivate loyalty program
curl --request PUT \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"loyalty_program": {
"name": "<string>",
"renewal_type": "yearly",
"starts_at": "2023-12-25",
"date_of_reset": "2023-12-25",
"tier_upgrade_criteria": "total-spent",
"points_earning_type": "dynamic",
"point_value": 1,
"redemption_expiry_type": "never",
"redemption_inactivity_days": 123,
"tiers": [
{
"name": "<string>",
"total_spent_threshold": 1,
"total_orders_threshold": 1,
"points_earning_rate": 123,
"fixed_points": 123,
"id": "<string>",
"is_initial": true,
"next_tier_id": 123
}
],
"id": "<string>",
"status": "draft",
"pause_starts_at": "2023-11-07T05:31:56Z",
"pause_ends_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z"
}
}
}Customers
Deactivate loyalty program
Deactivates the loyalty program, setting its status to inactive. Can only be used when the current status is active, scheduled, or paused. Returns the updated LoyaltyProgram object.
PUT
/
customers
/
loyalty-program
/
{id}
/
deactivate
Deactivate loyalty program
curl --request PUT \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/customers/loyalty-program/{id}/deactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"loyalty_program": {
"name": "<string>",
"renewal_type": "yearly",
"starts_at": "2023-12-25",
"date_of_reset": "2023-12-25",
"tier_upgrade_criteria": "total-spent",
"points_earning_type": "dynamic",
"point_value": 1,
"redemption_expiry_type": "never",
"redemption_inactivity_days": 123,
"tiers": [
{
"name": "<string>",
"total_spent_threshold": 1,
"total_orders_threshold": 1,
"points_earning_rate": 123,
"fixed_points": 123,
"id": "<string>",
"is_initial": true,
"next_tier_id": 123
}
],
"id": "<string>",
"status": "draft",
"pause_starts_at": "2023-11-07T05:31:56Z",
"pause_ends_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z"
}
}
}Was this page helpful?
⌘I