Class: MetronomeSDK::Resources::V1::Invoices

Inherits:
Object
  • Object
show all
Defined in:
lib/metronome_sdk/resources/v1/invoices.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Invoices

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Invoices.

Parameters:



75
76
77
# File 'lib/metronome_sdk/resources/v1/invoices.rb', line 75

def initialize(client:)
  @client = client
end

Instance Method Details

#regenerate(id: , request_options: {}) ⇒ MetronomeSDK::Models::V1::InvoiceRegenerateResponse

This endpoint regenerates a voided invoice and recalculates the invoice based on up-to-date rates, available balances, and other fees regardless of the billing period.

### Use this endpoint to:

Recalculate an invoice with updated rate terms, available balance, and fees to correct billing disputes or discrepancies

### Key response fields:

The regenerated invoice id, which is distinct from the previously voided invoice.

### Usage guidelines:

If an invoice is attached to a contract with a billing provider on it, the regenerated invoice will be distributed based on the configuration.

Parameters:

Returns:

See Also:



35
36
37
38
39
40
41
42
43
44
# File 'lib/metronome_sdk/resources/v1/invoices.rb', line 35

def regenerate(params)
  parsed, options = MetronomeSDK::V1::InvoiceRegenerateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/invoices/regenerate",
    body: parsed,
    model: MetronomeSDK::Models::V1::InvoiceRegenerateResponse,
    options: options
  )
end

#void(id: , request_options: {}) ⇒ MetronomeSDK::Models::V1::InvoiceVoidResponse

Permanently cancels an invoice by setting its status to voided, preventing collection and removing it from customer billing. Use this to correct billing errors, cancel incorrect charges, or handle disputed invoices that should not be collected. Returns the voided invoice ID with the status change applied immediately to stop any payment processing.

Parameters:

Returns:

See Also:



61
62
63
64
65
66
67
68
69
70
# File 'lib/metronome_sdk/resources/v1/invoices.rb', line 61

def void(params)
  parsed, options = MetronomeSDK::V1::InvoiceVoidParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/invoices/void",
    body: parsed,
    model: MetronomeSDK::Models::V1::InvoiceVoidResponse,
    options: options
  )
end