> ## Documentation Index
> Fetch the complete documentation index at: https://new.cove.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Submissions

> Track bureau submission status and trigger on-demand submissions

Submissions represent the status of Metro 2 file deliveries to credit bureaus. They are created automatically (monthly batch) or manually via `POST /submit`.

## Submission lifecycle

```mermaid theme={null}
graph LR
    A[pending] --> B[submitted]
    B --> C[accepted]
    B --> D[rejected]
    A --> E[error]
```

| Status      | Description                                |
| ----------- | ------------------------------------------ |
| `pending`   | Metro 2 file generated, waiting to be sent |
| `submitted` | File uploaded to bureau via SFTP           |
| `accepted`  | Bureau confirmed acceptance                |
| `rejected`  | Bureau rejected the record                 |
| `error`     | System error during submission             |

## Listing submissions

```bash theme={null}
curl "https://vvdufluovypptsnkihyv.supabase.co/functions/v1/submissions?bureau=equifax&status=accepted" \
  -H "x-api-key: sk_test_your_api_key_here"
```

### Filters

| Filter         | Type   | Description                            |
| -------------- | ------ | -------------------------------------- |
| `bureau`       | string | `equifax`, `transunion`, or `experian` |
| `status`       | string | Submission status                      |
| `tradeline_id` | uuid   | Filter by tradeline                    |
| `date_from`    | string | Inclusive lower bound (YYYY-MM-DD)     |
| `date_to`      | string | Inclusive upper bound (YYYY-MM-DD)     |

## Getting a submission

```bash theme={null}
curl https://vvdufluovypptsnkihyv.supabase.co/functions/v1/submissions/880e8400-e29b-41d4-a716-446655440003 \
  -H "x-api-key: sk_test_your_api_key_here"
```

### Response fields

| Field              | Type           | Description                   |
| ------------------ | -------------- | ----------------------------- |
| `id`               | uuid           | Submission ID                 |
| `tradeline_id`     | uuid           | Related tradeline             |
| `bureau`           | string         | Target bureau                 |
| `metro2_file_id`   | uuid or null   | Reference to the Metro 2 file |
| `submission_date`  | string         | YYYY-MM-DD                    |
| `status`           | string         | Current status                |
| `response_code`    | string or null | Bureau response code          |
| `response_message` | string or null | Bureau response message       |
| `error_details`    | string or null | Error details if failed       |
| `retry_count`      | integer        | Number of retry attempts      |

## Manual submission trigger

For partners with `submission_frequency = "on_demand"`, you can manually trigger bureau submission:

```bash theme={null}
curl -X POST https://vvdufluovypptsnkihyv.supabase.co/functions/v1/submit \
  -H "x-api-key: sk_test_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"tradeline_id": "9c843590-8552-4490-a50c-f0cc413d8b69"}'
```

**Requirements:**

* Tradeline must be active (`is_active: true`)
* Tradeline must have at least one unreported payment (`reported: false`)

Returns `202 Accepted` with one pending submission per configured bureau.
