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

# Update invoice custom properties

> Merge custom property values onto an invoice (send a key with `null` to remove it).
Values are validated against the tenant's `INVOICE` property definitions. Allowed at any
status — custom properties are external workflow metadata and stay editable after the invoice
is finalized.



## OpenAPI

````yaml https://api.meteroid.com/api-docs/openapi.json patch /api/v1/invoices/{invoice_id}/custom-properties
openapi: 3.1.0
info:
  title: meteroid
  description: ''
  license:
    name: LicenseRef-Meteroid-EE
    identifier: LicenseRef-Meteroid-EE
  version: 0.1.0
servers: []
security: []
tags:
  - name: Add-ons
  - name: Batch Jobs
  - name: Budgets
    description: >-
      Beta: may change before general availability. Spending limits on a
      customer's usage, or one subscription's, per currency, with alerts at
      percentages of the amount.
    x-beta: true
  - name: Checkout Sessions
  - name: Checks
    description: >-
      Beta: may change before general availability. Whether a customer may
      consume more of a feature right now.
    x-beta: true
  - name: Connect
    description: Manage connected accounts (Express & Standard)
  - name: Coupons
  - name: Credit Notes
  - name: Credit units
    description: >-
      Custom denominations, such as "credits", that usage can be priced in and
      credit granted or sold in, instead of money.
  - name: Credits
    description: >-
      Prepaid credit: a customer's wallets, credit grants, ledger and top-ups.
      Promotional credit applies before tax like a discount; paid credit applies
      after tax like a payment.
  - name: Custom Properties
  - name: Customers
  - name: Entitlements
  - name: Events
  - name: Features
  - name: Invoices
  - name: Licenses
    description: >-
      Licenses for your customers' self-hosted installations: signed tokens
      carrying their plan's entitlements, activated and refreshed by the
      installation over the public licensing endpoints.
  - name: Metrics
  - name: OAuth
    description: OAuth 2.0 token endpoints (public, client-credentials auth)
  - name: OAuth Apps
    description: Manage OAuth applications for Connect integrations
  - name: Plans
  - name: Product Families
  - name: Products
  - name: Subscriptions
  - name: Usage
  - name: Usage costs
    description: >-
      Beta: may change before general availability. A customer's or a
      subscription's usage events and usage over time, with what they cost.
    x-beta: true
  - name: Webhook Endpoints
    description: Manage outbound webhook endpoints and inspect their deliveries
