What is the integration recipe authorization header format?

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 :slight_smile:

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.

This is an important undocumented gotcha:

Yes you wouldn’t want to rely on the days_left minus a certain number of days to fake a trial duration or anything.

Thanks for pointing this out!

As a follow-up, we have the renewal date behavior documented here. I’ll work on adding it in the other locations!

Best,
Rachel

So do you have any suggestion for handling functionalities offered in a Free plan which resets every 30 days without relying on an external database?