> ## 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.

# إنشاء رموز دفعة

إنشاء رموز QR و/أو رموز شريطية لعدة شهادات دفعة واحدة. يُرجع ملف ZIP يحتوي على جميع صور الرموز المطلوبة.

### حالات الاستخدام

* طباعة الشهادات بالجملة باستخدام رموز QR
* إنشاء تسميات لمجموعة منتجات كاملة
* تصدير رموز التحقق للتوزيع دون اتصال بالإنترنت

### الاستجابة

يُرجع ملف ZIP (`Content-Type: application/zip`) يحتوي على صور PNG مسماة:

* `{attestation_id}-qr.png` لرموز QR
* `{attestation_id}-barcode.png` للرموز الشريطية

### حدود المعدل

طلبات الدفعة محدودة بمعدل 10 طلبات في الدقيقة. يمكن أن يحتوي كل طلب على ما يصل إلى 100 معرف إشهاد.

```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));
```


## OpenAPI

````yaml ar/mint-openapi.yaml POST /v1/attestations/codes/batch
openapi: 3.0.3
info:
  title: Truthlocks API
  description: >
    Truthlocks هي بنية تحتية عالمية للتحقق من المستندات وبيانات الاعتماد والأصول
    الرقمية.يحدد هذا المواصفات واجهة برمجة التطبيقات (API) الأساسية للتفاعل مع
    خدمات Truthlocks.


    ## عناوين URL الأساسية

    - **الإنتاج**: `https://api.truthlocks.com`

    - **البيئة التجريبية (Sandbox)**: `https://sandbox-api.truthlocks.com`


    ## المصادقة

    - **مفاتيح API**: استخدم رأس `X-API-Key` للعمليات من جهاز إلى جهاز

    - **رموز Bearer**: استخدم `Authorization: Bearer <jwt>` للعمليات التي يبدأها
    المستخدم


    ## هوية المستأجر

    في بيئة الإنتاج، تُستمد هوية المستأجر من السياق المصادق عليه (مفتاح API أو
    JWT).

    يتم تجاهل رأس `X-Tenant-ID` في بيئة الإنتاج لمنع الانتحال.
  version: 1.0.0
  contact:
    name: Truthlocks Support
    url: https://truthlocks.com/support
    email: support@truthlocks.com
servers:
  - url: https://api.truthlocks.com
    description: واجهة برمجة تطبيقات الإنتاج
  - url: https://sandbox-api.truthlocks.com
    description: بيئة اختبار (Sandbox)
security:
  - APIKey: []
  - BearerAuth: []
tags:
  - name: Authentication
    description: إدارة مفاتيح ورموز API
  - name: Issuers
    description: تسجيل المصدر وإدارة الثقة
  - name: Keys
    description: إدارة المفاتيح التشفيرية لجهات الإصدار
  - name: Attestations
    description: دورة حياة الإشهاد (السك، الإلغاء، الاستبدال)
  - name: Verification
    description: حزم التحقق والإثبات للإشهاد
  - name: Governance
    description: سير عمل حوكمة المصدر (للمسؤول فقط)
  - name: Identity
    description: إدارة المنظمة والمستخدمين والأدوار
  - name: Audit
    description: استعلامات أحداث التدقيق
  - name: Tenant Console
    description: ملف تعريف المستأجر ونقاط نهاية دورة الحياة
  - name: Health
    description: نقاط نهاية صحة الخدمة وجاهزيتها
  - name: Risk
    description: استيعاب إشارة المخاطر واكتشاف الاحتيال
  - name: Risk Enforcement
    description: إجراءات إنفاذ المخاطر — الحظر والتحدي والحجر والتكوين
  - name: Billing
    description: إدارة الفوترة والاشتراكات والإضافات
  - name: Machine Identity
    description: >-
      بروتوكول هوية وكيل الآلة (MAIP) — تسجيل الوكيل، الجلسات، الثقة، الشهادة،
      الامتثال، التنسيق، والمراقبة
externalDocs:
  description: واجهة برمجة تطبيقات الشفافية للقراءة فقط (مواصفات خدمة منفصلة)
  url: >-
    https://github.com/truthlocks/truthlock/blob/main/docs/transparency/openapi.yaml
paths:
  /v1/attestations/codes/batch:
    post:
      tags:
        - Attestations
      summary: إنشاء دفعة من رموز التحقق
      operationId: POST__v1_attestations_codes_batch
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
                    format: uuid
                  minItems: 1
                  maxItems: 100
                type:
                  type: string
                  enum:
                    - qr
                    - barcode
                    - both
                  default: qr
                size:
                  type: integer
                  minimum: 128
                  maximum: 1024
                  default: 256
              required:
                - ids
      responses:
        '200':
          description: أرشيف ZIP لصور رمز PNG.
          content:
            application/zip:
              schema:
                type: string
                format: binary
        '401':
          description: بيانات اعتماد مفقودة أو غير صالحة.
        '403':
          description: تم رفض الوصول لمساحة العمل أو البيئة أو الخطة هذه.
      security:
        - APIKey: []
        - BearerAuth: []
components:
  securitySchemes:
    APIKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: مفتاح API للمصادقة من جهاز إلى جهاز
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT للعمليات التي يبدأها المستخدم

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.