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

# Create Manual Order

> Crea l'ordine dello staff (contrassegno o bonifico, spedizione o
ritiro), o restituisce quello della stessa richiesta (200, `replayed`).



## OpenAPI

````yaml https://api.vellaro.io/openapi/admin.json post /api/v1/admin/orders
openapi: 3.1.0
info:
  title: Vellaro Admin API
  description: >-
    Store management under `/api/v1/admin`, for back ends and integrations.
    Every call takes `Authorization: Bearer <token>`: an admin API token or a
    staff user's token. The permissions of its role decide what it can do,
    always in its own store.
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags:
  - name: Orders
    description: >-
      Orders and manual orders, payments, refunds, shipments, invoices, returns,
      customer subscriptions.
  - name: Products
    description: Products, variants, images, prices and discounts, product lookups.
  - name: Categories & catalog setup
    description: >-
      Categories, brands, attributes, options, filters, downloadable files,
      recurring profiles.
  - name: Inventory
    description: Stock of the variants and stock statuses.
  - name: Customers
    description: Customers, customer groups, custom fields.
  - name: Reviews & questions
    description: Moderation of product reviews and questions.
  - name: Promotions & coupons
    description: Coupons and gift vouchers.
  - name: Marketing
    description: Campaigns, newsletter subscribers, affiliates and their commissions.
  - name: Content
    description: >-
      CMS pages, menus, banners, information pages, flipbooks, media library,
      SEO URLs, email templates, translations.
  - name: Settings
    description: >-
      Store settings, email delivery, languages, currencies, physical stores,
      social login providers.
  - name: Shipping
    description: Couriers, shipping rates, weight and length classes.
  - name: Taxes & geo
    description: Tax classes, rates and rules; countries, zones and geo zones.
  - name: Integrations & modules
    description: >-
      Integrations, plugins and modules (Iute, extra warranty, Nextera, Financa
      5, WhatsApp, Firebase), outbound webhooks.
  - name: AI
    description: AI content generation and the settings of the AI shopping assistant.
  - name: Imports
    description: 'CSV imports and the universal import: runs, mappings, previews, undo.'
  - name: Reports & dashboard
    description: Dashboard figures and reports.
  - name: Users & API keys
    description: Staff users and roles, publishable keys, admin API tokens.
  - name: Audit
    description: The store's audit log.