paths:
  /api/v1/invoices/{invoice_id}/custom-properties:
    patch:
      tags:
        - Invoices
      summary: Update invoice custom properties
      description: >-
        Merge custom property values onto an invoice (send a key with `null` to
        remove it).

        Values are validated against the tenant's `INVOICE` property
        definitions. Allowed at any

        status — custom properties are external workflow metadata and stay
        editable after the invoice

        is finalized.
      operationId: patch_invoice_custom_properties
      parameters:
        - name: invoice_id
          in: path
          description: Invoice ID
          required: true
          schema:
            $ref: '#/components/schemas/InvoiceId'
          example: inv_123
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceCustomPropertiesRequest'
        required: true
      responses:
        '200':
          description: Updated invoice
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invoice'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '404':
          description: Invoice not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    InvoiceId:
      type: string
      format: MeteroidId
      examples:
        - inv_7n42DGM5Tflk9n8mt7Fhc7
    InvoiceCustomPropertiesRequest:
      type: object
      description: >-
        Merge update of an invoice's custom property values (send a key with
        `null` to remove it).

        Allowed at any status — custom properties stay editable after the
        invoice is finalized.
      required:
        - custom_properties
      properties:
        custom_properties: {}
    Invoice:
      type: object
      required:
        - id
        - invoice_number
        - status
        - customer_id
        - currency
        - invoice_date
        - tax_inclusive
        - subtotal
        - subtotal_recurring
        - tax_amount
        - total
        - amount_due
        - line_items
        - tax_breakdown
        - transactions
        - payment_status
        - customer_details
        - applied_credits
        - coupons
        - invoice_type
        - net_terms
        - created_at
        - settled_by_credit_notes
        - custom_properties
      properties:
        amount_due:
          type: integer
          format: int64
        applied_credits:
          type: integer
          format: int64
          description: >-
            Paid credit applied after tax, in minor units of the invoice
            currency: it settles part of

            `total` like a payment, and `amount_due` is net of it.
        billing_period_start:
          type:
            - string
            - 'null'
          format: date
          description: >-
            The period/moment this invoice is about — the subscription period
            start, or the invoice's

            own date for manual/one-off. Stable and always present, distinct
            from `invoice_date` (the

            emission date). Shown as "Invoice date".
        child_invoice_id:
          oneOf:
            - $ref: '#/components/schemas/InvoiceId'
              description: >-
                Set on a cancelled invoice that has been reissued: the
                corrective invoice replacing it.
            - type: 'null'
        coupons:
          type: array
          items:
            $ref: '#/components/schemas/CouponLineItem'
        created_at:
          type: string
          format: date-time
        currency:
          $ref: '#/components/schemas/Currency'
        custom_properties:
          description: User-defined custom property values, keyed by definition `key`.
        customer_details:
          $ref: '#/components/schemas/CustomerDetails'
        customer_id:
          $ref: '#/components/schemas/CustomerId'
        due_date:
          type:
            - string
            - 'null'
          format: date
        einvoicing_status:
          oneOf:
            - $ref: '#/components/schemas/EInvoicingStatus'
              description: >-
                Absent when the invoicing entity had not opted in to
                e-invoicing.
            - type: 'null'
        finalized_at:
          type:
            - string
            - 'null'
          format: date-time
        id:
          $ref: '#/components/schemas/InvoiceId'
        invoice_date:
          type: string
          format: date
        invoice_number:
          type: string
        invoice_type:
          $ref: '#/components/schemas/InvoiceType'
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItem'
        marked_as_uncollectible_at:
          type:
            - string
            - 'null'
          format: date-time
        memo:
          type:
            - string
            - 'null'
        net_terms:
          type: integer
          format: int32
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
        parent_invoice_id:
          oneOf:
            - $ref: '#/components/schemas/InvoiceId'
              description: >-
                Set on a corrective invoice: the cancelled invoice this one
                replaces

                ("cancels and replaces"). The original is credited in full by a
                credit note.
            - type: 'null'
        payment_disputed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When a dispute or chargeback first took money still lost on this
            invoice's payments. The

            invoice stays paid; absent when nothing is disputed.
        payment_status:
          $ref: '#/components/schemas/InvoicePaymentStatus'
        promotional_credits:
          type: integer
          format: int64
          description: >-
            Promotional credit applied before tax (credit included with the
            plan, coupon credit, bonus

            credit), in minor units of the invoice currency. Like a discount, it
            reduces the taxable

            amount: `tax_amount` and `total` already exclude it, `subtotal` does
            not. Unlike

            `applied_credits`, which settles part of the `total` after tax.
        purchase_order:
          type:
            - string
            - 'null'
        reference:
          type:
            - string
            - 'null'
        settled_by_credit_notes:
          type: boolean
          description: >-
            True when the invoice is `PAID` without any payment: finalized
            credit notes cancelled its

            whole total. Nothing was collected, so it books no cash.
        status:
          $ref: '#/components/schemas/InvoiceStatus'
        subscription_id:
          oneOf:
            - $ref: '#/components/schemas/SubscriptionId'
            - type: 'null'
        subtotal:
          type: integer
          format: int64
        subtotal_recurring:
          type: integer
          format: int64
        tax_amount:
          type: integer
          format: int64
        tax_breakdown:
          type: array
          items:
            $ref: '#/components/schemas/TaxBreakdownItem'
        tax_inclusive:
          type: boolean
          description: >-
            The prices billed were quoted tax-included. Amounts are net
            regardless: the tax was

            carved out of the quoted price, so `total` is that price to the
            unit.
        total:
          type: integer
          format: int64
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/Transaction'
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        voided_at:
          type:
            - string
            - 'null'
          format: date-time
    RestErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
    CouponLineItem:
      type: object
      required:
        - coupon_id
        - name
        - total
      properties:
        coupon_id:
          type: string
        name:
          type: string
        total:
          type: integer
          format: int64
    Currency:
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHF
        - CLP
        - CNH
        - CNY
        - COP
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - IRR
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRU
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLL
        - SOS
        - SRD
        - SSP
        - STD
        - STN
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
        - ZWL
      examples:
        - EUR
    CustomerDetails:
      type: object
      required:
        - id
        - name
        - snapshot_at
      properties:
        alias:
          type:
            - string
            - 'null'
        billing_address:
          oneOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        email:
          type:
            - string
            - 'null'
        id:
          $ref: '#/components/schemas/CustomerId'
        name:
          type: string
        snapshot_at:
          type: string
          format: date-time
        vat_number:
          type:
            - string
            - 'null'
    CustomerId:
      type: string
      format: MeteroidId
      examples:
        - cus_7n42DGM5Tflk9n8mt7Fhc7
    EInvoicingStatus:
      type: string
      title: EInvoicingStatus
      description: >-
        Whether the structured e-invoice was produced with the accounting PDF.
        Absent when the

        invoicing entity had not opted in at the time the invoice was issued.
      enum:
        - GENERATED
        - FAILED
    InvoiceType:
      type: string
      enum:
        - RECURRING
        - ONE_OFF
        - ADJUSTMENT
        - USAGE_THRESHOLD
    InvoiceLineItem:
      type: object
      required:
        - name
        - amount_total
        - start_date
        - end_date
        - tax_rate
        - sub_line_items
      properties:
        amount_total:
          type: integer
          format: int64
        credit_unit:
          oneOf:
            - $ref: '#/components/schemas/InvoiceLineCreditUnit'
              description: >-
                Usage priced in a credit unit. The line's money amounts then
                only carry the credits the

                customer's balance in that unit did not cover, billed at `rate`.
            - type: 'null'
        description:
          type:
            - string
            - 'null'
        end_date:
          type: string
          format: date
        name:
          type: string
        quantity:
          type: string
          format: decimal
        quoted_unit_price:
          type: string
          format: decimal
          description: >-
            The tax-included unit price the customer was quoted, on a line
            billed from

            tax-inclusive prices. `unit_price` is its net counterpart.
        start_date:
          type: string
          format: date
        sub_line_items:
          type: array
          items:
            $ref: '#/components/schemas/SubLineItem'
        tax_rate:
          type: string
          format: decimal
        unit_price:
          type: string
          format: decimal
    InvoicePaymentStatus:
      type: string
      enum:
        - UNPAID
        - PARTIALLY_PAID
        - PAID
        - ERRORED
        - PROCESSING
    InvoiceStatus:
      type: string
      title: InvoiceStatus
      enum:
        - DRAFT
        - FINALIZED
        - UNCOLLECTIBLE
        - VOID
        - CLOSED
    SubscriptionId:
      type: string
      format: MeteroidId
      examples:
        - sub_7n42DGM5Tflk9n8mt7Fhc7
    TaxBreakdownItem:
      type: object
      required:
        - taxable_amount
        - tax_amount
        - tax_rate
        - name
      properties:
        exemption_reason:
          type:
            - string
            - 'null'
          description: >-
            Free-text legal exemption mention (EU exempt/reverse-charge
            invoices).
        exemption_type:
          oneOf:
            - $ref: '#/components/schemas/TaxExemptionType'
            - type: 'null'
        name:
          type: string
        tax_amount:
          type: integer
          format: int64
        tax_rate:
          type: string
          format: decimal
        tax_reference:
          type:
            - string
            - 'null'
          description: >-
            Accounting/reporting code of the tax rate for this line, for
            exports.
        taxable_amount:
          type: integer
          format: int64
    Transaction:
      type: object
      required:
        - id
        - amount
        - currency
        - status
        - payment_type
        - amount_refunded
        - amount_reversed
      properties:
        amount:
          type: integer
          format: int64
          minimum: 0
        amount_disputed:
          type: integer
          format: int64
          description: >-
            On a PAYMENT: the part of `amount_reversed` lost to disputes or
            chargebacks. The invoice

            stays paid; only the rest of `amount_reversed` (a failed collection)
            reopens it.
        amount_refunded:
          type: integer
          format: int64
          description: >-
            On a PAYMENT: how much was voluntarily given back (the sum of its
            settled REFUND

            children). The invoice stays paid — the Refund credit note is what
            reduces it.
        amount_reversed:
          type: integer
          format: int64
          description: >-
            On a PAYMENT: how much was involuntarily clawed back (chargeback,
            bank recall, lost

            dispute). This is what the invoice nets out, reopening it.
        amount_reversed_excess:
          type: integer
          format: int64
          description: >-
            On a PAYMENT: what the provider withdrew above what the payment
            still held (refunded

            before). Never applied to the invoice or credit: contest it with the
            provider.
        credit_note_id:
          oneOf:
            - $ref: '#/components/schemas/CreditNoteId'
              description: Set on a REFUND drawn against a finalized Refund credit note.
            - type: 'null'
        currency:
          type: string
        error:
          type:
            - string
            - 'null'
        id:
          $ref: '#/components/schemas/PaymentTransactionId'
        parent_transaction_id:
          oneOf:
            - $ref: '#/components/schemas/PaymentTransactionId'
              description: >-
                Set on a REFUND: the settled payment the money is given back
                from.
            - type: 'null'
        payment_method_id:
          oneOf:
            - $ref: '#/components/schemas/CustomerPaymentMethodId'
            - type: 'null'
        payment_method_info:
          oneOf:
            - $ref: '#/components/schemas/PaymentMethodInfo'
            - type: 'null'
        payment_type:
          $ref: '#/components/schemas/PaymentTypeEnum'
        processed_at:
          type:
            - string
            - 'null'
          format: date-time
        provider_transaction_id:
          type:
            - string
            - 'null'
        refund_mode:
          oneOf:
            - $ref: '#/components/schemas/RefundMode'
            - type: 'null'
        reversal_kind:
          oneOf:
            - $ref: '#/components/schemas/ReversalKind'
            - type: 'null'
        reversal_reason:
          type:
            - string
            - 'null'
          description: >-
            The provider's raw cause, or what the operator typed when reversing
            by hand.
        status:
          $ref: '#/components/schemas/PaymentStatusEnum'
    ErrorCode:
      type: string
      enum:
        - BAD_REQUEST
        - NOT_FOUND
        - CONFLICT
        - FORBIDDEN
        - UNAUTHORIZED
        - TOKEN_EXPIRED
        - TOO_MANY_REQUESTS
        - INTERNAL_SERVER_ERROR
    Address:
      type: object
      properties:
        city:
          type:
            - string
            - 'null'
        country:
          oneOf:
            - $ref: '#/components/schemas/CountryCode'
            - type: 'null'
        line1:
          type:
            - string
            - 'null'
        line2:
          type:
            - string
            - 'null'
        state:
          type:
            - string
            - 'null'
        zip_code:
          type:
            - string
            - 'null'
    InvoiceLineCreditUnit:
      type: object
      description: >-
        How a usage line priced in a credit unit was paid: the credits it
        consumed, those the

        customer's balance in the unit covered, and the rate the rest was billed
        at.
      required:
        - code
        - precision
        - rate
        - consumed
        - covered
      properties:
        code:
          type: string
          description: The credit unit's code, e.g. `CREDITS`.
        consumed:
          type: integer
          format: int64
          description: Credits the usage priced.
        covered:
          type: integer
          format: int64
          description: Of which paid by the customer's credit wallet.
        precision:
          type: integer
          format: int32
          description: Credit amounts are integers in 10^-precision credit.
          minimum: 0
        rate:
          type: string
          format: decimal
          description: Invoice-currency major units per credit.
        unit_price:
          type:
            - string
            - 'null'
          format: decimal
          description: Credits per usage unit.
    SubLineItem:
      type: object
      required:
        - id
        - name
        - total
        - quantity
        - unit_price
      properties:
        id:
          type: string
        name:
          type: string
        quantity:
          type: string
          format: decimal
        total:
          type: integer
          format: int64
        unit_price:
          type: string
          format: decimal
    TaxExemptionType:
      type: string
      enum:
        - REVERSE_CHARGE
        - TAX_EXEMPT
        - NOT_REGISTERED
        - EXPORT
        - NO_VAT_TERRITORY
    CreditNoteId:
      type: string
      format: MeteroidId
      examples:
        - crn_7n42DGM5Tflk9n8mt7Fhc7
    PaymentTransactionId:
      type: string
      format: MeteroidId
      examples:
        - pay_7n42DGM5Tflk9n8mt7Fhc7
    CustomerPaymentMethodId:
      type: string
      format: MeteroidId
      examples:
        - pm_7n42DGM5Tflk9n8mt7Fhc7
    PaymentMethodInfo:
      type: object
      required:
        - payment_method_type
      properties:
        account_number_hint:
          type:
            - string
            - 'null'
        card_brand:
          type:
            - string
            - 'null'
        card_last4:
          type:
            - string
            - 'null'
        payment_method_type:
          $ref: '#/components/schemas/PaymentMethodTypeEnum'
    PaymentTypeEnum:
      type: string
      enum:
        - PAYMENT
        - REFUND
    RefundMode:
      type: string
      description: >-
        How a voluntary refund was issued: through the provider, or recorded
        after a wire or cash

        movement made outside Meteroid.
      enum:
        - ONLINE
        - OFFLINE
    ReversalKind:
      type: string
      description: Why a payment was involuntarily clawed back.
      enum:
        - REFUND
        - CHARGEBACK
        - DEBTOR_RECALL
        - INSUFFICIENT_FUNDS
        - MANDATE_INVALID
        - RETURNED
        - DISPUTE
        - OTHER
    PaymentStatusEnum:
      type: string
      enum:
        - READY
        - PENDING
        - SETTLED
        - CANCELLED
        - FAILED
        - REFUNDED
    CountryCode:
      type: string
      format: CountryCode
      examples:
        - US
        - GB
        - FR
    PaymentMethodTypeEnum:
      type: string
      enum:
        - CARD
        - BANK_TRANSFER
        - WALLET
        - OTHER
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````

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