Class: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/invoice_create_params.rb

Defined Under Namespace

Classes: BillingAddress, LineItem, Plan, Product

Instance Attribute 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(city: nil, country: nil, line1: nil, line2: nil, name: nil, phone: nil, postal_code: nil, state: nil, tax_id_type: nil, tax_id_value: nil) ⇒ Object

Inline billing address to create a new mailing address for this invoice. Cannot be used together with mailing_address_id.

Parameters:

  • city (String, nil) (defaults to: nil)

    The city of the address.

  • country (String, nil) (defaults to: nil)

    The country of the address.

  • line1 (String, nil) (defaults to: nil)

    The line 1 of the address.

  • line2 (String, nil) (defaults to: nil)

    The line 2 of the address.

  • name (String, nil) (defaults to: nil)

    The name of the customer.

  • phone (String, nil) (defaults to: nil)

    The phone number of the customer.

  • postal_code (String, nil) (defaults to: nil)

    The postal code of the address.

  • state (String, nil) (defaults to: nil)

    The state of the address.

  • tax_id_type (Symbol, WhopSDK::Models::TaxIdentifierType, nil) (defaults to: nil)

    The type of tax identifier

  • tax_id_value (String, nil) (defaults to: nil)

    The value of the tax identifier.



# File 'lib/whop_sdk/models/invoice_create_params.rb', line 156

Instance Attribute Details

#automatically_finalizes_atTime?

The date and time when the invoice will be automatically finalized. For charge_automatically, triggers an automatic charge. For send_invoice, sends the invoice email to the customer at the specified time.

Returns:

  • (Time, nil)


65
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 65

optional :automatically_finalizes_at, Time, nil?: true

#billing_addressWhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress?

Inline billing address to create a new mailing address for this invoice. Cannot be used together with mailing_address_id.



72
73
74
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 72

optional :billing_address,
-> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress },
nil?: true

#charge_buyer_feeBoolean?

Whether to charge the customer a buyer fee on this invoice.

Returns:

  • (Boolean, nil)


80
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 80

optional :charge_buyer_fee, WhopSDK::Internal::Type::Boolean, nil?: true

#collection_methodSymbol, WhopSDK::Models::CollectionMethod

How the invoice should be collected. Use charge_automatically to charge a stored payment method, or send_invoice to email the customer.



37
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 37

required :collection_method, enum: -> { WhopSDK::CollectionMethod }

#company_idString

The unique identifier of the company to create this invoice for.

Returns:

  • (String)


43
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 43

required :company_id, String

#customer_nameString?

The name of the customer. Required when creating an invoice for a customer who is not yet a member of the company.

Returns:

  • (String, nil)


87
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 87

optional :customer_name, String, nil?: true

#due_dateTime?

The date by which the invoice must be paid. Required unless save_as_draft is true.

Returns:

  • (Time, nil)


94
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 94

optional :due_date, Time, nil?: true

#email_addressString?

The email address of the customer. Required when creating an invoice for a customer who is not yet a member of the company.

Returns:

  • (String, nil)


101
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 101

optional :email_address, String, nil?: true

#line_itemsArray<WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem>?

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price.



108
109
110
111
112
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 108

optional :line_items,
-> {
  WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem]
},
nil?: true

#mailing_address_idString?

The unique identifier of an existing mailing address to attach to this invoice. Cannot be used together with billing_address.

Returns:

  • (String, nil)


119
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 119

optional :mailing_address_id, String, nil?: true

#member_idString?

The unique identifier of an existing member to create this invoice for. If not provided, you must supply an email_address and customer_name.

Returns:

  • (String, nil)


126
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 126

optional :member_id, String, nil?: true

#payment_method_idString?

The unique identifier of the payment method to charge. Required when collection_method is charge_automatically.

Returns:

  • (String, nil)


133
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 133

optional :payment_method_id, String, nil?: true

#payment_token_idString?

The payment token ID to use for this invoice. If using charge_automatically, you must provide a payment_token.

Returns:

  • (String, nil)


140
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 140

optional :payment_token_id, String, nil?: true

#planWhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan

The plan attributes defining the price, currency, and billing interval for this invoice.



50
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 50

required :plan, -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan }

#productWhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product

The properties of the product to create for this invoice. Provide this to create a new product inline.



57
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 57

required :product, -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product }

#save_as_draftBoolean?

When true, creates the invoice as a draft without sending or charging. Relaxes customer and due date requirements.

Returns:

  • (Boolean, nil)


147
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 147

optional :save_as_draft, WhopSDK::Internal::Type::Boolean, nil?: true

#subscription_billing_anchor_atTime?

The date that defines when the subscription billing cycle should start. When set on a renewal plan invoice, this anchors all future billing periods to this date.

Returns:

  • (Time, nil)


154
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 154

optional :subscription_billing_anchor_at, Time, nil?: true