Class: MetronomeSDK::Resources::V1::Invoices
- Inherits:
-
Object
- Object
- MetronomeSDK::Resources::V1::Invoices
- Defined in:
- lib/metronome_sdk/resources/v1/invoices.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Invoices
constructor
private
A new instance of Invoices.
-
#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.
-
#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.
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.
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.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/metronome_sdk/resources/v1/invoices.rb', line 35 def regenerate(params) parsed, = MetronomeSDK::V1::InvoiceRegenerateParams.dump_request(params) @client.request( method: :post, path: "v1/invoices/regenerate", body: parsed, model: MetronomeSDK::Models::V1::InvoiceRegenerateResponse, 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.
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/metronome_sdk/resources/v1/invoices.rb', line 61 def void(params) parsed, = MetronomeSDK::V1::InvoiceVoidParams.dump_request(params) @client.request( method: :post, path: "v1/invoices/void", body: parsed, model: MetronomeSDK::Models::V1::InvoiceVoidResponse, options: ) end |