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

# Payme fiskalizatsiyasi

> Payme to'lovlarini fiskalizatsiya qilish

## Umumiy ko'rinish

**Payme Fiscalization API** avval boshlangan to'lovni yakunlash (fiskalizatsiya) uchun ishlatiladi
initiated Payme 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 Payme 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.id`                         | integer        | Internal fiscalization ID               |
| `data.result.receipt._id`         | string         | Receipt identifier                      |
| `data.result.receipt.create_time` | integer        | Receipt creation timestamp (ms)         |
| `data.result.receipt.pay_time`    | integer        | Payment timestamp (ms)                  |
| `data.error`                      | string \| null | Error description (null on success)     |
| `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/payme_confirm
openapi: 3.0.3
info:
  title: Payme Fiscalization API
  description: Fiscalization endpoint for Payme fiscalization
  version: 1.0.0
servers:
  - url: https://api.fiscalbox.uz
security: []
paths:
  /payment/payme_confirm:
    post:
      tags:
        - Payme Fiscalization
      summary: Fiscalization Payme payment
      operationId: paymeFiscalization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FiscalizationRequest'
            example:
              payment_id: 696e0246c9a128176d5934d8
              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:
                  id: 123
                  result:
                    receipt:
                      _id: 696e0246c9a128176d5934d8
                      create_time: 1768816711011
                      pay_time: 1768816711555
                  error: null
                error: null
                is_success: true
        '400':
          description: 'Invalid request (status code: 200)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400Response'
              example:
                data: null
                error:
                  code: 105
                  message: >-
                    {"payme_id":["This field may not be null."]}HTTP Exception
                    400 Bad Request
                  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 /payme/go response and
            provided by Payme.
          example: 696e0246c9a128176d5934d8
        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
          nullable: true
          properties:
            id:
              type: integer
              nullable: true
              example: 123
            result:
              type: object
              properties:
                receipt:
                  type: object
                  properties:
                    _id:
                      type: string
                      example: 696e0046c9a1a8176d5974d8
                    create_time:
                      type: integer
                      format: int64
                      example: 1768816711011
                    pay_time:
                      type: integer
                      format: int64
                      example: 1768816711555
            error:
              type: string
              nullable: true
        error:
          type: object
          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

````