---
title: "Record multiple revenue attributions in bulk"
method: POST
path: "/v2/revenue/bulk"
tags: ["revenue-v2"]
---

# Record multiple revenue attributions in bulk

`POST /v2/revenue/bulk`

## Request

- Base URL: `https://api.tracklysms.com/api`
- URL: `https://api.tracklysms.com/api/v2/revenue/bulk`
- Auth: API key in header `X-Api-Key`

Maximum 1000 records per request.

## Request body

- BulkRevenueRequest
  - `imported` boolean: Mark as imported data
  - `records` RevenueRequest[], required: Array of revenue records (max 1000); repeated message/offer/attribution sources are rejected
    - `attribution_type` string, required: How the revenue should be attributed: sale, click, send
    - `message_id` string, required: Opaque, variable-length message identifier. Same value passed in the {{sendId}} macro
    - `offer_id` string: Offer ID (Can be either the "externalId" or the offerId generated by TracklySMS
    - `revenue` number, required: Finite signed revenue amount; replaces the prior source amount
    - `timestamp` string, date-time: Conversion time, assumed UTC without a timezone. Omission preserves an existing time; new records use observation time.

## Response `201`

Revenue recorded

- BulkRevenueResponse
  - `error_count` integer: Number of records that failed
  - `errors` BulkRevenueError[]: Array of errors
    - `code` string: Error code
    - `error` string: Error message
    - `index` integer: Record index
  - `success_count` integer: Number of records successfully processed
  - `total_revenue` number: Total revenue processed

## Other responses

- `400`: Validation error
- `401`: Authentication error
- `413`: Too many records

---

[API](https://skmtc.dev/tracklysms/apis/trackly-sms-api.md) · [All operations](https://skmtc.dev/tracklysms/apis/trackly-sms-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tracklysms/apis/trackly-sms-api/revisions/ac1ad22cb2a9?raw)
