Skip to content

Create a user-subscription-enrollment

POST
/user-subscription-enrollments
object
data
object
user
required
One of:

DocumentId reference to plugin::users-permissions.user

string
plan
One of:

DocumentId reference to api::user-plan.user-plan

string
status
required
string
Allowed values: trial active pending_downgrade grace_period cancelled
started_at
string format: date-time
trial_ends_at
string format: date-time
expires_at
string format: date-time
sponsor
One of:

DocumentId reference to plugin::users-permissions.user

string
stripe_customer_id

Convention: user-${userId}, symmetric to the existing org-${orgId} convention (see billing-adapter.ts / checkout.ts).

string
stripe_subscription_id
string
sponsorship_invitation_token

F3.USERPLAN.04 — 7-day JWT (mirrors organisation-member.invitation_token) proving the sponsor invited THIS beneficiary. Set on POST /:sponsorId/sponsor, cleared once accepted (or replaced by a new invite).

string
pending_sponsorship

F3.USERPLAN.04 — set while a sponsorship invitation is outstanding (not yet accepted by the beneficiary): { sponsorId, sponsorEnrollmentId, tierId, beneficiaryEmail, invitedAt }. Cleared on accept (sponsor/plan/status become authoritative) or on a fresh re-invite.

sponsorship_stripe_item_id

F3.USERPLAN.04 — id of the Stripe subscription item added to the SPONSOR’s existing subscription for this beneficiary (stripe.subscriptionItems). Required to remove exactly this line item on revoke without touching the sponsor’s own base plan item or other beneficiaries’ items.

string

Created

object
data
object
user
required
One of:

DocumentId reference to plugin::users-permissions.user

string
plan
One of:

DocumentId reference to api::user-plan.user-plan

string
status
required
string
Allowed values: trial active pending_downgrade grace_period cancelled
started_at
string format: date-time
trial_ends_at
string format: date-time
expires_at
string format: date-time
sponsor
One of:

DocumentId reference to plugin::users-permissions.user

string
stripe_customer_id

Convention: user-${userId}, symmetric to the existing org-${orgId} convention (see billing-adapter.ts / checkout.ts).

string
stripe_subscription_id
string
sponsorship_invitation_token

F3.USERPLAN.04 — 7-day JWT (mirrors organisation-member.invitation_token) proving the sponsor invited THIS beneficiary. Set on POST /:sponsorId/sponsor, cleared once accepted (or replaced by a new invite).

string
pending_sponsorship

F3.USERPLAN.04 — set while a sponsorship invitation is outstanding (not yet accepted by the beneficiary): { sponsorId, sponsorEnrollmentId, tierId, beneficiaryEmail, invitedAt }. Cleared on accept (sponsor/plan/status become authoritative) or on a fresh re-invite.

sponsorship_stripe_item_id

F3.USERPLAN.04 — id of the Stripe subscription item added to the SPONSOR’s existing subscription for this beneficiary (stripe.subscriptionItems). Required to remove exactly this line item on revoke without touching the sponsor’s own base plan item or other beneficiaries’ items.

string
documentId
string
id
integer
createdAt
string format: date-time
updatedAt
string format: date-time
publishedAt
string format: date-time
nullable

Validation error

Missing or invalid authentication

Not authorized (tenant scope or capability)