---
title: "Query usage events"
method: GET
path: "/events"
tags: ["Events"]
---

# Query usage events

`GET /events`

## Request

- Base URL: `https://api-m.sandbox.paypal.com`
- URL: `https://api-m.sandbox.paypal.com/events`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `/api/oauth-proxy` scopes: `read`, `write`
- TypeScript: <https://skmtc.dev/paypal/apis/usage-based-billing-api/docs/events/get.ts> (a function with typed inputs; its response is checked against the schema)

## Query parameters

- `page` integer
- `per_page` integer
- `external_subscription_id` string
- `metric_code` string
- `from_date` string, date-time
- `to_date` string, date-time

## Response `200`

A list of usage events

- object
  - `events` EventResponse[]
    - `transaction_id` string, required: Unique identifier for the transaction associated with the event
    - `external_subscription_id` string, required: External subscription ID associated with the event
    - `metric_code` string, required: Identifier for the targeted metric. This value must match the `code` property of an active metric; otherwise, it will be disregarded during processing.
    - `timestamp` string, date-time: Date and time in ISO 8601 format.
    - `properties` object
    - `id` string: Unique identifier for the event
    - `created_at` string, date-time: Date and time in ISO 8601 format.
  - `metadata` PaginationMetadata
    - `total_count` integer
    - `total_pages` integer
    - `current_page` integer

## Other responses

- `403`: Authorization failed due to insufficient permissions.
- `404`: Resource Not Found.
- `500`: Internal Server Error - An unexpected error occurred

---

[API](https://skmtc.dev/paypal/apis/usage-based-billing-api.md) - [All operations](https://skmtc.dev/paypal/apis/usage-based-billing-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paypal/apis/usage-based-billing-api/revisions/22fb46514ac4?raw)
