Re: Setting-up billing for Partner Friendly apps

Solved
ARF
Shopify Partner
9 1 2

Here's more details. This is how we think the API should be used:

 

First get the plan_name:

GET /admin/api/2019-07/shop.json?fields=plan_name

 

The response contains the plan_name property:

{
  "plan_name": "affiliate",
}

Usually we would create the charge with something like:

POST /admin/api/#{api_version}/recurring_application_charges.json
{
  "recurring_application_charge": {
    "name": "Super Duper Plan",
    "price": 10.0,
    "return_url": "http://super-duper.shopifyapps.com",
    "trial_days": 5
  }
}

 

That is not correct for plan_name: affiliate. What is the correct code?

 

Accepted Solution (1)

Accepted Solutions
Busfox
Shopify Staff
Shopify Staff
628 49 106

This is an accepted solution.

Hi @ARF,

 

Since your post is specific to implementation of partner friendly billing, I've moved your post to our API board.

 

The best solution, in my opinion, is to fetch the shop's plan upon installation as well as subscribing to shop/update webhooks. This will allow you to stay in the loop on plan changes in the future.

 

If an install is on the affiliate plan, do not create a charge within Shopify. Then, if you receive a shop/update notification indicating the plan has changed, create the charge for whatever plan is chosen by the merchant. Of course, you will need to gate access to your app accordingly at that point.

 

Cheers,

Andrew | 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

View solution in original post

Replies 7 (7)
Busfox
Shopify Staff
Shopify Staff
628 49 106

This is an accepted solution.

Hi @ARF,

 

Since your post is specific to implementation of partner friendly billing, I've moved your post to our API board.

 

The best solution, in my opinion, is to fetch the shop's plan upon installation as well as subscribing to shop/update webhooks. This will allow you to stay in the loop on plan changes in the future.

 

If an install is on the affiliate plan, do not create a charge within Shopify. Then, if you receive a shop/update notification indicating the plan has changed, create the charge for whatever plan is chosen by the merchant. Of course, you will need to gate access to your app accordingly at that point.

 

Cheers,

Andrew | 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

ARF
Shopify Partner
9 1 2

Thanks @Busfox. I was under the impression that when a partner signs up for the app he agrees to incur charges when the app goes live. However, it seems that the partner will have to also agree to the charge after going live.

Which is true? If the former, please explain the details.

 

Thanks much.

Busfox
Shopify Staff
Shopify Staff
628 49 106

Hey @ARF,

 

The merchant always needs to approve a new charge, regardless of when it's created. This would happen when your app redirects them to the page to accept the charge. You have control over when you do this, if at all. To give the app for free you would create no charge, and thus need no acceptance from the merchant around billing. We give a high level view of the steps when it comes to billing here.

Andrew | 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

doughty
Shopify Partner
13 0 4

So is the "affiliate" plan name for development stores? Does the plan name change when they transfer the store to somebody and that person picks a paid plan?

EugeneKim
Shopify Partner
59 3 18

Hello @Busfox ,

It would be very helpful for partners to know all the plan_name values of shops that we should create a test charge for. Can you provide us this list? If you're able to add descriptions to each of the plan names that would be even better.

 

Thank you

infovarify
Shopify Partner
8 1 0

@EugeneKim 

Here is a list of plan_name from another thread

https://community.shopify.com/c/Shopify-APIs-SDKs/Enumeration-of-plan-name-from-GET-admin-shop-json/...

However I can see one is missing 'partner_test'

soghammed
New Member
3 0 0

Hi, Busfox,

 

may I know which webhooks are you referring to here please?
"well as subscribing to shop/update webhooks." 
I'm trying to implement your flow, thanks