curl --request POST \
--url https://api.salesive.com/api/v1/digital-access/grant \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "ada@example.com",
"productId": "6702c1a4e1b3a40012cd2001",
"kind": "pass",
"days": 30,
"grantId": "6702f0b2e1b3a40012cd5001"
}
'import requests
url = "https://api.salesive.com/api/v1/digital-access/grant"
payload = {
"email": "ada@example.com",
"productId": "6702c1a4e1b3a40012cd2001",
"kind": "pass",
"days": 30,
"grantId": "6702f0b2e1b3a40012cd5001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'ada@example.com',
productId: '6702c1a4e1b3a40012cd2001',
kind: 'pass',
days: 30,
grantId: '6702f0b2e1b3a40012cd5001'
})
};
fetch('https://api.salesive.com/api/v1/digital-access/grant', 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-access/grant",
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([
'email' => 'ada@example.com',
'productId' => '6702c1a4e1b3a40012cd2001',
'kind' => 'pass',
'days' => 30,
'grantId' => '6702f0b2e1b3a40012cd5001'
]),
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-access/grant"
payload := strings.NewReader("{\n \"email\": \"ada@example.com\",\n \"productId\": \"6702c1a4e1b3a40012cd2001\",\n \"kind\": \"pass\",\n \"days\": 30,\n \"grantId\": \"6702f0b2e1b3a40012cd5001\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.salesive.com/api/v1/digital-access/grant")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"ada@example.com\",\n \"productId\": \"6702c1a4e1b3a40012cd2001\",\n \"kind\": \"pass\",\n \"days\": 30,\n \"grantId\": \"6702f0b2e1b3a40012cd5001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesive.com/api/v1/digital-access/grant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"ada@example.com\",\n \"productId\": \"6702c1a4e1b3a40012cd2001\",\n \"kind\": \"pass\",\n \"days\": 30,\n \"grantId\": \"6702f0b2e1b3a40012cd5001\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "Access granted",
"data": {
"_id": "6702d3f0e1b3a40012cd3001",
"email": "ada@example.com",
"user": "66f0aa11e1b3a40012ef0001",
"scope": "product",
"product": {
"_id": "6702c1a4e1b3a40012cd2001",
"name": "The Lagos Cookbook"
},
"kind": "pass",
"status": "active",
"source": "granted",
"startsAt": "2026-10-12T08:00:00.000Z",
"accessUntil": "2026-11-11T08:00:00.000Z",
"daysLeft": 30,
"autoRenew": {
"enabled": false,
"cardLast4": null,
"cardBrand": null
},
"revokedAt": null,
"revokedReason": "",
"createdAt": "2026-10-12T08:00:00.000Z",
"updatedAt": "2026-10-12T08:00:00.000Z"
}
}{
"status": 201,
"success": true,
"message": "Access granted",
"data": {
"_id": "6702d3f0e1b3a40012cd3001",
"email": "ada@example.com",
"user": "66f0aa11e1b3a40012ef0001",
"scope": "product",
"product": {
"_id": "6702c1a4e1b3a40012cd2001",
"name": "The Lagos Cookbook"
},
"kind": "pass",
"status": "active",
"source": "granted",
"startsAt": "2026-10-12T08:00:00.000Z",
"accessUntil": "2026-11-11T08:00:00.000Z",
"daysLeft": 30,
"autoRenew": {
"enabled": false,
"cardLast4": null,
"cardBrand": null
},
"revokedAt": null,
"revokedReason": "",
"createdAt": "2026-10-12T08:00:00.000Z",
"updatedAt": "2026-10-12T08:00:00.000Z"
}
}{
"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": {}
}{
"status": 404,
"success": false,
"message": "Product not found",
"data": {}
}Grant buyer access
Gives a buyer lifetime or pass access to a product, or the all-access pass, without a payment.
curl --request POST \
--url https://api.salesive.com/api/v1/digital-access/grant \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "ada@example.com",
"productId": "6702c1a4e1b3a40012cd2001",
"kind": "pass",
"days": 30,
"grantId": "6702f0b2e1b3a40012cd5001"
}
'import requests
url = "https://api.salesive.com/api/v1/digital-access/grant"
payload = {
"email": "ada@example.com",
"productId": "6702c1a4e1b3a40012cd2001",
"kind": "pass",
"days": 30,
"grantId": "6702f0b2e1b3a40012cd5001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'ada@example.com',
productId: '6702c1a4e1b3a40012cd2001',
kind: 'pass',
days: 30,
grantId: '6702f0b2e1b3a40012cd5001'
})
};
fetch('https://api.salesive.com/api/v1/digital-access/grant', 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-access/grant",
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([
'email' => 'ada@example.com',
'productId' => '6702c1a4e1b3a40012cd2001',
'kind' => 'pass',
'days' => 30,
'grantId' => '6702f0b2e1b3a40012cd5001'
]),
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-access/grant"
payload := strings.NewReader("{\n \"email\": \"ada@example.com\",\n \"productId\": \"6702c1a4e1b3a40012cd2001\",\n \"kind\": \"pass\",\n \"days\": 30,\n \"grantId\": \"6702f0b2e1b3a40012cd5001\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.salesive.com/api/v1/digital-access/grant")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"ada@example.com\",\n \"productId\": \"6702c1a4e1b3a40012cd2001\",\n \"kind\": \"pass\",\n \"days\": 30,\n \"grantId\": \"6702f0b2e1b3a40012cd5001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesive.com/api/v1/digital-access/grant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"ada@example.com\",\n \"productId\": \"6702c1a4e1b3a40012cd2001\",\n \"kind\": \"pass\",\n \"days\": 30,\n \"grantId\": \"6702f0b2e1b3a40012cd5001\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "Access granted",
"data": {
"_id": "6702d3f0e1b3a40012cd3001",
"email": "ada@example.com",
"user": "66f0aa11e1b3a40012ef0001",
"scope": "product",
"product": {
"_id": "6702c1a4e1b3a40012cd2001",
"name": "The Lagos Cookbook"
},
"kind": "pass",
"status": "active",
"source": "granted",
"startsAt": "2026-10-12T08:00:00.000Z",
"accessUntil": "2026-11-11T08:00:00.000Z",
"daysLeft": 30,
"autoRenew": {
"enabled": false,
"cardLast4": null,
"cardBrand": null
},
"revokedAt": null,
"revokedReason": "",
"createdAt": "2026-10-12T08:00:00.000Z",
"updatedAt": "2026-10-12T08:00:00.000Z"
}
}{
"status": 201,
"success": true,
"message": "Access granted",
"data": {
"_id": "6702d3f0e1b3a40012cd3001",
"email": "ada@example.com",
"user": "66f0aa11e1b3a40012ef0001",
"scope": "product",
"product": {
"_id": "6702c1a4e1b3a40012cd2001",
"name": "The Lagos Cookbook"
},
"kind": "pass",
"status": "active",
"source": "granted",
"startsAt": "2026-10-12T08:00:00.000Z",
"accessUntil": "2026-11-11T08:00:00.000Z",
"daysLeft": 30,
"autoRenew": {
"enabled": false,
"cardLast4": null,
"cardBrand": null
},
"revokedAt": null,
"revokedReason": "",
"createdAt": "2026-10-12T08:00:00.000Z",
"updatedAt": "2026-10-12T08:00:00.000Z"
}
}{
"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": {}
}{
"status": 404,
"success": false,
"message": "Product not found",
"data": {}
}WRITE_INVENTORY scope.
- The buyer must already have a shopper account in the store (they have signed in once). Otherwise the call returns
404. - Send either
productIdorallAccess: true. The all-access pass can only be granted as apass.lifetimetakes nodays. - A pass defaults to 30 days (1 to 3650).
- If that buyer already has a record for the same product and kind, it is extended or reactivated instead of duplicated.
- Send the same
grantId(an ObjectId you generate) on a retry and the repeat changes nothing. Without agrantId, every call applies again.
201 when a record was created, 200 otherwise. The buyer does not get an email from this call.
WRITE_INVENTORY scope as editing products, so only request it for apps that are meant to manage buyers.digital. On any other store they return 403 with This is only available on digital stores. See Digital stores.curl -X POST https://api.salesive.com/api/v1/digital-access/grant \
-H "Authorization: Bearer app_<your-app-access-token>" \
-H "Content-Type: application/json" \
-d '{"email":"ada@example.com","productId":"6702c1a4e1b3a40012cd2001","kind":"pass","days":30,"grantId":"6702f0b2e1b3a40012cd5001"}'
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
The buyer's email address. Must belong to an existing shopper account.
lifetime never expires. pass runs for days.
lifetime, pass The digital product to grant. Omit when allAccess is true.
Grant the store-wide all-access pass instead of one product. Only valid with kind: "pass".
Length of a pass in days. Default 30. Not allowed with lifetime.
1 <= x <= 3650Optional ObjectId you generate. Makes a retried request a no-op.
Response
Grant buyer access: an existing record was extended, or this grantId was already applied (Access was already granted).
200
true
"Access granted"
One buyer's access record. There is one record per buyer, product (or the all-access pass) and kind, so buying a pass again extends the same record.
Show child attributes
Show child attributes
{
"_id": "6702d3f0e1b3a40012cd3001",
"email": "ada@example.com",
"user": "66f0aa11e1b3a40012ef0001",
"scope": "product",
"product": {
"_id": "6702c1a4e1b3a40012cd2001",
"name": "The Lagos Cookbook"
},
"kind": "pass",
"status": "active",
"source": "granted",
"startsAt": "2026-10-12T08:00:00.000Z",
"accessUntil": "2026-11-11T08:00:00.000Z",
"daysLeft": 30,
"autoRenew": {
"enabled": false,
"cardLast4": null,
"cardBrand": null
},
"revokedAt": null,
"revokedReason": "",
"createdAt": "2026-10-12T08:00:00.000Z",
"updatedAt": "2026-10-12T08:00:00.000Z"
}
Was this page helpful?

