Consent
Get Subscription Consent
Retrieve the consent status associated with a specific subscription.
GET
/
v1
/
subscriptions
/
{id}
/
consent
Get the consent tied to a subscription
curl --request GET \
--url https://billing.example.com/v1/subscriptions/{id}/consent \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/subscriptions/{id}/consent"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/subscriptions/{id}/consent', 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://billing.example.com/v1/subscriptions/{id}/consent",
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>"
],
]);
$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://billing.example.com/v1/subscriptions/{id}/consent"
req, _ := http.NewRequest("GET", 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.get("https://billing.example.com/v1/subscriptions/{id}/consent")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/subscriptions/{id}/consent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"consent_type": "recurring_billing",
"granted": true,
"granted_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"ip_address": "<string>",
"user_agent": "<string>",
"consent_text": "<string>",
"version": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The unique identifier of the subscription (e.g., sub_9f8e7d6c5b4a3210). |
Example Request
curl https://api.recurso.dev/v1/subscriptions/sub_9f8e7d6c5b4a3210/consent \
-H "Authorization: Bearer rsk_live_7f3a9b2c1d4e8f0a"
Response
Returns the consent record linked to the subscription.{
"id": "cons_Kp8wN3xRtL",
"subscription_id": "sub_9f8e7d6c5b4a3210",
"customer_id": "cust_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "billing",
"granted": true,
"granted_at": "2026-06-23T09:45:00Z",
"ip_address": "203.0.113.42",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36",
"revoked_at": null,
"created_at": "2026-06-23T09:45:00Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
type | string | The consent category. One of: marketing, billing, data_processing. |
granted | boolean | Whether consent is currently active. false if consent has been revoked. |
granted_at | string | ISO 8601 timestamp when consent was granted. |
ip_address | string | The IP address of the user at the time consent was collected. May be null. |
user_agent | string | The browser user agent string at the time consent was collected. May be null. |
If no consent record exists for the subscription, this endpoint returns a
404 Not Found response. Use the Record Consent endpoint to create one.Subscriptions without a valid consent record may be paused automatically depending on your compliance settings. Ensure consent is collected before activating subscriptions.
⌘I
Get the consent tied to a subscription
curl --request GET \
--url https://billing.example.com/v1/subscriptions/{id}/consent \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/subscriptions/{id}/consent"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/subscriptions/{id}/consent', 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://billing.example.com/v1/subscriptions/{id}/consent",
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>"
],
]);
$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://billing.example.com/v1/subscriptions/{id}/consent"
req, _ := http.NewRequest("GET", 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.get("https://billing.example.com/v1/subscriptions/{id}/consent")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/subscriptions/{id}/consent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"consent_type": "recurring_billing",
"granted": true,
"granted_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"ip_address": "<string>",
"user_agent": "<string>",
"consent_text": "<string>",
"version": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}