Skip to content

Instantly share code, notes, and snippets.

@alyatwa
Last active May 19, 2024 23:22
Show Gist options
  • Save alyatwa/c36bd36511bef6deb5d16f0f1de62bcf to your computer and use it in GitHub Desktop.
Save alyatwa/c36bd36511bef6deb5d16f0f1de62bcf to your computer and use it in GitHub Desktop.

subscription.canceled (cancel now)

{
    "data": {
        "id": "sub_01hy89z6jbcvkhvj0jgx6kr7cq",
        "items": [
            {
                "price": {
                    "id": "pri_01hy65qem51r03c3m07bwfy6we",
                    "name": "pro",
                    "type": "standard",
                    "status": "active",
                    "quantity": {
                        "maximum": 1,
                        "minimum": 1
                    },
                    "tax_mode": "account_setting",
                    "seller_id": "19760",
                    "created_at": "2024-05-18T15:39:32.869279Z",
                    "product_id": "pro_01hy65hm01sb9vwpghmvxr78q4",
                    "unit_price": {
                        "amount": "500",
                        "currency_code": "USD"
                    },
                    "updated_at": "2024-05-18T15:39:32.869279Z",
                    "custom_data": {
                        "id": "2",
                        "name": "pro"
                    },
                    "description": "pro",
                    "import_meta": null,
                    "trial_period": null,
                    "billing_cycle": {
                        "interval": "month",
                        "frequency": 1
                    },
                    "unit_price_overrides": []
                },
                "status": "active",
                "quantity": 1,
                "recurring": true,
                "created_at": "2024-05-19T11:32:09.931Z",
                "updated_at": "2024-05-19T11:32:09.931Z",
                "trial_dates": null,
                "next_billed_at": null,
                "previously_billed_at": "2024-05-19T11:32:08.824199Z"
            }
        ],
        "status": "canceled",
        "discount": null,
        "paused_at": null,
        "address_id": "add_01hy89xm0an52y5xc87vy0g9db",
        "created_at": "2024-05-19T11:32:09.931Z",
        "started_at": "2024-05-19T11:32:08.824199Z",
        "updated_at": "2024-05-19T23:20:33.671Z",
        "business_id": null,
        "canceled_at": "2024-05-19T23:20:33.669Z",
        "custom_data": null,
        "customer_id": "ctm_01hy6rrt1azba4n948269xbx18",
        "import_meta": null,
        "billing_cycle": {
            "interval": "month",
            "frequency": 1
        },
        "currency_code": "USD",
        "next_billed_at": null,
        "billing_details": null,
        "collection_mode": "automatic",
        "first_billed_at": "2024-05-19T11:32:08.824199Z",
        "scheduled_change": null,
        "current_billing_period": null
    },
    "event_id": "evt_01hy9jgar46cevnd2pgmdskqas",
    "event_type": "subscription.canceled",
    "occurred_at": "2024-05-19T23:20:34.308801Z",
    "notification_id": "ntf_01hy9jgav0ar5r4y98k8r5yf3e"
}

subscription.updated (cancel)

