# Search bet history

## POST /bet/search/

**Operation ID**: `search_bets`

Filter and search bet history using multiple criteria by providing specific bet IDs.

### Request Body

```json
{
  "ids": [123, 456, 789]
}
```

#### Parameters

| Field | Type            | Required | Description                 |
| ----- | --------------- | -------- | --------------------------- |
| `ids` | array\[integer] | No       | List of bet IDs to retrieve |

### Response

#### Success Response (200)

Returns an array of `BetHistorySimple` objects:

```json
[
  {
    "id": 123,
    "transaction_min_created_at": "2024-01-24T20:59:19.440549+11:00",
    "display_name": "My Bot Account",
    "amount": 10.00,
    "current_odds": 2.25,
    "created_at": "2024-01-24T20:59:19.440549+11:00",
    "meeting_date": "2024-01-24",
    "market": "Fixed Win",
    "submit_time": "2024-01-24T21:00:00+11:00",
    "result_time": "2024-01-24T21:10:00+11:00",
    "submit_result": "Success",
    "submit_error": null,
    "profit": -10.00,
    "used_boost": false,
    "used_spg": false,
    "used_bonus": false,
    "transaction_id": "TXN123",
    "bot_id": "BOT001",
    "is_deleted": false,
    "notified": true,
    "reporting_usage": 10.00,
    "sports": "RACING",
    "profit_updated_by": "system",
    "profit_updated_at": "2024-01-24T21:15:00+11:00",
    "settled_at": "2024-01-24T21:10:00+11:00",
    "transaction_result": "LOSS",
    "status": "SETTLED",
    "status_notes": "Race completed",
    "label": "Strategy A",
    "owner": 612,
    "bookie": 42,
    "notification": 789
  }
]
```

#### Error Responses

* **500 Internal server error** - Server encountered an error processing the request

### Usage

**Search for Specific Bets:**

```bash
curl -X POST "https://betmatic.app/api/bet/search/" \
  -H "Content-Type: application/json" \
  -H "Authorization: Token your_token" \
  -d '{
    "ids": [123, 456, 789]
  }'
```

**Search for Single Bet:**

```bash
curl -X POST "https://betmatic.app/api/bet/search/" \
  -H "Content-Type: application/json" \
  -H "Authorization: Token your_token" \
  -d '{
    "ids": [123]
  }'
```

### Potential Use Cases

1. **Specific Bet Analysis**: Retrieve detailed information for particular bets of interest
2. **Batch Bet Retrieval**: Get multiple specific bets in a single API call for efficiency
3. **Bet Verification**: Verify specific bet details for reconciliation purposes
4. **Performance Analysis**: Analyze specific bets that performed well or poorly
5. **Reporting**: Generate reports for specific sets of bets
6. **Audit Purposes**: Retrieve specific bets for compliance or audit requirements
7. **Customer Support**: Look up specific bet details for customer inquiries
8. **Data Export**: Extract specific bet data for external analysis tools

### Authentication

This endpoint requires authentication. Include your token in the Authorization header:

```
Authorization: Token your_token
```

\
Response Schema

Status Code **200**

<table><thead><tr><th width="191.99999999999997">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>integer</td><td>Bet History Id used in this system</td></tr><tr><td>display_name</td><td>string</td><td>name of session which placed bet</td></tr><tr><td>amount</td><td>integer</td><td>actual amount that placed, this can be different from notification amount.</td></tr><tr><td>current_odds</td><td>string</td><td>odds that actually applied</td></tr><tr><td>created_at</td><td>string(date-time)</td><td>Time when History is created</td></tr><tr><td>market</td><td>string</td><td>finally placed market</td></tr><tr><td>submit_time</td><td>string or null</td><td>bet slip submit clicked time</td></tr><tr><td>result_time</td><td>string or null</td><td>bet slip submit result time</td></tr><tr><td>submit_result</td><td>string</td><td>result of bet Success or Error or In Review</td></tr><tr><td>submit_error</td><td>string</td><td>If success Accepted, else error string from the bookie</td></tr><tr><td>profit</td><td>integer</td><td>profit obtained from right bet</td></tr><tr><td>used_boost</td><td>boolean</td><td>if this bet is boosted one</td></tr><tr><td>used_spg</td><td>boolean</td><td>if spg is used</td></tr><tr><td>used_bonus</td><td>boolean</td><td>if bonus money is used</td></tr><tr><td>transaction_id</td><td>integer</td><td>to be used to update the accepted amount and odds later</td></tr><tr><td>bot_id</td><td>string</td><td>Id of bot notification sent to</td></tr><tr><td>is_deleted</td><td>boolean</td><td>if bet history is deleted</td></tr><tr><td>notified</td><td>boolean</td><td>if this bet is notified via socket</td></tr><tr><td>reported_usage</td><td>integer</td><td>reported turnover of this bet</td></tr><tr><td>sports</td><td>string</td><td>Type of Sport</td></tr><tr><td>owner</td><td>integer</td><td>users id who placed this bet</td></tr><tr><td>bookie</td><td>integer</td><td>bookie id on whom bet is placed</td></tr><tr><td>notification</td><td>integer</td><td>notification id used in system</td></tr></tbody></table>
