Table of Contents

Struct CreateSubAccountRequest

Namespace
Vonage.SubAccounts.CreateSubAccount
Assembly
Vonage.dll

Represents a request to create a new subaccount under the primary account.

[Builder(new string[] { })]
public readonly struct CreateSubAccountRequest : IVonageRequest
Implements
Inherited Members

Properties

Name

Sets the name of the subaccount; limited to 80 characters.

[JsonPropertyOrder(0)]
[Mandatory(0)]
public string Name { get; }

Property Value

string

Examples

.WithName("Department A")

Secret

Sets the API secret for the subaccount. If not provided, a secret will be auto-generated.

[JsonPropertyOrder(2)]
[JsonConverter(typeof(MaybeJsonConverter<string>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<string> Secret { get; }

Property Value

Maybe<string>

Examples

.WithSecret("MySecurePassword123")

UsePrimaryAccountBalance

Disables balance sharing with the primary account. By default, subaccounts share the primary account's balance.

[JsonPropertyOrder(1)]
[JsonPropertyName("use_primary_account_balance")]
[OptionalBoolean(true, "DisableSharedAccountBalance")]
public bool UsePrimaryAccountBalance { get; }

Property Value

bool

Examples

.DisableSharedAccountBalance()

Methods

Build()

public static IBuilderForName Build()

Returns

IBuilderForName

BuildRequestMessage()

Converts the request to a HttpRequest.

public HttpRequestMessage BuildRequestMessage()

Returns

HttpRequestMessage

The Http request.