获取订阅详情
curl --request GET \
--url https://{api}.subotiz.com/api/v1/subscription/{subscription_id} \
--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/{subscription_id}', 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/{subscription_id}"
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/{subscription_id}",
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/{subscription_id}"
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/{subscription_id}")
.header("Request-Id", "<request-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api}.subotiz.com/api/v1/subscription/{subscription_id}")
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": {
"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>",
"usage_amount": "<string>",
"usage_unit": "<string>",
"model_type": "<string>",
"billing_threshold": "<string>",
"is_canceling": true,
"launch_cancel_at": "<string>",
"expected_cancel_at": "<string>",
"price_version_id": "<string>",
"first_source_channel": "<string>",
"last_source_channel": "<string>",
"is_renewable": true,
"current_period": 123,
"end_at": "<string>",
"fixed_term": 123
}
}{
"code": "system_error",
"message": "Internal server error."
}订阅
获取订阅详情
订阅详情
GET
/
api
/
v1
/
subscription
/
{subscription_id}
获取订阅详情
curl --request GET \
--url https://{api}.subotiz.com/api/v1/subscription/{subscription_id} \
--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/{subscription_id}', 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/{subscription_id}"
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/{subscription_id}",
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/{subscription_id}"
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/{subscription_id}")
.header("Request-Id", "<request-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api}.subotiz.com/api/v1/subscription/{subscription_id}")
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": {
"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>",
"usage_amount": "<string>",
"usage_unit": "<string>",
"model_type": "<string>",
"billing_threshold": "<string>",
"is_canceling": true,
"launch_cancel_at": "<string>",
"expected_cancel_at": "<string>",
"price_version_id": "<string>",
"first_source_channel": "<string>",
"last_source_channel": "<string>",
"is_renewable": true,
"current_period": 123,
"end_at": "<string>",
"fixed_term": 123
}
}{
"code": "system_error",
"message": "Internal server error."
}订阅详情
授权
Bearer API Key 鉴权。格式:Authorization: Bearer {your_api_key}
请求头
请求的唯一标识符
路径参数
订阅 ID
查询参数
商户唯一标识
此页面对您有帮助吗?
⌘I