# creditTransactions

```graphql
query CreditTransactions($input: CreditTransactionsInput!) {
  creditTransactions(input: $input) {
    data {
      id
      userId
      type
      pool
      amount
      description
      metadata
      activityType
      projectId
      projectName
      projectSlug
      createdAt
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
      prev
    }
  }
}
```

List the credit grants, purchases, refunds and charges of an account, newest first unless sorted otherwise; returns one page of credit transactions. Requires account.billing.read.

## Arguments

| Name                 | Type                     | Required | Description                                                               |
| -------------------- | ------------------------ | -------- | ------------------------------------------------------------------------- |
| `input`              | CreditTransactionsInput! | Yes      |                                                                           |
| `input.limit`        | Int                      |          | Maximum number of transactions to return. Default 50.                     |
| `input.cursor`       | String                   |          |                                                                           |
| `input.activityType` | String                   |          | Normalized activity category. Filtering applies before cursor pagination. |
| `input.sortBy`       | String                   |          |                                                                           |
| `input.sortOrder`    | String                   |          |                                                                           |

## Variables

```json
{
  "input": {}
}
```

## Responses

| Status | Description                                            |
| ------ | ------------------------------------------------------ |
| 200    | The CreditTransactionList! in data.creditTransactions. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query CreditTransactions($input: CreditTransactionsInput!) {\n  creditTransactions(input: $input) {\n    data {\n      id\n      userId\n      type\n      pool\n      amount\n      description\n      metadata\n      activityType\n      projectId\n      projectName\n      projectSlug\n      createdAt\n    }\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n      prev\n    }\n  }\n}",
  "variables": {
    "input": {}
  }
}'
```

## Example response

```json
{
  "data": {
    "creditTransactions": {
      "data": [
        {
          "id": "string",
          "userId": "string",
          "type": "string",
          "pool": "string",
          "amount": 0,
          "description": "string",
          "metadata": {},
          "activityType": "string",
          "projectId": "string",
          "projectName": "string",
          "projectSlug": "string",
          "createdAt": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string",
        "prev": "string"
      }
    }
  }
}
```
