# Record transaction

`POST https://api.nexus.gg/v1/attributions/transactions`

Records one or more transactions against a creator group. The body accepts either a single transaction or an array of them. If the same `transactionId` appears more than once within one array, every one of those rows is still saved (this is how you split credit for a single purchase across multiple group members); it is only treated as a duplicate against transactions that already exist for your publisher account from an earlier call, which returns a bare 409 with only the default status text, no JSON payload.

Once a request passes validation, `subtotal` must be a whole number in the smallest denomination of `currency` (cents for USD), minimum 1. By default (when `useLDCurrency` is omitted or `true`), that validated value is also what you send: the request passes through unconverted. `total` defaults to `subtotal` when omitted, and `totalCurrency` defaults to `currency` when omitted. On creation, `status` is only honored if it is `Normal` or `Test`; any other value, including an omitted one, is stored as `Normal`.

A currency your creator group has disabled is rejected with 400. None of this operation's 400 responses include a stable `code` field: an unresolvable `groupId` comes back as a bare, unstructured text body, and an unresolvable code/member comes back as a JSON object with only a `message`.

**NOTE**: This method uses **secret** (`nexus_sk_...`) API keys and should never be called from or embedded into the gaming client. These routes should ONLY be accessed from your back-end services. **NOTE**: The subtotal passed for a transaction will be in the smallest denomination of the currency.

## Authorizations

- `X-SHARED-SECRET` (string, header, required) - Send your **secret** API key (`nexus_sk_...`) in the `X-SHARED-SECRET` header. [Generate one](/authentication/api-keys/) in the Publisher Dashboard.

## Query parameters

- `groupId` (string) - Creator group to attribute this transaction to. If your key is scoped to a single program, that group is always used regardless of this value; otherwise falls back to your default group when omitted.

## Request body (`application/json`)

## Responses

### 200

Transaction created. Returns either a single transaction or an array if more than one was included in the request body.

#### Body (`application/json`)

### 400

Invalid input, object invalid, code not found in group members

### 409

A transaction with this transactionId already exists
