> ## 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.

# Refresh invoice

> Recompute a draft invoice against current usage, credits, coupons and tax, and return it.
Drafts are also refreshed periodically in the background; use this to force it, e.g. after
ingesting late events. Rejected while a payment for the invoice is in progress or when the
invoice was merged into a consolidated parent.



## OpenAPI

````yaml https://api.meteroid.com/api-docs/openapi.json post /api/v1/invoices/{invoice_id}/refresh
openapi: 3.1.0
info:
  title: meteroid
  description: ''
  license:
    name: LicenseRef-Proprietary
    identifier: LicenseRef-Proprietary
  version: 0.1.0
servers: []
security: []
tags:
  - name: Meteroid
    description: Meteroid API
  - name: Add-ons
  - name: Batch Jobs
  - name: Checkout Sessions
  - name: Connect
    description: Manage connected accounts (Express & Standard)
  - name: Coupons
  - name: Credit Notes
  - name: Custom Properties
  - name: Customers
  - name: Entitlements
  - name: Events
  - name: Features
  - name: Invoices
  - 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
paths:
  /api/v1/invoices/{invoice_id}/refresh:
    post:
      tags:
        - Invoices
      summary: Refresh invoice
      description: >-
        Recompute a draft invoice against current usage, credits, coupons and
        tax, and return it.

        Drafts are also refreshed periodically in the background; use this to
        force it, e.g. after

        ingesting late events. Rejected while a payment for the invoice is in
        progress or when the

        invoice was merged into a consolidated parent.
      operationId: refresh_invoice
      parameters:
        - name: invoice_id
          in: path
          description: Invoice ID
          required: true
          schema:
            $ref: '#/components/schemas/InvoiceId'
          example: inv_123
      responses:
        '200':
          description: Refreshed invoice
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invoice'
        '400':
          description: Invoice cannot be refreshed
          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
    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
        - custom_properties
      properties:
        amount_due:
          type: integer
          format: int64
        applied_credits:
          type: integer
          format: int64
        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_status:
          $ref: '#/components/schemas/InvoicePaymentStatus'
        purchase_order:
          type:
            - string
            - 'null'
        reference:
          type:
            - string
            - 'null'
        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
        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_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.
        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'
    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

````