Expose a Subscribe Link

On the edit subscription plan page, you’ll see a link for the “Sample customer url”. If you click that link, you’ll see an example of the url you can use to allow one of your customers to subscribe.

Here’s an example:

https://spreedly.com/meresheep-test/subscribers/44763/subscribe/41/screen-name-for-44763

In this case, 44763 is your customer id in your application. This is typically the unique identfier (often the primary key of your user table.) 41 is the subscription plan id. screen-name-for-44763 is the screen name for your customer. It’s how the customer will be displayed in the admin area of the spreedly UI. The screen name might be the customer’s email address, username, or whatever else you’d like.

Extra Credit

If you’d like Spreedly to default to using the saved first_name, last_name, email_address and credit card on file, simply pass in the subscriber’s token in the url like so:

https://spreedly.com/meresheep-test/subscribers/44763/d21de2b33ed811c1a040a507988241f550c45aee/subscribe/41

where d21de2b33ed811c1a040a507988241f550c45aee is the subscriber’s token. The goal here is to protect your customer’s privacy by only exposing the first_name, last_name, and email if know both the customer_id and the subscriber’s token are known.

It’s also worth noting that you might want to override the return url for this particular customer’s purchase. The return url is used in the “Continue” link at the bottom of the receipt page. Sometimes, you’d like that continue link to point to someplace specific for the customer, like their account page. To do this, you can pass a return_url parameter in the url like so:

https://spreedly.com/meresheep-test/subscribers/44763/subscribe/41?return_url=http://meresheep.com/account/31134/edit

You can also pass in the email, first name and last name as url parameters to pre-populate the form:

https://spreedly.com/meresheep-test/subscribers/44763/subscribe/41?email=joe@example.com&first_name=Joe&last_name=Smith

Next Step →

Return to the Integration Guide ↑

Olark Livehelp