How to charge RecurringApplicationCharge for Partner-Friendly apps?

Solved
New Member
11 0 0

Shopify says that in order to qualify for Partner-Friendly apps, we need to "not charge" for development stores. Here is the link (TIP section): https://help.shopify.com/en/api/app-store/charging-for-your-app

It says we should grant free access if { "plan_name" : "affiliate" })

When we set the price 0 on RecurringApplicationCharge, we get an error. How do we grant free access ?

0 Likes
Tourist
8 0 2

The article says "Consider". This means is up to you if you want to allow a free charge. You have the option to make this error go way by making your app 1.00(or any other positive value) for the type of stores you want.

 

Or if you don't want any fee then skip the Recurring Application Charge step in your app.

0 Likes

Success.

Shopify Staff
Shopify Staff
298 32 59

Hey Baris,

 

Yes, it's not possible to create a Recurring Application Charge with a price of $0.00, unless you have a capped amount of greater than $0.00 as well. So, a request with price of $0.00 and capped_amount of $10.00 should complete successfully and accomplish what you want.

 

That being said, you have a couple options for affiliate shops. You can either make use of the `test` parameter, which you would set to true to ensure that no real charge is made. Or more simply, you could skip the charge creation flow entirely in your application logic for affiliate shops.

 

Both of the above options should allow you to accomplish what it is you're trying to do and ultimately get your app listed on our Partner-friendly app list.

 

Edit: corrected for non-zero capped_amount value.

0 Likes
Shopify Partner
1843 170 535

I thought you can have recurring app charge $0 as long as the capped amount isn't $0 as well? i.e. for usage based charging models. That would be a good fit for partner friendly apps wherein recurring charge is 0, capped amount is whatever up to 10k, but you simply never charge them i.e. free app.

 

Or am I missing something here?

I turn coffee in to code - since 1998
1 Like
New Member
11 0 0

Hi Zameer, thanks for your answer. In either case, what will happen when a shop upgrades to (say) a basic plan? Do I have to charge them again? Or does Shopify handle this by itself?

0 Likes
Shopify Staff
Shopify Staff
298 32 59

As a rule of thumb, Shopify doesn't do anything "automatically" when it comes to the Billing API.

 

For the scenario when an affiliate shop moves to a paid plan, you would then have to create a new Recurring Application Charge for the shop.

 

This can be done by first subscribing to the `shop/update` webhook which will notify you when the shop's plan changes. You can then create a new Recurring Application Charge with the appropriate pricing structure you are looking to implement.

0 Likes
New Member
11 0 0

Thanks Zameer. I think you are saying that when the shop moves to a paid plan, request at my webhook for the store. But then how do I create a RecurringApplicationCharge? The RecurringApplicationCharge requires a situation where I present the user with a callback. However, when I get the request at the webhook, there is no user to show the callback to. 

0 Likes
Shopify Staff
Shopify Staff
298 32 59

This really depends on your implementation.

 

If you are storing shop data server side which includes plan names, then webhooks will let you update the data accordingly (this should also be combined with period polling as webhook delivery isn't guaranteed). The alternative would be to make a request to the GET /admin/shop.json endpoint for each session when your app is being used, to ensure that the plan is inline with the functionality you are offering.

 

For example, say you are storing plan names server side as this is more common. You should also have some sort of database which stores Recurring Application Charge data. Whenever a merchant accesses your app, you would first do a check to ensure that there is an active Recurring Application Charge which has been accepted by the merchant, if the plan is anything except affiliate. This check would take place prior to any other actions that can be made within your application, and would therefore allow you to redirect to the charge acceptance screen before the merchant is able to use your app.

0 Likes
Highlighted
Shopify Partner
132 4 12

Hi Zameer,

 

I'm so confused right now, I asked this to shopify support and got this response:

 

Great question, although this will allow for their app to send a free charges to any store that is in Affiliate (ie development store used by partners), it will still allow for an app charge to be sent when the plan name changes when handed off to a merchant.

When a development store with the app installed is handed off to a client they will be forced to pick a plan. During this stage, they will be prompted to accept any application charges as well!

 

So I was under the impression, that we as app developers don't need to do anything when the store get's handed off? In other words, I expected shopify to activate the charge for us? 

You see not every app will get accessed every day, once my app is setup they expect it to work and won't need to access the dashboard. 
Do I really need to block frontend functionality, and wait for:
the merchant to notice something is missing
figure out is my app that isn't working in which case they will either open the app and see they need to accept, or email me first and I need to explain them?

I'm not sure if I even want to enable it if this is the way it is

0 Likes