curl --request GET \
--url https://{api}.subotiz.com/api/v1/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Request-Id: <request-id>'const options = {
method: 'GET',
headers: {'Request-Id': '<request-id>', Authorization: 'Bearer <token>'}
};
fetch('https://{api}.subotiz.com/api/v1/subscription', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{api}.subotiz.com/api/v1/subscription"
headers = {
"Request-Id": "<request-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api}.subotiz.com/api/v1/subscription",
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>",
"Request-Id: <request-id>"
],
]);
$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://{api}.subotiz.com/api/v1/subscription"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Request-Id", "<request-id>")
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://{api}.subotiz.com/api/v1/subscription")
.header("Request-Id", "<request-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api}.subotiz.com/api/v1/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Request-Id"] = '<request-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": "<string>",
"message": "<string>",
"data": {
"has_more": true,
"list": [
{
"id": "<string>",
"customer_id": "<string>",
"email": "<string>",
"cycle_index": 123,
"metadata": {},
"cancel_reason": "<string>",
"sub_merchant_id": "<string>",
"status": "<string>",
"price_id": "<string>",
"total_cycles": 123,
"current_period_start": "<string>",
"current_period_end": "<string>",
"next_invoice_date": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"cancel_at": "<string>",
"order_id": "<string>",
"source_trade_id": "<string>",
"price_type": "<string>",
"price_version_id": "<string>",
"first_source_channel": "<string>",
"last_source_channel": "<string>",
"quantity": "<string>",
"quantity_unit": "<string>",
"payment_timing": "<string>",
"billing_dimension": "<string>",
"quantity_tier_type": "<string>",
"price_tier_type": "<string>",
"usage_amount": "<string>",
"quantity_tiers": [
{
"quantity_min": "<string>",
"quantity_max": "<string>",
"unit_price": "<string>",
"flat_amount": "<string>"
}
],
"usage_tiers": [
{
"usage_min": "<string>",
"usage_max": "<string>",
"unit_price": "<string>",
"flat_amount": "<string>"
}
],
"pending_change": {
"quantity": "<string>",
"cycle_index": 123,
"version": 123,
"effective_at": "<string>"
}
}
]
}
}{
"code": "system_error",
"message": "Internal server error."
}获取订阅列表
查询订阅合同列表
curl --request GET \
--url https://{api}.subotiz.com/api/v1/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Request-Id: <request-id>'const options = {
method: 'GET',
headers: {'Request-Id': '<request-id>', Authorization: 'Bearer <token>'}
};
fetch('https://{api}.subotiz.com/api/v1/subscription', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{api}.subotiz.com/api/v1/subscription"
headers = {
"Request-Id": "<request-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api}.subotiz.com/api/v1/subscription",
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>",
"Request-Id: <request-id>"
],
]);
$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://{api}.subotiz.com/api/v1/subscription"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Request-Id", "<request-id>")
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://{api}.subotiz.com/api/v1/subscription")
.header("Request-Id", "<request-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api}.subotiz.com/api/v1/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Request-Id"] = '<request-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": "<string>",
"message": "<string>",
"data": {
"has_more": true,
"list": [
{
"id": "<string>",
"customer_id": "<string>",
"email": "<string>",
"cycle_index": 123,
"metadata": {},
"cancel_reason": "<string>",
"sub_merchant_id": "<string>",
"status": "<string>",
"price_id": "<string>",
"total_cycles": 123,
"current_period_start": "<string>",
"current_period_end": "<string>",
"next_invoice_date": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"cancel_at": "<string>",
"order_id": "<string>",
"source_trade_id": "<string>",
"price_type": "<string>",
"price_version_id": "<string>",
"first_source_channel": "<string>",
"last_source_channel": "<string>",
"quantity": "<string>",
"quantity_unit": "<string>",
"payment_timing": "<string>",
"billing_dimension": "<string>",
"quantity_tier_type": "<string>",
"price_tier_type": "<string>",
"usage_amount": "<string>",
"quantity_tiers": [
{
"quantity_min": "<string>",
"quantity_max": "<string>",
"unit_price": "<string>",
"flat_amount": "<string>"
}
],
"usage_tiers": [
{
"usage_min": "<string>",
"usage_max": "<string>",
"unit_price": "<string>",
"flat_amount": "<string>"
}
],
"pending_change": {
"quantity": "<string>",
"cycle_index": 123,
"version": 123,
"effective_at": "<string>"
}
}
]
}
}{
"code": "system_error",
"message": "Internal server error."
}授权
Bearer API Key 鉴权。格式:Authorization: Bearer {your_api_key}
请求头
请求的唯一标识符
查询参数
订阅的 id 数组,筛选 id 属于这个数组的订阅记录
订阅业务状态:
- init - 待生效
- trial - 试用期
- active - 生效中
- paused - 暂停
- past_due - 逾期
- unpaid - 未支付
- canceled - 已终止
用于分页的游标。starting_after 是定义您在列表中位置的对象 ID。例如,如果想获取下一页,可以在第一次获取对象列表之后,使用最后一个对象的 id 作为参数值。不能和 `ending_before 同时使用
用于分页的游标 ending_before 是定义您在列表中位置的对象 ID。例如,如果想获取上一页,可以在第一次获取对象列表之后,使用第一个对象的 id 作为参数值。不能和 starting_after 同时使用
分页参数,每页数量,默认:10,接口默认按创建时间倒序排序。限制:[1, 100]
商户唯一标识
您平台的订单 ID 数组,筛选出 order_id 属于此数组的订阅记录。
来源交易订单 ID 数组,筛选出 source_trade_id 属于此数组的订阅记录
根据订阅周期筛选,支持的枚举值:
- week - 周
- month - 月
- quarter - 季
- year - 年
- customer-initiated - 客户发起
- over_threshold - 按量计费
搜索类型,取值为以下字段之一:subscription_id、trade_id、refund_id、invoice_id、customer_id
与 search_type 对应的搜索值
用于过滤的最小值(不包含,RFC3339格式的UTC时间,例如'2025-01-01T00:00:00Z')
用于过滤的最小值(包含,RFC3339格式的UTC时间,例如'2025-01-01T00:00:00Z')
用于过滤的最大值(不包含,RFC3339格式的UTC时间,例如'2025-01-01T00:00:00Z')
用于过滤的最大值(包含,RFC3339格式的UTC时间,例如'2025-01-01T00:00:00Z')
此页面对您有帮助吗?