Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Subscription based ordering, aka recurring payments/orders

Subscription based ordering, aka recurring payments/orders

hanshank
Tourist
6 0 0

Is there a way to use the Shopify API in a way where users of an app can subscribe to a product or service instead of just ordering it once, or would I have to write custom backend functionality for that?

Replies 5 (5)

Josh
Shopify Staff
1134 84 235

Hey @hanshank , 

 

A part of a subscription ordering process is possible by using our Order API - the problem with this, however, is capturing the funds that would be owed. You can't charge a credit card using this API endpoint so that portion of the process would have to be handled externally and then the order could be marked as paid.

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

hanshank
Tourist
6 0 0

Thanks for your reply @Josh . Just to clarify: Are you saying that capturing funds would have to happen externally, as in through 3rd party payment gateways like Stripe, Paypal etc? Doesn't Shopify have a separate API for capturing funds/payments?

Josh
Shopify Staff
1134 84 235

Hey again @hanshank , 

 

If using the Order API to create orders, the payment authorization would have to happen externally, yes - a credit card can't be authorized and charged via the Order API. 

 

However, if the order is created via the online storefront and the card has already been authorized, then we do have an API that can capture the funds. For a recurring order subscription though, using the online storefront is something you're probably going to want to avoid so I don't think that will necessarily be of much use in this case.

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

hanshank
Tourist
6 0 0

@Josh  I see. So would it possibly be better to use a third-party solution like "Stripe" to capture the payment and keep track of the credit card information, and then have a custom backend that will generate new "Shopify" orders on a set interval, charge the credit card externally and then send the order to Shopify? 

 

It seems hard to use Shopify as a package deal for dealing with subscriptions since Shopify can't store a customer's credit card information for repeated orders anyways. 

 

My plan of action as of now is to build that custom backend to deal with all the subscription logic, and then let Stripe deal with credit cards and transactions and Shopify will deal with orders and shipping. Does this sound like a reasonable approach when using the Storefront API for the front-end, or do you have any recommendations of easier/better ways we could do this? I know there are third-party plugins like re-charge, but we would like to try to avoid an extra 1% charge per transaction by rolling our own.

Josh
Shopify Staff
1134 84 235

Hey again @hanshank , 

 

If you're using the Storefront API it sounds like you're on the right track, but there are a couple of other potential solutions that I'll provide in case they seem like something you'd prefer. 

 

You could use the Checkout API to create a checkout, and then link a customer to that checkout to complete their purchase and create a new order to continue their subscription. That would shift the responsibility of continuing the subscription and providing payment details to the customer and is likely easier to implement. 

 

Alternatively, you could achieve a similar result by creating draft orders and then e-mailing an invoice to customers to complete their purchase as well. 

 

If the above isn't appealing though, then handling payment details in-house and creating orders via the API would be the way to go. I'd very much like others in the community to post in here with solutions they have found! 

 

 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog