cURL
curl --request GET \
--url https://us.api.flexprice.io/v1/subscriptions/{id}/schedulesfrom flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.subscriptions.list_subscription_schedules(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.subscriptions.listSubscriptionSchedules("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Subscriptions.ListSubscriptionSchedules(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.GetPendingSchedulesResponse != nil {
// handle response
}
}{
"count": 123,
"schedules": [
{
"can_be_cancelled": true,
"cancelled_at": "2023-11-07T05:31:56Z",
"configuration": {},
"configuration_details": {
"plan_change": {
"billing_period_behaviour": "unchanged",
"entity_policies": {
"addons": {
"default_behaviour": "carry",
"overrides": {}
}
},
"target_plan_id": "<string>"
}
},
"created_at": "2023-11-07T05:31:56Z",
"days_until_execution": 123,
"error_message": "<string>",
"executed_at": "2023-11-07T05:31:56Z",
"execution_details": {
"plan_change": {
"change_type": "<string>",
"effective_date": "2023-11-07T05:31:56Z",
"from_plan_id": "<string>",
"previous_subscription_id": "<string>",
"subscription_id": "<string>",
"to_plan_id": "<string>"
}
},
"execution_result": {},
"id": "<string>",
"metadata": {},
"schedule_type": "plan_change",
"scheduled_at": "2023-11-07T05:31:56Z",
"status": "pending",
"subscription_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}Subscriptions
List subscription schedules
Use when listing scheduled changes for a subscription (e.g. upcoming plan change or renewal). Returns all schedules for that subscription.
GET
/
subscriptions
/
{id}
/
schedules
cURL
curl --request GET \
--url https://us.api.flexprice.io/v1/subscriptions/{id}/schedulesfrom flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.subscriptions.list_subscription_schedules(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.subscriptions.listSubscriptionSchedules("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Subscriptions.ListSubscriptionSchedules(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.GetPendingSchedulesResponse != nil {
// handle response
}
}{
"count": 123,
"schedules": [
{
"can_be_cancelled": true,
"cancelled_at": "2023-11-07T05:31:56Z",
"configuration": {},
"configuration_details": {
"plan_change": {
"billing_period_behaviour": "unchanged",
"entity_policies": {
"addons": {
"default_behaviour": "carry",
"overrides": {}
}
},
"target_plan_id": "<string>"
}
},
"created_at": "2023-11-07T05:31:56Z",
"days_until_execution": 123,
"error_message": "<string>",
"executed_at": "2023-11-07T05:31:56Z",
"execution_details": {
"plan_change": {
"change_type": "<string>",
"effective_date": "2023-11-07T05:31:56Z",
"from_plan_id": "<string>",
"previous_subscription_id": "<string>",
"subscription_id": "<string>",
"to_plan_id": "<string>"
}
},
"execution_result": {},
"id": "<string>",
"metadata": {},
"schedule_type": "plan_change",
"scheduled_at": "2023-11-07T05:31:56Z",
"status": "pending",
"subscription_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
