API
GuidesGet API token
Admin Resources

Events

This resource allows a caller to inspect recent events in the store.
Endpoints

#The event object

Plus plan
An Event record represents an action that took place at a point in time.

Attributes

  • idinteger
    Unique numeric identifier for the Event.
  • object_idinteger
    The unique numeric identifier of the object associated with the Event.
  • The unique numeric identifier of the customer associated with the Event.
    This value can be null for events not directly associated with a customer.
  • created_atdatetime
    The date and time when the Event was created.
  • The resource type of the object associated with the Event, e.g. 'customer' or 'subscription'
  • verbstring
    The action describing the Event, e.g. 'created' or 'updated'
  • The short description that summarizes the Event.
  • A list of objects describing attributes that were changed during the Event.
    Show child attributesHide child attributes3
    • attributestring
      The key of an attribute updated on the object during this Event.
    • The previous value of the updated attribute.
    • valuestring
      The new value of the updated attribute.
  • sourceobject
    An object containing details about the origin of the Event.
    Show child attributesHide child attributes6
    • If the event resulted from action by a Store Admin, the account id of the store admin.
    • If the event resulted from action by an external API call, the primary key of the API token used to take the action.
    • If the event resulted from action by an external API call, the name of the API token used to take the action, as it is saved in Recharge Merchant Admin portal.
    • If the event resulted from action by a Store Admin, the email associated with the store admin account.
    • originstring
      The origin of the event, e.g. 'api', 'customer_portal', 'merchant_portal', 'recharge_process'
    • user_typestring
      The type of user who initiated the event, e.g. 'customer', 'store_admin', 'recharge_admin', 'recharge_process'
  • A list of objects passed explicitly to a Recharge API call that created the Event.
    This field will only be populated on events created using the Recharge API.
    Show child attributesHide child attributes2
    • keystring
      A user-defined key for the custom attribute associated with this Event.
    • valuestring
      A user-defined value for the custom attribute associated with this Event.
The event object
{
  "event": {
    "id": 7160141294,
    "object_id": 362310818,
    "customer_id": 36885098,
    "created_at": "2023-05-31T14:16:07",
    "object_type": "subscription",
    "verb": "updated",
    "description": "Updated subscription #362310818",
    "updated_attributes": [
      {
        "attribute": "price",
        "previous_value": "12.00",
        "value": "15.00"
      },
      {
        "attribute": "quantity",
        "previous_value": "3",
        "value": "5"
      }
    ],
    "source": {
      "account_id": null,
      "api_token_id": 987654321,
      "api_token_name": "Subscription API token",
      "account_email": null,
      "origin": "api",
      "user_type": null
    },
    "custom_attributes": [
      {
        "key": "ab_testing_flag",
        "value": "a"
      }
    ]
  }
}

#List events

GET/events
Plus plan
Returns all events associated with the store. The Events API is limited to events that occurred in the last 7 days
Scoperead_events
Granting the read_events scope to a token will expose some details about other Recharge API resources via the Events API.

Query parameters

  • Show events that occurred after a certain date
  • Show events that occurred before a certain date
  • Filter events by specific object_type, such as address, customer, or subscription.

    For a full list of available object types, refer to the list below.
    Show child attributesHide child attributes1
    • address, address/payment_method, app, async_batch, bundle_product, bundle_selection,
      cancellation_flow, charge, checkout, collection_product, collection, credit_account, credit_adjustment,
      customer, delivery_profile, discount, email, fraud_investigation,
      membership_program_condition, membership_program, membership, monthly_sku_swap_workflow_adapter,
      onetime, order, payment_method, plan, product, purchase_item, sequence_workflow_adapter,
      shipping_window_workflow_adapter, shop, store, subscription, theme, webhook, widget_settings
  • object_idinteger
    Show events with a specific object_id. This filter should be used with the object_type filter.
  • verbsstring
    Show events with a specific verb or comma-separated list of verbs
  • Show events related to a specific customer using the customer's primary identifier
  • originstring
    Filter events by specific source origin.
    Available origins: api, customer_portal, merchant_portal, recharge_process, external_platform.
GET/events
curl 'https://api.rechargeapps.com/events?limit=3' \
  -H 'X-Recharge-Version: 2021-11' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "events": [
    {
      "id": 7160141294,
      "object_id": 362310818,
      "customer_id": 36885098,
      "created_at": "2023-05-31T14:16:07",
      "object_type": "subscription",
      "verb": "updated",
      "description": "Updated subscription #362310818",
      "updated_attributes": [
        {
          "attribute": "price",
          "previous_value": "12.00",
          "value": "15.00"
        },
        {
          "attribute": "quantity",
          "previous_value": "3",
          "value": "5"
        }
      ],
      "source": {
        "account_id": null,
        "api_token_id": 987654321,
        "api_token_name": "Subscription API token",
        "account_email": null,
        "origin": "api",
        "user_type": null
      },
      "custom_attributes": [
        {
          "key": "ab_testing_flag",
          "value": "a"
        }
      ]
    }
  ]
}