Shoppers
The SDK provides shopper management functionalities that are documented here.

Actions

In order to consume the Shopper's functionality you have to connect the SDK first. You can find more information on how to do that in the Installation section.

Getting Shopper

Node.js
Go
1
LimePay.shoppers.get('shopperId') // returns new Promise<>
2
.then(shopper => {})
3
.catch(error => {});
Copied!
Returns object of type Shopper.
1
limePay.Shoppers.Get(shopperID string) // returns (*types.Shopper, error)
Copied!
Returns a pointer to Shopper object and an error.

Getting All Shoppers

Node.js
Go
1
LimePay.shoppers.getAll() // returns new Promise<>
2
.then(shopper => {})
3
.catch(error => {});
Copied!
Returns array of Shopper objects.
1
limePay.Shoppers.GetAll() // returns (*[]types.Shopper, error)
Copied!
Returns an array of Shopper objects and an error.

Creating Shopper

Node.js
Go
1
LimePay.shoppers.create(shopperData) // returns new Promise<>
2
.then(shopper => {})
3
.catch(error => {});
Copied!
Where shopperData is object with the following properties:
Field
Type
Description
Required
firstName
string
Shopper's first name
Yes
lastName
string
Shopper's last name
No
vendor
string
Vendor ID for which the shopper will be created. If not provided, the default organisation's vendor will be used
No
email
string
Shopper's email
Yes
useLimePayWallet
boolean
Whether the shopper will use LimePay Wallets or not. Default value is false
No
walletAddress
string
Shopper's wallet address
Yes, if useLimePayWallet is false
Returns object of type Shopper.
1
limePay.Shoppers.Create(shopperData types.Shopper)
2
// returns (*types.Shopper, error)
Copied!
Where shopperData is object with the following properties:
Field
Type
Description
Required
FirstName
string
Shopper's first name
Yes
LastName
string
Shopper's last name
No
Vendor
string
Vendor ID for which the shopper will be created. If not provided, the default organisation's vendor will be used
No
Email
string
Shopper's email
Yes
UseLimePayWallet
bool
Whether the shopper will use LimePay Wallets or not. Default value is false
No
WalletAddress
string
Shopper's wallet address
Yes, if UseLimePayWallet is false
Returns a pointer to Shopper object and an error.

Updating Shopper

Node.js
Go
1
LimePay.shoppers.update(shopperId, shopperData) // returns new Promise<>
2
.then(shopper => {})
3
.catch(error => {});
Copied!
Where shopperData is object with the following properties:
Field
Type
Description
Required
firstName
string
Shopper's first name
No
lastName
string
Shopper's last name
No
email
string
Shopper's email
No
walletAddress
string
Shopper's wallet address
No
Returns the updated Shopper.
1
limePay.Shoppers.Update(shopperID string, shopperData types.Shopper)
2
// returns (*types.Shopper, error)
Copied!
Where shopperData is object with the following properties:
Field
Type
Description
Required
FirstName
string
Shopper's first name
No
LastName
string
Shopper's last name
No
Email
string
Shopper's email
No
WalletAddress
string
Shopper's wallet address
No
Returns a pointer to Shopper object and an error.
walletAddress cannot be updated if the shopper is using LimePay Wallets

Getting Wallet Token

In order to receive Wallet Token for a given shopper, you have to execute the following function:
Node.js
Go
1
LimePay.shoppers.getWalletToken('shopperId') // returns new Promise<>
2
.then(result => {})
3
.catch(error => {});
Copied!
Returns object of type Wallet Token.
1
limePay.Shoppers.GetWalletToken(shopperID string) // returns (*types.WalletToken, error)
Copied!
Returns a pointer to Wallet Token object and an error.
Wallet token can be received only for shoppers that use LimePay Wallets.

Related Resources:

Last modified 2yr ago