Why subscription_billing_attempts/challenged webhook is giving error on creation .

RitikaThakur
Shopify Partner
19 0 6

1. When first time customer proceed with checkout of subscription product , subscription_contract webhook provide order id from where I get the contract details of each line item with next billing date :-

Array ( [data] => Array ( [order] => Array ( [createdAt] => 2021-10-25T09:27:47Z [lineItems] => Array ( [edges] => Array ( [0] => Array ( [node] => Array ( [contract] => Array ( [id] => gid://shopify/SubscriptionContract/2028470422 [nextBillingDate] => 2021-10-27T08:30:00Z ) [product] => Array ( [title] => Love’s Labour ) [sellingPlan] => Array ( [name] => every 2 day ) ) ) [1] => Array ( [node] => Array ( [contract] => Array ( [id] => gid://shopify/SubscriptionContract/2028503190 [nextBillingDate] => 2021-10-26T08:30:00Z ) [product] => Array ( [title] => Fingerprint ) [sellingPlan] => Array ( [name] => every day ) ) ) ) ) ) ) [extensions] => Array ( [cost] => Array ( [requestedQueryCost] => 43 [actualQueryCost] => 11 [throttleStatus] => Array ( [maximumAvailable] => 1000 [currentlyAvailable] => 989 [restoreRate] => 50 ) ) ) )

2. Now When I need to renew the contracts or create new order ,  I am using mutation "subscriptionBillingAttemptCreate"  & "subscriptionBillingAttempt"  but in the result of both api the value of  "nextbillingDate " in node "subscriptionContract" shows the incorrect date or the date of first renewal only whereas ideal it should show me the the actual nextBillingDate or the second renewal date

3. In fact I also tried , hitting the order GraphQL api of new order created in step 2 if it shows  me the the actual nextBillingDate or the second renewal date but that also  shows the incorrect date or the date of first renewal only

4. Then I tried creating subscription_billing_attempts/create webhook to check its JSON but it don't get hit or run without subscription_billing_attempts/challenged webhook  but it shows  "errors": "Could not find the webhook topic subscription_billing_attempts/challenged"  while creating the webhook,  although I already have scope "read_own_subscription_contracts"  in my app.

Please Help ..!!

Replies 2 (2)

JasonYang
Shopify Staff (Retired)
12 1 4

Hey @RitikaThakur ,

I'm not an expert in terms of webhooks, but subscription_billing_attempts/challenged would be triggered when there is a 3ds challenge associated with the billing attempt. 

What is the result like when you create webhooks for subscription_billing_attempts/success or failure? 

Also I'm not quite sure if subscription_billing_attempts/create is part of the existing webhooks. Maybe this documentation can help a little bit: https://shopify.dev/api/admin-rest/2021-10/resources/webhook#top. BillingAttempt can be found at the top

 

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

RitikaThakur
Shopify Partner
19 0 6

Thank You for your time ...!!!

In the Point 4 of my original message :-  I missed type  subscription_billing_attempts/success to   subscription_billing_attempts/create  . 

Yes I was able to successfully create  subscription_billing_attempts/success and  subscription_billing_attempts/failure but was not able to create "subscription_billing_attempts/challenged" " as it shows  "errors": "Could not find the webhook topic subscription_billing_attempts/challenged"  while creating the webhook,  although I already have scope "read_own_subscription_contracts"  in my app. So this was my question why it happen , if you can explain the reason it will be great help .

My main question is I need to know the next billing date after I create the billing attempt of first renewal .  let me explain the steps again that I followed  :- 


1. When first time customer proceed with checkout of subscription product , subscription_contract webhook provide order id from where I get the contract details of each line item with next billing date :-

Array ( [data] => Array ( [order] => Array ( [createdAt] => 2021-10-25T09:27:47Z [lineItems] => Array ( [edges] => Array ( [0] => Array ( [node] => Array ( [contract] => Array ( [id] => gid://shopify/SubscriptionContract/2028470422 [nextBillingDate] => 2021-10-27T08:30:00Z ) [product] => Array ( [title] => Love’s Labour ) [sellingPlan] => Array ( [name] => every 2 day ) ) ) [1] => Array ( [node] => Array ( [contract] => Array ( [id] => gid://shopify/SubscriptionContract/2028503190 [nextBillingDate] => 2021-10-26T08:30:00Z ) [product] => Array ( [title] => Fingerprint ) [sellingPlan] => Array ( [name] => every day ) ) ) ) ) ) ) [extensions] => Array ( [cost] => Array ( [requestedQueryCost] => 43 [actualQueryCost] => 11 [throttleStatus] => Array ( [maximumAvailable] => 1000 [currentlyAvailable] => 989 [restoreRate] => 50 ) ) ) )

2. Now When I need to renew the contracts or create new order ,  I am using mutation "subscriptionBillingAttemptCreate"  & "subscriptionBillingAttempt"  but in the result of both api the value of  "nextbillingDate " in node "subscriptionContract" shows the incorrect date or the date of first renewal only whereas ideally it should show me the the actual nextBillingDate or the second renewal date

3. In fact I also tried , hitting the order GraphQL api of new order created in step 2 if it shows  me the the actual nextBillingDate or the second renewal date but that also  shows the incorrect date or the date of first renewal only

4. Then I tried checking subscription_billing_attempts/success  webhook to check its JSON data but it don't get hit or run without subscription_billing_attempts/challenged webhook due to 3D secure check  I think  but as explained earlier as well it  shows  "errors": "Could not find the webhook topic subscription_billing_attempts/challenged"  while creating the webhook,  although I already have scope "read_own_subscription_contracts"  in my app. 

5. Also since we are doing the checkouts in testing mode so can you please help us why it didn't hit subscription_billing_attempts/success  webhook ?

6. Also , now some customer payment method may have 3D secure or some may have not so incase some have so can you please explain what exactly we need to do ? 

I have already gone through all the official documentation but didn't  find any proper connected flow of all the things . So if you can explain and answer all my above points , I will be great help .