---
title: "Record revenue attribution for a message"
method: POST
path: "/v2/revenue"
tags: ["revenue-v2"]
---

# Record revenue attribution for a message

`POST /v2/revenue`

## Request

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

Links revenue to a specific message and offer.

## Request body

- RevenueRequest
  - `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

- RevenueResponse
  - `message_id` string: Message ID
  - `revenue` number: Revenue amount
  - `success` boolean: Operation success

## Other responses

- `400`: Validation error
- `401`: Authentication error

---

[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)
