# external_recovery.overview

Cartões da recuperação de vendas externas. Quantidade e valor (na moeda `currency`, ou a mais frequente) dos pedidos de plataformas externas recusados, com chargeback, reembolsados e cancelados, e a quantidade de carrinhos abandonados. `currency` vem nulo sem pedidos.

- Endpoint: `POST https://app.atomiks.com.br/api/v1/external_recovery.overview` (corpo JSON)
- Quem pode chamar: membro da conta
- Escopo da chave: `crm:read`
- Grava dados: não
- Pela chave de API: sim
- Ferramenta MCP: `external_recovery_overview`
- Ficha em JSON: `https://app.atomiks.com.br/api/v1/openapi.json` (operationId `external_recovery.overview`)

## Entrada

| Campo | Tipo | Obrigatório | Nota |
|---|---|---|---|
| `currency` | string | não |  |

<details><summary>JSON Schema</summary>

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "currency": {
      "type": "string",
      "maxLength": 3
    }
  }
}
```

</details>

## Exemplo

```bash
curl -X POST https://app.atomiks.com.br/api/v1/external_recovery.overview \
  -H "Authorization: Bearer $ATOMIKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

CLI:

```bash
node cli/atomiks.mjs external_recovery.overview --json '{}'
```

MCP: ferramenta `external_recovery_overview` com a mesma entrada.

## Saída

Sucesso: `{"data": ...}` com o formato abaixo.

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "currency": {
      "type": [
        "string",
        "null"
      ]
    },
    "salesByCurrency": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "currency"
        ],
        "additionalProperties": false
      }
    },
    "statusBreakdown": {
      "type": "object",
      "properties": {
        "failed": {
          "type": "object",
          "properties": {
            "count": {
              "type": "number"
            },
            "value": {
              "type": "number"
            }
          },
          "required": [
            "count",
            "value"
          ],
          "additionalProperties": false
        },
        "chargeback": {
          "type": "object",
          "properties": {
            "count": {
              "type": "number"
            },
            "value": {
              "type": "number"
            }
          },
          "required": [
            "count",
            "value"
          ],
          "additionalProperties": false
        },
        "refunded": {
          "type": "object",
          "properties": {
            "count": {
              "type": "number"
            },
            "value": {
              "type": "number"
            }
          },
          "required": [
            "count",
            "value"
          ],
          "additionalProperties": false
        },
        "canceled": {
          "type": "object",
          "properties": {
            "count": {
              "type": "number"
            },
            "value": {
              "type": "number"
            }
          },
          "required": [
            "count",
            "value"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "failed",
        "chargeback",
        "refunded",
        "canceled"
      ],
      "additionalProperties": false
    },
    "cartAbandonment": {
      "type": "object",
      "properties": {
        "count": {
          "type": "number"
        }
      },
      "required": [
        "count"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "currency",
    "salesByCurrency",
    "statusBreakdown",
    "cartAbandonment"
  ],
  "additionalProperties": false
}
```

## Erros

`{"error": {"code", "message", "requestId"}}`. Códigos: `invalid_input` (400), `unauthorized` (401), `forbidden` / `account_pending` / `scope_missing` (403), `not_found` (404), `limit_reached` (409), `internal` (500).
