SUBSCRIPTIONS / PRESCRIPTIONS
SendSafe has the ability to process subscriptions including the ability to force billing by creating reorders periodically (i.e. monthly ordering of a refill prescription OR web site content subscription). Subscriptions can be configured to automatically renew at the end OR the expire when complete.
Subscriptions can be used for selling shippable products, digital payloads, pay-per-view websites, and much more!
IMPORTANT: Values in the OrderLineItem and OrderLineItemExt for the "parent order" is the control block for the subscription.
The parent order is the orignal order in which the subscription was purchased. Control values in the subscription control block are:
Subscription Life cycle:
|
There are two ways to find the "parent order" - either from the most recent subscription reorder OR by searching through all orders placed by the customer. The preferred method is to use a recent refill order. To find the original subscription order from a refill: load the orderlineitem for any refill for the customer. To find a list of refills for a customer follow these steps:
Once you have a refill orderline item loaded look in the
AltItemDescription
field. An so# appears in the AltItemDescription. The so# is the subscription order LineItemID
for which this refill was issued. This is the LineItemID from the "parent order."
FYI: Make sure you copy the entire so# since it can run off the entry field to the right and the entire number may therefore not be visible. |
Be sure to never change the AltItemDescription; changing this field can cause a subscription to fail.
Subscriptions can be turned on and off by setting the SubscriptionEnabed column in the control block: 0 = disabled, 1 = enabled, and 2 = enabled but NOT approved (i.e. the subscription is running but charges have been declined and will be retried). Load the "parent order" into the order admin page then click on the order lineitem for the subscription. Locate the SubscriptionEnabed and set as desired.
Subscriptions can be globally paused for an item by setting the items.QtyInStock for the refill to zero.
The shipto address can be changed in the customer MyAccount page or by editing addresses record that the ShiptoaddressID references in the control block (i.e. the original shipping address in the parent order). Load the "parent order" into the order admin page then click on the order lineitem for the subscription and make address changes as desired on the order lineitem.
The ship method can be changed by editing the ShipMethod in the control block. Load the "parent order" into the order admin page then click on the order lineitem for the subscription and make changes as desired on the order lineitem.
The number of refill orders remaining in a subscription can be changed by editing the SubscriptionPeriodsLeft in the control block. Load the "parent order" into the order admin page then click on the order lineitem for the subscription and make changes as desired on the order lineitem.
The date that the susbscription will be refilled can be changed by editing the NextOrderDate in the control block. Load the "parent order" into the order admin page then click on the order lineitem for the subscription and make changes as desired on the order lineitem.
If a credit card charge fails on a automated subscription reorder then the customer should be directed to use the Credit Card information update function found on the My Account page. The failed subscription reorder will be retried every 24 hours. If the customer has updated their account information then the retry will use the new information. Under no circumstances should the customer place a manual order for the items that would have been reordered by the subscription. If the customer does this they will be charged for both the manual order and then 24 hours later when the automated reorder goes through, they will be changed again (and receive double products).
Subscription refills will charged the same price for the item during the entire lifetime of the subscription. Each refill is a clone of the original donnor order. The following costs will remain the same regardless the changes made to Items, customer records, or shipping cost pages. Cloned subscription orders WILL NOT retain the same SendSafeTxNum as the donnor; the Transactionid and SendSafeTxNum will be the same in a cloned subscription.
*The portion of the sales tax or shipping charges for a refill will be a simple ratio of the original amount
i.e. ratio = [SubTotal of all LineItems] / [Price of refill lineitem]
THEN protion of sales tax = original sales tax x ratio
The cloning process does have limitations. If a person moves from a location where sales tax is changed to a location where sales tax is not charge, then the control block records (original order) must have the sales tax amount changed. This must be done so that future clones of an order will have the correct amount. The same is true for price increase or changes in shipping charges.
Steps to setup a subscription:
Subscription Items are setup by assigning these values to an item which will be purchased as a subscription. These values are located in the ItemsExt:
Subscriptions must be setup so the Item which is the subscription also fulfills the first subscription allotment.
The refill SubscriptionForcedOrderSKU item will be used for subsequient orders. This item must NOT BE THE SAME SKU as the parent subscription item. The same item sku can be used by multiple different parent subscription items.
A free number of refills can be specified for a subscription as a bonus for purchasing a subscription instead of individual order.
The the deplexing flag is required in almost all cases so that subscription is processed as seperate lineitems if a item quantity of great than one was ordered.
To create a subscription which is only billed once and does not send out refills or process reorders set SubscriptionForcedOrderSKU to null.
Optional (legacy): You can make all listed subscriptions mutually exclusive by listing them in: Application("SubscriptionSKUS") = "S-001,S-006,S-101,S-106"
The customer can change the shipping address used for subscription refills by going to the MyAccount page and changing the subscription address.
The shipping address and method for subscription refills can also be change using the admin pages. To change the ship address or method for all future refills you must change the information in the original subscription. The original subscription is the control-block used for all refills. To find the original subscription order from a refill: load the orderlineitem for any refill and look in the AltItemDescription field. The so# appearing in the AltItemDescription is the subscription order number from which this refill was issued.
FYI: Make sure you copy the entire so# - since it can run off the entry field to the right and the entire number may therefore not be visible.
Subscriptions can be paused individually or globally.
Global pause
Subscriptions can be globally paused for any item by setting the items.QtyInStock for the refill item to zero.
Individual pause
The admin page or SQL can be used to pause subscriptions. The subscription is paused by setting the
SubscriptionEnabed flag to something other than
1. If you need to perform bulk enable/disable, the best way to do this is the set SubscriptionEnabed to something
other than the defined 0=disabled and 1=enabled State. The processing logic uses an SQL query which include the
clause "SubscriptionEnabed > 0" - as a result SubscriptionEnabed = -1 and be in a state where it is NOT disabled but
also not running.
Any negative number can be used for pausing. As a result there can be an unlimited number of groups of subscriptions which are paused for different reasons and remain easily grouped.
In the global storefront file storefront config file:
| Keyword | Description |
| SUBSCRIPTIONS ENABLED = YES | Enabled and disables activating subscription orders as they come in. |
| SUBSCRIPTION TERMINAL COUNT = 5 | Set the number of failed charges before a subscription is disabled. |
| CONDDEPLEX LINEITEMS = YES | Enable/Disable conditional deduplex of flagged lineitems |
Once you have subscriptions setup, you should test the setup.
Subscription activation occurs when the subscription is first purchased. Acitivation sets up the subscription control block in the parent order lineitem. The activation function is performed by activateSubscriptionInOrder(). The following occurs:
Subscription billing is performed on orderlineitems and automatically forces a subscription order through the system for every subscription it finds. The activities performed by this job are listed below. These activities are performed on subscriptions which are enabled and in a state where action is required (i.e. NextOrderDate <= getDate()).
This function is run by a JobQueue job which looks like the example below:
| Parameter | value |
| param1 | If set to 1 THEN charge for shipping on free subscription refills; set to anything other than one will result in zero shipping charges on any free subscription refill. |
| param2 | Renewal mode: If set to 1 THEN subscription will automatically renew. If set to 0 or null then subscriptions will not automatically renew when their period has expired. |
| param3 | max number of orders to process each pass (max value = 500) |
Notes:
The Generic SQL Job is used to run termination code which searches for listing / Advertisement subscription which have completed and then disabled their associated listings, advertisements, and other product records.
The termination jobs for listings finds subscriptions which have all billing cycles (SubscriptionType)
completed and disables display of the subscription listing. The SQL which is used for Listing is:
update listing set ApprovedForDisplay = 0
where indexkey in
(
Select listing.indexkey
from
Orders, OrderLineItem, OrderLineItemExt, ItemsExt, listing
where
Orders.transactionid = OrderLineItem.transactionid and
OrderLineItem.ItemCodeId = ItemsExt.ItemCodeId and
OrderLineItem.LineItemid = OrderLineItemExt.LineItemid and
listing.orderLineItemID = OrderLineItem.LineItemID and
NextOrderDate <= getDate() and
SubscriptionPeriodsLeft = 0 and
SubscriptionEnabed > 0 and
Orders.ApprovalCode like '%approved%'
)
This function is run by a JobQueue job which looks like the example below:
| Parameter | value |
| param1 | Selection logic (with the first field being the record locator code for the listing or advertisement) |
| param2 | n/a |
| param3 | n/a |
Notes: