Zephr User Guide

List Subscriptions Endpoint

0 views 0

The Chargify extension creates a new API endpoint at mydomain.com//plugins/public/chargify/subscriptions, which lists the Chargify subscriptions for the signed-in user.

This endpoint can be called using the following cURL command:

curl --location --request GET
'https://MYDOMAIN.com/plugins/public/chargify/subscriptions' \
--header 'Cookie: blaize_session=df45a301-23a7-465a-b838-61d81d6e1bd5'

The response from this endpoint is similar to the following:

{
    "subscriptions": [
        {
            "token": null,
            "managed-by": "Chargify",
            "external-id": 1234567,
            "next-billing-time": "2021-08-14T17:02:30-04:00",
            "ends": null,
            "blaize-product": {
                id": "product-1",
                "label": "Product 1",
                "description": ""
            },
            "transaction-history": [
                {
                    "human-readable-amount": "$3.74 CAD",
                    "time": "2021-07-14T17:02:30-04:00",
                    "currency": "CAD",
                    "cents": 374,
                    "cycle": null,
                    "period_start": "2021-07-14",
                    "period_end": "2021-08-14",
                    "cycleCount": 1,
                    "taxRate": {}
                }
            ],
            "subscription-state": "active",
            "paid_through_date": "2021-08-14T17:02:30-04:00",
            "plan_id": 234567,
            "plan_name": "Monthly magazine"
        }
    ]
}