import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: 'My API Key',
});
const subscriptions = await client.organizations.subscriptions.list('id');
console.log(subscriptions);{
"data": [
{
"org_id": "<string>",
"status": "active",
"type": "plan",
"price": {
"unit_amount": 123,
"currency": "<string>",
"recurring": {
"interval": "day",
"interval_count": 123
}
},
"current_period_start": "<string>",
"current_period_end": "<string>",
"cancel_at": "<string>",
"cancel_at_period_end": true,
"plan": "free",
"addon": "dedicated-ips",
"quota": {
"monthly": {
"transac_emails": 123
},
"daily": {
"transac_emails": 123
}
},
"schedule": {
"created": "<string>",
"phases": [
{
"price": {
"unit_amount": 123,
"currency": "<string>",
"recurring": {
"interval": "day",
"interval_count": 123
},
"type": "plan",
"plan": "free",
"quota": {
"monthly": {
"transac_emails": 123
},
"daily": {
"transac_emails": 123
}
}
}
}
]
}
}
]
}Return the organization subscriptions
import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: 'My API Key',
});
const subscriptions = await client.organizations.subscriptions.list('id');
console.log(subscriptions);{
"data": [
{
"org_id": "<string>",
"status": "active",
"type": "plan",
"price": {
"unit_amount": 123,
"currency": "<string>",
"recurring": {
"interval": "day",
"interval_count": 123
}
},
"current_period_start": "<string>",
"current_period_end": "<string>",
"cancel_at": "<string>",
"cancel_at_period_end": true,
"plan": "free",
"addon": "dedicated-ips",
"quota": {
"monthly": {
"transac_emails": 123
},
"daily": {
"transac_emails": 123
}
},
"schedule": {
"created": "<string>",
"phases": [
{
"price": {
"unit_amount": 123,
"currency": "<string>",
"recurring": {
"interval": "day",
"interval_count": 123
},
"type": "plan",
"plan": "free",
"quota": {
"monthly": {
"transac_emails": 123
},
"daily": {
"transac_emails": 123
}
}
}
}
]
}
}
]
}Bearer HTTP authentication. Allowed headers Authorization: Bearer <API_KEY>
The organization id previously created
A successful response
Show child attributes
The id of the organization
The status of the subscription (plan or addon
active, canceled, incomplete, incomplete_expired, past_due, paused, trialing, unpaid The type of the subscription
plan, addon Show child attributes
The unit amount in cents (or local equivalent) to be charged
ISO currency code
Start of the current period that the subscription has been invoiced for
End of the current period that the subscription has been invoiced for
If the subscription has been canceled, the date of that cancellation
Whether this subscription will or did cancel at the end of the current billing period
The name of the plan
free, starter, scale, enterprise The name of the addon
dedicated-ips Show child attributes
Show child attributes
The date of the creation of the schedule
Show child attributes
Show child attributes
The unit amount in cents (or local equivalent) to be charged
ISO currency code
The type of the subscription
plan, addon The name of the plan
free, starter, scale, enterprise Show child attributes