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

# Создание заказа



## OpenAPI

````yaml POST /order/create
openapi: 3.1.0
info:
  version: 1.0.0
  title: OpenAPI B2B Every SIM
  description: API для работы с eSIM картами в B2B
servers:
  - url: https://api.every.ru/b2b/esim
security:
  - bearerAuth: []
paths:
  /order/create:
    post:
      summary: Создать новый заказ
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCreateRequest'
      responses:
        '200':
          description: Заказ успешно создан
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderResponse'
        '400':
          description: Неверный запрос - неверные параметры
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Неверный ID пакета или отсутствуют обязательные параметры
        '404':
          description: Заказ не найден
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth:
            - write
components:
  schemas:
    OrderCreateRequest:
      type: object
      properties:
        packet:
          type: integer
          format: uint
          description: Тип пакета для заказа
          example: 1234567890
        count:
          type: integer
          format: uint
          nullable: true
          description: Количество eSIM (по умолчанию 1)
          example: 2
        track_id:
          type: string
          nullable: true
          description: Идентификатор отслеживания для корреляции заказа (опционально)
          example: track_abc123xyz
      required:
        - packet
    CreateOrderResponse:
      $ref: '#/components/schemas/Order'
      description: Детали заказа
    Error:
      type: object
      properties:
        code:
          type: integer
          description: Код ошибки
          example: -32602
        message:
          type: string
          description: Сообщение об ошибке
          example: Заказ не найден
        data:
          type: object
          properties:
            code:
              type: integer
              description: Внутренний код ошибки
              example: 1
          required:
            - code
      required:
        - code
        - message
        - data
    Order:
      type: object
      properties:
        id:
          type: integer
          format: uint
          description: Индетификатор заказа
          example: 1234567890
        country:
          type: string
          pattern: ^[A-Z]{2}$
          description: Код страны в формате ISO 3166-1 alpha-2
          example: RU
        packet:
          type: integer
          format: uint
          description: Идентификатор пакета
          example: 1234567890
        count:
          type: integer
          format: uint
          description: Количество eSIM в заказе
          example: 1
        created_at:
          type: string
          format: date-time
          description: Временная метка создания заказа в формате ISO 8601 UTC
          example: '2023-12-01T10:30:00Z'
        expired_at:
          type: string
          format: date-time
          description: Временная метка истечения заказа в формате ISO 8601 UTC
          example: '2023-12-08T10:30:00Z'
        status:
          type: string
          enum:
            - inited
            - paid
            - canceled
            - expired
          description: Статус заказа
          example: inited
      required:
        - id
        - country
        - packet
        - count
        - created_at
        - expired_at
        - status
        - payment
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````