Atlassian API for Organisation Billing

Khai Shaun Ng December 20, 2023

Hello, 

I am wondering if there is a way to pull the billing info for all products within a site or organisation? 

The data I'm looking for is within "admin.atlassian.com/o/<ORG_ID>/billing-preview"

When inspecting the browser, I noticed that it is calling this API for all our cloud sites:

  • "admin.atlassian.com/gateway/api/billing-ux/cloud/<SITE_ID>/billing/v2/site-entitlements"

The question is, neither the Org Admin token nor my account token works for the API call above via Postman.

What we need is to pull these information via API, and store it for billing purposes: jsm_billing_cloud.png

Both Basic Auth and Bearer Token doesn't work in this case. The only way to make this work is to add cookie for "cloud.session.token" and paste in the generated token from the browser when accessing the billing page, into the Postman headers, but the problem is there seems to be no way to generate such token on the fly. 

It would be great if there is a way to authenticate Org admins to access this via REST API.

Has anyone tried this before? 

1 answer

0 votes
David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 20, 2023

Hello @Khai Shaun Ng 

Just as per this thread from last week, there are no public billing APIs. What you are essentially doing at the moment is 'hijacking' one of Atlassian's internal APIs used to provide billing data to the web GUI. Atlassian don't want you doing that outside the browser session, that's why you can't use anything other than the browser session token.

Also, if you Google 'Atlassian billing API' you will see all the many times the topic has already been discussed and will also be lead directly to the feature request CLOUD-11223 asking for such APIs to be made available.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events