@nuskin/conversion-sdk

The SDK for the conversion tool

Usage no npm install needed!

<script type="module">
  import nuskinConversionSdk from 'https://cdn.skypack.dev/@nuskin/conversion-sdk';
</script>

README

Conversion NPM Library

This NPM library houses logic for converting customers between tiers. Refer also to conversion-lambda which manages interfacing with API's on Universe and SAP

Domain terminology:

Tier

One of CUSTOMER, PREFERRED_MEMBER, DISTRIBUTOR These are documented and accessible through the MEMBER_TIERS property on the service

Convert

Move a member from their current tier to a target tier

Intent

The tier that the member would like to convert to

Expected response format

The following explains the expected response formats when interacting with this service. In the case of an issue with a request, it will come back in the errorMessageKey field in the response. A full list of the possible error message keys can be found in src/errorMessageCodekey.js

getConversionOptions

success

If the request was successful

[{
    tier: 'a tier',
    current: true/false // this is the user's current tier,
    requiredFields: {}// this will house the list of fields required in the current market to make the move
}, ...]

error

If the request failed

{
    errorMessageKey: 'an error'
}

convertTo

success

If the request was successful

{
    errorMessageKey:  null,
    success:  true
}

error

If the request failed

{

errorMessageKey:  'an error'
}