question

maria-nabil avatar image
maria-nabil asked David Marginian Deactivated answered

How to create order from an employee account using Rest Api ?

When I use this API to create order from the acoount of the employee ( using the authorization token that I got from Oauth2) :

var client = new RestClient("https://sandbox.dev.clover.com/v3/merchants/"+mid+ "/orders?access_token"+token );
            var request = new RestRequest(Method.POST);
            request.AddHeader("content-type", "application/json");
            request.AddParameter("application/json", "{\"employee\":{\"id\":\""+employee_id+"\"},\"total\":100}", ParameterType.RequestBody);
            IRestResponse response = client.Execute(request);

I got 401 unauthorized ,


But when I use the test API token that I created from the merchant dashboard it succeeded .

Can anyone say why this happens ?

Thanks in advance .

OrdersOAuthAPI TokenEmployees
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

Welcome to the
Clover Developer Community