Customers
Several methods are provided for managing the Customer within the SDK.
Create Customer#
Create a customer account using information from the user
Params#
| Name | Type | Example |
|---|---|---|
| customer | CustomerInfo | { name: 'Abdelkhalek Zellat', carType: 'Tesla', carColor: 'Silver', licensePlate: 'AB 0496', phone: '555-555-5555' } |
Example#
Login with Email/Password#
Login the user in using existing credentials
Params#
| Name | Type | Example |
|---|---|---|
| Str | 'name@email.com' | |
| password | Str | 'password' |
Example#
Login with Token#
Login the user with a previously obtained customer API token
Params#
| Name | Type | Example |
|---|---|---|
| token | Str | 'F69PGKM1QXCN7Dj3ybEXCpU4' |
Eample#
Logout#
Logs out the current customer.
Params#
| Name | Type |
|---|---|
| None | None |
Example#
Update Customer#
Update customer info for the logged in user
Params#
| Name | Type | Example |
|---|---|---|
| customer | CustomerInfo | { name: 'Abdelkhalek Zellat', carType: 'Tesla', carColor: 'Silver', licensePlate: 'AB 0496', phone: '555-555-5555' } |
Example#
SignUp a Customer#
Link an email and password with the current anonymous logged in user.
Params#
| Name | Type | Example |
|---|---|---|
| Str | 'name@email.com' | |
| password | Str | 'password' |
Example#
Get Current Customer#
Returns an instance of the current customer
Params#
| Name | Type |
|---|---|
| None | None |