Agent: Plan¶
Get a Stripe Checkout link for a platform plan¶
POST /api/v1/agent/plan/checkout/
Requires payments: edit. Body: {"plan_slug": "..."}. Returns checkout_url; a person pays at that link. The plan takes effect when Stripe confirms.
Authentication: API key — Authorization: Bearer <key>
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/plan/checkout/`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
400 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |
502 |
No response body |
Platform plans on sale¶
GET /api/v1/agent/plans/
Requires payments: view. The plans an organization can move to, and its current one.
Authentication: API key — Authorization: Bearer <key>
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/plans/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |