Aller au contenu

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>

curl -sS -X POST "https://www-dev.yoshuko.com/api/v1/agent/plan/checkout/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

url = f"https://www-dev.yoshuko.com/api/v1/agent/plan/checkout/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
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>

curl -sS -X GET "https://www-dev.yoshuko.com/api/v1/agent/plans/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

url = f"https://www-dev.yoshuko.com/api/v1/agent/plans/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
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.