Iron Plans
Search…
Server-side API
Below is a collection of commonly used server-side API examples to get started quickly.
For a comprehensive look into the Iron Plans server-side API, see the OpenAPI docs.
Generate a Customer Token:
Python
1
requests.post(
2
"https://api.ironplans.com/customers/v1/token/",
3
json={"customer_source_id": user_id, "customer_email": email},
4
headers={"Authorization": "Bearer PROVIDER_PRIVATE_TOKEN"}
5
).json()["token"]
Copied!
Get a team's subscription usage:
Python
1
requests.get(
2
f"https://api.ironplans.com/subscriptions/v1/{subscription_id}/usage/",
3
headers={"Authorization": "Bearer my-private-token"}
4
).json()
Copied!
Report usage for a given subscription:
Python
1
data = {"op": "inc", "slug": "requests", "value": 1}
2
3
requests.post(
4
f"https://api.ironplans.com/subscriptions/v1/{subscription_id}/report/",
5
data=data,
6
headers={"Authorization": "Bearer my-private-token"}
7
).json()
Copied!
See all invoices for a given team:
Python
1
requests.get(
2
f"https://api.ironplans.com/teams/v1/{team_id}/invoices/",
3
headers={"Authorization": "Bearer my-private-token"}
4
).json()
Copied!
Copy link