subscription_log

Collection: subscription_logs

Beta: This resource may change in backwards-incompatible ways before it's final.

A subscription log records one thing that happened to a subscription: it was created, billed, refunded, changed, cancelled or reactivated, its past-due amount moved, or the dunning schedule acted on it. Logs are written automatically and are read-only. Each new log is also sent to webhooks whose event_resource is subscription_log.

Retrieve a log by ID, or as a collection for a subscription (/subscriptions/{id}/subscription_logs) or a store (/stores/{id}/subscription_logs).

Renamed from subscription events

Subscription logs were first released as subscription events. If you used them then, update your integration: the resource is now subscription_log (/subscription_logs, fx:subscription_logs), its event_type and event_source properties are now type and source, and the webhook event_resource is now subscription_log. Webhooks set to subscription_event were moved to subscription_log. The old URLs and names aren't accepted.

Net amount

net_amount is a subscription's recurring items after discounts, without tax or shipping: the amount MRR is based on. amount is the whole recurring charge. Logs written before net amounts were recorded don't have it.

Log Types

type When it is written Typical source
created A checkout created the subscription. transaction links to the original transaction. Details include net_amount when known. cit_checkout
billing_success Money was collected for the subscription: its first payment, a renewal, a restart, a plan change that charges, or a past-due payment. Details include order_total, the amount collected. See "Payments" below. cit_checkout, mit_checkout, mit_api, mit_admin, mit_recurring, mit_dunning, mit_system
billing_failed A renewal or past-due reattempt was declined. error_message holds the gateway's error. Details include order_total, the amount attempted; a past-due reattempt also has past_due_amount. mit_recurring, mit_dunning, mit_admin
billing_refunded Money collected for the subscription was returned: a refund, or a void of a captured payment. Details include order_total, the amount returned as a positive number. transaction links to the original charge. A refund of a charge that also recovered a past due is split the same way the charge was (see "Payments" below). mit_admin, mit_api, mit_system
cancelled The subscription was deactivated: the moment it churned. Written when an update deactivates it immediately, or when its end_date arrives and it is deactivated, with the source of whoever set the end_date. Setting a future end_date writes a modified log instead. Details include the subscription's amount, net_amount when known, and end_date at deactivation. An immediate deactivation also has cancellation_source; one logged when the end_date arrives doesn't. mit_api, mit_admin, mit_checkout, cit_checkout, mit_system
reactivated A deactivated subscription was made active again. Details include net_amount when known. mit_api, mit_admin
modified Subscription fields changed; changes holds each one's before and after value. See "Modified logs" below. mit_api, mit_admin, mit_recurring, mit_checkout, cit_checkout
past_due_updated The past-due amount changed; changes.past_due_amount holds the before and after. When a past-due payment, a renewal or a checkout clears it, details include reason: recovered (the past due was paid) or written_off (it was cleared without being paid). A change made by updating the subscription has no reason. mit_recurring, mit_dunning, mit_admin, mit_api, mit_checkout, cit_checkout
dunning_reattempt The dunning schedule reattempted the past-due amount; the result is logged separately. Details include failed_days, the days since the first failed payment. mit_dunning
dunning_email_sent A dunning reminder email was sent to the customer. Details include failed_days and email_type (dunning_reminder). mit_dunning
auto_cancelled The dunning schedule cancelled the subscription. Details include amount, net_amount when known, past_due_amount and failed_days. mit_dunning

Payments

A billing_success log is written when the money is collected, not when the charge is attempted:

  • A card payment on a gateway set to authorize only is logged when it is captured, not at checkout or renewal.
  • A hosted or pending payment is logged when its status becomes captured or approved.
  • Purchase orders and ACH payments are logged when the checkout completes, since few of them ever change status. A later refund or void writes billing_refunded.

The same money is never logged twice: a repeated gateway notification, or a status that moves back and forth, doesn't write another log.

A charge that also collects a past-due amount writes two billing_success logs on the same transaction: the subscription's own charge, and the past due recovered, which also has past_due_amount and is_makeup_payment: true. Their order_total values add up to the amount charged. A payment of only the past due writes just the recovery log. A refund of such a charge writes billing_refunded logs split between the two parts in the same proportion as their billing_success logs, the recovery part again with past_due_amount and is_makeup_payment: true. When one checkout starts several subscriptions, each gets a share of the charge in proportion to its items, and so does a refund of it; one-off products in the same order aren't counted, and a subscription with nothing charged yet, such as a free trial, gets no log until its first charge.

