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: How to use Billing API correctly for public shopify app

How to use Billing API correctly for public shopify app

Broly
Shopify Partner
2 0 2

Hi Guys, 

New to shopify developers platform and facing issues understanding basic billing related queries. I have gone through Billing API flow, Billing API and its usage, and have some queries, would be great if any of the Shopify gurus can help answer these.

1. In case of a paid app with recurring monthly charges, does Shopify automatically charge app fee from merchant/store or do I need to use Shopify Billing API?
2. If I need to use Shopify Billing API, when do I need to call billing API, is it every month on some specific dates to trigger billing or is it just a one time step during app installation?
3. Can I launch an app as free and then later make it a paid app?  
4. What are the options to make an app free for certain subset of users during initial days of app launch and later make it paid? 
5. How can I charge any customer different recurring charges based on their certain usage like number of users in store, premium features etc.

Thanks,

Replies 7 (7)

mortdavi
Visitor
2 0 0

I would also be very interested in hearing the answers to the questions above.

Zameer
Shopify Staff
297 31 90

Hey Broly,

The questions to most of your answers can be found in the two pieces of documentation which you included, but here's a brief summary:

  1. If you've activated a RecurringApplicationCharge with the Billing API, the merchant will automatically be charged a fixed-value every 30 days.
  2. You call the Billing API twice during setup. Initially to create the charge, which you then get the merchant to approve, and finally to activate the approved charge using the charge_id which Shopify returns to you. If you created a RecurringApplicationCharge then you only need to activate the charge once during setup
  3. Yes! When transitioning to a paid app, you would just have to create an ApplicationCharge (or RecurringApplicationCharge) for each merchant.
  4. The options are endless and this is completely up to you! After a merchant has installed your app, you choose exactly what events and conditions trigger the creation of the ApplicationCharge. This could be checking to see what the total number of products are, the number of transaction passing a certain threshold, even the name of the shop containing a certain substring. The logic for this implementation is entirely left up to the developer. 
  5. Again, this is all possible within your implementation. All you would have to do is implement the appropriate logic when calling the Billing API to create a charge. Before creating the charge, you could take a look at any property of the given shop and then trigger the API call with the appropriate parameters for that subgroup.

Hopefully, this helps shed some light on the process. This FAQ document is also helpful when running into issues: https://help.shopify.com/en/api/app-store/charging-for-your-app/faq

To learn more visit the Shopify Help Center or the Community Blog.

Larsecom
Shopify Partner
3 0 0

Hi Zameer,

We are working on a public app for the Shopify App Store, but we have a few problems including the Billing API. Could we get in direct contact with you to fix the issues? 

Thank you,

Lars and Dominik

banned
appbuilder1
Tourist
4 0 1

@Larsecom good luck with that. They are one of the worst and it's gotten worse. Never a human to talk to, the closest is a chat. And 99% of the time, they read from a script with the result of just wasted time and frustration. And now forcing apps to use their billing so they can get 20% revenue even when you've already established billing services like Stripe for your app. They just don't care. It's purely a money grab. One that is monopolistic and likely illegal beyond the fact that it's just out right nasty and one sighted. This is the same kind of practices that caused Apple and others problems with their app stores. Will partners need to have a case action law suit filled for Shopify to be forced to end this unacceptable practice!? I implore other partners to stand up against this kind of abuse of power!

mortdavi
Visitor
2 0 0

Follow-up questions - who handles the sensitive payment information? I.e. What exactly does the developer have to store, do we have to take card details etc. or is that all done on Shopify's end?

 

Finally, best case scenario (although I know this is ambiguous, it'd be good to have a ball-park), what would you say is the minimum number of lines of code required for a very basic implementation (standard monthly charge for each user)?

 

Are there any examples out there you could point us towards, on GitHub or something? Sample code would be helpful to see how it all works in the backend.

Zameer
Shopify Staff
297 31 90

Hey,

Developers never need to worry about dealing with payment information as that is all taken care of by Shopify once the appropriate calls are made with the Billing API.

In terms of a minimalist implementation, I would imagine that making a POST request to create and activate a RecurringApplicationCharge immediately after your app is installed (regardless of any other parameters), would be the easiest approach. Obviously, the assumption here is that there is a single fixed price for your app, with a potential free trial period. Such an implementation shouldn't take more than a dozen lines of code.

There currently isn't any official Shopify examples that I can point you to, but this may be something that we will be adding in the future.

To learn more visit the Shopify Help Center or the Community Blog.

__will
Tourist
4 0 1

Did any examples ever get posted? The documentation is incredibly sparse.  The API  documentation and the shopify_api gem are understadable, but some examples of how to use the api woud be helpful.  I see request for this all over the shopify forum, youtube comments etc.