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

# Pay Existing Order

> Start a FRESH payment attempt for an order that was created but never
paid, without touching its contents, price or number.

Same money-safety rules as the gateway confirm endpoints: the order is
row-locked, must still be unpaid/not cancelled, must belong to the caller,
and its stock is re-verified. Everything the gateways need is rebuilt from
the ORDER (never from the cart or the request), so the customer pays exactly
what was quoted.



## OpenAPI

````yaml https://api.vellaro.io/openapi/storefront.json post /api/v1/orders/{order_id}/pay
openapi: 3.1.0
info:
  title: Vellaro Storefront API
  description: >-
    The API of storefronts and mobile apps. The store comes from the publishable
    key in the `X-Vellaro-Key` header (or from the store's domain); the
    customer's endpoints also take the customer's token as `Authorization:
    Bearer <access_token>`.
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags:
  - name: Authentication
    description: >-
      Customer sign-up and login, tokens, password reset, email verification,
      Google and Apple login, two-factor authentication.
  - name: Catalog
    description: Products, categories and brands, with filters, sorting and pagination.
  - name: Search
    description: Full-text product search and suggestions as you type.
  - name: Cart
    description: >-
      The cart of a guest (`X-Cart-Token`) or of the logged-in customer, and the
      extra warranty offered on a product page.
  - name: Checkout & orders
    description: >-
      Checkout, the customer's orders and reorder, «Order on WhatsApp» (cart
      codes, clicks).
  - name: Payments
    description: >-
      The store's payment methods, paying an order again, and the confirmation
      steps of PayPal, PokPay and Iute.
  - name: Account
    description: >-
      The logged-in customer: profile, addresses, wishlist, digital downloads,
      subscriptions, affiliate account.
  - name: Reviews & questions
    description: Product reviews and product questions.
  - name: AI chat
    description: 'The store''s AI shopping assistant: conversations, messages, feedback.'
  - name: Content
    description: CMS pages, menus, banners, flipbooks and information pages.
  - name: Marketing & contact
    description: >-
      Newsletter sign-up and email links, the contact form, campaign click
      tracking.
  - name: Store
    description: >-
      The store for the storefront: brand, public settings, languages,
      translations, currencies, physical stores, theme.
  - name: Devices
    description: Push-notification devices of the mobile app.
paths:
  /api/v1/orders/{order_id}/pay:
    post:
      tags:
        - Payments
      summary: Pay Existing Order
      description: >-
        Start a FRESH payment attempt for an order that was created but never

        paid, without touching its contents, price or number.


        Same money-safety rules as the gateway confirm endpoints: the order is

        row-locked, must still be unpaid/not cancelled, must belong to the
        caller,

        and its stock is re-verified. Everything the gateways need is rebuilt
        from

        the ORDER (never from the cart or the request), so the customer pays
        exactly

        what was quoted.
      operationId: pay_existing_order_api_v1_orders__order_id__pay_post
      parameters:
        - name: order_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Order Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_CheckoutResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ApiResponse_CheckoutResponse_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/CheckoutResponse'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/PaginationMeta'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ApiResponse[CheckoutResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CheckoutResponse:
      properties:
        order_id:
          type: string
          format: uuid
          title: Order Id
        payment_method:
          type: string
          title: Payment Method
        client_secret:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Secret
        stripe_publishable_key:
          type: string
          title: Stripe Publishable Key
          default: ''
        paypal_order_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Paypal Order Id
        paypal_client_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Paypal Client Id
        pok_order_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Pok Order Id
        pok_env:
          anyOf:
            - type: string
            - type: 'null'
          title: Pok Env
        paysera_redirect_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Paysera Redirect Url
        iute:
          anyOf:
            - $ref: '#/components/schemas/IuteCheckoutOut'
            - type: 'null'
        bank_details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Bank Details
        subtotal:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Subtotal
        goods_subtotal:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Goods Subtotal
        warranty_total:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Warranty Total
        shipping_cost:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Shipping Cost
        tax:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Tax
        tax_rate:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Tax Rate
        prices_include_tax:
          type: boolean
          title: Prices Include Tax
          default: false
        discount_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Discount Amount
        total:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total
        currency:
          type: string
          title: Currency
        voucher_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Voucher Code
        voucher_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Voucher Amount
          default: '0'
        voucher_remaining:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Voucher Remaining
        guest_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Guest Token
      type: object
      required:
        - order_id
        - payment_method
        - subtotal
        - shipping_cost
        - tax
        - discount_amount
        - total
        - currency
      title: CheckoutResponse
      description: Response from POST /checkout — contains everything the frontend needs.
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total:
          type: integer
          title: Total
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - page
        - page_size
        - total
        - total_pages
      title: PaginationMeta
    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
    IuteCheckoutOut:
      properties:
        mode:
          type: string
          const: redirect
          title: Mode
          default: redirect
        redirect_url:
          type: string
          title: Redirect Url
      type: object
      required:
        - redirect_url
      title: IuteCheckoutOut
      description: >-
        PIANO_IUTE §7.1, DI-16 (IUTE-13): Iute in Redirect. `redirect_url` is
        the

        `checkout.url` of Iute: the storefront sends the customer there with a
        GET,

        and back on `/checkout/iute/return?order_id=…` asks OUR API for the
        state

        (never `?status=`). No `attempt_id` (REV-3): it is the `orderId` sent to

        Iute and does not leave the server.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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