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

# Create Invoice

> Creates an invoice (line items + optional single VAT/Tax percentage on the subtotal) together with a payment to pay it. The returned `payment_id` links to that payment — fetch it via `GET /payments/{id}` to obtain the shareable payment link (`shortUrl`).



## OpenAPI

````yaml POST /invoices
openapi: 3.0.0
info:
  title: Ebioro Merchant API
  description: >-
    API for merchant payment processing on Stellar. Supports direct USDC
    payments and cross-chain deposits from multiple blockchains.
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /invoices:
    post:
      tags:
        - Invoices
      summary: Create an invoice
      description: >-
        Creates an invoice (line items + optional single VAT/Tax percentage on
        the subtotal) together with a payment to pay it. The returned
        `payment_id` links to that payment — fetch it via `GET /payments/{id}`
        to obtain the shareable payment link (`shortUrl`).
      operationId: InvoicesController_create
      parameters:
        - name: x-digest-timestamp
          in: header
          description: Current Unix timestamp
          required: true
          schema:
            type: string
        - name: x-digest-key
          in: header
          description: Your public api key
          required: true
          schema:
            type: string
        - name: x-digest-signature
          in: header
          description: Digest Auth Signature
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInvoiceDto'
      responses:
        '200':
          description: The created invoice.
          content:
            application/json:
              example:
                id: c9310d0f-6338-4780-b8d2-6a125e258a4a
                invoice_number: INV-2026-4
                status: sent
                currency: USD
                line_items:
                  - description: Consulting — June
                    quantity: 2
                    unit_price: 10000
                subtotal: 20000
                tax_percentage: 21
                tax_total: 4200
                total: 24200
                issued_at: '2026-06-10T15:24:48.801Z'
                due_at: null
                payment_id: pt_EL1yKOzKdv
                notes: Thanks for your business.
                customer:
                  id: 9c4749b3-8f18-4a25-9d67-8b1866d6c56d
                  customer_type: business
                  name: null
                  company_name: Example Co B.V.
                  email: billing@example.com
                  vat_number: null
                  address: null
                createdAt: '2026-06-10T15:24:48.791Z'
                updatedAt: '2026-06-10T15:24:48.866Z'
              schema:
                $ref: '#/components/schemas/InvoiceDto'
        '401':
          description: Authentication failed.
          content:
            application/json:
              example:
                reason: Signature verification failed
                statusCode: 401
        '404':
          description: Not found (or owned by another merchant).
          content:
            application/json:
              example:
                reason: Not found
                statusCode: 404
      security:
        - customHeader: []
components:
  schemas:
    CreateInvoiceDto:
      type: object
      properties:
        currency:
          type: string
          example: USD
          description: Pricing currency (ISO 4217). The invoice settles in USDC.
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItemDto'
          minItems: 1
        tax_percentage:
          type: number
          minimum: 0
          maximum: 100
          example: 21
          description: >-
            Single VAT/Tax rate (percent) applied to the subtotal. Defaults to
            0.
        customer_id:
          type: string
          format: uuid
          description: Existing customer id to bill. Mutually exclusive with customer.
        customer:
          $ref: '#/components/schemas/InvoiceCustomerInputDto'
        due_at:
          type: string
          format: date-time
          example: '2026-07-01T00:00:00Z'
        notes:
          type: string
          example: Thanks for your business.
        invoice_number:
          type: string
          description: >-
            Merchant-provided invoice number. If omitted, generated from the
            merchant prefix + gapless counter.
      required:
        - currency
        - line_items
    InvoiceDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        invoice_number:
          type: string
          example: INV-2026-4
        status:
          type: string
          enum:
            - draft
            - sent
            - paid
            - overdue
            - voided
          example: sent
        currency:
          type: string
          example: USD
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItemDto'
        subtotal:
          type: integer
          example: 20000
          description: Subtotal in the smallest currency unit (cents).
        tax_percentage:
          type: number
          example: 21
        tax_total:
          type: integer
          example: 4200
          description: Tax amount in cents.
        total:
          type: integer
          example: 24200
          description: Total in cents.
        issued_at:
          type: string
          format: date-time
          nullable: true
        due_at:
          type: string
          format: date-time
          nullable: true
        payment_id:
          type: string
          example: pt_EL1yKOzKdv
          description: >-
            id of the linked payment. Fetch it via GET /payments/{id} to obtain
            the shareable payment link (shortUrl / hostedUrl).
        notes:
          type: string
          nullable: true
        customer:
          type: object
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    InvoiceLineItemDto:
      type: object
      properties:
        description:
          type: string
          example: Consulting — June
        quantity:
          type: integer
          example: 2
          description: Quantity (whole units).
        unit_price:
          type: integer
          example: 10000
          description: Unit price in the smallest unit of the currency (e.g. cents).
      required:
        - description
        - quantity
        - unit_price
    InvoiceCustomerInputDto:
      type: object
      description: Inline customer to attach to the invoice when no customer_id is given.
      properties:
        customer_type:
          type: string
          enum:
            - individual
            - business
          example: business
        name:
          type: string
          example: Jane Doe
        company_name:
          type: string
          example: Example Co B.V.
        email:
          type: string
          format: email
          example: billing@example.com
        vat_number:
          type: string
          example: NL859090913B01
        address:
          type: object
          example:
            line1: Main Street 1
            postal_code: 1000 AA
            city: Amsterdam
            country: NL
  securitySchemes:
    customHeader:
      type: apiKey
      in: header
      name: x-digest-key
      description: Your public API key

````