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

# Create invoice

Creates a one-off invoice.

<Snippet file="invoice-created-request.mdx" />

## Request

<ParamField body="accountId" type="string" required>
  The ID of the account for which the invoice is being created.
</ParamField>

<ParamField body="billingPeriodStart" type="timestamp" required>
  The start date of the billing period for the invoice. (RFC 3339 formatted
  timestamp)
</ParamField>

<ParamField body="billingPeriodEnd" type="timestamp" required>
  The end date of the billing period for the invoice. (RFC 3339 formatted
  timestamp)
</ParamField>

<ParamField body="description" type="string">
  A description or note for the invoice. Also known as memo.
</ParamField>

<ParamField body="lineItems" type="List" subType="api.LineItemCreateRequest">
  A list of line items included in the invoice.

  <Expandable title="properties">
    <ParamField body="description" type="string">
      Description of the line item.
    </ParamField>

    <ParamField body="unitPrice" type="object">
      Details of the unit price.
    </ParamField>

    <ParamField body="quantity" type="object">
      Quantity details.
    </ParamField>

    <ParamField body="productId" type="string">
      ID of the product associated with the line item.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="issueDate" type="string">
  The date when the invoice should be issued. (RFC 3339 timestamp)
</ParamField>

## Response

<Snippet file="invoice-created-response.mdx" />

<ParamField body="id" type="string" required>
  The Alguna ID of the invoice.
</ParamField>

<ParamField body="accountId" type="string" required>
  The Alguna ID of the account associated with the invoice.
</ParamField>

<ParamField body="status" type="string" required>
  The status of the invoice.
</ParamField>

<ParamField body="dueDate" type="string" required>
  The due date of the invoice. (RFC 3339 timestamp).
</ParamField>

<ParamField body="issueDate" type="string" required>
  The date when the invoice was issued. (RFC 3339 timestamp)
</ParamField>

<ParamField body="billingPeriodStart" type="string" required>
  The start date of the billing period for the invoice. (RFC 3339 timestamp)
</ParamField>

<ParamField body="billingPeriodEnd" type="string" required>
  The end date of the billing period for the invoice. (RFC 3339 timestamp)
</ParamField>

<ParamField body="billingPeriod" type="string" required>
  The formatted billing period for the invoice.
</ParamField>

<ParamField body="currency" type="string" required>
  The ISO 4217 currency in which the invoice is billed.
</ParamField>

<ParamField body="description" type="string" required>
  The description of the invoice.
</ParamField>

<ParamField body="lineItems" type="List" subType="api.LineItemResponse" required>
  A list of line items included in the invoice.

  <Expandable title="properties">
    <ParamField body="id" type="string" required>
      The Alguna ID of the line item.
    </ParamField>

    <ParamField body="description" type="string" required>
      Description of the line item.
    </ParamField>

    <ParamField body="billingPeriodStart" type="string" required>
      The start date of the billing period for the line item. (RFC 3339
      timestamp)
    </ParamField>

    <ParamField body="billingPeriodEnd" type="string" required>
      The end date of the billing period for the line item. (RFC 3339 timestamp)
    </ParamField>

    <ParamField body="quantity" type="string" required>
      The quantity of the line item.
    </ParamField>

    <ParamField body="unitPrice" type="string" required>
      The unit price of the line item.
    </ParamField>

    <ParamField body="totalPrice" type="string" required>
      The total price of the line item.
    </ParamField>

    <ParamField body="isEditable" type="boolean" required>
      A boolean indicating whether the line item is editable (`true` or
      `false`).
    </ParamField>

    <ParamField body="productId" type="string" required>
      The Alguna ID of the product associated with the line item.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="subtotal" type="string" required>
  The subtotal amount of the invoice.
</ParamField>

<ParamField body="tax" type="string" required>
  The tax amount of the invoice.
</ParamField>

<ParamField body="total" type="string" required>
  The total amount of the invoice as a decimal String.
</ParamField>

<ParamField body="amountPaid" type="string" required>
  The amount paid for the invoice.
</ParamField>

<ParamField body="amountRemaining" type="string" required>
  The remaining amount to be paid for the invoice.
</ParamField>

<ParamField body="externalId" type="string" required>
  The external ID associated with the invoice.
</ParamField>

<ParamField body="externalProvider" type="string" required>
  The external provider associated with the invoice.
</ParamField>

<ParamField body="externalUrl" type="string" required>
  The external URL associated with the invoice.
</ParamField>

<ParamField body="purchaseOrderNumber" type="string">
  The purchase order number associated with the invoice.
</ParamField>

<ParamField body="createdAt" type="datetime" required>
  The date and time at which the invoice was created.
</ParamField>

<ParamField body="updatedAt" type="datetime" required>
  The date and time at which the invoice was last updated.
</ParamField>
