API reference

Events

Knox answers these operations with the same requests and responses as Stripe's API. Authenticate with your secret key, Authorization: Bearer sk_test_..., from your server, and send form-encoded bodies. Test mode only: live processing is currently disabled.

Base URL
https://api.knoxapi.com

List all events

GET/v1/events

List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in event object api_version attribute (not according to your current Stripe API version or Stripe-Version header).

Query parameters

  • createdobject | integer

    Only return events that were created during the given date interval.

    Show 4 child parameters
    • gtinteger
    • gteinteger
    • ltinteger
    • lteinteger
  • delivery_successboolean

    Filter events by whether all webhooks were successfully delivered. If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned.

  • ending_beforestring

    A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • limitinteger

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

  • starting_afterstring

    A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

  • typestring

    A string containing a specific event name, or group of events using * as a wildcard. The list will be filtered to include only events with a matching event property.

  • typesarray of strings

    An array of up to 20 strings containing specific event names. The list will be filtered to include only events with a matching event property. You may pass either type or types, but not both.

Returns

A list of event objects.

GET /v1/events
curl -G https://api.knoxapi.com/v1/events \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode limit=3
Response
{
  "object": "list",
  "url": "/v1/events",
  "has_more": false,
  "data": [
    {
      "api_version": null,
      "created": 1234567890,
      "data": {
        "object": {
          "active": true,
          "aggregate_usage": null,
          "amount": 2000,
          "amount_decimal": "2000",
          "billing_scheme": "per_unit",
          "created": 1721948530,
          "currency": "usd",
          "id": "price_1PgafmB7WZ01zgkW6dKueIc5",
          "interval": "month",
          "interval_count": 1,
          "livemode": false,
          "metadata": {},
          "meter": null,
          "nickname": null,
          "object": "plan",
          "product": "prod_QXg1hqf4jFNsqG",
          "tiers_mode": null,
          "transform_usage": null,
          "trial_period_days": null,
          "usage_type": "licensed"
        }
      },
      "id": "evt_1Pgc76B7WZ01zgkWwyRHS12y",
      "livemode": false,
      "object": "event",
      "pending_webhooks": 0,
      "request": {
        "id": null,
        "idempotency_key": null
      },
      "type": "plan.created"
    }
  ]
}

Retrieve an event

GET/v1/events/{id}

Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook.

Path parameters

  • idstringRequired

Query parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The event object.

GET /v1/events/{id}
curl https://api.knoxapi.com/v1/events/evt_1Pgc76B7WZ01zgkWwyRHS12y \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "api_version": null,
  "created": 1234567890,
  "data": {
    "object": {
      "active": true,
      "aggregate_usage": null,
      "amount": 2000,
      "amount_decimal": "2000",
      "billing_scheme": "per_unit",
      "created": 1721948530,
      "currency": "usd",
      "id": "price_1PgafmB7WZ01zgkW6dKueIc5",
      "interval": "month",
      "interval_count": 1,
      "livemode": false,
      "metadata": {},
      "meter": null,
      "nickname": null,
      "object": "plan",
      "product": "prod_QXg1hqf4jFNsqG",
      "tiers_mode": null,
      "transform_usage": null,
      "trial_period_days": null,
      "usage_type": "licensed"
    }
  },
  "id": "evt_1Pgc76B7WZ01zgkWwyRHS12y",
  "livemode": false,
  "object": "event",
  "pending_webhooks": 0,
  "request": {
    "id": null,
    "idempotency_key": null
  },
  "type": "plan.created"
}

Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.