> For the complete documentation index, see [llms.txt](https://cde-inc.gitbook.io/cde-cad-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cde-inc.gitbook.io/cde-cad-documentation/fivem-developer-integration/firearms.md). Agents can also search and read this documentation through its [MCP server](https://cde-inc.gitbook.io/cde-cad-documentation/~gitbook/mcp).

# Firearms

## Look Up a Firearm by Serial Number

```
GET /api/civilian/fivem-firearm/:serial?communityId=DISCORD_GUILD_ID
```

Serial is normalized to uppercase with whitespace stripped.

### Response

```json
{
  "serialNumber": "SN123456",
  "make": "Glock",
  "model": "17",
  "caliber": "9mm",
  "type": "Pistol",
  "isStolen": false,
  "owner": "John Doe",
  "ownerId": "60f7b2c8e1234a001f345678"
}
```

Returns `404` if not found.

## Register a Firearm

```
POST /api/civilian/fivem-register-firearm
```

### Request Body

```json
{
  "serialNumber": "SN123456",        // required
  "ownerId": "123-45-6789",          // required: civilian _id, SSN, or licenseNumber
  "communityId": "DISCORD_GUILD_ID", // required
  "make": "Glock",                   // required
  "model": "17",                     // required
  "caliber": "9mm",                  // optional
  "type": "Pistol"                   // optional: Pistol, Rifle, Shotgun, SMG, Other
}
```

If the serial already exists in the community the record is updated (owner reassigned).

### Response

```json
{
  "action": "created",
  "firearmId": "...",
  "message": "Firearm registered successfully",
  "firearm": { "serialNumber": "SN123456", "owner": "John Doe", "make": "Glock", "model": "17", "type": "Pistol" }
}
```

## Mark Firearm Stolen / Recovered

```
PATCH /api/civilian/fivem-firearm/:serial/stolen
```

### Request Body

```json
{
  "communityId": "DISCORD_GUILD_ID",
  "stolen": true,
  "description": "Stolen during robbery at Maze Bank" // optional
}
```

### Response

```json
{ "serialNumber": "SN123456", "isStolen": true }
```

## Bulk Sync a Civilian's Firearms

```
POST /api/civilian/fivem-sync-firearms
```

Upserts every firearm in the array for the given civilian. New serials are created; existing ones are updated.

### Request Body

```json
{
  "ownerId": "123-45-6789",          // required: civilian _id, SSN, or licenseNumber
  "communityId": "DISCORD_GUILD_ID", // required
  "firearms": [                      // required array
    {
      "serialNumber": "SN123456",    // required
      "make": "Glock",
      "model": "17",
      "caliber": "9mm",
      "type": "Pistol"
    }
  ]
}
```

### Response

```json
{ "success": true, "created": 2, "updated": 1, "failed": 0, "message": "Synced 3 firearms" }
```
