import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.accounts.update({
customerId: "acme-us",
name: "Acme Corp",
addCustomerIds: [
"acme-eu",
],
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.accounts.update(
customer_id="acme-us",
name="Acme Corp",
add_customer_ids=[
"acme-eu",
],
)curl --request POST \
--url https://api.useautumn.com/v1/accounts.update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"customer_id": "acme-us",
"name": "Acme Corp",
"add_customer_ids": [
"acme-eu"
]
}
'{
"id": "acme",
"name": "Acme Corp",
"customers": [
{
"id": "acme-us",
"name": "Acme US",
"email": "billing@acme.com"
},
{
"id": "acme-eu",
"name": "Acme EU",
"email": "eu-billing@acme.com"
}
],
"created_at": 1781113864000
}
Update Account
Updates an account’s name or ID, and links or unlinks customers. Account IDs are optional and only ever set by you. A customer belongs to at most one account. Look the account up by account_id or by any linked customer’s customer_id; when that customer has no account yet, linking customers to it creates one. Linking a customer that is already in another account fails unless you pass move: true. Removing the last customer deletes the account and returns null.
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.accounts.update({
customerId: "acme-us",
name: "Acme Corp",
addCustomerIds: [
"acme-eu",
],
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.accounts.update(
customer_id="acme-us",
name="Acme Corp",
add_customer_ids=[
"acme-eu",
],
)curl --request POST \
--url https://api.useautumn.com/v1/accounts.update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"customer_id": "acme-us",
"name": "Acme Corp",
"add_customer_ids": [
"acme-eu"
]
}
'{
"id": "acme",
"name": "Acme Corp",
"customers": [
{
"id": "acme-us",
"name": "Acme US",
"email": "billing@acme.com"
},
{
"id": "acme-eu",
"name": "Acme EU",
"email": "eu-billing@acme.com"
}
],
"created_at": 1781113864000
}
Body Parameters
Response
{
"id": "acme",
"name": "Acme Corp",
"customers": [
{
"id": "acme-us",
"name": "Acme US",
"email": "billing@acme.com"
},
{
"id": "acme-eu",
"name": "Acme EU",
"email": "eu-billing@acme.com"
}
],
"created_at": 1781113864000
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
The account's ID, if one was set. Pass this or customer_id.
1 - 256^[a-zA-Z0-9_\-.]+$Look the account up through one of its customers. Pass this or account_id.
A display name for the account. Pass null to clear it.
256Set the account's ID, unique in this environment. Pass null to clear it. Accounts have no ID until you set one.
1 - 256^[a-zA-Z0-9_\-.]+$Customers to link. When looking up by customer_id and that customer has no account yet, linking creates one.
100Your unique identifier for the customer
Customers to unlink. The customers themselves are unchanged. Removing the last customer deletes the account.
100Your unique identifier for the customer
Move customers in add_customer_ids out of any other account they belong to. Without it, linking a customer that's in another account fails.
Response
OK
The updated account, or null when its last customer was removed and the account was deleted.
The account's ID, if you've set one. Autumn never generates it.
The account's name, if set.
Customers linked to the account, oldest link first.
Show child attributes
Show child attributes
When the account was created, ms since epoch.