> ## Documentation Index
> Fetch the complete documentation index at: https://omniflow-vpn.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Post v1accountshoppurchase

> Opens the order for a reviewed recipient against a live quote. The displayed quote is echoed back and the server re-quotes before charging, refusing with `quote_expired` when the window has passed and `price_changed` when the number moved. The recipient must be byte-identical to the reviewed form, so a raw `@name` or a pasted link is refused rather than silently normalised after confirmation.



## OpenAPI

````yaml https://raw.githubusercontent.com/kewldan/omniflow/main/api/openapi.yaml post /v1/account/shop/purchase
openapi: 3.0.3
info:
  title: Omniflow API
  version: 1.0.0
  description: >-
    Customer, commerce, payment, wallet, fulfillment, and operations API for
    Omniflow.
servers: []
security: []
paths:
  /v1/account/shop/purchase:
    post:
      tags:
        - account
      description: >-
        Opens the order for a reviewed recipient against a live quote. The
        displayed quote is echoed back and the server re-quotes before charging,
        refusing with `quote_expired` when the window has passed and
        `price_changed` when the number moved. The recipient must be
        byte-identical to the reviewed form, so a raw `@name` or a pasted link
        is refused rather than silently normalised after confirmation.
      operationId: purchaseAccountShopProduct
      parameters:
        - $ref: '#/components/parameters/CSRFToken'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - productId
                - quantity
                - recipient
                - quote
              properties:
                productId:
                  type: string
                  format: uuid
                quantity:
                  type: integer
                  minimum: 1
                  maximum: 10
                recipient:
                  type: string
                forSelf:
                  type: boolean
                  description: >-
                    Presentation only. Omniflow stores no Telegram username for
                    a web customer, so this never decides delivery or
                    authorisation.
                quote:
                  $ref: '#/components/schemas/AccountShopQuote'
                promoCode:
                  type: string
                useWallet:
                  type: boolean
                  default: false
                  description: Stated explicitly, so a balance is never spent by omission.
      responses:
        '201':
          description: Order opened
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountShopOrder'
        '400':
          $ref: '#/components/responses/Problem'
        '404':
          $ref: '#/components/responses/Problem'
        '409':
          $ref: '#/components/responses/Problem'
        '422':
          $ref: '#/components/responses/Problem'
        '503':
          $ref: '#/components/responses/Problem'
components:
  parameters:
    CSRFToken:
      in: header
      name: X-CSRF-Token
      required: true
      description: >-
        Echoes the token from the current session. Required on every unsafe
        method.
      schema:
        type: string
    IdempotencyKey:
      in: header
      name: Idempotency-Key
      required: true
      schema:
        type: string
        minLength: 8
        maxLength: 128
  schemas:
    AccountShopQuote:
      type: object
      required:
        - priceMinor
        - currency
        - expiresAt
      description: >-
        A price and the moment it stops applying. The two travel together so a
        client cannot hold one without the other.
      properties:
        priceMinor:
          type: integer
          format: int64
        currency:
          type: string
        expiresAt:
          type: string
          format: date-time
    AccountShopOrder:
      type: object
      required:
        - id
        - productName
        - kind
        - quantity
        - recipient
        - forSelf
        - currency
        - amounts
        - payment
        - delivery
      properties:
        id:
          type: string
          format: uuid
        productName:
          type: string
        kind:
          type: string
          enum:
            - telegram_premium
            - telegram_stars
        quantity:
          type: integer
        recipient:
          type: string
        forSelf:
          type: boolean
        currency:
          type: string
        amounts:
          type: object
          required:
            - priceMinor
            - discountMinor
            - walletMinor
            - externalMinor
            - paidMinor
          properties:
            priceMinor:
              type: integer
              format: int64
            discountMinor:
              type: integer
              format: int64
            walletMinor:
              type: integer
              format: int64
            externalMinor:
              type: integer
              format: int64
            paidMinor:
              type: integer
              format: int64
        payment:
          type: object
          required:
            - state
            - required
            - possible
          properties:
            state:
              type: string
            required:
              type: boolean
            possible:
              type: boolean
              description: >-
                An enabled provider settles this currency. False is stated
                rather than dead-ended.
        delivery:
          $ref: '#/components/schemas/AccountShopDelivery'
        createdAt:
          type: string
          format: date-time
    AccountShopDelivery:
      type: object
      required:
        - state
        - attempts
        - supportHandoff
        - supportReference
      properties:
        state:
          type: string
          enum:
            - awaiting_payment
            - queued
            - submitted
            - polling
            - delayed
            - delivered
            - needs_review
            - refunded
            - failed
            - cancelled
          description: >-
            `needs_review` is an ambiguous delivery parked for an operator.
            There is no retry route for it: the gateway honours no idempotency
            key, so retrying could deliver and charge twice.
        attempts:
          type: integer
        supportHandoff:
          type: boolean
          description: True only for needs_review and failed.
        supportReference:
          type: string
        failureReason:
          type: string
          enum:
            - retryable
            - permanent
            - recipient_invalid
            - provider_balance
            - provider_unavailable
            - ambiguous
        deliveredAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        refund:
          type: object
          required:
            - amountMinor
            - currency
          properties:
            amountMinor:
              type: integer
              format: int64
            currency:
              type: string
    Problem:
      type: object
      required:
        - type
        - title
        - status
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        request_id:
          type: string
  responses:
    Problem:
      description: Request failed
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.