Check Successful Subscription for Partner App

Greetings Shopify community!

This is my first experience in creating an app.

Before writing here I read the documentation and studied similar questions, but I have yet to find the answer.

I need to create a subscription with a trial period. I made my app according to the instructions https://shopify.dev/docs/apps/billing/subscriptions/time-based.
And implemented the subscription.

To test everything, including payment, I created a test store and activated Bogus Gateway.
I have done everything according to the documentation.

On the request https://{{shop_url}}/admin/api/2023-10/graphql.json the application received a link to which the client was redirected. The client saw the following:

After clicking approve application receive client with charge_id and everything seems fine.

Under Settings - Billing - Subscriptions is next

But after the trial period expired, the application got the following webhook

{
    "admin_graphql_api_id": "gid://shopify/AppSubscription/2368939XXXX",
    "admin_graphql_api_shop_id": "gid://shopify/Shop/5486592XXXX",
    "capped_amount": null,
    "created_at": "2023-10-31T10:43:56-04:00",
    "currency": "USD",
    "name": "S (5 requests/sec)",
    "status": "EXPIRED",
    "updated_at": "2023-11-03T07:00:05-04:00"
}

If I understood correctly, the payment was past due.
2. How to test and get a successful payment?

  1. Why the payment is expired?
  2. Where can I read about all statuses?

Thanks

1 Like

Here information with detail steps

Settings - Payments

Settings - Payments - (for testing) Bogus Gateway - Manage

Settings - Apps and sales channels - Uninstall โ†’ Install

Install - to APP(redirect) - to Shopify (return with scope, redirect_uri and state)

Install uninstalled app - to APP(redirect) - call AppSubscriptionCreate(with โ€œtestโ€: true)
response:

{
    "data": {
        "appSubscriptionCreate": {
            "userErrors": [],
            "appSubscription": {
                "id": "gid://shopify/AppSubscription/23704174XXX",
                "test": true,
                "lineItems": [
                    {
                        "id": "gid://shopify/AppSubscriptionLineItem/23704174XXX?v=1&index=0",
                        "plan": {
                            "pricingDetails": {
                                "__typename": "AppRecurringPricing"
                            }
                        }
                    }
                ]
            },
            "confirmationUrl": "https://XXX-test.myshopify.com/admin/charges/36148183XXX/23704174XXX/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRsKwhvAOGEBQA6EmF1dG9fYWN0aXZhdGVU--5e183c5bbe172c4d84478c5034a58303e6d92e0d"
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 22,
            "actualQueryCost": 22,
            "throttleStatus": {
                "maximumAvailable": 1000,
                "currentlyAvailable": 978,
                "restoreRate": 50
            }
        }
    }
}

Redirect client to confirmationUrl

Approve subscription - Approve

Settings - Apps and sales channels - View details (on Installed app)

Settings - Apps and sales channels - View details (on Installed app) - View current invoice

Settings - Billing

I hope the information I provided is sufficient to resolve my issue. If any additional details are required, please let me know.