# Response example

## Sample Response

```json
{
  "id": "92ca2c72-53c0-4552-be3c-7559398564cb",
  "cur": "USD",
  "seatbid": [
    {
      "seat": "triplelift",
      "bid": [
        {
          "id": "bid-12345",
          "impid": "92ca2c72-53c0-4552-be3c-7559398564cb",
          "price": 1.78,
          "adomain": ["advertiser.com"],
          "crid": "creative-123",
          "w": 320,
          "h": 480,
          "adm": "<html><!-- ad markup --></html>",
          "ext": {
            "mediaType": "banner",
            "tagId": "testnexx",
            "ssp": "triplelift",
            "prebid": {
              "type": "banner",
              "targeting": {
                "hb_env": "mobile-app",
                "hb_cache_id": "e18e97c5-dbba-416c-8df6-2c082b113f25",
                "hb_pb": "1.78",
                "hb_cache_path": "/cache",
                "hb_size": "320x480",
                "hb_bidder": "triplelift",
                "hb_partner": "nexx360",
                "hb_cache_host": "fast.nexx360.io",
                "hb_format": "banner"
              },
              "cache": {
                "bids": {
                  "url": "https://fast.nexx360.io/cache?uuid=e18e97c5-dbba-416c-8df6-2c082b113f25",
                  "cacheId": "e18e97c5-dbba-416c-8df6-2c082b113f25"
                }
              }
            }
          }
        }
      ]
    }
  ],
  "ext": {
    "version": "1.0.0"
  }
}
```

## Response Structure

### Root Level

| Field     | Type   | Description                      |
| --------- | ------ | -------------------------------- |
| `id`      | string | Request ID (echoed from request) |
| `cur`     | string | Currency code (USD, EUR, etc.)   |
| `seatbid` | array  | Array of seat bids               |
| `ext`     | object | Extension object with metadata   |

### SeatBid Object

| Field  | Type   | Description           |
| ------ | ------ | --------------------- |
| `seat` | string | SSP/bidder identifier |
| `bid`  | array  | Array of bid objects  |

### Bid Object

| Field     | Type    | Description                      |
| --------- | ------- | -------------------------------- |
| `id`      | string  | Unique bid identifier            |
| `impid`   | string  | Impression ID (links to request) |
| `price`   | number  | Bid price (CPM)                  |
| `adomain` | array   | Advertiser domains               |
| `crid`    | string  | Creative ID                      |
| `w`       | integer | Creative width                   |
| `h`       | integer | Creative height                  |
| `dealid`  | string  | Deal ID (if applicable)          |
| `adm`     | string  | Ad markup (HTML/VAST/JSON)       |

### Bid Extension (ext.prebid)

| Field       | Type   | Description                         |
| ----------- | ------ | ----------------------------------- |
| `type`      | string | Media type (banner, video, native)  |
| `targeting` | object | Prebid targeting keys for ad server |
| `cache`     | object | Cache information for ad retrieval  |

## Video Response

For video bids, the response includes VAST XML in the cache:

```json
{
  "id": "video-request-id",
  "cur": "USD",
  "seatbid": [
    {
      "seat": "rubicon",
      "bid": [
        {
          "id": "video-bid-123",
          "impid": "video-imp-id",
          "price": 5.50,
          "adomain": ["videoadvertiser.com"],
          "crid": "video-creative-456",
          "w": 320,
          "h": 480,
          "ext": {
            "mediaType": "video",
            "prebid": {
              "type": "video",
              "targeting": {
                "hb_env": "mobile-app",
                "hb_cache_id": "vast-uuid-12345",
                "hb_pb": "5.50",
                "hb_cache_path": "/cache",
                "hb_size": "320x480",
                "hb_bidder": "rubicon",
                "hb_partner": "nexx360",
                "hb_cache_host": "fast.nexx360.io",
                "hb_format": "video"
              },
              "cache": {
                "vastXml": {
                  "url": "https://fast.nexx360.io/cache?uuid=vast-uuid-12345",
                  "cacheId": "vast-uuid-12345"
                }
              }
            }
          }
        }
      ]
    }
  ]
}
```

## Native Response

For native bids, the `adm` field contains a JSON string with native assets:

```json
{
  "id": "native-request-id",
  "cur": "USD",
  "seatbid": [
    {
      "seat": "appnexus",
      "bid": [
        {
          "id": "native-bid-789",
          "impid": "native-imp-id",
          "price": 2.25,
          "adomain": ["nativeadvertiser.com"],
          "crid": "native-creative-101",
          "adm": "{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"title\":{\"text\":\"Ad Title\"}},{\"id\":2,\"img\":{\"url\":\"https://example.com/image.jpg\",\"w\":300,\"h\":250}}],\"link\":{\"url\":\"https://click.example.com\"}}",
          "ext": {
            "mediaType": "native",
            "prebid": {
              "type": "native",
              "targeting": {
                "hb_env": "mobile-app",
                "hb_cache_id": "native-uuid-789",
                "hb_pb": "2.25",
                "hb_bidder": "appnexus",
                "hb_partner": "nexx360",
                "hb_cache_host": "fast.nexx360.io",
                "hb_format": "native"
              }
            }
          }
        }
      ]
    }
  ]
}
```

## No Bid Response

When no bids are received, the response returns an empty seatbid array:

```json
{
  "id": "92ca2c72-53c0-4552-be3c-7559398564cb",
  "cur": "USD",
  "seatbid": [],
  "ext": {
    "version": "1.0.0"
  }
}
```

## Error Responses

### 400 Bad Request

Returned when the request is malformed or missing required fields.

### 204 No Content

Returned when the request is filtered (e.g., geo-filtering, IP filtering).
