A place to discuss charging merchants for your apps and services using the billing API.
Hi,
I am having a tough time pinning this down. In general when I query the GraphQL API for billing info I get the correct currentPeriodEnd which is 30 days after the charge was activated like so:
{ "data": { "id": "gid://shopify/AppSubscription/12878577741", "name": "Pay As You Grow", "createdAt": "2020-04-25T18:55:46Z", "currentPeriodEnd": "2020-05-25T18:56:17Z", "test": false, "status": "ACTIVE", "trialDays": 0, }, "casted_data": {}, "errors": [] }
but sometimes the currentPeriodEnd is just a few days after the date the charge was activate. For Example here:
{ "data": { "id": "gid://shopify/AppSubscription/15100870787", "name": "Pay As You Grow", "createdAt": "2020-04-22T21:23:47Z", "currentPeriodEnd": "2020-04-29T20:08:52Z", "test": false, "status": "ACTIVE", "trialDays": 0, }, "casted_data": {}, "errors": [] }
What am I supposed to be using to determine the billing periods? If a store installed and activated a charge on 2020-04-22T21:23:47Z the billing period should end on 2020-05-22 21:23:25 UTC not 2020-04-29T20:08:52Z
Hey @Enea,
For 15100870787, the merchant first installed the app on 2020-02-29, and uninstalled/reinstalled the app on 2020-04-02 - so the 29th cycle stuck.
Scott | Developer Advocate @ Shopify
We're looking into brining the trial_ends_on across to the GraphQL API. For now, you'll need to manually calculate (createdAt + trialDays).
Scott | Developer Advocate @ Shopify
Is the created at date always the same as the date the charge was activated?
Good point, these will be different. In that case, for now you'll need to rely on the REST API, or track the activation date on your side.
Would it be possible to also add the activated/confirmed timestamp to GraphQL?
I'll pass this feedback along.
Scott | Developer Advocate @ Shopify
Thank you
What do you think the time table for adding those fields looks like?
The discussion is still taking place. There's no ETA.
Scott | Developer Advocate @ Shopify
Hi SBD_ , a couple questions:
Thank you
SBD_ another follow up:
RecurringApplicationCharge.trial_ends_on is a date rather than a datetime. What time of day does the trial end?
Thank you