Skip to main content
POST
/
admin
/
subscriptions
/
assign
Assign subscription to user
curl --request POST \
  --url https://api.sprucecollective.co.uk/admin/subscriptions/assign \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "billing_interval": "daily",
  "duration_months": 12,
  "reason": "<string>",
  "site_id": "<string>",
  "tier": "<string>",
  "user_id": "<string>",
  "start_date": "<string>"
}
'
{
  "amount_cents": 123,
  "auto_renew": true,
  "available_credits": 123,
  "billing_interval": "<string>",
  "can_be_cancelled": true,
  "cancellation_reason": "<string>",
  "cancelled_at": "<string>",
  "cooling_off_expiry": "<string>",
  "created_at": "<string>",
  "credits_used_this_period": 123,
  "currency": "<string>",
  "current_period_end": "<string>",
  "current_period_start": "<string>",
  "entry_credits_per_period": 123,
  "id": "<string>",
  "is_active": true,
  "is_cancelled": true,
  "is_in_trial": true,
  "is_paused": true,
  "is_trial_active": true,
  "metadata": {},
  "next_billing_date": "<string>",
  "paused_until": "<string>",
  "payment_method": "<string>",
  "site_id": "<string>",
  "status": "<string>",
  "subscription_start_date": "<string>",
  "tier": "<string>",
  "trial_end_date": "<string>",
  "trial_start_date": "<string>",
  "updated_at": "<string>",
  "user_id": "<string>"
}

Authorizations

Authorization
string
header
required

Type "Bearer" followed by a space and JWT token.

Body

application/json

Subscription assignment data

billing_interval
enum<string>
required
Available options:
daily,
weekly,
monthly,
quarterly,
yearly
duration_months
integer
required

How many months to assign

Required range: 1 <= x <= 24
reason
string
required

Admin reason for assignment

site_id
string
required
tier
string
required
user_id
string
required
start_date
string

Optional custom start date (YYYY-MM-DD)

Response

Created

amount_cents
integer
auto_renew
boolean
available_credits
integer
billing_interval
string
can_be_cancelled
boolean
cancellation_reason
string
cancelled_at
string
cooling_off_expiry
string
created_at
string
credits_used_this_period
integer
currency
string
current_period_end
string
current_period_start
string
entry_credits_per_period
integer
id
string
is_active
boolean
is_cancelled
boolean
is_in_trial
boolean
is_paused
boolean
is_trial_active
boolean
metadata
object
next_billing_date
string
paused_until
string
payment_method
string
site_id
string
status
string
subscription_start_date
string
tier
string
trial_end_date
string
trial_start_date
string
updated_at
string
user_id
string