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

# Uzum FastPay to'lovi

> Uzum FastPay orqali to'lovni boshlash

## Umumiy ko'rinish

**Uzum FastPay Payment API** orqali to'lovni boshlash uchun ishlatiladi
Uzum’s FastPay system.

Bu endpoint to'lov tranzaksiyasini yaratadi va `payment_id` qaytaradi
that must be used later for fiscalization.

***

## So'rov maydonlari

| Maydon    | Turi    | Majburiy | Tavsif                             |
| --------- | ------- | -------- | ---------------------------------- |
| `amount`  | integer | ✅        | Payment amount in sums             |
| `qr_code` | string  | ✅        | Unique Uzum transaction identifier |

***

## Javob maydonlari

### ✅ Muvaffaqiyatli javob `200`

| Maydon                     | Turi           | Tavsif                                     |
| -------------------------- | -------------- | ------------------------------------------ |
| `data`                     | object         | Javob ma'lumoti                            |
| `data.payment_id`          | string         | Unique payment identifier                  |
| `data.payment_status`      | string         | Payment status (`SUCCESS`, `FAILED`, etc.) |
| `data.error_code`          | string         | Provider error code (`0` on success)       |
| `data.error_message`       | string \| null | Error description (null on success)        |
| `data.client_phone_number` | string         | Client phone number                        |
| `error`                    | null           | Error object (always `null` on success)    |
| `is_success`               | boolean        | Always `true`                              |

### 🚫 Xatolik javobi `400`

> **Eslatma:** Xatolik holatida ham server HTTP `200` qaytaradi.

| Maydon          | Turi        | Tavsif                     |
| --------------- | ----------- | -------------------------- |
| `data`          | null        | No data returned           |
| `error`         | object      | Error details              |
| `error.code`    | integer     | Internal 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/uzum
openapi: 3.1.0
info:
  title: Uzum FastPay API
  description: Payment endpoint for Payme payments
  license:
    name: MIT
    identifier: ''
  version: 1.0.0
servers:
  - url: https://fbox.ngrok.io
security: []
paths:
  /payment/uzum:
    post:
      tags:
        - Uzum FastPay Payment
      summary: Uzum FastPay payment
      operationId: paymeGoPayment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
            example:
              amount: 1000
              qr_code: >-
                7993:5061401:01KFDH7KB4KNBJD8QRVFBVQ39X:3sySIUxrog+hhtBwUXquxn97N5k=
      responses:
        '200':
          description: Fiscalization successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponse'
              example:
                data:
                  payment_id: bb75f609-6d97-4b45-9ed3-80e5fcd19ef1
                  payment_status: SUCCESS
                  error_code: '0'
                  error_message: null
                  client_phone_number: '998712565009'
                error: null
                is_success: true
        '400':
          description: 'Invalid request (status code: 200)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                data: null
                error:
                  code: 105
                  message: >-
                    The input has already been written to an output stream and
                    can not be consumed again.
                  data: null
                is_success: false
        '500':
          description: Internal server error
components:
  schemas:
    PaymentRequest:
      type: object
      required:
        - amount
        - qr_code
      properties:
        amount:
          type: integer
          description: Payment amount in sums
          example: 1000
        qr_code:
          type: string
          description: Unique transaction identifier
          example: 7993:5061401:01KFDH7KB4KNBJD8QRVFBVQ39X:3sySIUxrog+hhtBwUXquxn97N5k=
    PaymentResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            payment_id:
              type: string
              nullable: false
            payment_message:
              type: string
              example: SUCCESS
            error_code:
              type: string
              nullable: false
              example: '0'
            error_message:
              type: string
              nullable: true
            client_phone_number:
              type: string
              nullable: false
              example: '998712565009'
        error:
          type: string
          nullable: true
        is_success:
          type: boolean
          example: true
    ErrorResponse:
      type: object
      properties:
        data:
          type: string
          nullable: true
          default: null
        error:
          type: object
          properties:
            code:
              type: integer
              example: 104
            message:
              type: string
              example: >-
                The input has already been written to an output stream and can
                not be consumed again.
            data:
              type: string
              nullable: true
              default: null
        is_success:
          type: boolean
          example: false

````