Ingest subscriptions into the system
curl --request POST \
--url https://api.slickerhq.com/ingest/v1/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscriptions": [
{
"id": "sub_12345678",
"state": "SUBSCRIPTION_STATE_ACTIVE",
"customerId": "cus_87654321",
"businessEntity": "ACME Inc.",
"planId": "plan_premium_monthly",
"amount": 2000,
"currency": "USD",
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-05T12:30:00Z",
"activatedAt": "2023-01-01T00:00:00Z",
"expiresAt": "2023-04-01T00:00:00Z",
"billingPeriod": 1,
"billingPeriodUnit": "BILLING_PERIOD_UNIT_MONTH"
},
{
"id": "sub_87654321",
"state": "SUBSCRIPTION_STATE_CANCELED",
"customerId": "cus_12345678",
"businessEntity": "ACME Inc.",
"planId": "plan_basic_annual",
"amount": 10000,
"currency": "USD",
"createdAt": "2022-10-01T00:00:00Z",
"updatedAt": "2023-01-10T09:15:00Z",
"activatedAt": "2022-10-01T00:00:00Z",
"canceledAt": "2023-01-10T09:15:00Z",
"expiresAt": "2023-10-01T00:00:00Z",
"billingPeriod": 1,
"billingPeriodUnit": "BILLING_PERIOD_UNIT_YEAR"
}
]
}
'import requests
url = "https://api.slickerhq.com/ingest/v1/subscriptions"
payload = { "subscriptions": [
{
"id": "sub_12345678",
"state": "SUBSCRIPTION_STATE_ACTIVE",
"customerId": "cus_87654321",
"businessEntity": "ACME Inc.",
"planId": "plan_premium_monthly",
"amount": 2000,
"currency": "USD",
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-05T12:30:00Z",
"activatedAt": "2023-01-01T00:00:00Z",
"expiresAt": "2023-04-01T00:00:00Z",
"billingPeriod": 1,
"billingPeriodUnit": "BILLING_PERIOD_UNIT_MONTH"
},
{
"id": "sub_87654321",
"state": "SUBSCRIPTION_STATE_CANCELED",
"customerId": "cus_12345678",
"businessEntity": "ACME Inc.",
"planId": "plan_basic_annual",
"amount": 10000,
"currency": "USD",
"createdAt": "2022-10-01T00:00:00Z",
"updatedAt": "2023-01-10T09:15:00Z",
"activatedAt": "2022-10-01T00:00:00Z",
"canceledAt": "2023-01-10T09:15:00Z",
"expiresAt": "2023-10-01T00:00:00Z",
"billingPeriod": 1,
"billingPeriodUnit": "BILLING_PERIOD_UNIT_YEAR"
}
] }
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({
subscriptions: [
{
id: 'sub_12345678',
state: 'SUBSCRIPTION_STATE_ACTIVE',
customerId: 'cus_87654321',
businessEntity: 'ACME Inc.',
planId: 'plan_premium_monthly',
amount: 2000,
currency: 'USD',
createdAt: '2023-01-01T00:00:00Z',
updatedAt: '2023-01-05T12:30:00Z',
activatedAt: '2023-01-01T00:00:00Z',
expiresAt: '2023-04-01T00:00:00Z',
billingPeriod: 1,
billingPeriodUnit: 'BILLING_PERIOD_UNIT_MONTH'
},
{
id: 'sub_87654321',
state: 'SUBSCRIPTION_STATE_CANCELED',
customerId: 'cus_12345678',
businessEntity: 'ACME Inc.',
planId: 'plan_basic_annual',
amount: 10000,
currency: 'USD',
createdAt: '2022-10-01T00:00:00Z',
updatedAt: '2023-01-10T09:15:00Z',
activatedAt: '2022-10-01T00:00:00Z',
canceledAt: '2023-01-10T09:15:00Z',
expiresAt: '2023-10-01T00:00:00Z',
billingPeriod: 1,
billingPeriodUnit: 'BILLING_PERIOD_UNIT_YEAR'
}
]
})
};
fetch('https://api.slickerhq.com/ingest/v1/subscriptions', 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.slickerhq.com/ingest/v1/subscriptions",
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([
'subscriptions' => [
[
'id' => 'sub_12345678',
'state' => 'SUBSCRIPTION_STATE_ACTIVE',
'customerId' => 'cus_87654321',
'businessEntity' => 'ACME Inc.',
'planId' => 'plan_premium_monthly',
'amount' => 2000,
'currency' => 'USD',
'createdAt' => '2023-01-01T00:00:00Z',
'updatedAt' => '2023-01-05T12:30:00Z',
'activatedAt' => '2023-01-01T00:00:00Z',
'expiresAt' => '2023-04-01T00:00:00Z',
'billingPeriod' => 1,
'billingPeriodUnit' => 'BILLING_PERIOD_UNIT_MONTH'
],
[
'id' => 'sub_87654321',
'state' => 'SUBSCRIPTION_STATE_CANCELED',
'customerId' => 'cus_12345678',
'businessEntity' => 'ACME Inc.',
'planId' => 'plan_basic_annual',
'amount' => 10000,
'currency' => 'USD',
'createdAt' => '2022-10-01T00:00:00Z',
'updatedAt' => '2023-01-10T09:15:00Z',
'activatedAt' => '2022-10-01T00:00:00Z',
'canceledAt' => '2023-01-10T09:15:00Z',
'expiresAt' => '2023-10-01T00:00:00Z',
'billingPeriod' => 1,
'billingPeriodUnit' => 'BILLING_PERIOD_UNIT_YEAR'
]
]
]),
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.slickerhq.com/ingest/v1/subscriptions"
payload := strings.NewReader("{\n \"subscriptions\": [\n {\n \"id\": \"sub_12345678\",\n \"state\": \"SUBSCRIPTION_STATE_ACTIVE\",\n \"customerId\": \"cus_87654321\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_premium_monthly\",\n \"amount\": 2000,\n \"currency\": \"USD\",\n \"createdAt\": \"2023-01-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-05T12:30:00Z\",\n \"activatedAt\": \"2023-01-01T00:00:00Z\",\n \"expiresAt\": \"2023-04-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_MONTH\"\n },\n {\n \"id\": \"sub_87654321\",\n \"state\": \"SUBSCRIPTION_STATE_CANCELED\",\n \"customerId\": \"cus_12345678\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_basic_annual\",\n \"amount\": 10000,\n \"currency\": \"USD\",\n \"createdAt\": \"2022-10-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-10T09:15:00Z\",\n \"activatedAt\": \"2022-10-01T00:00:00Z\",\n \"canceledAt\": \"2023-01-10T09:15:00Z\",\n \"expiresAt\": \"2023-10-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_YEAR\"\n }\n ]\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.slickerhq.com/ingest/v1/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptions\": [\n {\n \"id\": \"sub_12345678\",\n \"state\": \"SUBSCRIPTION_STATE_ACTIVE\",\n \"customerId\": \"cus_87654321\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_premium_monthly\",\n \"amount\": 2000,\n \"currency\": \"USD\",\n \"createdAt\": \"2023-01-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-05T12:30:00Z\",\n \"activatedAt\": \"2023-01-01T00:00:00Z\",\n \"expiresAt\": \"2023-04-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_MONTH\"\n },\n {\n \"id\": \"sub_87654321\",\n \"state\": \"SUBSCRIPTION_STATE_CANCELED\",\n \"customerId\": \"cus_12345678\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_basic_annual\",\n \"amount\": 10000,\n \"currency\": \"USD\",\n \"createdAt\": \"2022-10-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-10T09:15:00Z\",\n \"activatedAt\": \"2022-10-01T00:00:00Z\",\n \"canceledAt\": \"2023-01-10T09:15:00Z\",\n \"expiresAt\": \"2023-10-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_YEAR\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slickerhq.com/ingest/v1/subscriptions")
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 \"subscriptions\": [\n {\n \"id\": \"sub_12345678\",\n \"state\": \"SUBSCRIPTION_STATE_ACTIVE\",\n \"customerId\": \"cus_87654321\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_premium_monthly\",\n \"amount\": 2000,\n \"currency\": \"USD\",\n \"createdAt\": \"2023-01-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-05T12:30:00Z\",\n \"activatedAt\": \"2023-01-01T00:00:00Z\",\n \"expiresAt\": \"2023-04-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_MONTH\"\n },\n {\n \"id\": \"sub_87654321\",\n \"state\": \"SUBSCRIPTION_STATE_CANCELED\",\n \"customerId\": \"cus_12345678\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_basic_annual\",\n \"amount\": 10000,\n \"currency\": \"USD\",\n \"createdAt\": \"2022-10-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-10T09:15:00Z\",\n \"activatedAt\": \"2022-10-01T00:00:00Z\",\n \"canceledAt\": \"2023-01-10T09:15:00Z\",\n \"expiresAt\": \"2023-10-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_YEAR\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"requestId": "req_2uqkAo1bwllmzrgV2qtGv48DtGI"
}{
"code": 400,
"message": "Invalid subscription data: missing required fields",
"details": []
}{
"code": 401,
"message": "Unauthorized: missing or invalid API key in Bearer token",
"details": []
}{
"code": 403,
"message": "Forbidden: insufficient permissions to ingest subscriptions",
"details": []
}{
"code": 429,
"message": "Rate limit exceeded: try again later",
"details": []
}{
"code": 500,
"message": "Internal server error",
"details": []
}{
"requestId": "req_2uqkAo1bwllmzrgV2qtGv48DtGI"
}Slicker Endpoints
Add subscriptions
POST
/
v1
/
subscriptions
Ingest subscriptions into the system
curl --request POST \
--url https://api.slickerhq.com/ingest/v1/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscriptions": [
{
"id": "sub_12345678",
"state": "SUBSCRIPTION_STATE_ACTIVE",
"customerId": "cus_87654321",
"businessEntity": "ACME Inc.",
"planId": "plan_premium_monthly",
"amount": 2000,
"currency": "USD",
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-05T12:30:00Z",
"activatedAt": "2023-01-01T00:00:00Z",
"expiresAt": "2023-04-01T00:00:00Z",
"billingPeriod": 1,
"billingPeriodUnit": "BILLING_PERIOD_UNIT_MONTH"
},
{
"id": "sub_87654321",
"state": "SUBSCRIPTION_STATE_CANCELED",
"customerId": "cus_12345678",
"businessEntity": "ACME Inc.",
"planId": "plan_basic_annual",
"amount": 10000,
"currency": "USD",
"createdAt": "2022-10-01T00:00:00Z",
"updatedAt": "2023-01-10T09:15:00Z",
"activatedAt": "2022-10-01T00:00:00Z",
"canceledAt": "2023-01-10T09:15:00Z",
"expiresAt": "2023-10-01T00:00:00Z",
"billingPeriod": 1,
"billingPeriodUnit": "BILLING_PERIOD_UNIT_YEAR"
}
]
}
'import requests
url = "https://api.slickerhq.com/ingest/v1/subscriptions"
payload = { "subscriptions": [
{
"id": "sub_12345678",
"state": "SUBSCRIPTION_STATE_ACTIVE",
"customerId": "cus_87654321",
"businessEntity": "ACME Inc.",
"planId": "plan_premium_monthly",
"amount": 2000,
"currency": "USD",
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-05T12:30:00Z",
"activatedAt": "2023-01-01T00:00:00Z",
"expiresAt": "2023-04-01T00:00:00Z",
"billingPeriod": 1,
"billingPeriodUnit": "BILLING_PERIOD_UNIT_MONTH"
},
{
"id": "sub_87654321",
"state": "SUBSCRIPTION_STATE_CANCELED",
"customerId": "cus_12345678",
"businessEntity": "ACME Inc.",
"planId": "plan_basic_annual",
"amount": 10000,
"currency": "USD",
"createdAt": "2022-10-01T00:00:00Z",
"updatedAt": "2023-01-10T09:15:00Z",
"activatedAt": "2022-10-01T00:00:00Z",
"canceledAt": "2023-01-10T09:15:00Z",
"expiresAt": "2023-10-01T00:00:00Z",
"billingPeriod": 1,
"billingPeriodUnit": "BILLING_PERIOD_UNIT_YEAR"
}
] }
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({
subscriptions: [
{
id: 'sub_12345678',
state: 'SUBSCRIPTION_STATE_ACTIVE',
customerId: 'cus_87654321',
businessEntity: 'ACME Inc.',
planId: 'plan_premium_monthly',
amount: 2000,
currency: 'USD',
createdAt: '2023-01-01T00:00:00Z',
updatedAt: '2023-01-05T12:30:00Z',
activatedAt: '2023-01-01T00:00:00Z',
expiresAt: '2023-04-01T00:00:00Z',
billingPeriod: 1,
billingPeriodUnit: 'BILLING_PERIOD_UNIT_MONTH'
},
{
id: 'sub_87654321',
state: 'SUBSCRIPTION_STATE_CANCELED',
customerId: 'cus_12345678',
businessEntity: 'ACME Inc.',
planId: 'plan_basic_annual',
amount: 10000,
currency: 'USD',
createdAt: '2022-10-01T00:00:00Z',
updatedAt: '2023-01-10T09:15:00Z',
activatedAt: '2022-10-01T00:00:00Z',
canceledAt: '2023-01-10T09:15:00Z',
expiresAt: '2023-10-01T00:00:00Z',
billingPeriod: 1,
billingPeriodUnit: 'BILLING_PERIOD_UNIT_YEAR'
}
]
})
};
fetch('https://api.slickerhq.com/ingest/v1/subscriptions', 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.slickerhq.com/ingest/v1/subscriptions",
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([
'subscriptions' => [
[
'id' => 'sub_12345678',
'state' => 'SUBSCRIPTION_STATE_ACTIVE',
'customerId' => 'cus_87654321',
'businessEntity' => 'ACME Inc.',
'planId' => 'plan_premium_monthly',
'amount' => 2000,
'currency' => 'USD',
'createdAt' => '2023-01-01T00:00:00Z',
'updatedAt' => '2023-01-05T12:30:00Z',
'activatedAt' => '2023-01-01T00:00:00Z',
'expiresAt' => '2023-04-01T00:00:00Z',
'billingPeriod' => 1,
'billingPeriodUnit' => 'BILLING_PERIOD_UNIT_MONTH'
],
[
'id' => 'sub_87654321',
'state' => 'SUBSCRIPTION_STATE_CANCELED',
'customerId' => 'cus_12345678',
'businessEntity' => 'ACME Inc.',
'planId' => 'plan_basic_annual',
'amount' => 10000,
'currency' => 'USD',
'createdAt' => '2022-10-01T00:00:00Z',
'updatedAt' => '2023-01-10T09:15:00Z',
'activatedAt' => '2022-10-01T00:00:00Z',
'canceledAt' => '2023-01-10T09:15:00Z',
'expiresAt' => '2023-10-01T00:00:00Z',
'billingPeriod' => 1,
'billingPeriodUnit' => 'BILLING_PERIOD_UNIT_YEAR'
]
]
]),
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.slickerhq.com/ingest/v1/subscriptions"
payload := strings.NewReader("{\n \"subscriptions\": [\n {\n \"id\": \"sub_12345678\",\n \"state\": \"SUBSCRIPTION_STATE_ACTIVE\",\n \"customerId\": \"cus_87654321\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_premium_monthly\",\n \"amount\": 2000,\n \"currency\": \"USD\",\n \"createdAt\": \"2023-01-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-05T12:30:00Z\",\n \"activatedAt\": \"2023-01-01T00:00:00Z\",\n \"expiresAt\": \"2023-04-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_MONTH\"\n },\n {\n \"id\": \"sub_87654321\",\n \"state\": \"SUBSCRIPTION_STATE_CANCELED\",\n \"customerId\": \"cus_12345678\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_basic_annual\",\n \"amount\": 10000,\n \"currency\": \"USD\",\n \"createdAt\": \"2022-10-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-10T09:15:00Z\",\n \"activatedAt\": \"2022-10-01T00:00:00Z\",\n \"canceledAt\": \"2023-01-10T09:15:00Z\",\n \"expiresAt\": \"2023-10-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_YEAR\"\n }\n ]\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.slickerhq.com/ingest/v1/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptions\": [\n {\n \"id\": \"sub_12345678\",\n \"state\": \"SUBSCRIPTION_STATE_ACTIVE\",\n \"customerId\": \"cus_87654321\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_premium_monthly\",\n \"amount\": 2000,\n \"currency\": \"USD\",\n \"createdAt\": \"2023-01-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-05T12:30:00Z\",\n \"activatedAt\": \"2023-01-01T00:00:00Z\",\n \"expiresAt\": \"2023-04-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_MONTH\"\n },\n {\n \"id\": \"sub_87654321\",\n \"state\": \"SUBSCRIPTION_STATE_CANCELED\",\n \"customerId\": \"cus_12345678\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_basic_annual\",\n \"amount\": 10000,\n \"currency\": \"USD\",\n \"createdAt\": \"2022-10-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-10T09:15:00Z\",\n \"activatedAt\": \"2022-10-01T00:00:00Z\",\n \"canceledAt\": \"2023-01-10T09:15:00Z\",\n \"expiresAt\": \"2023-10-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_YEAR\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slickerhq.com/ingest/v1/subscriptions")
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 \"subscriptions\": [\n {\n \"id\": \"sub_12345678\",\n \"state\": \"SUBSCRIPTION_STATE_ACTIVE\",\n \"customerId\": \"cus_87654321\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_premium_monthly\",\n \"amount\": 2000,\n \"currency\": \"USD\",\n \"createdAt\": \"2023-01-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-05T12:30:00Z\",\n \"activatedAt\": \"2023-01-01T00:00:00Z\",\n \"expiresAt\": \"2023-04-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_MONTH\"\n },\n {\n \"id\": \"sub_87654321\",\n \"state\": \"SUBSCRIPTION_STATE_CANCELED\",\n \"customerId\": \"cus_12345678\",\n \"businessEntity\": \"ACME Inc.\",\n \"planId\": \"plan_basic_annual\",\n \"amount\": 10000,\n \"currency\": \"USD\",\n \"createdAt\": \"2022-10-01T00:00:00Z\",\n \"updatedAt\": \"2023-01-10T09:15:00Z\",\n \"activatedAt\": \"2022-10-01T00:00:00Z\",\n \"canceledAt\": \"2023-01-10T09:15:00Z\",\n \"expiresAt\": \"2023-10-01T00:00:00Z\",\n \"billingPeriod\": 1,\n \"billingPeriodUnit\": \"BILLING_PERIOD_UNIT_YEAR\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"requestId": "req_2uqkAo1bwllmzrgV2qtGv48DtGI"
}{
"code": 400,
"message": "Invalid subscription data: missing required fields",
"details": []
}{
"code": 401,
"message": "Unauthorized: missing or invalid API key in Bearer token",
"details": []
}{
"code": 403,
"message": "Forbidden: insufficient permissions to ingest subscriptions",
"details": []
}{
"code": 429,
"message": "Rate limit exceeded: try again later",
"details": []
}{
"code": 500,
"message": "Internal server error",
"details": []
}{
"requestId": "req_2uqkAo1bwllmzrgV2qtGv48DtGI"
}Authorizations
API key authentication using a Bearer token in the Authorization header.
Example: Authorization: Bearer YOUR_API_KEY
Body
application/json
Request to ingest subscription data. Maximum of 200 subscriptions per request.
Show child attributes
Show child attributes
Response
A successful response.
Unique identifier for tracking the request through the system
Example:
"req_2uqkAo1bwllmzrgV2qtGv48DtGI"
⌘I