Turn auto-renew on or off
curl --request POST \
--url https://store.salesive.com/api/v1/library/{entitlementId}/auto-renew \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop-id: <api-key>' \
--data '
{
"enabled": false
}
'import requests
url = "https://store.salesive.com/api/v1/library/{entitlementId}/auto-renew"
payload = { "enabled": False }
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'x-shop-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: false})
};
fetch('https://store.salesive.com/api/v1/library/{entitlementId}/auto-renew', 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://store.salesive.com/api/v1/library/{entitlementId}/auto-renew",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-shop-id: <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://store.salesive.com/api/v1/library/{entitlementId}/auto-renew"
payload := strings.NewReader("{\n \"enabled\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-shop-id", "<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))
}HttpResponse<String> response = Unirest.post("https://store.salesive.com/api/v1/library/{entitlementId}/auto-renew")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/library/{entitlementId}/auto-renew")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "Auto-renew turned off",
"data": {
"entitlementId": "6702d3f0e1b3a40012cd3001",
"autoRenew": false
}
}{
"status": 400,
"success": false,
"message": "No saved card. Tick \"Renew automatically\" the next time you buy this pass.",
"code": "no_saved_card",
"data": {}
}{
"status": 403,
"success": false,
"message": "Please log in to see your library",
"code": "login_required",
"data": {}
}{
"status": 404,
"success": false,
"message": "Access not found",
"code": "not_found",
"data": {}
}Library
Turn auto-renew on or off
Switch automatic renewal of a 30-day pass for the signed-in shopper.
POST
/
library
/
{entitlementId}
/
auto-renew
Turn auto-renew on or off
curl --request POST \
--url https://store.salesive.com/api/v1/library/{entitlementId}/auto-renew \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop-id: <api-key>' \
--data '
{
"enabled": false
}
'import requests
url = "https://store.salesive.com/api/v1/library/{entitlementId}/auto-renew"
payload = { "enabled": False }
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'x-shop-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: false})
};
fetch('https://store.salesive.com/api/v1/library/{entitlementId}/auto-renew', 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://store.salesive.com/api/v1/library/{entitlementId}/auto-renew",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-shop-id: <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://store.salesive.com/api/v1/library/{entitlementId}/auto-renew"
payload := strings.NewReader("{\n \"enabled\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-shop-id", "<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))
}HttpResponse<String> response = Unirest.post("https://store.salesive.com/api/v1/library/{entitlementId}/auto-renew")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/library/{entitlementId}/auto-renew")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "Auto-renew turned off",
"data": {
"entitlementId": "6702d3f0e1b3a40012cd3001",
"autoRenew": false
}
}{
"status": 400,
"success": false,
"message": "No saved card. Tick \"Renew automatically\" the next time you buy this pass.",
"code": "no_saved_card",
"data": {}
}{
"status": 403,
"success": false,
"message": "Please log in to see your library",
"code": "login_required",
"data": {}
}{
"status": 404,
"success": false,
"message": "Access not found",
"code": "not_found",
"data": {}
}Request
POST /library/6702d3f0e1b3a40012cd3001/auto-renew
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
Content-Type: application/json
{
"enabled": false
}
Headers
| Header | Type | Description |
|---|---|---|
Authorization | string | Provide the customer token as Bearer <jwt>. Must be a real, signed-in account. |
x-shop-id | string | Identify the shop context. |
Content-Type | string | Always set to application/json. |
Path parameters
| Parameter | Type | Description |
|---|---|---|
entitlementId | string | The entitlementId of a row from Get the shopper’s library. |
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | true to renew automatically, false to stop. |
How auto-renew works. The shopper opts in when buying a pass, by sending
autoRenew: true when adding the line to the cart or when creating the order. If they pay by card through Paystack and the card can be charged again, it is saved (encrypted) on the access record. From then on, within 3 days before the pass ends, Salesive charges the saved card at today’s price and extends the pass by 30 days. After 3 failed charges auto-renew switches itself off, and the shopper is emailed each time.Turning it off here also throws the saved card away. Turning it on needs a card that was saved earlier, so there is no way to switch it on for a pass that was never bought with the opt-in. Lifetime access cannot be renewed.Successful response
{
"status": 200,
"success": true,
"message": "Auto-renew turned off",
"data": {
"entitlementId": "6702d3f0e1b3a40012cd3001",
"autoRenew": false
}
}
Error responses
| Status | code | When |
|---|---|---|
400 | invalid_body | enabled is missing or not a boolean. |
400 | not_renewable | The access is lifetime. |
400 | no_saved_card | Turning it on without a saved card. |
403 | login_required | Not a real signed-in account. |
404 | not_found | No such access for this shopper in this store. |
{
"status": 400,
"success": false,
"message": "No saved card. Tick \"Renew automatically\" the next time you buy this pass.",
"code": "no_saved_card",
"data": {}
}
Authorizations
JWT issued by the Salesive Store API for authenticated shoppers.
Optional storefront identifier sent as a header to scope responses to a specific shop. Try It requests remember this value once provided.
Headers
Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.
Path Parameters
The entitlementId of a library row.
Body
application/json
Was this page helpful?

