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

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

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 721

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.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


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

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.

Parameters:

  • value (WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress, nil)

Returns:



637
638
639
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 637

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

#charge_buyer_feeBoolean?

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

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


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

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.

Parameters:

  • value (WhopSDK::Models::collection_method)

Returns:



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

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

#company_idString

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

Parameters:

  • value (String)

Returns:

  • (String)


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

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :customer_name, String, nil?: true

#due_dateTime?

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

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


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

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

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.

Parameters:

  • value (::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::LineItem], nil)

Returns:



673
674
675
676
677
# File 'lib/whop_sdk/models/invoice_create_params.rb', line 673

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

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.

Parameters:

  • value (WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan)

Returns:



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

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

#product_idString

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

Parameters:

  • value (String)

Returns:

  • (String)


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

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.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


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

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.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


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

optional :subscription_billing_anchor_at, Time, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


469
# File 'sig/whop_sdk/models/invoice_create_params.rbs', line 469

def to_hash: -> {