⚓️ Portcall

Plan basics - price, renew schedule, free trial period, etc.

Current plan model and lifecycle in the v1 API.

What a plan contains

  • name
  • currency
  • interval and interval_count
  • trial_period_days
  • default fixed item price (unit_amount, in cents)
  • attached features through plan-features

Plan lifecycle

  1. POST /v1/plans creates the plan in draft flow.
  2. Add features with POST /v1/plan-features.
  3. POST /v1/plans/{id}/publish makes it subscribable.

Checkout sessions and payment links require the plan to be published.

Create a plan

curl -sS -X POST "$PORTCALL_API_BASE/v1/plans" \
  -H "x-api-key: $PORTCALL_API_KEY" \
  -H "content-type: application/json" \
  -d '{"name":"Pro","currency":"USD","interval":"month","interval_count":1,"trial_period_days":14,"unit_amount":9900}'