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

# Batch Generate Codes

Generate QR codes and/or barcodes for multiple attestations at once. Returns a ZIP file containing all requested code images.

### Use cases

* Bulk certificate printing with QR codes
* Generating labels for an entire product batch
* Exporting verification codes for offline distribution

### Request body

<ParamField body="ids" type="string[]" required>
  Array of attestation UUIDs. Maximum 100 per request.
</ParamField>

<ParamField body="type" type="string" default="qr">
  Type of codes to generate. Options: `qr`, `barcode`, `both`
</ParamField>

<ParamField body="size" type="integer" default="256">
  Size for QR codes in pixels (128 to 1024). Barcodes use default 300x80.
</ParamField>

### Response

Returns a ZIP file (`Content-Type: application/zip`) containing PNG images named:

* `{attestation_id}-qr.png` for QR codes
* `{attestation_id}-barcode.png` for barcodes

### Rate limits

Batch requests are rate-limited to 10 requests per minute. Each request can contain up to 100 attestation IDs.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST \
    -H "Authorization: Bearer $API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "ids": [
        "550e8400-e29b-41d4-a716-446655440000",
        "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
      ],
      "type": "both",
      "size": 512
    }' \
    "https://api.truthlocks.com/v1/attestations/codes/batch" \
    --output verification-codes.zip
  ```

  ```typescript SDK theme={null}
  const zipBuffer = await client.attestations.getBatchCodes(
    ['550e8400-e29b-41d4-a716-446655440000', '6ba7b810-9dad-11d1-80b4-00c04fd430c8'],
    { type: 'both', size: 512 }
  );
  fs.writeFileSync('verification-codes.zip', Buffer.from(zipBuffer));
  ```
</RequestExample>
