Get All Orders By Saved View

Overview

This endpoint is used for getting orders in bulk, using a saved view. A saved view for Orders must be created on the Manage Orders page in the new Sellercloud UI.

The advantages of using this endpoint for getting orders are as follows:

  • Ease of use: You can set your filters once, save them as a saved view, and then easily utilize those same filters when getting orders by simply referencing that saved view ID.
  • Flexibility: The filters available in the new SellerCloud UI are numerous and extremely flexible.

In order to get information for orders by saved view, you can consume the endpoint presented in this article. However in order to do that, you must:

  1. Be an authenticated user. For information on how you can authenticate, see: Authentication. As soon as you authenticate and receive a valid token, it needs to be passed on this call for getting orders.
  2. Have a valid ID of a currently existing saved view. For information on how you can get existing saved views, see Saved Views

Endpoint

The endpoint for the TT server would be:

https://tt.api.sellercloud.com/rest/api/orders/getallbyview?request.ViewID=100&request.pageNumber=1&request.pageSize=50

For your server, the endpoint will be:

https://{your_server_id}.api.sellercloud.com/rest/api/orders/GetAllByView?request.ViewID=100&request.pageNumber=1&request.pageSize=50

Request

Information about expected request parameters can be found on swagger UI https://tt.api.sellercloud.com/rest/swagger.

  • Method Type: HttpGet
  • Authorization: Use Bearer Token + token received from token authentication
  • Header info: Content-Type: application/json
  • Parameters:
ParametersData TypeDescriptionIs Required
pageNumberintegerPage numberYes
pageSizeintegerNumber of orders per page.

NOTE:

Maximum number of orders that can be pulled with a single call is 50.

Yes
viewIDintegerID of existing saved viewYes

Response

  • If user is authenticated and provides a valid page number and page size, then response will be Status Code 200 => OK and orders metadata in JSON format

  • If user is not authenticated, then response will be Status Code 401 => Not Valid Token
  • On server response => Status Code 500 => Internal Server Error

Different status codes can be found in this section here: https://sellercloud.com/developer/dev-category/resources/

Demo in c#

string username = “{your_username}”;
string password = “{your_password}”;

IAuthenticationClient authenticationClient = new AuthenticationClient();
string token = authenticationClient.Login(baseUri, new LoginRequest(username, password));

using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(“Bearer”, token);
var responseMessage = client.GetAsync(url).Result;

var content = responseMessage.Content
.ReadAsStringAsync()
.Result;

return JsonConvert.DeserializeObject<GetAllResponse>(content);
}

var responseMessage = client.SendAsync(request).Result;

var content = responseMessage.Content
.ReadAsStringAsync()
.Result;

var response = JsonConvert.DeserializeObject(content);

return response.access_token;
}
}
}
}

public DateTime? validFrom { get; set; }
public DateTime? validTo { get; set; }
}

public interface IAuthenticationClient
{
string Login(string baseUri, LoginRequest request);
}

public class LoginRequest
{
public LoginRequest(string username, string password)
{
this.Username = username;
this.Password = password;
}

public string Username { get; }

public string Password { get; }
}

Was this article helpful?

Next
Import Physical Inventory