paths:
  /api/v1/admin/orders:
    post:
      tags:
        - Orders
      summary: Create Manual Order
      description: |-
        Crea l'ordine dello staff (contrassegno o bonifico, spedizione o
        ritiro), o restituisce quello della stessa richiesta (200, `replayed`).
      operationId: create_manual_order_api_v1_admin_orders_post
      parameters:
        - name: lang
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Force content language (it|en|sq)
            title: Lang
          description: Force content language (it|en|sq)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManualOrderCreateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManualOrderResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ManualOrderCreateRequest:
      properties:
        channel:
          anyOf:
            - type: string
              enum:
                - phone
                - whatsapp
                - email
                - in_store
                - other
            - type: 'null'
          title: Channel
        customer:
          oneOf:
            - $ref: '#/components/schemas/ExistingCustomerIn'
            - $ref: '#/components/schemas/GuestCustomerIn'
          title: Customer
          discriminator:
            propertyName: mode
            mapping:
              existing: '#/components/schemas/ExistingCustomerIn'
              guest: '#/components/schemas/GuestCustomerIn'
        delivery:
          oneOf:
            - $ref: '#/components/schemas/ShipDeliveryIn'
            - $ref: '#/components/schemas/PickupDeliveryIn'
          title: Delivery
          discriminator:
            propertyName: mode
            mapping:
              pickup: '#/components/schemas/PickupDeliveryIn'
              ship: '#/components/schemas/ShipDeliveryIn'
        business_invoice:
          anyOf:
            - $ref: '#/components/schemas/BusinessInvoiceInput'
            - type: 'null'
        lines:
          items:
            $ref: '#/components/schemas/LineIn'
          type: array
          maxItems: 100
          title: Lines
        payment:
          $ref: '#/components/schemas/PaymentIn'
        notes:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Notes
        internal_note:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Internal Note
        email_customer:
          type: boolean
          title: Email Customer
          default: false
        locale:
          anyOf:
            - type: string
              maxLength: 5
            - type: 'null'
          title: Locale
        idempotency_key:
          type: string
          format: uuid
          title: Idempotency Key
        expected_total:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Expected Total
      type: object
      required:
        - customer
        - delivery
        - payment
        - idempotency_key
        - expected_total
      title: ManualOrderCreateRequest
      description: >-
        POST /admin/orders: in più la chiave del doppio clic e il totale del
        preventivo.
    ManualOrderResponse:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/StaffOrderOut'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/ManualOrderMeta'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ManualOrderResponse
      description: '`{"data": StaffOrderOut, "meta": …}`; 201, o 200 per un replay.'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ExistingCustomerIn:
      properties:
        mode:
          type: string
          const: existing
          title: Mode
        user_id:
          type: string
          format: uuid
          title: User Id
      type: object
      required:
        - mode
        - user_id
      title: ExistingCustomerIn
      description: Un cliente con account del negozio, attivo e non anonimizzato.
    GuestCustomerIn:
      properties:
        mode:
          type: string
          const: guest
          title: Mode
        full_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Full Name
        phone:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Phone
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
      type: object
      required:
        - mode
        - full_name
      title: GuestCustomerIn
      description: 'Un ospite: telefono O email (spesso al telefono c''è solo il numero).'
    ShipDeliveryIn:
      properties:
        mode:
          type: string
          const: ship
          title: Mode
        shipping_address:
          $ref: '#/components/schemas/AddressSchema'
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressSchema'
            - type: 'null'
      type: object
      required:
        - mode
        - shipping_address
      title: ShipDeliveryIn
      description: >-
        Spedizione: fatturazione uguale alla spedizione quando manca (come il
        checkout).
    PickupDeliveryIn:
      properties:
        mode:
          type: string
          const: pickup
          title: Mode
        store_id:
          type: string
          format: uuid
          title: Store Id
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressSchema'
            - type: 'null'
      type: object
      required:
        - mode
        - store_id
      title: PickupDeliveryIn
      description: Ritiro in un punto vendita attivo del negozio, spedizione 0.
    BusinessInvoiceInput:
      properties:
        company_name:
          type: string
          title: Company Name
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
        vat_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Vat Number
      type: object
      required:
        - company_name
      title: BusinessInvoiceInput
      description: >-
        B2B invoice details captured at checkout for THIS order (order-level

        snapshot). Independent from the account default, so guests and one-off

        company purchases work too. When present the order becomes a B2B
        receipt;

        an Albanian company sends `tax_id` (NIPT), a foreign one `vat_number`
        (VAT).
    LineIn:
      properties:
        variant_id:
          type: string
          format: uuid
          title: Variant Id
        quantity:
          type: integer
          maximum: 9999
          minimum: 1
          title: Quantity
      type: object
      required:
        - variant_id
        - quantity
      title: LineIn
    PaymentIn:
      properties:
        mode:
          type: string
          maxLength: 32
          minLength: 1
          title: Mode
        method:
          anyOf:
            - type: string
              maxLength: 32
            - type: 'null'
          title: Method
        reason:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Reason
        reference:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Reference
        fiscal:
          anyOf:
            - type: string
              enum:
                - now
                - at_register
                - later
            - type: 'null'
          title: Fiscal
        delivered_now:
          type: boolean
          title: Delivered Now
          default: false
      type: object
      required:
        - mode
      title: PaymentIn
      description: >-
        `mode` in R2a: `cod` o `bank_transfer` (ORD-16), `paid` («già pagato»,

        ORD-32); il link con R5. Un altro valore: 422

        `order.payment_method_not_allowed`.


        Solo con `paid` (per gli altri modi non contano):

        - `method`: come sono arrivati i soldi, `cash` · `card_pos` ·
          `bank_transfer` (bonifico ricevuto); un altro valore, o nessuno, è 422
          `order.payment_method_not_allowed`;
        - `reason`: obbligatorio (blocco `order.payment_reason_required`),
        perché
          da *Pagato* lo stato non torna indietro e uno sbaglio si corregge solo con
          un rimborso;
        - `reference`: il riferimento del bonifico o della ricevuta del POS,
        nella
          riga del registro dei pagamenti;
        - `fiscal`: lo scontrino (`orders/receipt.py`), obbligatorio e mai
          preselezionato con Nextera attivo (blocco `order.fiscal_choice_required`);
          `now` senza Nextera attivo è il blocco 409 `order.fiscal_now_unavailable`;
        - `delivered_now`: «Consegnato subito» al banco, l'ordine nasce
        *Consegnato*.
    StaffOrderOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        status:
          type: string
          title: Status
        payment_status:
          type: string
          title: Payment Status
        payment_method:
          type: string
          title: Payment Method
        stripe_payment_intent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Stripe Payment Intent Id
        subtotal:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Subtotal
        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
        amount_refunded:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount Refunded
          default: '0'
        currency:
          type: string
          title: Currency
        coupon_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Coupon Code
        customer_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Email
        customer_phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Phone
        shipping_address:
          additionalProperties: true
          type: object
          title: Shipping Address
        billing_address:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Billing Address
        tracking_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Tracking Number
        shipping_carrier:
          anyOf:
            - type: string
            - type: 'null'
          title: Shipping Carrier
        invoice_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Invoice Number
        invoice_issued_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Invoice Issued At
        customer_vat_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Vat Id
        customer_tax_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Tax Code
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        items:
          items:
            $ref: '#/components/schemas/StaffOrderItemOut'
          type: array
          title: Items
          default: []
        history:
          items:
            $ref: '#/components/schemas/OrderHistoryOut'
          type: array
          title: History
          default: []
        payment_attempt:
          anyOf:
            - $ref: '#/components/schemas/PaymentAttemptOut'
            - type: 'null'
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
        channel:
          anyOf:
            - type: string
            - type: 'null'
          title: Channel
        created_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By Name
        email_customer:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Email Customer
        delivery_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Delivery Mode
        manual_discount:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Manual Discount
        fiscal_external:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Fiscal External
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
        deleted_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Deleted By Name
        delete_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Delete Reason
        delete_reason_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Delete Reason Code
        purge_after:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Purge After
        imported:
          type: boolean
          title: Imported
          default: false
        deletion:
          anyOf:
            - $ref: '#/components/schemas/OrderDeletionSummary'
            - type: 'null'
      type: object
      required:
        - id
        - user_id
        - status
        - payment_status
        - payment_method
        - stripe_payment_intent_id
        - subtotal
        - shipping_cost
        - tax
        - discount_amount
        - total
        - currency
        - coupon_code
        - customer_email
        - customer_phone
        - shipping_address
        - billing_address
        - tracking_number
        - shipping_carrier
        - invoice_number
        - notes
        - created_at
        - updated_at
      title: StaffOrderOut
    ManualOrderMeta:
      properties:
        reference:
          type: string
          title: Reference
        share_text:
          type: string
          title: Share Text
        replayed:
          type: boolean
          title: Replayed
        password_setup_sent:
          type: boolean
          title: Password Setup Sent
          default: false
      type: object
      required:
        - reference
        - share_text
        - replayed
      title: ManualOrderMeta
    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
    AddressSchema:
      properties:
        first_name:
          type: string
          title: First Name
        last_name:
          type: string
          title: Last Name
        company:
          anyOf:
            - type: string
            - type: 'null'
          title: Company
        address_line1:
          type: string
          title: Address Line1
        address_line2:
          anyOf:
            - type: string
            - type: 'null'
          title: Address Line2
        city:
          type: string
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        postal_code:
          type: string
          title: Postal Code
        country:
          type: string
          title: Country
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
      type: object
      required:
        - first_name
        - last_name
        - address_line1
        - city
        - postal_code
        - country
      title: AddressSchema
    StaffOrderItemOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        variant_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Variant Id
        product_name:
          type: string
          title: Product Name
        variant_sku:
          type: string
          title: Variant Sku
        variant_attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Variant Attributes
        quantity:
          type: integer
          title: Quantity
        unit_price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Unit Price
        total_price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total Price
        kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Kind
        parent_item_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Item Id
        service_meta:
          anyOf:
            - $ref: '#/components/schemas/StaffOrderItemServiceOut'
            - type: 'null'
        catalog_unit_price:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Catalog Unit Price
        price_override_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Override Reason
      type: object
      required:
        - id
        - variant_id
        - product_name
        - variant_sku
        - variant_attributes
        - quantity
        - unit_price
        - total_price
      title: StaffOrderItemOut
    OrderHistoryOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        event_type:
          type: string
          title: Event Type
          default: status_change
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        notify_customer:
          type: boolean
          title: Notify Customer
        actor_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Actor Name
        is_internal:
          type: boolean
          title: Is Internal
          default: false
        meta:
          additionalProperties: true
          type: object
          title: Meta
          default: {}
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - comment
        - notify_customer
        - created_at
      title: OrderHistoryOut
    PaymentAttemptOut:
      properties:
        method:
          type: string
          const: iute
          title: Method
          default: iute
        state:
          anyOf:
            - type: string
              enum:
                - awaiting
                - approved
                - declined
            - type: 'null'
          title: State
      type: object
      title: PaymentAttemptOut
      description: >-
        Il sottoinsieme pubblico del tentativo corrente di un ordine Iute
        (§7.1).


        `state`: `awaiting` (domanda inviata, anche con un importo da
        verificare),

        `approved` (approvata, firmata o pagata: il pagato si legge da

        `payment_status`), `declined`, null (nessuna domanda vista: sessione
        aperta,

        chiusa senza domanda, scaduta o superata). Lo scrive

        `iute.storefront.public_attempts`; al posto dell'oggetto c'è null per un

        altro metodo e per un ordine Iute importato senza tentativi.
    OrderDeletionSummary:
      properties:
        deletable:
          type: boolean
          title: Deletable
        blockers:
          items:
            type: string
          type: array
          title: Blockers
          default: []
      type: object
      required:
        - deletable
      title: OrderDeletionSummary
      description: Il riassunto del controllo nel dettaglio dello staff (`StaffOrderOut`).
    StaffOrderItemServiceOut:
      properties:
        years:
          anyOf:
            - type: integer
            - type: 'null'
          title: Years
        base_unit_price:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Base Unit Price
        percent:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Percent
        min_price:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Min Price
        rounding:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rounding
        version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Version
        terms_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Terms Path
      type: object
      title: StaffOrderItemServiceOut
      description: >-
        La fotografia completa della garanzia extra per lo staff (GAR-15, D10):
        la regola com'era all'ordine.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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