Update the all-access pass
curl --request PUT \
--url https://api.salesive.com/api/v1/digital-products/pass \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"name": "All-access pass",
"description": "Every book in the store for 30 days.",
"price": 7500
}
'import requests
url = "https://api.salesive.com/api/v1/digital-products/pass"
payload = {
"enabled": True,
"name": "All-access pass",
"description": "Every book in the store for 30 days.",
"price": 7500
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
name: 'All-access pass',
description: 'Every book in the store for 30 days.',
price: 7500
})
};
fetch('https://api.salesive.com/api/v1/digital-products/pass', 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://api.salesive.com/api/v1/digital-products/pass",
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([
'enabled' => true,
'name' => 'All-access pass',
'description' => 'Every book in the store for 30 days.',
'price' => 7500
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.salesive.com/api/v1/digital-products/pass"
payload := strings.NewReader("{\n \"enabled\": true,\n \"name\": \"All-access pass\",\n \"description\": \"Every book in the store for 30 days.\",\n \"price\": 7500\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.salesive.com/api/v1/digital-products/pass")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"name\": \"All-access pass\",\n \"description\": \"Every book in the store for 30 days.\",\n \"price\": 7500\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesive.com/api/v1/digital-products/pass")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"name\": \"All-access pass\",\n \"description\": \"Every book in the store for 30 days.\",\n \"price\": 7500\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "All-access pass saved successfully",
"data": {
"pass": {
"_id": "6702e0a1e1b3a40012cd4001",
"shop": "66a1eee0e1b3a40012ab0001",
"enabled": true,
"name": "All-access pass",
"description": "Every book in the store for 30 days.",
"price": 7500,
"periodDays": 30,
"configured": true,
"productCount": 12
}
}
}{
"status": 400,
"success": false,
"message": "A one-time price is required",
"data": {}
}{
"status": 401,
"success": false,
"message": "App token expired or invalid.",
"data": {}
}{
"status": 403,
"success": false,
"message": "This app is missing the required permission(s): WRITE_INVENTORY",
"data": {}
}Digital products
Update the all-access pass
Creates or updates the store’s all-access pass.
PUT
/
digital-products
/
pass
Update the all-access pass
curl --request PUT \
--url https://api.salesive.com/api/v1/digital-products/pass \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"name": "All-access pass",
"description": "Every book in the store for 30 days.",
"price": 7500
}
'import requests
url = "https://api.salesive.com/api/v1/digital-products/pass"
payload = {
"enabled": True,
"name": "All-access pass",
"description": "Every book in the store for 30 days.",
"price": 7500
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
name: 'All-access pass',
description: 'Every book in the store for 30 days.',
price: 7500
})
};
fetch('https://api.salesive.com/api/v1/digital-products/pass', 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://api.salesive.com/api/v1/digital-products/pass",
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([
'enabled' => true,
'name' => 'All-access pass',
'description' => 'Every book in the store for 30 days.',
'price' => 7500
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.salesive.com/api/v1/digital-products/pass"
payload := strings.NewReader("{\n \"enabled\": true,\n \"name\": \"All-access pass\",\n \"description\": \"Every book in the store for 30 days.\",\n \"price\": 7500\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.salesive.com/api/v1/digital-products/pass")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"name\": \"All-access pass\",\n \"description\": \"Every book in the store for 30 days.\",\n \"price\": 7500\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesive.com/api/v1/digital-products/pass")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"name\": \"All-access pass\",\n \"description\": \"Every book in the store for 30 days.\",\n \"price\": 7500\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "All-access pass saved successfully",
"data": {
"pass": {
"_id": "6702e0a1e1b3a40012cd4001",
"shop": "66a1eee0e1b3a40012ab0001",
"enabled": true,
"name": "All-access pass",
"description": "Every book in the store for 30 days.",
"price": 7500,
"periodDays": 30,
"configured": true,
"productCount": 12
}
}
}{
"status": 400,
"success": false,
"message": "A one-time price is required",
"data": {}
}{
"status": 401,
"success": false,
"message": "App token expired or invalid.",
"data": {}
}{
"status": 403,
"success": false,
"message": "This app is missing the required permission(s): WRITE_INVENTORY",
"data": {}
}Creates or updates the store’s all-access pass. The period is fixed at 30 days. Turning the pass on (
enabled: true) needs a price above 0, otherwise the call returns 400 with Set a price above 0 to turn the pass on. Only the fields you send change. Requires the WRITE_INVENTORY scope.
These endpoints only work on a store whose type is
digital. On any other store they return 403 with This is only available on digital stores. See Digital stores.curl -X PUT https://api.salesive.com/api/v1/digital-products/pass \
-H "Authorization: Bearer app_<your-app-access-token>" \
-H "Content-Type: application/json" \
-d '{"enabled":true,"name":"All-access pass","price":7500}'
Authorizations
Installed-app access token (prefix app_), issued by the OAuth install flow. The store is bound to the token server-side , never send a shop id.
Body
application/json
Response
Update the all-access pass: success.
Example:
200
Example:
true
Example:
"All-access pass saved successfully"
Show child attributes
Show child attributes
Example:
{
"pass": {
"_id": "6702e0a1e1b3a40012cd4001",
"shop": "66a1eee0e1b3a40012ab0001",
"enabled": true,
"name": "All-access pass",
"description": "Every book in the store for 30 days.",
"price": 7500,
"periodDays": 30,
"configured": true,
"productCount": 12
}
}
Was this page helpful?

