Class: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID

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

Defined Under Namespace

Classes: BillingAddress, LineItem, Plan

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 705

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)


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

optional :automatically_finalizes_at, Time, nil?: true

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

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



621
622
623
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 621

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

#charge_buyer_feeBoolean?

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

Returns:

  • (Boolean, nil)


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

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.



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

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

#company_idString

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

Returns:

  • (String)


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

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)


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

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)


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

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)


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

optional :email_address, String, nil?: true

#line_itemsArray<WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::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.



657
658
659
660
661
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 657

optional :line_items,
-> {
  WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::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)


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

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)


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

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)


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

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)


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

optional :payment_token_id, String, nil?: true

#planWhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan

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



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

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

#product_idString

The unique identifier of an existing product to create this invoice for.

Returns:

  • (String)


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

required :product_id, String

#save_as_draftBoolean?

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

Returns:

  • (Boolean, nil)


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

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)


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

optional :subscription_billing_anchor_at, Time, nil?: true