获取商品定价列表
curl --request GET \
--url https://{api}.subotiz.com/api/v1/prices \
--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/prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{api}.subotiz.com/api/v1/prices"
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/prices",
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/prices"
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/prices")
.header("Request-Id", "<request-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api}.subotiz.com/api/v1/prices")
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>",
"price_name": "<string>",
"price_alias": "<string>",
"product_id": "<string>",
"merchant_id": "<string>",
"currency": "<string>",
"billing_type": "<string>",
"price_val": "<string>",
"description": "<string>",
"price_plan": {
"price_plan_id": "<string>",
"plan_name": "<string>",
"billing_cycle_unit": "<string>",
"billing_cycle_count": 123,
"is_infinite": true,
"base_price_val": "<string>",
"plan_description": "<string>",
"price_plan_tiers": [
{
"period_count": 123,
"period_unit": "<string>",
"original_price": "<string>",
"due_price": "<string>",
"discount_type": "<string>",
"discount_value": "<string>"
}
]
},
"biz_status": "<string>",
"has_trial": true,
"trial_period": {
"trial_period_unit": "<string>",
"trial_period_count": 123
},
"created_at": "<string>",
"price_type": "<string>",
"usage_amount": "<string>",
"usage_unit": "<string>",
"model_type": "<string>",
"billing_threshold": "<string>",
"trial_type": 123,
"trial_amount": "<string>",
"metadata": {}
}
]
}
}商品定价
获取商品定价列表
定价方案列表
GET
/
api
/
v1
/
prices
获取商品定价列表
curl --request GET \
--url https://{api}.subotiz.com/api/v1/prices \
--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/prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{api}.subotiz.com/api/v1/prices"
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/prices",
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/prices"
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/prices")
.header("Request-Id", "<request-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api}.subotiz.com/api/v1/prices")
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>",
"price_name": "<string>",
"price_alias": "<string>",
"product_id": "<string>",
"merchant_id": "<string>",
"currency": "<string>",
"billing_type": "<string>",
"price_val": "<string>",
"description": "<string>",
"price_plan": {
"price_plan_id": "<string>",
"plan_name": "<string>",
"billing_cycle_unit": "<string>",
"billing_cycle_count": 123,
"is_infinite": true,
"base_price_val": "<string>",
"plan_description": "<string>",
"price_plan_tiers": [
{
"period_count": 123,
"period_unit": "<string>",
"original_price": "<string>",
"due_price": "<string>",
"discount_type": "<string>",
"discount_value": "<string>"
}
]
},
"biz_status": "<string>",
"has_trial": true,
"trial_period": {
"trial_period_unit": "<string>",
"trial_period_count": 123
},
"created_at": "<string>",
"price_type": "<string>",
"usage_amount": "<string>",
"usage_unit": "<string>",
"model_type": "<string>",
"billing_threshold": "<string>",
"trial_type": 123,
"trial_amount": "<string>",
"metadata": {}
}
]
}
}定价方案列表
授权
Bearer API Key 鉴权。格式:Authorization: Bearer {your_api_key}
请求头
请求的唯一标识符
查询参数
定价ID 集合检索,集合大小限制[0,100]
定价状态
- draft - 草稿
- active - 激活
- frozen - 冻结
用于分页的游标。starting_after 是定义您在列表中位置的对象 ID。例如,如果想获取下一页,可以在第一次获取对象列表之后,使用最后一个对象的 id 作为参数值。不能和 ending_before 同时使用
用于分页的游标。ending_before 是定义您在列表中位置的对象 ID。例如,如果想获取上一页,可以在第一次获取对象列表之后,使用第一个对象的 id 作为参数值。不能和 starting_after 同时使用
分页参数,接口默认按创建时间倒序排序。限制:[1, 100]
通过商品ID查询定价
用于过滤的最小值(不包含,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')
此页面对您有帮助吗?
⌘I