Class: ModernTreasury::Models::Invoice

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/modern_treasury/models/invoice.rb

Overview

Defined Under Namespace

Modules: PaymentMethod, PaymentType, Status Classes: CounterpartyBillingAddress, CounterpartyShippingAddress, InvoicerAddress

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(country:, line1:, locality:, postal_code:, region:, line2: nil) ⇒ Object

The invoice issuer’s business address.

Parameters:

  • country (String)

    Country code conforms to [ISO 3166-1 alpha-2]

  • line1 (String)
  • locality (String)

    Locality or City.

  • postal_code (String)

    The postal code of the address.

  • region (String)

    Region or State.

  • line2 (String) (defaults to: nil)


# File 'lib/modern_treasury/models/invoice.rb', line 273

Instance Attribute Details

#amount_paidInteger

Amount paid on the invoice in specified currency’s smallest unit, e.g., $10 USD would be represented as 1000.

Returns:

  • (Integer)


17
# File 'lib/modern_treasury/models/invoice.rb', line 17

required :amount_paid, Integer

#amount_remainingInteger

Amount remaining due on the invoice in specified currency’s smallest unit, e.g., $10 USD would be represented as 1000.

Returns:

  • (Integer)


24
# File 'lib/modern_treasury/models/invoice.rb', line 24

required :amount_remaining, Integer

#contact_detailsArray<ModernTreasury::Models::ContactDetail>

The invoicer’s contact details displayed at the top of the invoice.



30
# File 'lib/modern_treasury/models/invoice.rb', line 30

required :contact_details, -> { ModernTreasury::Internal::Type::ArrayOf[ModernTreasury::ContactDetail] }

#counterparty_billing_addressModernTreasury::Models::Invoice::CounterpartyBillingAddress?

The counterparty’s billing address.



36
37
38
# File 'lib/modern_treasury/models/invoice.rb', line 36

required :counterparty_billing_address,
-> { ModernTreasury::Invoice::CounterpartyBillingAddress },
nil?: true

#counterparty_idString

The ID of the counterparty receiving the invoice.

Returns:

  • (String)


44
# File 'lib/modern_treasury/models/invoice.rb', line 44

required :counterparty_id, String

#counterparty_shipping_addressModernTreasury::Models::Invoice::CounterpartyShippingAddress?

The counterparty’s shipping address where physical goods should be delivered.



50
51
52
# File 'lib/modern_treasury/models/invoice.rb', line 50

required :counterparty_shipping_address,
-> { ModernTreasury::Invoice::CounterpartyShippingAddress },
nil?: true

#created_atTime

Returns:

  • (Time)


57
# File 'lib/modern_treasury/models/invoice.rb', line 57

required :created_at, Time

#currencySymbol, ModernTreasury::Models::Currency

Currency that the invoice is denominated in. Defaults to ‘USD` if not provided.



63
# File 'lib/modern_treasury/models/invoice.rb', line 63

required :currency, enum: -> { ModernTreasury::Currency }

#descriptionString

An optional free-form description of the invoice.

Returns:

  • (String)


69
# File 'lib/modern_treasury/models/invoice.rb', line 69

required :description, String

#due_dateTime

A future date by when the invoice needs to be paid.

Returns:

  • (Time)


75
# File 'lib/modern_treasury/models/invoice.rb', line 75

required :due_date, Time

#expected_paymentsArray<ModernTreasury::Models::ExpectedPayment>

The expected payments created for an unpaid invoice.



81
82
# File 'lib/modern_treasury/models/invoice.rb', line 81

required :expected_payments,
-> { ModernTreasury::Internal::Type::ArrayOf[ModernTreasury::ExpectedPayment] }

#fallback_payment_methodString?

When payment_method is automatic, the fallback payment method to use when an automatic payment fails. One of ‘manual` or `ui`.

Returns:

  • (String, nil)


89
# File 'lib/modern_treasury/models/invoice.rb', line 89

required :fallback_payment_method, String, nil?: true

#hosted_urlString

The URL of the hosted web UI where the invoice can be viewed.

Returns:

  • (String)


95
# File 'lib/modern_treasury/models/invoice.rb', line 95

required :hosted_url, String

#idString

Returns:

  • (String)


10
# File 'lib/modern_treasury/models/invoice.rb', line 10

required :id, String

#invoicer_addressModernTreasury::Models::Invoice::InvoicerAddress?

The invoice issuer’s business address.



101
# File 'lib/modern_treasury/models/invoice.rb', line 101

required :invoicer_address, -> { ModernTreasury::Invoice::InvoicerAddress }, nil?: true

#invoicer_nameString?

The name of the issuer for the invoice. Defaults to the name of the Organization.

Returns:

  • (String, nil)


108
# File 'lib/modern_treasury/models/invoice.rb', line 108

required :invoicer_name, String, nil?: true

#issued_atTime?

Translation missing: en.openapi.descriptions.invoice.schema.issued_at

Returns:

  • (Time, nil)


114
# File 'lib/modern_treasury/models/invoice.rb', line 114

required :issued_at, Time, nil?: true

#ledger_account_settlement_idString?

Deprecated.

The ledger account settlement object linked to the invoice.

Returns:

  • (String, nil)


122
# File 'lib/modern_treasury/models/invoice.rb', line 122

required :ledger_account_settlement_id, String, nil?: true

#live_modeBoolean

This field will be true if this object exists in the live environment or false if it exists in the test environment.

Returns:

  • (Boolean)


129
# File 'lib/modern_treasury/models/invoice.rb', line 129

required :live_mode, ModernTreasury::Internal::Type::Boolean

#metadataHash{Symbol=>String}?

Additional data represented as key-value pairs. Both the key and value must be strings.

