##API URLS
- Account Resources
- Catalog Resources
- Downline Resources
##Authentication
To obtain a token, issue a request to POST https://www.youngliving.com/api/accounts/token
- The request must be a HTTP POST request.
- The request must include a Content-Type header with the value of application/json.
- The body of the request must in JSON format. Note: userName and password are required in order to obtain a token.
Request body
{
"userName":"",
"email":"",
"memberId":"",
"password":""
}
Example request
POST /api/accounts/token HTTP/1.1
Host: youngliving.com
Content-Type: application/json
{
"userName":"janedoe",
"email":"janedoe",
"memberId":"123456789",
"password":"password"
}
##Organization Base URL: https://www.youngliving.com/vo.dlv.api/downline ###Endpoints
- GET /children/user/{periodid}
- GET /children/member_id/{periodid}
- GET /detail/user/{periodid}
- GET /detail/{memberid}/{periodid}
###Examples
- (0 can be used in place of {periodid} for current period)
####Get downline for authorized user. Example Request:
GET
https://www.youngliving.com/vo.dlv.api/downline/children/user/405
Example Response:
{
"customerid": "1449977",
"currentperiodid": 406,
"periodid": 405,
"chartstartperiod": 398,
"chartendperiod": 405,
"totalchildren": 74,
"legs": [ … ]
}
####Get downline for specific user Example Request:
GET
https://www.youngliving.com/vo.dlv.api/downline/children/1223344/405
Example Response:
{
"customerid": 1223344,
"currentperiodid": 406,
"periodid": 405,
"chartstartperiod": 398,
"chartendperiod": 405,
"totalchildren": 15,
"legs": [ … ]
}
####Get details for authorized user. Example Request:
GET
https://youngliving.com/vo.dlv.api/downline/detail/user/405
Example Response:
{
"customerid": 123456,
"name": "BLOW, JOE",
"customertype": 2,
"email": "[email protected]",
"mainphone": "1234567891",
"datesignedup": "5/1/2013 12:27:52 PM",
"dateactivated": "5/1/2013 12:27:52 PM",
"onhold": false,
"activitystatusid": 1,
"holdreason": "",
"avatarimage": "",
"volume": { … },
"rank": { … },
"address": { … },
"autoship": { … },
"sponsor": { … },
"enroller": { … }
}
####Get details for a specific user. Example Request:
GET
https://youngliving.com/vo.dlv.api/downline/detail/user/405
Example Response:
{
"customerid": 1223344,
"name": "MEMBER, COOL",
"customertype": 2,
"email": "[email protected]",
"mainphone": "1234567891",
"datesignedup": "11/16/2013 12:19:32 PM",
"dateactivated": "11/16/2013 12:19:32 PM",
"onhold": false,
"activitystatusid": 1,
"holdreason": "",
"avatarimage": "",
"volume": { … },
"rank": { … },
"address": { … },
"autoship": { … },
"sponsor": { … },
"enroller": { … },
"sponsorpath": [ … ]
}
##Commission Base URL: https://youngliving.com/vo.dlv.api/commission ###Endpoints
- GET: /check/summary/{periodid}
- GET: /check/unilevel/{periodid}/{levelnum}
- GET: /history/{periodid}
###Examples
- (0 can be used in place of {periodid} for current period)
####Get commission check summary for a specific commission period. Example Request:
GET
https://youngliving.com/vo.dlv.api/commission/check/summary/405
Example Result:
{
"customerid":"123456",
"checkid":"12345678",
"checkdate":"11/17/2014",
"periodid":"405",
"checktotal":"314.39",
"totalcommission":"317.39",
"currencyunit":"USD",
"dgyf":"0",
"paidasrankid":2,
"maxrankid":2,
"volume":{
"ogv":4635.5,
"pv":290.25,
"pgv":4635.5
},
"retail":{
"commission":"11.84"
},
"unilevel":{
"commission":"229.71",
"levels":[
{
"levelnum":1,
"commission":"$142.83"
},
{
"levelnum":2,
"commission":"$63.49"
},
{
"levelnum":3,
"commission":"$23.39"
}
]
},
"faststart":{
"commission":"75.84",
"levels":[
{
"levelnum":1,
"commission":"$8.44"
},
{
"levelnum":2,
"commission":"$67.40"
}
]
},
"personalgen":{
"commission":"0"
},
"generations":{
"commission":"0"
},
"risingstar":{
"commission":"0"
},
"leadership":{
"commission":"0"
},
"diamondexpress":{
"commission":"0"
},
"starterkit":{
"commission":"0"
},
"adjustments":{
"total":"-3",
"items":[
{
"description":"Maintenance Fee",
"amount":"-3",
"commledgertypeid":2
}
]
}
}
#####Get commission check details for a specific level in a commission period. Example Request:
GET
https://youngliving.com/vo.dlv.api/commission/check/unilevel/405/1
Example Result:
{
"customerid":123456,
"periodid":406,
"commissionvolume":1785,
"percentage":8,
"commissionearned":"$142.83",
"unilevel":{
"levels":[
{
"membernum":123445,
"membername":"MEMBER, COOL",
"commissionvolume":75.25,
"percentage":8.0,
"commissionsearned":6.02
},
...
]
}
}
#####Get commission check details for a specific level in a commission period. Example Request:
GET
https://youngliving.com/vo.dlv.api/commission/history/405
Example Result:
{
"customerid":1449977,
"checks":[
{
"periodid":405,
"checknumber":"12345678",
"checkdate":"11/17/2014",
"amount":317.39,
"amountformatted":"$317.39",
"currency":"USD"
},
...
]
}
##Qualification Endpoints
- GET: https://youngliving.com/vo.dlv.api/downline/qualification/user/period_id
- (0 for current period)
##Essential Rewards Base URL: https://youngliving.com/api/shopping/essential-rewards ###Endpoints
- GET: /info
###Examples
####Get essential rewards information Example Request:
GET
https://youngliving.com/api/shopping/essential-rewards/info
Example Result:
{
"totalPoints": 96,
"totalExpiringPoints30Days": 0,
"consecutiveMonthsOfErOrders": 12,
"earningPercentage": 15,
"availableMonthlyPoints": 96,
"monthsBeforePercentageIncrease": 0,
"nextEarningRate": 0,
"isEnrolled": true,
"payments": [ … ],
"legacyOtgProcessingDayOfMonth": 1,
"legacyNfrProcessingDayOfMonth": 1,
"isErTemplateConfirmed": true,
"areErDeliveriesValid": true,
"doesTemplateMeetMinPv": true,
"otg": {
"processingDate": {
"year": 2014,
"month": 12,
"day": 1
}
},
"nfr": {
"processingDate": {
"year": 2014,
"month": 11,
"day": 1
}
}
}
##Helpers
function getPeriodId(date) { // Defaults to Current Period if you leave 'date' empty
date = date instanceof Date ? date : new Date();
return (date.getFullYear() * 12 + date.getMonth() + 1) - (2014 * 12 + 5) + 400;
}
Hi guys, I would like to get the available products with prices and so on, my question is how the shopping api works
if I hit this URL
https://www.youngliving.com/api/shopping
I get that
Well, there seems to be nothing there that is related to shopping/buying products.
Does someone know how this api retrieve products?
Should this api do that? It looks like that is for manage user info, but not products.
For the people that are asking how to do that.
I would recommed to work in a agnostic way without really coding first, use a api tester.
Well to get the token, which you have to add in the header as - authtoken : value - you send the post request and then hier is a example with javascript backend (express)
you can call it from the frontend with some fake page just for test what will hit the /authenticate
in React something like
I would recommed that after you get the plainToken from the logs use it as authtoken value in the header and take the " " away from the value