order_total and past_due_amount are usually JSON numbers, but some logs hold them as numeric strings, so parse them rather than relying on the JSON type.

Modified logs

changes can include frequency, next_transaction_date, start_date, end_date, past_due_amount, error_message, amount and net_amount. An amount change always comes with net_amount, even when only tax or shipping moved; net_amount has only an after when its value before isn't known. A change to the net amount alone is logged with net_amount alone. An amount change is recorded:

  • at a successful renewal whose charge differs from the previous amount, unless it also collected a past due (source mit_recurring);
  • when a checkout modifies or restarts the subscription;
  • when items, item options or applied coupon codes on the subscription's transaction_template are added, edited or removed through this API: one log per request, however many it changes. The subscription's modified webhook is sent too. A legacy PayPal Express subscription's template can't be changed this way; see the subscription resource.

Editing a template item through this API also writes a log of the item's own changes, with item_id in details (and action: item_added for a new item). Cancelling or reactivating a subscription through the deprecated legacy XML API (source mit_api) or the legacy admin (source mit_admin) is logged, but a template change made through the XML API isn't: its amount change shows up at the next renewal.

Required Scopes How scopes work →

Actions

GET View a subscription log
HEAD Get just the header response
OPTIONS Get a response explaining which HTTP methods are supported

Properties (6)

type String · Read-only

What happened. See the log types above.

createdbilling_successbilling_failedbilling_refundedcancelledreactivatedmodifiedpast_due_updateddunning_reattemptdunning_email_sentauto_cancelled
source String · Read-only

Who or what caused the log, named for whether the merchant (mit_) or the customer (cit_) initiated it: mit_api (this API), mit_admin (the Foxy admin), mit_recurring (the renewal job), mit_dunning (the dunning schedule), mit_checkout (a checkout the merchant started), cit_checkout (a customer's checkout), mit_system (a gateway notification, or a scheduled end_date with no recorded source).

cit_customer_portal is defined but not currently written.

changes Object (JSON) · Read-only

For modified and past_due_updated logs, each changed field with its before and after value. Only fields that changed are included, except net_amount, which comes with every amount change. See "Modified logs" above.

Null for other types. Example: {"amount": {"before": 24.55, "after": 31.9}, "net_amount": {"before": 21.49, "after": 27.98}}

error_message String · Read-only · max 500

The gateway's error for a billing_failed log.

Null for other types.

details Object (JSON) · Read-only

Context for the log, which varies by type. See the log types above.

Null when there is none.

date_created DateTime · Read-only

When the log was written.

Link Relations (6)

self This Subscription Log
fx:store GET PATCH PUT DELETE This Store
fx:subscription GET PATCH PUT This Subscription
fx:customer GET PATCH PUT DELETE This Customer
fx:transaction GET PATCH PUT POST Related Transaction

Only present when the log has a related transaction.

Zoomable Resources

Embed related resources using ?zoom=<resource>. Filter with ?resource:property=value.

https://api.foxycart.com/subscription_logs/{id}

Example Representation

Zoom
{
  "_links": {
    "curies": [
      {
        "name": "fx",
        "href": "https://api.foxycart.com/rels/{rel}",
        "templated": true
      }
    ],
    "self": {
      "href": "https://api.foxycart.com/subscription_logs/123",
      "title": "This Subscription Log"
    },
    "fx:store": {
      "href": "https://api.foxycart.com/stores/456",
      "title": "This Store"
    },
    "fx:subscription": {
      "href": "https://api.foxycart.com/subscriptions/321",
      "title": "This Subscription"
    },
    "fx:customer": {
      "href": "https://api.foxycart.com/customers/789",
      "title": "This Customer"
    },
    "fx:transaction": {
      "href": "https://api.foxycart.com/transactions/999",
      "title": "Related Transaction"
    }
  },
  "type": "billing_success",
  "source": "mit_recurring",
  "changes": null,
  "error_message": null,
  "details": {
    "order_total": 24.55,
    "past_due_amount": 24.55,
    "is_makeup_payment": true
  },
  "date_created": "2026-10-05T03:14:22-0700"
}