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 2 (2)
Liam
Shopify Staff
Shopify Staff
1868 196 573

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 1

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?