Update a billing account
PreviewPATCH
/user/v1/billingAccount
Update the default billing account.
query parameters
The identifier of the organization.
If not specified the billing account for the user is used.
body parameters
The human-readable display name of the billing account.
The maximum length is 200 characters.
This might be further restricted by the billing provider.
The email address of the billing account.
The maximum length is 320 characters.
This might be further restricted by the billing provider.
The E164 phone number of the billing account (e.g. +12125550123
).
The address for the billing account.
The city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
Returns
The status of the billing account.
Possible values:USER_MANAGED
ADMIN_MANAGED
UNMANAGED
BROKEN
NOT_SETUP
The human-readable display name of the billing account.
The email address of the billing account.
The E164 phone number for the billing account (e.g. +12125550123
).
The billing address for the billing account.
The city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
The ISO-4217 currency code for the billing account (e.g. USD
).
The balance amount for the account.
A negative value indicates an amount which will be subtracted from the next invoice (credit).
A positive value indicates an amount which will be added to the next invoice (debt).
checkouts
BillingAccountCheckout[]
Possible values:CHANGE
START_TRIAL
CONVERT_TRIAL
START_PAID
UPGRADE_PLAN
DOWNGRADE_PLAN
CHANGE_TERMS
SWITCH_TO_MONTHLY
SWITCH_TO_YEARLY
CHANGE_SEATS
CHANGE_PAYMENT_METHOD
CANCEL
RESTART
paymentMethods
PaymentMethod[]
The default and latest 10 payment methods for the account.
The system-assigned identifier of the payment method.
Possible values:CARD
UNKNOWN
A human-readable description of the payment method.
This can be used to show a description of the payment method when the type is UNKNOWN or not explicitly handled.
The full name of the owner of the payment method.
The address for the payment method.
The city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
Whether the payment method is the default for the account.
The last payment error.
This will be unset if the payment method is updated or if a payment succeeds.
The general error code (e.g. INVALID_ARGUMENT
).
Possible values:OK
CANCELLED
UNKNOWN
INVALID_ARGUMENT
DEADLINE_EXCEEDED
NOT_FOUND
ALREADY_EXISTS
PERMISSION_DENIED
UNAUTHENTICATED
RESOURCE_EXHAUSTED
FAILED_PRECONDITION
ABORTED
OUT_OF_RANGE
UNIMPLEMENTED
INTERNAL
UNAVAILABLE
DATA_LOSS
A developer-facing error message.
A reason code for the error (e.g. USER_PENDING_DELETION
).
The parameter path related to the error (e.g. member.userId
).
Additional metadata related to the error.
A user-facing error message.
Card payment method (e.g. Visa credit card).
The brand of the card (e.g. VISA
).
Possible values:AMERICAN_EXPRESS
DINERS_CLUB
DISCOVER
JCB
MASTERCARD
UNIONPAY
VISA
The last for digits of the card.
The funding method for the card (e.g. DEBIT
)
Possible values:CREDIT
DEBIT
PREPAID
The creation time of the payment method connection.
The last update time of the payment method connection.
The subscription for the account.
The system-assigned identifier of the subscription.
The status of the subscription.
Possible values:TRIALING
CHECKOUT_ISSUE
ACTIVE
PAST_DUE
PAUSED
CANCELED
The currency code for the subscription (e.g. USD
).
The system-assigned identifier of the plan.
Possible values:AVAILABLE
UNAVAILABLE
The client defined unique identifier of the plan.
The description of the plan.
The tier for the plan.
This is only available in checkout and pricing.
Possible values:FREE
TIER1
TIER2
TIER3
TIER4
TIER5
ENTERPRISE
The currency code for the plan (e.g. USD
).
The billing interval for the plan.
Possible values:DAY
WEEK
MONTH
YEAR
The revision for the plan.
The system-assigned identifier of the plan revision.
Whether this is the current revision for the subscription.
This is only set in checkout.
Whether this is the selected revision.
This is only set in checkout.
Whether this is the latest revision for the plan.
This is only set for a current or selected plan in checkout.
Whether this is the current plan for the subscription.
This is only set in checkout.
Whether this is the selected plan.
This is only set in checkout.
Whether this is the default term for the plan.
The trial settings.
For authenticated requests, this will only be set for accounts that are eligible for a new trial.
The number of days in the trial.
Whether the change is considered an upgrade or a downgrade.
This is only set in checkout.
Possible values:UPGRADE
DOWNGRADE
The savings for the plan.
The savings are in comparison to the plan in the revision with the shortest billing interval (normally monthly).
The percentage savings (1-100).
This percentage is rounded down.
The items associated with plan.
Possible values:PLAN
PLAN_ADDON
SEAT
The product associated with the item.
The system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
The price associated with the item.
The system-assigned identifier of the price.
The currency for the price.
The billing mode for the price.
Possible values:FIXED_TERM
USAGE_BASED
The billing interval for the price.
Possible values:DAY
WEEK
MONTH
YEAR
The price is fixed per quantity.
The decimal amount for the defined currency (e.g. 9.95
).
Whether to transform the quantity before multiplying amount.
The amount to divide the quantity by.
Whether to round the result up or down.
The price is dependent on the quantity.
The strategy for evaluating the tiers.
Possible values:GRADUATED
VOLUME
tiers
PriceTieredPriceTier[]
The upper quantity for tier (inclusive).
The per quantity amount for the tier.
The flat amount for the tier.
paymentMethod
PaymentMethod
The system-assigned identifier of the payment method.
Possible values:CARD
UNKNOWN
A human-readable description of the payment method.
This can be used to show a description of the payment method when the type is UNKNOWN or not explicitly handled.
The full name of the owner of the payment method.
The address for the payment method.
The city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
Whether the payment method is the default for the account.
The last payment error.
This will be unset if the payment method is updated or if a payment succeeds.
The general error code (e.g. INVALID_ARGUMENT
).
Possible values:OK
CANCELLED
UNKNOWN
INVALID_ARGUMENT
DEADLINE_EXCEEDED
NOT_FOUND
ALREADY_EXISTS
PERMISSION_DENIED
UNAUTHENTICATED
RESOURCE_EXHAUSTED
FAILED_PRECONDITION
ABORTED
OUT_OF_RANGE
UNIMPLEMENTED
INTERNAL
UNAVAILABLE
DATA_LOSS
A developer-facing error message.
A reason code for the error (e.g. USER_PENDING_DELETION
).
The parameter path related to the error (e.g. member.userId
).
Additional metadata related to the error.
A user-facing error message.
Card payment method (e.g. Visa credit card).
The brand of the card (e.g. VISA
).
Possible values:AMERICAN_EXPRESS
DINERS_CLUB
DISCOVER
JCB
MASTERCARD
UNIONPAY
VISA
The last for digits of the card.
The funding method for the card (e.g. DEBIT
)
Possible values:CREDIT
DEBIT
PREPAID
The creation time of the payment method connection.
The last update time of the payment method connection.
The subscription is scheduled to be canceled at the end of the current billing period.
cancelPeriodEnd
boolean
DeprecatedThe subscription is scheduled to be canceled at the end of the current billing period.
The time the subscription started.
The time the subscription ends/ended.
The trial information for the subscription.
The time the trial started.
The time the trial ended/ends.
The number of days in the trial.
This number is rounded to the nearest whole number of days.
The number of days remaining in the trial.
This number is rounded down, so will generally be less than days. It will be zero on the last day of the trial and null when the trial expires.
currentPeriod
SubscriptionCurrentPeriod
The current billing period for the subscription.
The time the current billing period started.
The time the current billing period ends.
The identifier of the item.
The details of the associated product.
The system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
The details of the associated price.
The system-assigned identifier of the price.
The currency for the price.
The billing mode for the price.
Possible values:FIXED_TERM
USAGE_BASED
The billing interval for the price.
Possible values:DAY
WEEK
MONTH
YEAR
The price is fixed per quantity.
The decimal amount for the defined currency (e.g. 9.95
).
Whether to transform the quantity before multiplying amount.
The amount to divide the quantity by.
Whether to round the result up or down.
The price is dependent on the quantity.
The strategy for evaluating the tiers.
Possible values:GRADUATED
VOLUME
tiers
PriceTieredPriceTier[]
The upper quantity for tier (inclusive).
The per quantity amount for the tier.
The flat amount for the tier.
The quantity for the item.
seats
SubscriptionSeatInfo[]
The information about the various seats available in the subscription.
Whether a seat can be assigned or reserved.
Possible values:AVAILABLE
UNAVAILABLE
PROVISIONABLE
The code that best describes the reason for the state.
The subscription item product.
The system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
The number of seats expected to be invoiced for the current billing period.
This might be less than the total quantity while a subscription change is pending or if the subscription is over-provisioned.
The number of seats expected at renewal.
This will only be set when different from current quantity.
The number of seats currently assigned.
The number of seats not assigned.
The number of seats currently reserved because of pending invitations.
These can be made available by cancelling outstanding invitations.
The number of seats which can be assigned or reserved.
The total number of seats associated with the subscription.
The creation time of the subscription.
The last update time of the subscription.
The status of the billing account.
Possible values:USER_MANAGED
ADMIN_MANAGED
UNMANAGED
BROKEN
NOT_SETUP
The human-readable display name of the billing account.
The email address of the billing account.
The E164 phone number for the billing account (e.g. +12125550123
).
The billing address for the billing account.
The city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
The ISO-4217 currency code for the billing account (e.g. USD
).
The balance amount for the account.
A negative value indicates an amount which will be subtracted from the next invoice (credit).
A positive value indicates an amount which will be added to the next invoice (debt).
checkouts
BillingAccountCheckout[]
Possible values:CHANGE
START_TRIAL
CONVERT_TRIAL
START_PAID
UPGRADE_PLAN
DOWNGRADE_PLAN
CHANGE_TERMS
SWITCH_TO_MONTHLY
SWITCH_TO_YEARLY
CHANGE_SEATS
CHANGE_PAYMENT_METHOD
CANCEL
RESTART
paymentMethods
PaymentMethod[]
The default and latest 10 payment methods for the account.
The system-assigned identifier of the payment method.
Possible values:CARD
UNKNOWN
A human-readable description of the payment method.
This can be used to show a description of the payment method when the type is UNKNOWN or not explicitly handled.
The full name of the owner of the payment method.
The address for the payment method.
The city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
Whether the payment method is the default for the account.
The last payment error.
This will be unset if the payment method is updated or if a payment succeeds.
The general error code (e.g. INVALID_ARGUMENT
).
Possible values:OK
CANCELLED
UNKNOWN
INVALID_ARGUMENT
DEADLINE_EXCEEDED
NOT_FOUND
ALREADY_EXISTS
PERMISSION_DENIED
UNAUTHENTICATED
RESOURCE_EXHAUSTED
FAILED_PRECONDITION
ABORTED
OUT_OF_RANGE
UNIMPLEMENTED
INTERNAL
UNAVAILABLE
DATA_LOSS
A developer-facing error message.
A reason code for the error (e.g. USER_PENDING_DELETION
).
The parameter path related to the error (e.g. member.userId
).
Additional metadata related to the error.
A user-facing error message.
Card payment method (e.g. Visa credit card).
The brand of the card (e.g. VISA
).
Possible values:AMERICAN_EXPRESS
DINERS_CLUB
DISCOVER
JCB
MASTERCARD
UNIONPAY
VISA
The last for digits of the card.
The funding method for the card (e.g. DEBIT
)
Possible values:CREDIT
DEBIT
PREPAID
The creation time of the payment method connection.
The last update time of the payment method connection.
The subscription for the account.
The system-assigned identifier of the subscription.
The status of the subscription.
Possible values:TRIALING
CHECKOUT_ISSUE
ACTIVE
PAST_DUE
PAUSED
CANCELED
The currency code for the subscription (e.g. USD
).
The system-assigned identifier of the plan.
Possible values:AVAILABLE
UNAVAILABLE
The client defined unique identifier of the plan.
The description of the plan.
The tier for the plan.
This is only available in checkout and pricing.
Possible values:FREE
TIER1
TIER2
TIER3
TIER4
TIER5
ENTERPRISE
The currency code for the plan (e.g. USD
).
The billing interval for the plan.
Possible values:DAY
WEEK
MONTH
YEAR
The revision for the plan.
The system-assigned identifier of the plan revision.
Whether this is the current revision for the subscription.
This is only set in checkout.
Whether this is the selected revision.
This is only set in checkout.
Whether this is the latest revision for the plan.
This is only set for a current or selected plan in checkout.
Whether this is the current plan for the subscription.
This is only set in checkout.
Whether this is the selected plan.
This is only set in checkout.
Whether this is the default term for the plan.
The trial settings.
For authenticated requests, this will only be set for accounts that are eligible for a new trial.
The number of days in the trial.
Whether the change is considered an upgrade or a downgrade.
This is only set in checkout.
Possible values:UPGRADE
DOWNGRADE
The savings for the plan.
The savings are in comparison to the plan in the revision with the shortest billing interval (normally monthly).
The percentage savings (1-100).
This percentage is rounded down.
The items associated with plan.
Possible values:PLAN
PLAN_ADDON
SEAT
The product associated with the item.
The system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
The price associated with the item.
The system-assigned identifier of the price.
The currency for the price.
The billing mode for the price.
Possible values:FIXED_TERM
USAGE_BASED
The billing interval for the price.
Possible values:DAY
WEEK
MONTH
YEAR
The price is fixed per quantity.
The decimal amount for the defined currency (e.g. 9.95
).
Whether to transform the quantity before multiplying amount.
The amount to divide the quantity by.
Whether to round the result up or down.
The price is dependent on the quantity.
The strategy for evaluating the tiers.
Possible values:GRADUATED
VOLUME
tiers
PriceTieredPriceTier[]
The upper quantity for tier (inclusive).
The per quantity amount for the tier.
The flat amount for the tier.
paymentMethod
PaymentMethod
The system-assigned identifier of the payment method.
Possible values:CARD
UNKNOWN
A human-readable description of the payment method.
This can be used to show a description of the payment method when the type is UNKNOWN or not explicitly handled.
The full name of the owner of the payment method.
The address for the payment method.
The city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
Whether the payment method is the default for the account.
The last payment error.
This will be unset if the payment method is updated or if a payment succeeds.
The general error code (e.g. INVALID_ARGUMENT
).
Possible values:OK
CANCELLED
UNKNOWN
INVALID_ARGUMENT
DEADLINE_EXCEEDED
NOT_FOUND
ALREADY_EXISTS
PERMISSION_DENIED
UNAUTHENTICATED
RESOURCE_EXHAUSTED
FAILED_PRECONDITION
ABORTED
OUT_OF_RANGE
UNIMPLEMENTED
INTERNAL
UNAVAILABLE
DATA_LOSS
A developer-facing error message.
A reason code for the error (e.g. USER_PENDING_DELETION
).
The parameter path related to the error (e.g. member.userId
).
Additional metadata related to the error.
A user-facing error message.
Card payment method (e.g. Visa credit card).
The brand of the card (e.g. VISA
).
Possible values:AMERICAN_EXPRESS
DINERS_CLUB
DISCOVER
JCB
MASTERCARD
UNIONPAY
VISA
The last for digits of the card.
The funding method for the card (e.g. DEBIT
)
Possible values:CREDIT
DEBIT
PREPAID
The creation time of the payment method connection.
The last update time of the payment method connection.
The subscription is scheduled to be canceled at the end of the current billing period.
cancelPeriodEnd
boolean
DeprecatedThe subscription is scheduled to be canceled at the end of the current billing period.
The time the subscription started.
The time the subscription ends/ended.
The trial information for the subscription.
The time the trial started.
The time the trial ended/ends.
The number of days in the trial.
This number is rounded to the nearest whole number of days.
The number of days remaining in the trial.
This number is rounded down, so will generally be less than days. It will be zero on the last day of the trial and null when the trial expires.
currentPeriod
SubscriptionCurrentPeriod
The current billing period for the subscription.
The time the current billing period started.
The time the current billing period ends.
The identifier of the item.
The details of the associated product.
The system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
The details of the associated price.
The system-assigned identifier of the price.
The currency for the price.
The billing mode for the price.
Possible values:FIXED_TERM
USAGE_BASED
The billing interval for the price.
Possible values:DAY
WEEK
MONTH
YEAR
The price is fixed per quantity.
The decimal amount for the defined currency (e.g. 9.95
).
Whether to transform the quantity before multiplying amount.
The amount to divide the quantity by.
Whether to round the result up or down.
The price is dependent on the quantity.
The strategy for evaluating the tiers.
Possible values:GRADUATED
VOLUME
tiers
PriceTieredPriceTier[]
The upper quantity for tier (inclusive).
The per quantity amount for the tier.
The flat amount for the tier.
The quantity for the item.
seats
SubscriptionSeatInfo[]
The information about the various seats available in the subscription.
Whether a seat can be assigned or reserved.
Possible values:AVAILABLE
UNAVAILABLE
PROVISIONABLE
The code that best describes the reason for the state.
The subscription item product.
The system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
The number of seats expected to be invoiced for the current billing period.
This might be less than the total quantity while a subscription change is pending or if the subscription is over-provisioned.
The number of seats expected at renewal.
This will only be set when different from current quantity.
The number of seats currently assigned.
The number of seats not assigned.
The number of seats currently reserved because of pending invitations.
These can be made available by cancelling outstanding invitations.
The number of seats which can be assigned or reserved.
The total number of seats associated with the subscription.
The creation time of the subscription.
The last update time of the subscription.
curl https://api.userhub.com/user/v1/billingAccount?organizationId=org_28seyVGVL1got6 \
-H "UserHub-Api-Key: $USERHUB_USER_KEY" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN" \
-X PATCH \
--json '{
"displayName": "Acme"
}'
const res = await userApi.billingAccount.update({
organizationId: "org_28seyVGVL1got6",
displayName: "Acme",
});
res, err := userApi.BillingAccount().Update(
context.Background(),
&userapi.BillingAccountUpdateInput{
OrganizationId: "org_28seyVGVL1got6",
DisplayName: userapi.Some[string]("Acme"),
},
)
$res = $userApi->billingAccount->update(
organizationId: 'org_28seyVGVL1got6',
displayName: 'Acme',
);
res = user_api.billing_account.update(
organization_id="org_28seyVGVL1got6",
display_name="Acme",
)
Response bodyJSON
{
"state": "USER_MANAGED",
"displayName": "Acme",
"currencyCode": "USD",
"balanceAmount": "0",
"checkouts": [],
"paymentMethods": []
}