Sync the subscription from Stripe
import requests
url = "https://platform.ankra.app/api/v1/org/billing/sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/billing/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/billing/sync \
--header 'Authorization: Bearer <token>'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"display_name": "<string>",
"free_vcpu_allowance": 123,
"vcpu_rate_hourly": 123,
"annual_discount_pct": 123,
"flat_monthly_cents": 123
},
"stripe_customer_id": "<string>",
"stripe_subscription_id": "<string>",
"billing_cycle": "<string>",
"status": "<string>",
"current_period_start": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z",
"commitment_start": "2023-11-07T05:31:56Z",
"commitment_end": "2023-11-07T05:31:56Z",
"custom_flat_monthly_cents": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Billing
Sync the subscription from Stripe
Re-reads the organisation’s subscription from Stripe, for when a change made in Stripe’s own pages has not arrived by webhook yet, and answers the subscription as stored. Requires billing.manage, checked against the token’s scopes and then against the member’s role whatever the authorisation rollout state; a token pinned to a project is refused, since billing has no per-project form.
POST
/
api
/
v1
/
org
/
billing
/
sync
Sync the subscription from Stripe
import requests
url = "https://platform.ankra.app/api/v1/org/billing/sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/billing/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/billing/sync \
--header 'Authorization: Bearer <token>'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"display_name": "<string>",
"free_vcpu_allowance": 123,
"vcpu_rate_hourly": 123,
"annual_discount_pct": 123,
"flat_monthly_cents": 123
},
"stripe_customer_id": "<string>",
"stripe_subscription_id": "<string>",
"billing_cycle": "<string>",
"status": "<string>",
"current_period_start": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z",
"commitment_start": "2023-11-07T05:31:56Z",
"commitment_end": "2023-11-07T05:31:56Z",
"custom_flat_monthly_cents": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Headers
Response
The subscription