Returns:

  • (Hash{Symbol=>String}, nil)


136
# File 'lib/modern_treasury/models/invoice.rb', line 136

required :metadata, ModernTreasury::Internal::Type::HashOf[String], nil?: true

#notification_email_addressesArray<String>?

Emails in addition to the counterparty email to send invoice status notifications to. At least one email is required if notifications are enabled and the counterparty doesn’t have an email.

Returns:

  • (Array<String>, nil)


144
# File 'lib/modern_treasury/models/invoice.rb', line 144

required :notification_email_addresses, ModernTreasury::Internal::Type::ArrayOf[String], nil?: true

#notifications_enabledBoolean

If true, the invoice will send email notifications to the invoice recipients about invoice status changes.

Returns:

  • (Boolean)


151
# File 'lib/modern_treasury/models/invoice.rb', line 151

required :notifications_enabled, ModernTreasury::Internal::Type::Boolean

#numberString

A unique record number assigned to each invoice that is issued.

Returns:

  • (String)


157
# File 'lib/modern_treasury/models/invoice.rb', line 157

required :number, String

#objectString

Returns:

  • (String)


162
# File 'lib/modern_treasury/models/invoice.rb', line 162

required :object, String

#originating_account_idString

The ID of the internal account the invoice should be paid to.

Returns:

  • (String)


168
# File 'lib/modern_treasury/models/invoice.rb', line 168

required :originating_account_id, String

Translation missing: en.openapi.descriptions.invoice.schema.paid_at

Returns:

  • (Time, nil)


174
# File 'lib/modern_treasury/models/invoice.rb', line 174

required :paid_at, Time, nil?: true

#payment_effective_dateDate?

Date transactions are to be posted to the participants’ account. Defaults to the current business day or the next business day if the current day is a bank holiday or weekend. Format: yyyy-mm-dd.

Returns:

  • (Date, nil)


182
# File 'lib/modern_treasury/models/invoice.rb', line 182

required :payment_effective_date, Date, nil?: true

#payment_methodSymbol, ...

When opening an invoice, whether to show the embedded payment UI , automatically debit the recipient, or rely on manual payment from the recipient.



189
# File 'lib/modern_treasury/models/invoice.rb', line 189

required :payment_method, enum: -> { ModernTreasury::Invoice::PaymentMethod }, nil?: true

#payment_ordersArray<ModernTreasury::Models::PaymentOrder>

The payment orders created for paying the invoice through the invoice payment UI.



196
# File 'lib/modern_treasury/models/invoice.rb', line 196

required :payment_orders, -> { ModernTreasury::Internal::Type::ArrayOf[ModernTreasury::PaymentOrder] }

#payment_typeSymbol, ...

One of ‘ach` or `eft`.



202
# File 'lib/modern_treasury/models/invoice.rb', line 202

required :payment_type, enum: -> { ModernTreasury::Invoice::PaymentType }, nil?: true

#pdf_urlString?

The URL where the invoice PDF can be downloaded.

Returns:

  • (String, nil)


208
# File 'lib/modern_treasury/models/invoice.rb', line 208

required :pdf_url, String, nil?: true

#receiving_account_idString?

The receiving account ID. Can be an ‘internal_account`.

Returns:

  • (String, nil)


214
# File 'lib/modern_treasury/models/invoice.rb', line 214

required :receiving_account_id, String, nil?: true

#recipient_emailString?

The email of the recipient of the invoice. Leaving this value as null will fallback to using the counterparty’s name.

Returns:

  • (String, nil)


221
# File 'lib/modern_treasury/models/invoice.rb', line 221

required :recipient_email, String, nil?: true

#recipient_nameString?

The name of the recipient of the invoice. Leaving this value as null will fallback to using the counterparty’s name.

Returns:

  • (String, nil)


228
# File 'lib/modern_treasury/models/invoice.rb', line 228

required :recipient_name, String, nil?: true

#remind_after_overdue_daysArray<Integer>?

Number of days after due date when overdue reminder emails will be sent out to invoice recipients.

Returns:

  • (Array<Integer>, nil)


235
# File 'lib/modern_treasury/models/invoice.rb', line 235

required :remind_after_overdue_days, ModernTreasury::Internal::Type::ArrayOf[Integer], nil?: true

#statusSymbol, ModernTreasury::Models::Invoice::Status

The status of the invoice.



241
# File 'lib/modern_treasury/models/invoice.rb', line 241

required :status, enum: -> { ModernTreasury::Invoice::Status }

#total_amountInteger

Total amount due in specified currency’s smallest unit, e.g., $10 USD would be represented as 1000.

Returns:

  • (Integer)


248
# File 'lib/modern_treasury/models/invoice.rb', line 248

required :total_amount, Integer

#transaction_line_item_idsArray<String>

IDs of transaction line items associated with an invoice.

Returns:

  • (Array<String>)


254
# File 'lib/modern_treasury/models/invoice.rb', line 254

required :transaction_line_item_ids, ModernTreasury::Internal::Type::ArrayOf[String]

#updated_atTime

Returns:

  • (Time)


259
# File 'lib/modern_treasury/models/invoice.rb', line 259

required :updated_at, Time

#virtual_account_idString?

The ID of the virtual account the invoice should be paid to.

Returns:

  • (String, nil)


265
# File 'lib/modern_treasury/models/invoice.rb', line 265

required :virtual_account_id, String, nil?: true

#voided_atTime?

Translation missing: en.openapi.descriptions.invoice.schema.voided_at

Returns:

  • (Time, nil)


271
# File 'lib/modern_treasury/models/invoice.rb', line 271

required :voided_at, Time, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/modern_treasury/models/invoice.rb', line 526