Get the user's services
- Production and sandbox. The token decides the environment.
https://api.beautyrouter.com/v1/user/services
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Get, RequestUri = new Uri("https://api.beautyrouter.com/v1/user/services"), Headers = { { "Authorization", "Bearer <token>" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.beautyrouter.com/v1/user/services"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.beautyrouter.com/v1/user/services") .get() .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'GET', url: 'https://api.beautyrouter.com/v1/user/services', headers: {Authorization: 'Bearer <token>'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.beautyrouter.com/v1/user/services';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val request = Request.Builder() .url("https://api.beautyrouter.com/v1/user/services") .get() .addHeader("Authorization", "Bearer <token>") .build()
val response = client.newCall(request).execute()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.beautyrouter.com/v1/user/services', [ 'headers' => [ 'Authorization' => 'Bearer <token>', ],]);
echo $response->getBody();import requests
url = "https://api.beautyrouter.com/v1/user/services"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.json())require 'uri'require 'net/http'
url = URI("https://api.beautyrouter.com/v1/user/services")
http = Net::HTTP.new(url.host, url.port)http.use_ssl = true
request = Net::HTTP::Get.new(url)request["Authorization"] = 'Bearer <token>'
response = http.request(request)puts response.read_bodycurl --request GET \ --url https://api.beautyrouter.com/v1/user/services \ --header 'Authorization: Bearer <token>'import Foundation
let headers = ["Authorization": "Bearer <token>"]
let request = NSMutableURLRequest(url: NSURL(string: "https://api.beautyrouter.com/v1/user/services")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)request.httpMethod = "GET"request.allHTTPHeaderFields = headers
let session = URLSession.sharedlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) }})
dataTask.resume()Returns the logged-in user’s selection. source is company when the user follows the company, or user when
they have their own selection.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The user’s services.
object
The IDs of the services that apply to the user.
company when the user follows the company, user when they have their own selection.
Examples
{ "serviceIds": [ "svc-2Hk8mNq4Lp", "svc-7Tz3bVw9Rc" ], "source": "company"}invalid_user_token: the user token is missing or wrong. user_token_expired: the user token expired. Log the
user in again with POST /v1/login.
The body of every error response.
object
object
A stable error code.
A sentence for developers. It can change, so do not match on it.
The request field that caused the error. Only some errors have it.
Only on verification_data_missing and app_setup_incomplete. What still needs to be set.
Only on order_total_changed and order_has_problems. A fresh quote.
object
One group per supplier. Each group becomes one order.
object
object
An amount in dollars, with up to two decimal places.
The discount on the whole line, in US dollars.
An amount in dollars, with up to two decimal places.
The total of the lines, in US dollars.
The discount on the whole order, in US dollars.
object
The shipping charge in US dollars, or null when it cannot be worked out.
How much more to order for free shipping, or null when it does not apply.
The sales tax in US dollars, or null when it cannot be worked out.
object
The exemption certificate used, or null.
Why no certificate applies, or null when one does.
The amount the salon pays for this group in US dollars, or null when it cannot be worked out. Send it back as
expectedTotal. A group with problems has no expectedTotal.
now: Beauty Router charges the card when the order is created. after_verification: the company is
prequalified, so the charge waits until its verification ends.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The lines no supplier can take.
object
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
What stops every group.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The sum of all the groups in US dollars, or null when a group’s total is.
Always usd.
Examples
{ "error": { "code": "invalid_user_token", "message": "The user token is missing or not valid." }}{ "error": { "code": "user_token_expired", "message": "The user token expired. Log the user in again." }}internal_error: something failed on Beauty Router’s side. Try again later.
The body of every error response.
object
object
A stable error code.
A sentence for developers. It can change, so do not match on it.
The request field that caused the error. Only some errors have it.
Only on verification_data_missing and app_setup_incomplete. What still needs to be set.
Only on order_total_changed and order_has_problems. A fresh quote.
object
One group per supplier. Each group becomes one order.
object
object
An amount in dollars, with up to two decimal places.
The discount on the whole line, in US dollars.
An amount in dollars, with up to two decimal places.
The total of the lines, in US dollars.
The discount on the whole order, in US dollars.
object
The shipping charge in US dollars, or null when it cannot be worked out.
How much more to order for free shipping, or null when it does not apply.
The sales tax in US dollars, or null when it cannot be worked out.
object
The exemption certificate used, or null.
Why no certificate applies, or null when one does.
The amount the salon pays for this group in US dollars, or null when it cannot be worked out. Send it back as
expectedTotal. A group with problems has no expectedTotal.
now: Beauty Router charges the card when the order is created. after_verification: the company is
prequalified, so the charge waits until its verification ends.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The lines no supplier can take.
object
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
What stops every group.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The sum of all the groups in US dollars, or null when a group’s total is.
Always usd.
Examples
{ "error": { "code": "internal_error", "message": "Something went wrong. Try again later." }}