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

# Update invoice

> Updates an issued invoice. Every field is optional; only what you send is changed.

`billing_milestones_attributes` requires the Scale plan and returns `422` without it.
Send `id` to change an existing milestone, omit it to add one, and send
`_destroy: true` with an `id` to remove one.




## OpenAPI

````yaml /api-reference/openapi.yaml put /invoices/{id}
openapi: 3.0.3
info:
  title: Streamlined API
  description: >
    Access customers, customer applications, customer groups, products, payouts,
    invoices, transactions, and deposit links programmatically through this API,
    and receive webhooks when deposit links change. All requests must be
    authenticated with an API key.
  version: 1.6.0
  license:
    name: Proprietary
    url: https://streamlinedpayments.com/terms
servers:
  - url: https://api.staging.streamlinedpayments.com/api/v1
    description: Sandbox
  - url: https://api.streamlinedpayments.com/api/v1
    description: Production
security:
  - AppIdAuth: []
    ApiKeyAuth: []
tags:
  - name: Customers
    description: Create, update and delete the businesses you sell to.
  - name: Customer applications
    description: >-
      List the applications your customers submit, and approve them. Approving
      can also set net terms and export the customer to Shopify. See [Approve
      customer applications](/guides/customer-applications).
  - name: Customer groups
    description: >-
      Organize customers into groups and manage who's in each one. A group can
      be linked to a Shopify B2B company.
  - name: Customer files
    description: Upload and manage files attached to a customer.
  - name: Customer addresses
    description: Manage a customer's addresses and choose their default billing address.
  - name: Orders
    description: Create orders, add and remove line items, and schedule them.
  - name: Invoices
    description: Create invoices from orders, then list, look up and update them.
  - name: Transactions
    description: List transactions and look one up.
  - name: Payouts
    description: List payouts, including pending ones, and look one up.
  - name: Products
    description: >-
      Create and update the products and services you sell, import them in bulk,
      and merge duplicates.
  - name: Deposit links
    description: Collect money from a customer before an invoice exists.
  - name: Webhooks
    description: >-
      Register HTTPS endpoints to receive events when something changes. See
      [Webhooks](/guides/webhooks) for signatures, retries and delivery
      guarantees.
paths:
  /invoices/{id}:
    put:
      tags:
        - Invoices
      summary: Update invoice
      description: >
        Updates an issued invoice. Every field is optional; only what you send
        is changed.


        `billing_milestones_attributes` requires the Scale plan and returns
        `422` without it.

        Send `id` to change an existing milestone, omit it to add one, and send

        `_destroy: true` with an `id` to remove one.
      operationId: updateInvoice
      parameters:
        - name: id
          in: path
          description: The UUID of the invoice to update
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                due_date:
                  type: string
                  format: date
                memo:
                  type: string
                po_number:
                  type: string
                billing_milestones_attributes:
                  type: array
                  description: Scale plan only.
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Omit to add a new milestone.
                      name:
                        type: string
                      amount:
                        type: integer
                        description: >-
                          In cents when amount_type is `fixed`, a percentage
                          when `percentage`.
                      amount_type:
                        type: string
                        enum:
                          - fixed
                          - percentage
                      net_terms:
                        type: integer
                      due_date:
                        type: string
                        format: date
                      issued_at:
                        type: string
                        format: date-time
                      issue_method:
                        type: string
                      _destroy:
                        type: boolean
                        description: Send with an `id` to remove that milestone.
      responses:
        '200':
          description: Invoice updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceUpdated'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Invoice not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invoice not found
        '422':
          description: The update was rejected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Milestone billing is not available on your plan
components:
  schemas:
    InvoiceUpdated:
      type: object
      description: >-
        Returned by Update Invoice. Narrower than InvoiceDetail, and it carries
        milestones.
      properties:
        invoice:
          type: object
          properties:
            uuid:
              type: string
              format: uuid
            created_at:
              type: string
              format: date-time
            currency:
              $ref: '#/components/schemas/Currency'
            amount:
              type: integer
            identifier:
              type: string
            due_date:
              type: string
              format: date
            status:
              type: string
            current_open_balance:
              type: integer
            payment_url:
              type: string
            recipient:
              $ref: '#/components/schemas/InvoiceRecipient'
            billing_milestones:
              type: array
              items:
                $ref: '#/components/schemas/BillingMilestone'
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    Currency:
      type: string
      description: >-
        ISO currency code. Most resources support these. Products are limited to
        USD, CAD, EUR, GBP, AUD.
      enum:
        - USD
        - CAD
        - GBP
        - EUR
        - AUD
        - JPY
        - INR
    InvoiceRecipient:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        company_name:
          type: string
          nullable: true
        display_name:
          type: string
          nullable: true
          description: >-
            Company name if present, otherwise first/last name. Null if neither
            is set.
    BillingMilestone:
      type: object
      properties:
        uuid:
          type: string
        name:
          type: string
        amount:
          type: integer
        amount_type:
          type: string
          enum:
            - fixed
            - percentage
        due_date:
          type: string
          format: date
        has_been_issued:
          type: boolean
        current_open_balance:
          type: integer
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            AuthenticationRequired:
              value:
                error: Authentication required
                message: >-
                  API endpoint requires authentication. Please provide valid
                  X-App-Id and X-Api-Key headers.
            InvalidCredentials:
              value:
                error: Invalid credentials
                message: >-
                  The provided API credentials are invalid. Please check your
                  X-App-Id and X-Api-Key values.
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: X-App-Id
      description: App ID for authentication
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API Key for authentication

````

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