Billing api failing because of custom Apps

Tallpro
Shopify Partner
1 0 0

Hey,

 

I have an issue, My development app having "public app" label in apps list, I added test: true flag for testing payments, but when I call the, im getting error: Custom Apps Cannot use billing api

 

error im getting: 

array:2 [  "data" => array:1 [    "appSubscriptionCreate" => array:2 [
      "confirmationUrl" => null
      "userErrors" => array:1 [
        0 => array:2 [
          "field" => null
          "message" => "Custom apps cannot use the Billing API"
        ]
      ]
    ]
  ]
  "extensions" => array:1 [    "cost" => array:3 [
      "requestedQueryCost" => 10
      "actualQueryCost" => 10
      "throttleStatus" => array:3 [
        "maximumAvailable" => 1000.0
        "currentlyAvailable" => 990
        "restoreRate" => 50.0
      ]
    ]
  ]]

 

how i call mutation:

[
"query" => self::RECURRING_PURCHASE_MUTATION,
"variables" => [
"name" => $config["chargeName"],
"lineItems" => [
"plan" => [
"appRecurringPricingDetails" => [
"interval" => $config["interval"],
"price" => ["amount" => $config["amount"], "currencyCode" => $config["currencyCode"]],
],
],
],
"returnUrl" => $returnUrl,
"test" => true,
],
]

Please help me how to avoid this "Custom Apps..." ? 

Replies 5 (5)

Liam
Shopify Staff
2731 302 783

Hi Tallpro,

 

Custom apps are intended for a single shop, and don't go through the Shopify app store, and so don't need to access the Billing API. They're typically used for merchants who need custom functionality that wouldn't be applicable to other shops. These apps are not charged through the Shopify Billing API, but rather any fees associated would be arranged directly between the merchant and the developer.

 

On the other hand, public apps are listed in the Shopify app store and can be installed on any shop. These use the Billing API to charge fees.

 

To avoid this error, you need to make sure your app is set as a public app when implementing the Billing API. You can check this by going to your Partner Dashboard and looking at the app setup. 

 

Hope this helps!

Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog

DIW
Shopify Partner
9 0 2

I was told I had to migrate all my app development from public apps to custom apps because we are not allowed to have unpublished public apps anymore. Now I can't test or expand any features related to billing. How do we get around this?

onspruce
Shopify Partner
13 0 2

Hi Liam,

 

How can a developer test the Billing API outside of a Public app?  Now that Private apps and Unpublished apps are deprecated, there appears to be no way to test the Billing API in a development environment.

 

jhelmer25
Shopify Partner
6 0 2

I am having the same challenges.

 

It appears impossible to test any billing API flows without "push and pray", since we do not want to make a development store app published for general consumption.

jhelmer25
Shopify Partner
6 0 2

Update: For people trying to test the billing API using a non-custom app, you can create a public app, and leave it in the draft state. Note however, that only custom apps let you (a) create install links for distribution testing, and (b) use the theme/assets APIs w/o explicit approval from Shopify.

 

So there are tradeoffs...