Confirms new account e-mail and returns account registration status. See reference.
Success response schema:
{
data: {
state: string
}
}
Failure response schema: Error schema
Example:
const response = await client.account.confirm({ confirmation_token: '2xssfC9Hzf8DJXyRZGmB' })
Sends an account recovery link to the provided email address. The link allows resetting the password for the account.
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.forgotPassword({
user: {
email: 'spree@example.com'
}
})
Changes the password associated with the account using an account recovery token.
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.resetPassword({
reset_password_token: '7381273269536713689562374856',
user: {
password: '123!@#asdASD',
password_confirmation: '123!@#asdASD'
}
})
Updates account and returns its attributes. See api docs.
Required token: Bearer token
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.update({
bearer_token: '7381273269536713689562374856',
user: {
email: 'john@snow.org',
password: 'new_spree123',
password_confirmation: 'new_spree123'
}
})
Returns current user information. See api docs.
Required token: Bearer token
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.accountInfo({ bearer_token: '7381273269536713689562374856' })
Returns a list of Credit Cards for the signed in User. See api docs.
Required token: Bearer token
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.creditCardsList({ bearer_token: '7381273269536713689562374856' })
Return the User's default Credit Card. See api docs.
Required token: Bearer token
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.defaultCreditCard({ bearer_token: '7381273269536713689562374856' })
Remove a User's Credit Card. See api docs.
Required token: Bearer token
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.removeCreditCard({
bearer_token: '7381273269536713689562374856',
id: '14'
})
Returns Orders placed by the User. Only completed ones. See api docs.
Required token: Bearer token
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.completedOrdersList({
bearer_token: '7381273269536713689562374856'
})
Return the User's completed Order. See api docs.
Required token: Bearer token
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.completedOrder({
bearer_token: '7381273269536713689562374856',
order_number: 'R653163382'
})
Returns a list of Addresses for the signed in User. See api docs.
Required token: Bearer token
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.addressesList({
bearer_token: '7381273269536713689562374856'
})
Returns a single address for the signed in User.
Required token: Bearer token
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.showAddress({
bearer_token: '7381273269536713689562374856',
id: '1'
})
Create a new Address for the signed in User. See api docs.
Required token: Bearer token
Options schema:
interface options {
address: {
firstname: string
lastname: string
address1: string
address2?: string
city: string
phone?: string
zipcode: string
state_name: string // State Abbreviations
country_iso: string // Country ISO (2-chars) or ISO3 (3-chars)
company?: string
}
}
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.createAddress({
bearer_token: '7381273269536713689562374856',
address: {
firstname: 'John',
lastname: 'Snow',
address1: '7735 Old Georgetown Road',
address2: '2nd Floor',
city: 'Bethesda',
phone: '3014445002',
zipcode: '20814',
state_name: 'MD',
country_iso: 'US',
company: 'Spark'
}
})
Removes selected Address for the signed in User. See api docs.
Required token: Bearer token
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.removeAddress({
bearer_token: '7381273269536713689562374856',
id: '1'
})
Update selected Address for the signed in User. See api docs.
Required token: Bearer token
Options schema:
interface options {
id: string
address: {
firstname: string
lastname: string
address1: string
address2?: string
city: string
phone?: string
zipcode: string
state_name: string // State Abbreviations
country_iso: string // Country ISO (2-chars) or ISO3 (3-chars)
company?: string
}
}
Success response schema: Success schema
Failure response schema: Error schema
Example:
const response = await client.account.updateAddress({
bearer_token: '7381273269536713689562374856',
id: '1',
address: {
firstname: 'John',
lastname: 'Snow',
address1: '7735 Old Georgetown Road',
address2: '2nd Floor',
city: 'Bethesda',
phone: '3014445002',
zipcode: '20814',
state_name: 'MD',
country_iso: 'US',
company: 'Spark'
}
})
Protected
spreeOptional
tokens: ITokenOptional
params: anyOptional
responseParsing: ResponseParsingProtected
classifyProtected
processProtected
processProtected
spreeGenerated using TypeDoc
Creates new account and returns its attributes. See api docs.
Success response schema: Success schema
Failure response schema: Error schema
Example: