Get the shopper's library
curl --request GET \
--url https://store.salesive.com/api/v1/library \
--header 'Authorization: Bearer <token>' \
--header 'x-shop-id: <api-key>'import requests
url = "https://store.salesive.com/api/v1/library"
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'x-shop-id': '<api-key>'}
};
fetch('https://store.salesive.com/api/v1/library', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://store.salesive.com/api/v1/library"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-shop-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://store.salesive.com/api/v1/library")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/library")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "Library retrieved",
"data": {
"items": [
{
"entitlementId": "6702d3f0e1b3a40012cd3001",
"productId": "6702c1a4e1b3a40012cd2001",
"name": "The Lagos Cookbook",
"author": "Ngozi Okafor",
"images": [
"https://cdn.salesive.com/d/lagos-cookbook-cover.jpg"
],
"format": "pdf",
"size": 8421376,
"source": "pass",
"kind": "pass",
"status": "active",
"accessUntil": "2026-11-11T08:00:00.000Z",
"daysLeft": 30,
"autoRenew": true,
"autoRenewCard": {
"brand": "visa",
"last4": "4081"
},
"renewMode": "pass",
"downloadUrl": "https://store.salesive.com/api/v1/downloads/9f2c1b7e4a6d8035c1e2f4a7b9d0c3e5a8b1d4f6c7e90123"
}
],
"pass": {
"name": "All-access pass",
"description": "Every book in the store for 30 days.",
"price": 7500,
"periodDays": 30,
"productCount": 12
}
}
}{
"status": 400,
"success": false,
"message": "Store context is required",
"code": "shop_required",
"data": {}
}{
"status": 403,
"success": false,
"message": "Please log in to see your library",
"code": "login_required",
"data": {}
}{
"status": 500,
"success": false,
"message": "Could not load your library",
"code": "library_error",
"data": {}
}Library
Get the shopper's library
Return every digital title the signed-in shopper holds in this store, with download links.
GET
/
library
Get the shopper's library
curl --request GET \
--url https://store.salesive.com/api/v1/library \
--header 'Authorization: Bearer <token>' \
--header 'x-shop-id: <api-key>'import requests
url = "https://store.salesive.com/api/v1/library"
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'x-shop-id': '<api-key>'}
};
fetch('https://store.salesive.com/api/v1/library', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://store.salesive.com/api/v1/library"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-shop-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://store.salesive.com/api/v1/library")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/library")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "Library retrieved",
"data": {
"items": [
{
"entitlementId": "6702d3f0e1b3a40012cd3001",
"productId": "6702c1a4e1b3a40012cd2001",
"name": "The Lagos Cookbook",
"author": "Ngozi Okafor",
"images": [
"https://cdn.salesive.com/d/lagos-cookbook-cover.jpg"
],
"format": "pdf",
"size": 8421376,
"source": "pass",
"kind": "pass",
"status": "active",
"accessUntil": "2026-11-11T08:00:00.000Z",
"daysLeft": 30,
"autoRenew": true,
"autoRenewCard": {
"brand": "visa",
"last4": "4081"
},
"renewMode": "pass",
"downloadUrl": "https://store.salesive.com/api/v1/downloads/9f2c1b7e4a6d8035c1e2f4a7b9d0c3e5a8b1d4f6c7e90123"
}
],
"pass": {
"name": "All-access pass",
"description": "Every book in the store for 30 days.",
"price": 7500,
"periodDays": 30,
"productCount": 12
}
}
}{
"status": 400,
"success": false,
"message": "Store context is required",
"code": "shop_required",
"data": {}
}{
"status": 403,
"success": false,
"message": "Please log in to see your library",
"code": "login_required",
"data": {}
}{
"status": 500,
"success": false,
"message": "Could not load your library",
"code": "library_error",
"data": {}
}Request
GET /library
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
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. |
A guest session (the anonymous user from
POST /auth/ghost) or a request with no token gets 403 with code: "login_required". Send the shopper through the login flow, then call this again. Buying a digital item also needs a real account, because access is tied to the buyer’s email. The response is sent with Cache-Control: no-store because every downloadUrl carries a credential.Response fields
data.items has one row per title. When several purchases reach the same title (for example a lifetime copy and the all-access pass), the best one is shown.
| Field | Type | Description |
|---|---|---|
entitlementId | string | The access record id. Pass it to Turn auto-renew on or off. |
productId | string | The digital product id. |
name, author, images | mixed | Title details for display. |
format, size | string, number | pdf, epub, mobi or zip, and the size in bytes. |
source | string | purchase (bought outright), pass (a 30-day pass for this title), all_access (the store pass) or granted (given by the seller). |
kind | string | lifetime or pass. |
status | string | active or expired. Revoked access is not listed. |
accessUntil | string | null | End of a pass. null for lifetime access. |
daysLeft | number | null | Whole days left. null for lifetime access, 0 once expired. |
autoRenew | boolean | Whether the pass renews automatically. |
autoRenewCard | object | null | { brand, last4 } of the saved card while auto-renew is on. |
renewMode | string | null | What buying again would buy: pass (this title for 30 days) or all_access. null when the row cannot be renewed. |
downloadUrl | string | null | Opens the file, see Download a purchased file. null once the access has expired. |
data.pass is the store’s current all-access pass, or null, so the library page can offer a renewal without a second call.
Successful response
{
"status": 200,
"success": true,
"message": "Library retrieved",
"data": {
"items": [
{
"entitlementId": "6702d3f0e1b3a40012cd3001",
"productId": "6702c1a4e1b3a40012cd2001",
"name": "The Lagos Cookbook",
"author": "Ngozi Okafor",
"images": ["https://cdn.salesive.com/d/lagos-cookbook-cover.jpg"],
"format": "pdf",
"size": 8421376,
"source": "pass",
"kind": "pass",
"status": "active",
"accessUntil": "2026-11-11T08:00:00.000Z",
"daysLeft": 30,
"autoRenew": true,
"autoRenewCard": { "brand": "visa", "last4": "4081" },
"renewMode": "pass",
"downloadUrl": "https://store.salesive.com/api/v1/downloads/9f2c1b7e4a6d8035c1e2f4a7b9d0c3e5a8b1d4f6c7e90123"
}
],
"pass": {
"name": "All-access pass",
"description": "Every book in the store for 30 days.",
"price": 7500,
"periodDays": 30,
"productCount": 12
}
}
}
Renewing
A pass is renewed by buying it again: add{ "digitalId": "<productId>", "mode": "pass" } (or { "allAccess": true } when renewMode is all_access) with Add item to cart and check out as usual. The new purchase extends the same access record, adding 30 days to whatever is left.
Error response
{
"status": 403,
"success": false,
"message": "Please log in to see your library",
"code": "login_required",
"data": {}
}
400 shop_required (no store context) and 500 library_error.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.
Response
The shopper's library.
Example:
200
Example:
true
Example:
"Library retrieved"
Show child attributes
Show child attributes
Example:
{
"items": [
{
"entitlementId": "6702d3f0e1b3a40012cd3001",
"productId": "6702c1a4e1b3a40012cd2001",
"name": "The Lagos Cookbook",
"author": "Ngozi Okafor",
"images": [
"https://cdn.salesive.com/d/lagos-cookbook-cover.jpg"
],
"format": "pdf",
"size": 8421376,
"source": "pass",
"kind": "pass",
"status": "active",
"accessUntil": "2026-11-11T08:00:00.000Z",
"daysLeft": 30,
"autoRenew": true,
"autoRenewCard": { "brand": "visa", "last4": "4081" },
"renewMode": "pass",
"downloadUrl": "https://store.salesive.com/api/v1/downloads/9f2c1b7e4a6d8035c1e2f4a7b9d0c3e5a8b1d4f6c7e90123"
}
],
"pass": {
"name": "All-access pass",
"description": "Every book in the store for 30 days.",
"price": 7500,
"periodDays": 30,
"productCount": 12
}
}
Was this page helpful?

