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

# Anor fiskalizatsiyasi

> Anor to'lovlarini fiskalizatsiya qilish

## Umumiy ko'rinish

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

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

***

## So'rov maydonlari

| Maydon           | Turi   | Majburiy | Tavsif                                                             |
| ---------------- | ------ | -------- | ------------------------------------------------------------------ |
| `transaction_id` | string | ✅        | Unique transaction (payment) identifier received from Anor 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.message`        | string         | O'qilishi oson xato xabari by provider                   |
| `data.error_code`     | integer        | error\_code provided by Provider                         |
| `data.payment_id`     | integer        | Unique payment identifier received from Anor payment     |
| `data.transaction_id` | string \| null | Unique transaction identifier received from Anor payment |
| `error`               | null           | Error object (always `null` on success)                  |
| `is_success`          | boolean        | Always `true`                                            |

***

### 🚫 Xatolik javobi

| 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/anor_confirm
openapi: 3.0.3
info:
  title: Anor Fiscalization API
  description: Fiscalization endpoint for Anor payments
  version: 1.0.0
servers:
  - url: https://api.fiscalbox.uz
security: []
paths:
  /payment/anor_confirm:
    post:
      tags:
        - Anor Fiscalization
      summary: Fiscalization Anor payment
      operationId: anorFiscalization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnorFiscalizationRequest'
            example:
              transaction_id: a12fc00f-5af5-65b8-adf8-74bff44680ee
              qr_code: >-
                https://ofd.soliq.uz/check?t=UZ170703100597&r=2421&c=20230104121801&s=514343190161
      responses:
        '200':
          description: Fiscalization processed (success or error)
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/AnorFiscalizationSuccessResponse'
                  - $ref: '#/components/schemas/AnorFiscalizationErrorResponse'
              examples:
                success:
                  value:
                    data:
                      message: Fiscalization completed successfully
                      error_code: 0
                      payment_id: 123456
                      transaction_id: a12fc00f-5af5-65b8-adf8-74bff44680ee
                    error: null
                    is_success: true
                error:
                  value:
                    data: null
                    error:
                      code: 105
                      message: Invalid transaction_id
                      data: null
                    is_success: false
        '400':
          description: Validation or processing error (may still be returned as 200)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnorFiscalizationErrorResponse'
              example:
                data: null
                error:
                  code: 105
                  message: Transaction not found
                  data: null
                is_success: false
        '500':
          description: Internal server error
components:
  schemas:
    AnorFiscalizationRequest:
      type: object
      required:
        - transaction_id
        - qr_code
      properties:
        transaction_id:
          type: string
          description: Unique transaction identifier received from Anor payment
          example: a12fc00f-5af5-65b8-adf8-74bff44680ee
        qr_code:
          type: string
          description: URL of the fiscal receipt from Soliq (OFD)
          example: >-
            https://ofd.soliq.uz/check?t=UZ170703100597&r=2421&c=20230104121801&s=514343190161
    AnorFiscalizationSuccessResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            message:
              type: string
              description: Provider message
            error_code:
              type: integer
              description: Error code provided by provider
              example: 0
            payment_id:
              type: integer
              description: Unique payment identifier received from Anor payment
            transaction_id:
              type: string
              nullable: true
              description: Unique transaction identifier
        error:
          type: string
          nullable: true
        is_success:
          type: boolean
          example: true
    AnorFiscalizationErrorResponse:
      type: object
      properties:
        data:
          type: object
          nullable: true
          example: null
        error:
          type: object
          properties:
            code:
              type: integer
              example: 105
            message:
              type: string
              example: Invalid transaction_id
            data:
              type: string
              nullable: true
              default: null
        is_success:
          type: boolean
          example: false

````