SubscriptionContracts query reutrns blank billingAttempts field

Solved

Hi, 

We are making Shopify App for subscriptions.
We called SubscriptionContracts GraphQL query. It returns SubscriptionContracts response. But billingAttempts field was blank`[]`.

Also, We haven't received webhook for "subscriptionBillingAttemptsSuccess" and "subscriptionBillingAttemptsfailure" topics.

Could early access users take billingAttempts by GraphQL response or webhook?

Thanks,

0 Likes
BStubbs
Shopify Partner
127 14 51

Have you created a billingAttempt?

https://shopify.dev/tutorials/create-manage-subscription-contracts#create-a-billing-attempt

 

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!

No, We didn't. We expected that customers create subscription's order then Shopify creates billing Attempts automatically.

Should we call billingAttempt API?

0 Likes
BStubbs
Shopify Partner
127 14 51

This is an accepted solution.

After the SubscriptionContract is initiated, the app is responsible for creating billingAttempts, not Shopify.

Check out the tutorial here: https://shopify.dev/tutorials/shopify-subscriptions-overview#modeling-your-app-for-subscriptions

 

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!

I see. We'll call billingAttempts API!

Thank you for replying!

0 Likes
_gogo
Tourist
4 0 1

Following the tutorial, it notes "...Shopify generates a subscription contract and creates a billing attempt on the initial purchase"

To clarify, should we expect the initial billing attempt to be generated by Shopify or none at all?   From your response, I assume the first subscription order is billed and processed by Shopify(that doesn't create a billingAttempt; hence billingAttempts field is [] ), and subsequent subscription orders would be created through the app?

BStubbs
Shopify Partner
127 14 51

Hi @_gogo 

Welcome to the forums!

Good point, I don't think the wording on some of this is really very good. But you are correct.

From the tutorial:

A billing attempt represents an attempt at executing a billing cycle and charging the customer payment method for a subscription contract. A billing attempt executes a contract in its current state and ensures that the app’s contract data is synced with Shopify before billing.

For a new contract, there is no billingAttempt as the tasks were completed as part of the order and contract creation. All future billingAttempts will be called by the app. 

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
engozy
New Member
3 0 0

Can you please let me know, how you are accessing SubscriptionContracts Graphql?
I am getting permission error - https://community.shopify.com/c/Shopify-Discussion/Unable-to-access-the-SubscriptionContract/m-p/104...

0 Likes
kunalwf
Tourist
4 0 1

@BStubbs I owe you two beers now

0 Likes