Setting a business user's role

Is there a way (via the API or the via the web) to set a business user’s role? It looks like the two options are “EMPLOYEE” and “OWNER” (https://poynt.com/docs/api/#model-employmentdetails), but I can’t find a way to update this value. How is somebody set as an owner initially?

Hi Jordan,

When the first terminal user is created during onboarding their account is designated as OWNER. Subsequent users are designated as EMPLOYEEs. You can change the role of the user by sending a PATCH request:

	// 1012703 is the user id of this business user
	URL url = new URL("https://services.poynt.net/businesses/" + businessId + "/businessUsers/1012703");
			
	OkHttpClient client = new OkHttpClient();
	MediaType JSON = MediaType.parse("application/json; charset=utf-8");
	String json = "[{\"op\": \"replace\",\"path\": \"/employmentDetails/role\",\"value\":\"OWNER\"}]";
	RequestBody body = RequestBody.create(JSON, json);
	Request request = new Request.Builder()
			.url(url)
			.patch(body)
			.addHeader("api-version", "1.2")
			.addHeader("Poynt-Request-Id", UUID.randomUUID().toString())
			.addHeader("Authorization", "Bearer " + accessToken)
			.build();
		
	Response response = client.newCall(request).execute();
	
	System.out.println(response.toString());

Thanks Dennis, this worked perfectly.