Backend API
Update an existing account using the ID that was returned when created.
Arguments
Unique identifier for the account.
Customer's email address.
Indicates the customer opted into email communications.
Full name of the customer. If first_name or last_name are updated, then name will be automatically updated as a combination of first/last.
Default customer shipping information.
Setting this value will populate shipping with the associated customer's account address on file.
Shipping address line 1: street address/PO box/company name.
Shipping address line 2: apartment/suite/unit/building.
Shipping city/district/suburb/town/village.
Two-letter ISO country code.
Shipping first name. If name is updated, then first_name will be automatically updated as the first word of the name.
Shipping last name. If name is updated, then last_name will be automatically updated as the last words of the name.
Shipping full name. If first_name or last_name are updated, then name will be automatically updated as a combination of first/last.
Shipping phone number.
Shipping state/county/province/region.
Shipping zip/postal code.
Default customer billing information.
Setting this value will populate billing.card with the associated customer's credit card on file.
Billing address line 1: street address/PO box/company name.
Billing address line 2: apartment/suite/unit/building.
Credit card billing details used when billing.method=card.
Token generated by Swell Checkout or Stripe.js.
Credit card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown.
Two-digit number representing the credit card expiration month.
Four-digit number representing the credit card expiration year.
Last four digits of the card number.
Billing city/district/suburb/town/village.
Two-letter ISO country code.
Billing first name. If name is updated, then first_name will be automatically updated as the first word of the name.
Billing last name. If name is updated, then last_name will be automatically updated as the last words of the name.
Billing full name. If first_name or last_name are updated, then name will be automatically updated as a combination of first/last.
Method of payment. Can be card, account, or any one of the manual methods defined in payment settings.
Billing phone number.
Billing state/county/province/region.
VAT number for a business customer associated with this billing method, if applicable.
Billing zip/postal code.
Three-letter ISO currency code in uppercase. Defaults to the store's base currency.
Date of the last order placed by the customer.
Customer's first name. If name is updated, then first_name will be automatically updated as the first word of the name.
Customer group used for special price rules and other customer logic.
If name is updated, then last_name will be automatically updated as the last words of the name.
Password used to login and gain access to sensitive information. When the customer has a password, they are required to log in when placing an order using the associated email address. This value is automatically encrypted using bcrypt.
Unique key created when a customer requests a password reset.
When a customer requests password reset, an email is sent with this URL to redirect and authenticate the request.
Customer's phone number.
Type of customer account. Can be one of individual or business.
Possible enum values:
Default VAT number for a business customer, if applicable.
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.put('/accounts/{id}', {
id: '62991607782f3b0013cf17af',
email: 'sheogorath@shiveringisles.com'
});
Response
{
"first_name": "Sheogorath",
"email": "sheogorath@shiveringisles.com",
"group": "Deadric princes",
"currency": "USD",
"name": "Sheogorath",
"date_created": "2022-06-02T19:56:55.028Z",
"type": "individual",
"order_count": 0,
"order_value": 0,
"balance": 50000,
"id": "62991607782f3b0013cf17af"
}