Hi all, I’ve been working on an app with integration actions and I’ve been struggling to find a comprehensive description of the format of the Authorization header passed through. This would come in very helpful as the app needs to validate the subscription of the account performing the action but there is no defined subscription field in the example format here despite me knowing it exists from testing.
Is there more comprehensive documentation on the valid format of the JWT anywhere?
The subscription object (which will be on the subscription key in the jwt) has the following typescript type:
type Subscription = {
plan_id: string;
is_trial: boolean;
renewal_date: string: //ISO timestamp with offset
pricing_version: number;
billing_period: "monthly" | "yearly" | null;
days_left: number
}
if billing_period is null that means the subscription is your free plan or a plan in trial (with is_trial being true if its a trial, or false if its the paid version of that plan)
Note that for free plans renewal_date and days_left is always today + 10 years. It advances each day. Beware of this
That query will return the same result. Do note you can set a mock subscription as described on that page, and you’ll now get a subscription in the JWT - with the caveat that setting a mock subscription does not permit you to set billing_period to null (it errors) so you can’t quite validate the free/trial scenario as you’d expect.