---
title: "Create multiple usage events in batch."
method: POST
path: "/events/batch"
tags: ["Events"]
---

# Create multiple usage events in batch.

`POST /events/batch`

## Request

- Base URL: `https://api-m.sandbox.paypal.com`
- URL: `https://api-m.sandbox.paypal.com/events/batch`
- 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/batch/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- object
  - `events` EventRequest[]
    - `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

## Response `201`

Events accepted for processing.

- EventsAcceptedWithResults
  - `status` 'ACCEPTED': Status indicating that the event has been accepted for processing
  - `results` object: Results of the accepted events
    - `success_count` integer: Number of events successfully processed
    - `error_count` integer: Number of events that failed processing
    - `errors` object[]: Details about failed events
      - `transaction_id` string: Transaction ID of the failed event
      - `error_code` string: Error code
      - `error_message` string: Detailed error message

## Other responses

- `400`: Bad Request - Invalid input data
- `403`: Authorization failed due to insufficient permissions.
- `409`: Conflict - The request could not be completed due to a conflict with the current state of the resource.
- `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)
