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

# Click fiskalizatsiyasi

> Click to'lovlarini fiskalizatsiya qilish

## Umumiy ko'rinish

**Click Fiscalization API** avval boshlangan to'lovni yakunlash (fiskalizatsiya) uchun ishlatiladi
initiated Click payment.

Bu endpoint to'lovni tasdiqlaydi va Soliq (OFD) tomonidan yaratilgan fiskal chekni biriktiradi
by Soliq (OFD).

***

## So'rov maydonlari

| Maydon       | Turi   | Majburiy | Tavsif                                                |
| ------------ | ------ | -------- | ----------------------------------------------------- |
| `payment_id` | string | ✅        | Unique payment identifier received from Click payment |
| `qr_code`    | string | ✅        | URL of the fiscal receipt from Soliq (OFD)            |

***

## Javob maydonlari

### ✅ Muvaffaqiyatli javob

| Maydon            | Turi           | Tavsif                                                |
| ----------------- | -------------- | ----------------------------------------------------- |
| `data`            | object         | Javob ma'lumoti                                       |
| `data.payment_id` | string \| null | Payment identifier                                    |
| `data.inn`        | string \| null | Taxpayer identification number (if available)         |
| `data.qr_code`    | string \| null | Fiscal receipt URL                                    |
| `data.status`     | string         | Fiscalization status (`successfully`, `failed`, etc.) |
| `data.error`      | string \| null | Error description (null on success)                   |
| `error`           | null           | Error object (always `null` on success)               |
| `is_success`      | boolean        | Always `true`                                         |

***

### 🚫 Xatolik javobi

> **Eslatma:** Validatsiya xatosi bo'lsa ham server HTTP `200` qaytaradi.

| Maydon          | Turi        | Tavsif                                       |
| --------------- | ----------- | -------------------------------------------- |
| `data`          | null        | No data returned                             |
| `error`         | object      | Error details                                |
| `error.code`    | integer     | Internal validation or processing error code |
| `error.message` | string      | O'qilishi oson xato xabari                   |
| `error.data`    | any \| null | Additional error details                     |
| `is_success`    | boolean     | Always `false`                               |


## OpenAPI

````yaml POST /payment/click_confirm
openapi: 3.0.3
info:
  title: Click Fiscalization API
  description: Fiscalization endpoint for Click payments
  version: 1.0.0
servers:
  - url: https://fbox.ngrok.io
security: []
paths:
  /payment/click_confirm:
    post:
      tags:
        - Click Fiscalization
      summary: Fiscalization Click payment
      operationId: clickFiscalization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FiscalizationRequest'
            example:
              payment_id: '4710103925'
              qr_code: >-
                https://ofd.soliq.uz/check?t=UZ170703100597&r=2421&c=20230104121801&s=514343190161
      responses:
        '200':
          description: Fiscalization successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FiscalizationResponse'
              example:
                data:
                  inn: null
                  payment_id: null
                  qr_code: null
                  status: successfully
                  error: null
                error: null
                is_success: true
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400Response'
              example:
                data: null
                error:
                  code: 7
                  message: '{"payment_id":["This field may not be blank."]}'
                  data: null
                is_success: false
        '500':
          description: Internal server error
components:
  schemas:
    FiscalizationRequest:
      type: object
      required:
        - payment_id
        - qr_code
      properties:
        payment_id:
          type: string
          description: >-
            Unique order identifier received in the /click/pass response and
            provided by Click.
          example: '4710103925'
        qr_code:
          type: string
          description: Link to fiscalization transaction on Soliq
          example: >-
            https://ofd.soliq.uz/check?t=UZ170703100597&r=2421&c=20230104121801&s=514343190161
    FiscalizationResponse:
      type: object
      properties:
        data:
          type: object
          required:
            - status
          properties:
            inn:
              type: string
              nullable: true
            payment_id:
              type: string
              nullable: true
            qr_code:
              type: string
              nullable: true
            status:
              type: string
              example: successfully
            error:
              type: string
              nullable: true
        error:
          type: string
          nullable: true
        is_success:
          type: boolean
          example: true
    Error400Response:
      type: object
      properties:
        data:
          type: string
          nullable: true
          default: null
        error:
          type: object
          properties:
            code:
              type: integer
              example: 7
            message:
              type: string
              example: '{"payment_id":["This field may not be blank."]}'
            data:
              type: string
              nullable: true
              default: null
        is_success:
          type: boolean
          example: false

````