{
    "data": {
        "id": "sub_01hy89z6jbcvkhvj0jgx6kr7cq",
        "items": [
            {
                "price": {
                    "id": "pri_01hy65qem51r03c3m07bwfy6we",
                    "name": "pro",
                    "type": "standard",
                    "status": "active",
                    "quantity": {
                        "maximum": 1,
                        "minimum": 1
                    },
                    "tax_mode": "account_setting",
                    "seller_id": "19760",
                    "created_at": "2024-05-18T15:39:32.869279Z",
                    "product_id": "pro_01hy65hm01sb9vwpghmvxr78q4",
                    "unit_price": {
                        "amount": "500",
                        "currency_code": "USD"
                    },
                    "updated_at": "2024-05-18T15:39:32.869279Z",
                    "custom_data": {
                        "id": "2",
                        "name": "pro"
                    },
                    "description": "pro",
                    "import_meta": null,
                    "trial_period": null,
                    "billing_cycle": {
                        "interval": "month",
                        "frequency": 1
                    },
                    "unit_price_overrides": []
                },
                "status": "active",
                "quantity": 1,
                "recurring": true,
                "created_at": "2024-05-19T11:32:09.931Z",
                "updated_at": "2024-05-19T11:32:09.931Z",
                "trial_dates": null,
                "next_billed_at": null,
                "previously_billed_at": "2024-05-19T11:32:08.824199Z"
            }
        ],
        "status": "active",
        "discount": null,
        "paused_at": null,
        "address_id": "add_01hy89xm0an52y5xc87vy0g9db",
        "created_at": "2024-05-19T11:32:09.931Z",
        "started_at": "2024-05-19T11:32:08.824199Z",
        "updated_at": "2024-05-19T22:35:20.461Z",
        "business_id": null,
        "canceled_at": null,
        "custom_data": null,
        "customer_id": "ctm_01hy6rrt1azba4n948269xbx18",
        "import_meta": null,
        "billing_cycle": {
            "interval": "month",
            "frequency": 1
        },
        "currency_code": "USD",
        "next_billed_at": null,
        "billing_details": null,
        "collection_mode": "automatic",
        "first_billed_at": "2024-05-19T11:32:08.824199Z",
        "scheduled_change": {
            "action": "cancel",
            "resume_at": null,
            "effective_at": "2024-06-19T11:32:08.824199Z"
        },
        "current_billing_period": {
            "ends_at": "2024-06-19T11:32:08.824199Z",
            "starts_at": "2024-05-19T11:32:08.824199Z"
        }
    },
    "event_id": "evt_01hy9fxgyvx63j2b2x7hza9s3p",
    "event_type": "subscription.updated",
    "occurred_at": "2024-05-19T22:35:20.923401Z",
    "notification_id": "ntf_01hy9fxh1na1qe6jpb1b61tscn"
}

subscription.activated

{
  "event_id": "evt_01hy89z781kyx4ng",
  "event_type": "subscription.activated",
  "occurred_at": "2024-05-19T11:32:10.626905Z",
  "notification_id": "ntf_01hy89z7bbvevwnajcr8s7p4n9",
  "data": {
    "id": "sub_01hy89z6jbcvkhvj0jgx6kr7cq",
    "items": [
      {
        "price": {
          "id": "pri_01hy65qem51r03c",
          "name": "pro",
          "type": "standard",
          "status": "active",
          "quantity": {
            "maximum": 1,
            "minimum": 1
          },
          "tax_mode": "account_setting",
          "created_at": "2024-05-18T15:39:32.869279Z",
          "product_id": "pro_01hy65hm01sb9vwpghmvxr78q4",
          "unit_price": {
            "amount": "500",
            "currency_code": "USD"
          },
          "updated_at": "2024-05-18T15:39:32.869279Z",
          "custom_data": {
            "id": "2",
            "name": "pro"
          },
          "description": "pro",
          "import_meta": null,
          "trial_period": null,
          "billing_cycle": {
            "interval": "month",
            "frequency": 1
          },
          "unit_price_overrides": []
        },
        "status": "active",
        "quantity": 1,
        "recurring": true,
        "created_at": "2024-05-19T11:32:09.931Z",
        "updated_at": "2024-05-19T11:32:09.931Z",
        "trial_dates": null,
        "next_billed_at": "2024-06-19T11:32:08.824199Z",
        "previously_billed_at": "2024-05-19T11:32:08.824199Z"
      }
    ],
    "status": "active",
    "discount": null,
    "paused_at": null,
    "address_id": "add_01hy89xm0an52y5xc87vy0g9db",
    "created_at": "2024-05-19T11:32:09.931Z",
    "started_at": "2024-05-19T11:32:08.824199Z",
    "updated_at": "2024-05-19T11:32:09.931Z",
    "business_id": null,
    "canceled_at": null,
    "custom_data": null,
    "customer_id": "ctm_01hy6rrt1azba4n948269xbx18",
    "import_meta": null,
    "billing_cycle": {
      "interval": "month",
      "frequency": 1
    },
    "currency_code": "USD",
    "next_billed_at": "2024-06-19T11:32:08.824199Z",
    "billing_details": null,
    "collection_mode": "automatic",
    "first_billed_at": "2024-05-19T11:32:08.824199Z",
    "scheduled_change": null,
    "current_billing_period": {
      "ends_at": "2024-06-19T11:32:08.824199Z",
      "starts_at": "2024-05-19T11:32:08.824199Z"
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment