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

# Create Invoice



## OpenAPI

````yaml /api-reference/manexx-merchant-api.json post /api/v1/external/invoices
openapi: 3.0.3
info:
  title: Manexx Merchant API
  version: 0.1.0
  description: Public merchant integration API (X-Api-Key).
servers:
  - url: https://api.manexx.com
security: []
tags:
  - name: Merchant API
    description: Merchant API
paths:
  /api/v1/external/invoices:
    post:
      tags:
        - Merchant API
      summary: Create Invoice
      operationId: create_invoice_api_v1_external_invoices_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantInvoiceCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success_MerchantInvoiceRead_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    MerchantInvoiceCreate:
      properties:
        external_id:
          type: string
          maxLength: 128
          minLength: 1
          title: External Id
          description: Your own order id. Unique per business; used for idempotency.
          example: order-4821
        customer_id:
          type: string
          maxLength: 128
          minLength: 1
          title: Customer Id
          description: Your identifier for the paying customer.
          example: user-99
        amount:
          anyOf:
            - type: number
              exclusiveMinimum: true
              minimum: 0
            - type: string
          title: Amount
          description: Base order amount in fiat. Positive, max 2 decimal places.
          example: '1050.00'
        currency:
          type: string
          maxLength: 16
          minLength: 2
          title: Currency
          description: Fiat currency code. Must be active and allowed for your business.
          example: UAH
        purpose:
          title: Purpose
          description: Optional order description shown to the customer.
          nullable: true
          type: string
          maxLength: 255
          example: 'Order #4821'
        callback_url:
          title: Callback Url
          description: HTTPS webhook URL for settlement. Falls back to business settings.
          nullable: true
          type: string
          maxLength: 512
          example: https://shop.example/webhooks/manexx
        success_url:
          title: Success Url
          description: HTTPS redirect after successful payment. Falls back to settings.
          nullable: true
          type: string
          maxLength: 512
          example: https://shop.example/paid
        fail_url:
          title: Fail Url
          description: HTTPS redirect after failed payment. Falls back to settings.
          nullable: true
          type: string
          maxLength: 512
          example: https://shop.example/failed
      type: object
      required:
        - external_id
        - customer_id
        - amount
        - currency
      title: MerchantInvoiceCreate
    Success_MerchantInvoiceRead_:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          $ref: '#/components/schemas/MerchantInvoiceRead'
      type: object
      required:
        - data
      title: Success[MerchantInvoiceRead]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MerchantInvoiceRead:
      properties:
        uuid:
          type: string
          format: uuid
          title: Uuid
          description: Our order id. Look the invoice up by this or by external_id.
          example: 9f2c1e5a-3b7d-4e21-a0c9-1f2e3d4c5b6a
        external_id:
          type: string
          title: External Id
          description: Your order id.
          example: order-4821
        customer_id:
          type: string
          title: Customer Id
          description: Your customer id.
          example: user-99
        purpose:
          title: Purpose
          description: Order description.
          nullable: true
          type: string
          example: 'Order #4821'
        amount:
          type: string
          title: Amount
          description: Base order amount in fiat.
          example: '1050.00'
        amount_to_send:
          title: Amount To Send
          description: >-
            Amount the customer pays (with client commission). Null until a
            method is chosen.
          nullable: true
          type: string
          example: '1071.00'
        currency:
          $ref: '#/components/schemas/CurrencyShort'
        status:
          $ref: '#/components/schemas/MerchantInvoiceStatus'
          description: Invoice status.
          example: pending
        callback_url:
          title: Callback Url
          nullable: true
          type: string
          example: https://shop.example/webhooks/manexx
        success_url:
          title: Success Url
          nullable: true
          type: string
          example: https://shop.example/paid
        fail_url:
          title: Fail Url
          nullable: true
          type: string
          example: https://shop.example/failed
        payment_url:
          title: Payment Url
          description: >-
            Hosted payment link. Returned only to the creator (X-Api-Key); null
            on the public read.
          nullable: true
          type: string
          example: https://pay.manexx.com/pay/9f2c1e5a-...?token=...
        created_at:
          type: string
          format: date-time
          title: Created At
          example: '2026-07-16T09:24:11Z'
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: >-
            Current deadline. Switches from method-selection to payment window
            once a method is picked.
          example: '2026-07-16T09:39:11Z'
      type: object
      required:
        - uuid
        - external_id
        - customer_id
        - amount
        - currency
        - status
        - created_at
        - expires_at
      title: MerchantInvoiceRead
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CurrencyShort:
      properties:
        id:
          type: integer
          title: Id
          example: 1
        code:
          type: string
          title: Code
          description: Currency code.
          example: UAH
        name:
          type: string
          title: Name
          description: Currency name.
          example: Ukrainian hryvnia
        symbol:
          type: string
          title: Symbol
          description: Currency symbol.
          example: ₴
      type: object
      required:
        - id
        - code
        - name
        - symbol
      title: CurrencyShort
    MerchantInvoiceStatus:
      type: string
      enum:
        - pending
        - success
        - fail
        - expired
        - canceled
      title: MerchantInvoiceStatus
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key

````