TypeScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({organization_slug: '<string>', redirect_url: '<string>'})
};
fetch('https://api.useautumn.com/v1/platform/oauth_url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.useautumn.com/v1/platform/oauth_url"
payload = {
"organization_slug": "<string>",
"redirect_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl -X POST 'https://api.useautumn.com/v1/platform/oauth_url' \
-H 'Authorization: Bearer am_sk_test_...' \
-H 'Content-Type: application/json' \
-d '{
"organization_slug": "tenant-org",
"env": "test",
"redirect_url": "https://yourapp.com/stripe/callback"
}'
{
"oauth_url": "<string>"
}{
"message": "<string>",
"code": "not_found"
}{
"message": "<string>",
"code": "not_found"
}{
"message": "<string>",
"code": "not_found"
}Platform (Beta)
Generate Stripe OAuth URL
Generates a Stripe Connect OAuth URL for a platform organization. Use this to allow your tenants to connect their Stripe accounts.
POST
/
platform
/
oauth_url
TypeScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({organization_slug: '<string>', redirect_url: '<string>'})
};
fetch('https://api.useautumn.com/v1/platform/oauth_url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.useautumn.com/v1/platform/oauth_url"
payload = {
"organization_slug": "<string>",
"redirect_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl -X POST 'https://api.useautumn.com/v1/platform/oauth_url' \
-H 'Authorization: Bearer am_sk_test_...' \
-H 'Content-Type: application/json' \
-d '{
"organization_slug": "tenant-org",
"env": "test",
"redirect_url": "https://yourapp.com/stripe/callback"
}'
{
"oauth_url": "<string>"
}{
"message": "<string>",
"code": "not_found"
}{
"message": "<string>",
"code": "not_found"
}{
"message": "<string>",
"code": "not_found"
}Generates a Stripe Connect OAuth URL for a platform organization. Use this to allow your tenants to connect their Stripe accounts through the OAuth flow.
OAuth Flow
After generating the OAuth URL:- Redirect your tenant to the
oauth_url - User authorizes their Stripe account
- Stripe redirects to Autumn’s callback URL
- Autumn processes the authorization and redirects to your
redirect_url - Your
redirect_urlwill receive query parameters:success=trueorsuccess=falsemessage=...(if error occurred)
OAuth state is stored in Upstash with a 10-minute expiry. The organization must have been created via the platform API before generating an OAuth URL.
Authorizations
Autumn API key with Bearer prefix
Body
application/json
Response
OAuth URL generated successfully
Stripe Connect OAuth URL to redirect the user to.