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
LimePay.shoppers.get('shopperId') // returns new Promise<>
.then(shopper => {})
.catch(error => {});

Returns object of type Shopper.

limePay.Shoppers.Get(shopperID string) // returns (*types.Shopper, error)

Returns a pointer to Shopper object and an error.

Getting All Shoppers

Node.js
Go
LimePay.shoppers.getAll() // returns new Promise<>
.then(shopper => {})
.catch(error => {});

Returns array of Shopper objects.

limePay.Shoppers.GetAll() // returns (*[]types.Shopper, error)

Returns an array of Shopper objects and an error.

Creating Shopper

Node.js
Go
LimePay.shoppers.create(shopperData) // returns new Promise<>
.then(shopper => {})
.catch(error => {});

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.

limePay.Shoppers.Create(shopperData types.Shopper)
// returns (*types.Shopper, error)

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
LimePay.shoppers.update(shopperId, shopperData) // returns new Promise<>
.then(shopper => {})
.catch(error => {});

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.

limePay.Shoppers.Update(shopperID string, shopperData types.Shopper)
// returns (*types.Shopper, error)

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
LimePay.shoppers.getWalletToken('shopperId') // returns new Promise<>
.then(result => {})
.catch(error => {});

Returns object of type Wallet Token.

limePay.Shoppers.GetWalletToken(shopperID string) // returns (*types.WalletToken, error)

Returns a pointer to Wallet Token object and an error.

Wallet token can be received only for shoppers that use LimePay Wallets.

Related Resources:

‚Äč