Re: Billing API Webhooks

Billing API Webhooks

pk7
Tourist
8 0 1

I cannot find any webhooks related to billing.

I need to know when one-time application charge changes status.
Is it possible to be notified by shopify when it happens, or should I monitor it myself, requesting charge status periodically ? 

Replies 11 (11)

SBD_
Shopify Staff
1831 273 419

Hey @pk7 

 

There aren't any billing webhooks. 
Update: Billing Webhooks are available through our Billing GraphQL API.

 

You should be able to keep track of the status along the way: when you create the charge it will be pending, when they they accept (and redirect back to you) it will be accepted, once you activate it becomes active - should they not accept within two days it will be expired.

 

Scott | Developer Advocate @ Shopify 

pk7
Tourist
8 0 1

We have SaaS app that integrates with shopify (along with other services). Client uses it for example on our mobile application.

He needs to buy a billing plan on our application in ourder to use it.

He has to have account on our side. If we won't know that his payment failed nor succeeded, we won't know if we should restrict his access to our SaaS. 

We have this system implemented on our side already (attaching Visa / Mastercard card), but it is Shopifys requirment to bill his via Shopify Billing API in order to pass shopify app review. 

SBD_
Shopify Staff
1831 273 419

Once the charge is accepted, you can activate it. Then, look at the response to confirm it's been activated.

Scott | Developer Advocate @ Shopify 

pk7
Tourist
8 0 1

How can I know it has been confirmed by client ?

Should I depend only on clients browser redirect ? It's not really reliable, isn't it ? 

pk7
Tourist
8 0 1

Also, if you require of us to charge our clients using Shopify billing API, it would be nice to know if client didn't pay.
Won't you agree ?

SBD_
Shopify Staff
1831 273 419

Only accepted charges can be activated. https://shopify.dev/tutorials/charging-for-your-app-with-rest-admin-api-concepts#one-time-applicatio...

 

Should I depend only on clients browser redirect ? It's not really reliable, isn't it ? 

No. The redirect contains a charge ID - you'll need to activate this charge and examine the response.

Scott | Developer Advocate @ Shopify 

pk7
Tourist
8 0 1

Yes, but you still depend on the fact that client's browser will or will not do something.

It's not really reliable, especially when we're talking about financing stuff.

Tanaka
Shopify Staff (Retired)
4 0 0

Hello,

 

Billing Webhooks are only available through our Billing GraphQL API, you can find more information about this here and how to create and subscribe to them

https://shopify.dev/tutorials/bill-for-your-app-using-graphql-admin-api

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

darrelladjei
Visitor
1 0 0

Hi,

*Background*

I'm following https://shopify.dev/tutorials/bill-for-your-app-using-graphql-admin-api#webhooks-for-billing with graphql. 

I'm having issues subscribing to the app_purchases_one_time/update webhook topic. (403 response status with no message) . 

 

*Ask*

Am I missing some required scopes? I just want to know if payment for my app was confirmed or declined.

Thanks

 

tinyeinstein
Shopify Partner
1 0 0

Probably  you need to subscribe to this topic 'app_subscriptions/update'  

Giltee
Shopify Partner
17 3 6

Hey @SBD_ this was really helpful information. I read all the documentation for the billing API and I don't believe this is mentioned any where. It would be really great for devs that are going through this process for the first time to have it included in the documentation. Just my 2 cents.