# Credit mutations

Changes in the credit of billing accounts

Base URL: `https://api.cv-transformer.com/v1`. Endpoints: `GET /credit_mutations`. Authenticate with the header `Authorization: Bearer YOUR_API_KEY` (see [authentication](https://www.cv-transformer.com/nb-NO/api-reference/authentication.md)).

## The credit mutation object

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `uuid` | Unique identifier. |
| `billing_account_id` | `uuid \| null` | Identifier of the related billing account. References [`billing_accounts.id`](https://www.cv-transformer.com/nb-NO/api-reference/billing_accounts.md). |
| `organization_id` | `uuid \| null` | Identifier of the related organization. References [`organizations.id`](https://www.cv-transformer.com/nb-NO/api-reference/organizations.md). |
| `paddle_transaction_id` | `text \| null` | Identifier of the Paddle transaction that bought the credit, if any. |
| `created_at` | `timestamp with time zone` | Creation timestamp. |
| `delta` | `integer` | Change in credit: positive when credit is added, negative when it is used. |

```json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "billing_account_id": "00000000-0000-0000-0000-000000000000",
  "organization_id": "00000000-0000-0000-0000-000000000000",
  "paddle_transaction_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2026-01-01T12:00:00+00:00",
  "delta": 0
}
```

### Related resources

Embed related resources with the [`select` parameter](https://www.cv-transformer.com/nb-NO/api-reference/selecting.md), for example `select=*,billing_accounts(*)`. Resources related through more than one column need the column as a hint, like `table!column(*)`.

| Embed | Type | Description |
| --- | --- | --- |
| `billing_accounts(*)` | `object \| null` | The [billing account](https://www.cv-transformer.com/nb-NO/api-reference/billing_accounts.md) referenced by `billing_account_id`. |
| `organizations(*)` | `object \| null` | The [organization](https://www.cv-transformer.com/nb-NO/api-reference/organizations.md) referenced by `organization_id`. |

## List credit mutations

`GET /v1/credit_mutations` · requires the `organization:read` scope

Filter on any attribute with `column=operator.value` (see [filtering](https://www.cv-transformer.com/nb-NO/api-reference/filtering.md)). Choose columns and embed related resources with `select` (see [selecting](https://www.cv-transformer.com/nb-NO/api-reference/selecting.md)), and sort and paginate with `order`, `limit` and `offset` (see [sorting and pagination](https://www.cv-transformer.com/nb-NO/api-reference/sorting-pagination.md)).

```bash
curl "https://api.cv-transformer.com/v1/credit_mutations?limit=10&select=*" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Responses:

- `200`: A list of credit mutations with the selected columns. The `Content-Range` header holds the range returned and the total count, like `0-9/42`.
- `206`: Partial Content
- `400`: The request is malformed, for example an unknown column or an invalid filter.
- `401`: The API key is missing or invalid.
- `403`: The API key doesn't have the scope this request needs.
- `429`: The API key made more requests per minute than its rate limit allows. Retry after the number of seconds in the `Retry-After` header.

Errors have a JSON body with a `message`, `details` and `hint`, and for database errors a `code`. See the [introduction](https://www.cv-transformer.com/nb-NO/api-reference.md) for more on errors. The full API is described by the OpenAPI spec at https://api.cv-transformer.com/v1/openapi.json.
