Create a subscription signup link

View as Markdown

Generates a tokenised signup link that allows a specific customer to subscribe to a plan. Use plan_code to identify the plan. The returned token can be appended to your subscribe page URL (e.g. /subscribe/{token}). The token expires after 24 hours.

Authentication

AuthorizationBearer
API key obtained from the Afternoon dashboard

Request

This endpoint expects an object.
customer_idstringRequiredformat: "cuid"
Customer ID
plan_codestringRequiredformat: "^[a-z0-9]+(?:_[a-z0-9]+)*$"
Plan code
success_urlstringOptionalformat: "uri"
URL to redirect to after successful signup
back_urlstringOptionalformat: "uri"
URL to go back to when customer clicks Back
previous_subscription_idstringOptionalformat: "cuid"
Existing subscription ID to change from. If omitted, link creates a new subscription.
change_timing_modeenumOptional

Required when previous_subscription_id is provided. Use “now” or “end_of_period”.

Allowed values:
cancel_now_prepaid_refund_policyenumOptional

Only allowed when change_timing_mode is “now”. Controls prepaid fixed-fee refunds.

Allowed values:

Response

Signup link created
successboolean
request_idstring

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
500
Internal Server Error