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

# Create Order

> Buy proxies of any category.

* ``isp`` / ``datacenter`` - per-IP packages; ``country`` is required.
* ``residential`` / ``mobile`` - per-GB packages. If the account already has
  an active subscription in that category the purchase TOPS IT UP instead of
  creating a second one (``is_top_up: true``); pass ``subscription_id`` to
  pick the target explicitly.



## OpenAPI

````yaml /api-reference/proxy.json post /v1/proxy/orders
openapi: 3.1.0
info:
  title: Lumi Proxy API
  version: 1.1.0
  description: >-
    Публичный REST API прокси Lumi. Ключ привязан к одному аккаунту и делает то
    же, что клиент делает в боте.


    Авторизация: `Authorization: Bearer <ключ>`. Денежные запросы дополнительно
    требуют заголовок `Idempotency-Key`.
servers:
  - url: https://api.lumiweb.cc/proxy
    description: production
security:
  - bearerAuth: []
paths:
  /v1/proxy/orders:
    post:
      tags:
        - proxy
      summary: Create Order
      description: >-
        Buy proxies of any category.


        * ``isp`` / ``datacenter`` - per-IP packages; ``country`` is required.

        * ``residential`` / ``mobile`` - per-GB packages. If the account already
        has
          an active subscription in that category the purchase TOPS IT UP instead of
          creating a second one (``is_top_up: true``); pass ``subscription_id`` to
          pick the target explicitly.
      operationId: create_order
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Idempotency-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    OrderRequest:
      properties:
        category:
          type: string
          maxLength: 32
          title: Category
          description: residential | mobile | isp | datacenter
        quantity:
          type: integer
          maximum: 1000
          minimum: 1
          title: Quantity
        country:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Country
          description: ISO-2 code or catalog name. Required for isp/datacenter.
        region:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Region
        city:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: City
        isp:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Isp
        rotation_seconds:
          anyOf:
            - type: integer
              maximum: 604800
              minimum: 1
            - type: 'null'
          title: Rotation Seconds
          description: rotating only; omit for a new IP on every request
        session_mode:
          type: string
          enum:
            - rotating
            - sticky
          title: Session Mode
          default: rotating
        protocol:
          type: string
          enum:
            - http
            - socks5
          title: Protocol
          default: http
        format:
          type: string
          enum:
            - url
            - user:pass@host:port
            - user:pass:host:port
            - host:port:user:pass
          title: Format
          default: url
        auto_renew:
          type: boolean
          title: Auto Renew
          description: static only
          default: false
        subscription_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Subscription Id
          description: rotating only - force the top-up target
      type: object
      required:
        - category
        - quantity
      title: OrderRequest
      description: >-
        One proxy purchase.


        ``quantity`` is GB for rotating categories (residential / mobile) and
        the

        number of IPs for static ones (isp / datacenter).


        Rotating purchases MERGE by default: a category the user already owns an

        active subscription in is topped up rather than duplicated (the same
        rule

        the bot enforces). Pass ``subscription_id`` to target one explicitly, or

        read back ``is_top_up`` to see what happened.
    OrderOut:
      properties:
        status:
          type: string
          title: Status
        category:
          type: string
          title: Category
        subscription_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Subscription Id
        order_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Order Id
        price_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Usd
        quantity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Quantity
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
        is_top_up:
          type: boolean
          title: Is Top Up
          default: false
        geo_applied:
          type: boolean
          title: Geo Applied
          default: false
        geo_failed:
          type: boolean
          title: Geo Failed
          default: false
      type: object
      required:
        - status
        - category
      title: OrderOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Ключ вида lumi_proxy_… Выдаётся оператором.

````