# checkBillingAction

The check the app runs before a skip trace, export or email verification of `count` records. Read `state` and `reason` first: a BLOCKED org (payment needed) shows 0 whatever it holds. For those three, `unitsAvailable` is what the action can spend, unused plan allowance (none during a trial) PLUS wallet credits (bought or granted): what answers "how many skip traces are left". For other actions it is not credits (null, or seat slots for an invite). It checks the org, not the person: skip traces still need an admin. `willTriggerAutoRecharge.chargeCents` is a card charge: say so and get a yes first; when null, mention no card. Read-only.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "checkBillingAction", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `action`: `BillingAction!` (required, one of `EXPORT_PROPERTIES`, `SKIPTRACE`, `EMAIL_VERIFICATION`, `SEND_TEXT`, `START_CALL`, `CREATE_TEAM_INVITE`, `ACCEPT_TEAM_INVITE`)
- `count`: `Int`

## Response (data, an example)

```json
{
  "organizationQuery": {
    "canTakeAction": "…"
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "checkBillingAction",
    "variables": {
      "action": "EXPORT_PROPERTIES"
    }
  }'
```
