There are two options when creating Reps in Freedom through API.
When creating a Rep in Freedom there are three pieces of information that should be validated BEFORE creating the Rep record. The following APIs should be used to look up against Freedom as the system of record:
Look Up | Method |
---|---|
Check Sponsor Exists | GET /api/user/rep/{repDID}/info |
Check ReplicatedSiteName Doesn't Exist | POST api/rep/validateRepURL |
Check Enrollee Email Doesn't Exist | POST api/rep/validateRepEmail |
In addition to these look ups, you will need to identify the Bonus Payout method the Rep should be set to. If you only offer check or direct deposit, you may choose to simply hard code those IDs. If there are more payout options and they are based on where the enrollee is signing up from, ByDesign suggests utiliing this look up to get the correct Bonus Payout method
Look Up | Method |
---|---|
Available Bonus Payout Methods | GET /api/PayoutMethod/List |
It is important that before creating a Rep the data validations noted above have been completed. Once you are read to create a Rep and you have confirmed all the data is valid, you will call POST api/rep/Create
In addition to the data validations noted above, when creating Reps through the Online Signup Workflow, the following lookups need to be performed.
Look Up | Method |
---|---|
Available RepTypes | GET api/admin/repType |
Available RankTypes | GET api/admin/rankType |
Items Available for Enrollment | GET api/inventory/InventoryShopping/GetEnrollmentItems?repDID={repDID}&langKey={langKey}&country={country}&cartConfigurationId={cartConfigurationId}&localeID={localeID} |
When utilizing the Online Signup flow, the calls should be made in the following order as demonstrated in the diagram. It is important to note that once you start the Online Signup Order it follows the same process as the OnlineOrder for regular orders.
If upgrading from a Customer to a Rep is permitted by the company, the new Rep account does not have be created through the methods above and can follow this flow instead.