Retrieves the order history of a customer. The response may display the results across multiple pages, when applicable.
curl -X GET\
\
\
-H "Accept: application/xml,application/json"\
"http://localhost:9001/occ/v2/{baseSiteId}/users/{userId}/orders?currentPage=&fields=&pageSize=&sort=&statuses="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.OrdersApi;
import java.io.File;
import java.util.*;
public class OrdersApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2_Password
OAuth oauth2_Password = (OAuth) defaultClient.getAuthentication("oauth2_Password");
oauth2_Password.setAccessToken("YOUR ACCESS TOKEN");
// Configure OAuth2 access token for authorization: oauth2_client_credentials
OAuth oauth2_client_credentials = (OAuth) defaultClient.getAuthentication("oauth2_client_credentials");
oauth2_client_credentials.setAccessToken("YOUR ACCESS TOKEN");
OrdersApi apiInstance = new OrdersApi();
String baseSiteId = baseSiteId_example; // String | Base site identifier
String userId = userId_example; // String | User identifier or one of the literals : 'current' for currently authenticated user, 'anonymous' for anonymous user
Integer currentPage = 56; // Integer | Current result page. Default value is 0.
String fields = fields_example; // String | Response configuration. This is the list of fields that should be returned in the response body. Examples: BASIC,DEFAULT,FULL
Integer pageSize = 56; // Integer | The number of results returned per page.
String sort = sort_example; // String | Sorting method applied to the return results.
String statuses = statuses_example; // String | Filters orders with specified status(es). For example, statuses = CANCELLED returns CANCELLED orders. To filter multiple statues, separate statues with "," and all orders with these statuses will be returned. For example, statuses = CANCELLED,COMPLETED,READY returns all orders with statuses CANCELLED,COMPLETED, and READY.
Options available are:
CANCELLING,
CHECKED_VALID,
CREATED,
OPEN,
READY,
CHECKED_INVALID,
ON_HOLD,
ON_VALIDATION,
PENDING_APPROVAL,
SUSPENDED,
COMPLETED,
PAYMENT_AUTHORIZED,
PENDING_APPROVAL_FROM_MERCHANT,
CANCELLED,
PAYMENT_NOT_AUTHORIZED,
PENDING_QUOTE,
APPROVED_QUOTE,
PAYMENT_AMOUNT_RESERVED,
PAYMENT_AMOUNT_NOT_RESERVED,
REJECTED_QUOTE,
APPROVED,
PAYMENT_CAPTURED,
PAYMENT_NOT_CAPTURED,
REJECTED,
APPROVED_BY_MERCHANT,
FRAUD_CHECKED,
ORDER_SPLIT,
REJECTED_BY_MERCHANT,
ASSIGNED_TO_ADMIN,
PROCESSING_ERROR,
B2B_PROCESSING_ERROR,
WAIT_FRAUD_MANUAL_CHECK,
PAYMENT_NOT_VOIDED,
TAX_NOT_VOIDED,
TAX_NOT_COMMITTED,
TAX_NOT_REQUOTED
try {
OrderHistoryList result = apiInstance.getUserOrderHistory(baseSiteId, userId, currentPage, fields, pageSize, sort, statuses);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling OrdersApi#getUserOrderHistory");
e.printStackTrace();
}
}
}
import io.swagger.client.api.OrdersApi;
public class OrdersApiExample {
public static void main(String[] args) {
OrdersApi apiInstance = new OrdersApi();
String baseSiteId = baseSiteId_example; // String | Base site identifier
String userId = userId_example; // String | User identifier or one of the literals : 'current' for currently authenticated user, 'anonymous' for anonymous user
Integer currentPage = 56; // Integer | Current result page. Default value is 0.
String fields = fields_example; // String | Response configuration. This is the list of fields that should be returned in the response body. Examples: BASIC,DEFAULT,FULL
Integer pageSize = 56; // Integer | The number of results returned per page.
String sort = sort_example; // String | Sorting method applied to the return results.
String statuses = statuses_example; // String | Filters orders with specified status(es). For example, statuses = CANCELLED returns CANCELLED orders. To filter multiple statues, separate statues with "," and all orders with these statuses will be returned. For example, statuses = CANCELLED,COMPLETED,READY returns all orders with statuses CANCELLED,COMPLETED, and READY.
Options available are:
CANCELLING,
CHECKED_VALID,
CREATED,
OPEN,
READY,
CHECKED_INVALID,
ON_HOLD,
ON_VALIDATION,
PENDING_APPROVAL,
SUSPENDED,
COMPLETED,
PAYMENT_AUTHORIZED,
PENDING_APPROVAL_FROM_MERCHANT,
CANCELLED,
PAYMENT_NOT_AUTHORIZED,
PENDING_QUOTE,
APPROVED_QUOTE,
PAYMENT_AMOUNT_RESERVED,
PAYMENT_AMOUNT_NOT_RESERVED,
REJECTED_QUOTE,
APPROVED,
PAYMENT_CAPTURED,
PAYMENT_NOT_CAPTURED,
REJECTED,
APPROVED_BY_MERCHANT,
FRAUD_CHECKED,
ORDER_SPLIT,
REJECTED_BY_MERCHANT,
ASSIGNED_TO_ADMIN,
PROCESSING_ERROR,
B2B_PROCESSING_ERROR,
WAIT_FRAUD_MANUAL_CHECK,
PAYMENT_NOT_VOIDED,
TAX_NOT_VOIDED,
TAX_NOT_COMMITTED,
TAX_NOT_REQUOTED
try {
OrderHistoryList result = apiInstance.getUserOrderHistory(baseSiteId, userId, currentPage, fields, pageSize, sort, statuses);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling OrdersApi#getUserOrderHistory");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: oauth2_Password)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
// Configure OAuth2 access token for authorization: (authentication scheme: oauth2_client_credentials)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
String *baseSiteId = baseSiteId_example; // Base site identifier
String *userId = userId_example; // User identifier or one of the literals : 'current' for currently authenticated user, 'anonymous' for anonymous user
Integer *currentPage = 56; // Current result page. Default value is 0. (optional) (default to 0)
String *fields = fields_example; // Response configuration. This is the list of fields that should be returned in the response body. Examples: BASIC,DEFAULT,FULL (optional) (default to DEFAULT)
Integer *pageSize = 56; // The number of results returned per page. (optional) (default to 20)
String *sort = sort_example; // Sorting method applied to the return results. (optional)
String *statuses = statuses_example; // Filters orders with specified status(es). For example, statuses = CANCELLED returns CANCELLED orders. To filter multiple statues, separate statues with "," and all orders with these statuses will be returned. For example, statuses = CANCELLED,COMPLETED,READY returns all orders with statuses CANCELLED,COMPLETED, and READY.
Options available are:
CANCELLING,
CHECKED_VALID,
CREATED,
OPEN,
READY,
CHECKED_INVALID,
ON_HOLD,
ON_VALIDATION,
PENDING_APPROVAL,
SUSPENDED,
COMPLETED,
PAYMENT_AUTHORIZED,
PENDING_APPROVAL_FROM_MERCHANT,
CANCELLED,
PAYMENT_NOT_AUTHORIZED,
PENDING_QUOTE,
APPROVED_QUOTE,
PAYMENT_AMOUNT_RESERVED,
PAYMENT_AMOUNT_NOT_RESERVED,
REJECTED_QUOTE,
APPROVED,
PAYMENT_CAPTURED,
PAYMENT_NOT_CAPTURED,
REJECTED,
APPROVED_BY_MERCHANT,
FRAUD_CHECKED,
ORDER_SPLIT,
REJECTED_BY_MERCHANT,
ASSIGNED_TO_ADMIN,
PROCESSING_ERROR,
B2B_PROCESSING_ERROR,
WAIT_FRAUD_MANUAL_CHECK,
PAYMENT_NOT_VOIDED,
TAX_NOT_VOIDED,
TAX_NOT_COMMITTED,
TAX_NOT_REQUOTED (optional)
OrdersApi *apiInstance = [[OrdersApi alloc] init];
// Retrieves the order history of a customer.
[apiInstance getUserOrderHistoryWith:baseSiteId
userId:userId
currentPage:currentPage
fields:fields
pageSize:pageSize
sort:sort
statuses:statuses
completionHandler: ^(OrderHistoryList output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var CommerceWebservices = require('commerce_webservices');
var defaultClient = CommerceWebservices.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2_Password
var oauth2_Password = defaultClient.authentications['oauth2_Password'];
oauth2_Password.accessToken = "YOUR ACCESS TOKEN"
// Configure OAuth2 access token for authorization: oauth2_client_credentials
var oauth2_client_credentials = defaultClient.authentications['oauth2_client_credentials'];
oauth2_client_credentials.accessToken = "YOUR ACCESS TOKEN"
var api = new CommerceWebservices.OrdersApi()
var baseSiteId = baseSiteId_example; // {{String}} Base site identifier
var userId = userId_example; // {{String}} User identifier or one of the literals : 'current' for currently authenticated user, 'anonymous' for anonymous user
var opts = {
'currentPage': 56, // {{Integer}} Current result page. Default value is 0.
'fields': fields_example, // {{String}} Response configuration. This is the list of fields that should be returned in the response body. Examples: BASIC,DEFAULT,FULL
'pageSize': 56, // {{Integer}} The number of results returned per page.
'sort': sort_example, // {{String}} Sorting method applied to the return results.
'statuses': statuses_example // {{String}} Filters orders with specified status(es). For example, statuses = CANCELLED returns CANCELLED orders. To filter multiple statues, separate statues with "," and all orders with these statuses will be returned. For example, statuses = CANCELLED,COMPLETED,READY returns all orders with statuses CANCELLED,COMPLETED, and READY.
Options available are:
CANCELLING,
CHECKED_VALID,
CREATED,
OPEN,
READY,
CHECKED_INVALID,
ON_HOLD,
ON_VALIDATION,
PENDING_APPROVAL,
SUSPENDED,
COMPLETED,
PAYMENT_AUTHORIZED,
PENDING_APPROVAL_FROM_MERCHANT,
CANCELLED,
PAYMENT_NOT_AUTHORIZED,
PENDING_QUOTE,
APPROVED_QUOTE,
PAYMENT_AMOUNT_RESERVED,
PAYMENT_AMOUNT_NOT_RESERVED,
REJECTED_QUOTE,
APPROVED,
PAYMENT_CAPTURED,
PAYMENT_NOT_CAPTURED,
REJECTED,
APPROVED_BY_MERCHANT,
FRAUD_CHECKED,
ORDER_SPLIT,
REJECTED_BY_MERCHANT,
ASSIGNED_TO_ADMIN,
PROCESSING_ERROR,
B2B_PROCESSING_ERROR,
WAIT_FRAUD_MANUAL_CHECK,
PAYMENT_NOT_VOIDED,
TAX_NOT_VOIDED,
TAX_NOT_COMMITTED,
TAX_NOT_REQUOTED
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getUserOrderHistory(baseSiteId, userId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getUserOrderHistoryExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2_Password
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
// Configure OAuth2 access token for authorization: oauth2_client_credentials
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new OrdersApi();
var baseSiteId = baseSiteId_example; // String | Base site identifier
var userId = userId_example; // String | User identifier or one of the literals : 'current' for currently authenticated user, 'anonymous' for anonymous user
var currentPage = 56; // Integer | Current result page. Default value is 0. (optional) (default to 0)
var fields = fields_example; // String | Response configuration. This is the list of fields that should be returned in the response body. Examples: BASIC,DEFAULT,FULL (optional) (default to DEFAULT)
var pageSize = 56; // Integer | The number of results returned per page. (optional) (default to 20)
var sort = sort_example; // String | Sorting method applied to the return results. (optional)
var statuses = statuses_example; // String | Filters orders with specified status(es). For example, statuses = CANCELLED returns CANCELLED orders. To filter multiple statues, separate statues with "," and all orders with these statuses will be returned. For example, statuses = CANCELLED,COMPLETED,READY returns all orders with statuses CANCELLED,COMPLETED, and READY.
Options available are:
CANCELLING,
CHECKED_VALID,
CREATED,
OPEN,
READY,
CHECKED_INVALID,
ON_HOLD,
ON_VALIDATION,
PENDING_APPROVAL,
SUSPENDED,
COMPLETED,
PAYMENT_AUTHORIZED,
PENDING_APPROVAL_FROM_MERCHANT,
CANCELLED,
PAYMENT_NOT_AUTHORIZED,
PENDING_QUOTE,
APPROVED_QUOTE,
PAYMENT_AMOUNT_RESERVED,
PAYMENT_AMOUNT_NOT_RESERVED,
REJECTED_QUOTE,
APPROVED,
PAYMENT_CAPTURED,
PAYMENT_NOT_CAPTURED,
REJECTED,
APPROVED_BY_MERCHANT,
FRAUD_CHECKED,
ORDER_SPLIT,
REJECTED_BY_MERCHANT,
ASSIGNED_TO_ADMIN,
PROCESSING_ERROR,
B2B_PROCESSING_ERROR,
WAIT_FRAUD_MANUAL_CHECK,
PAYMENT_NOT_VOIDED,
TAX_NOT_VOIDED,
TAX_NOT_COMMITTED,
TAX_NOT_REQUOTED (optional)
try
{
// Retrieves the order history of a customer.
OrderHistoryList result = apiInstance.getUserOrderHistory(baseSiteId, userId, currentPage, fields, pageSize, sort, statuses);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling OrdersApi.getUserOrderHistory: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2_Password
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure OAuth2 access token for authorization: oauth2_client_credentials
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$api_instance = new Swagger\Client\ApiOrdersApi();
$baseSiteId = baseSiteId_example; // String | Base site identifier
$userId = userId_example; // String | User identifier or one of the literals : 'current' for currently authenticated user, 'anonymous' for anonymous user
$currentPage = 56; // Integer | Current result page. Default value is 0.
$fields = fields_example; // String | Response configuration. This is the list of fields that should be returned in the response body. Examples: BASIC,DEFAULT,FULL
$pageSize = 56; // Integer | The number of results returned per page.
$sort = sort_example; // String | Sorting method applied to the return results.
$statuses = statuses_example; // String | Filters orders with specified status(es). For example, statuses = CANCELLED returns CANCELLED orders. To filter multiple statues, separate statues with "," and all orders with these statuses will be returned. For example, statuses = CANCELLED,COMPLETED,READY returns all orders with statuses CANCELLED,COMPLETED, and READY.
Options available are:
CANCELLING,
CHECKED_VALID,
CREATED,
OPEN,
READY,
CHECKED_INVALID,
ON_HOLD,
ON_VALIDATION,
PENDING_APPROVAL,
SUSPENDED,
COMPLETED,
PAYMENT_AUTHORIZED,
PENDING_APPROVAL_FROM_MERCHANT,
CANCELLED,
PAYMENT_NOT_AUTHORIZED,
PENDING_QUOTE,
APPROVED_QUOTE,
PAYMENT_AMOUNT_RESERVED,
PAYMENT_AMOUNT_NOT_RESERVED,
REJECTED_QUOTE,
APPROVED,
PAYMENT_CAPTURED,
PAYMENT_NOT_CAPTURED,
REJECTED,
APPROVED_BY_MERCHANT,
FRAUD_CHECKED,
ORDER_SPLIT,
REJECTED_BY_MERCHANT,
ASSIGNED_TO_ADMIN,
PROCESSING_ERROR,
B2B_PROCESSING_ERROR,
WAIT_FRAUD_MANUAL_CHECK,
PAYMENT_NOT_VOIDED,
TAX_NOT_VOIDED,
TAX_NOT_COMMITTED,
TAX_NOT_REQUOTED
try {
$result = $api_instance->getUserOrderHistory($baseSiteId, $userId, $currentPage, $fields, $pageSize, $sort, $statuses);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->getUserOrderHistory: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::OrdersApi;
# Configure OAuth2 access token for authorization: oauth2_Password
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
# Configure OAuth2 access token for authorization: oauth2_client_credentials
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::OrdersApi->new();
my $baseSiteId = baseSiteId_example; # String | Base site identifier
my $userId = userId_example; # String | User identifier or one of the literals : 'current' for currently authenticated user, 'anonymous' for anonymous user
my $currentPage = 56; # Integer | Current result page. Default value is 0.
my $fields = fields_example; # String | Response configuration. This is the list of fields that should be returned in the response body. Examples: BASIC,DEFAULT,FULL
my $pageSize = 56; # Integer | The number of results returned per page.
my $sort = sort_example; # String | Sorting method applied to the return results.
my $statuses = statuses_example; # String | Filters orders with specified status(es). For example, statuses = CANCELLED returns CANCELLED orders. To filter multiple statues, separate statues with "," and all orders with these statuses will be returned. For example, statuses = CANCELLED,COMPLETED,READY returns all orders with statuses CANCELLED,COMPLETED, and READY.
Options available are:
CANCELLING,
CHECKED_VALID,
CREATED,
OPEN,
READY,
CHECKED_INVALID,
ON_HOLD,
ON_VALIDATION,
PENDING_APPROVAL,
SUSPENDED,
COMPLETED,
PAYMENT_AUTHORIZED,
PENDING_APPROVAL_FROM_MERCHANT,
CANCELLED,
PAYMENT_NOT_AUTHORIZED,
PENDING_QUOTE,
APPROVED_QUOTE,
PAYMENT_AMOUNT_RESERVED,
PAYMENT_AMOUNT_NOT_RESERVED,
REJECTED_QUOTE,
APPROVED,
PAYMENT_CAPTURED,
PAYMENT_NOT_CAPTURED,
REJECTED,
APPROVED_BY_MERCHANT,
FRAUD_CHECKED,
ORDER_SPLIT,
REJECTED_BY_MERCHANT,
ASSIGNED_TO_ADMIN,
PROCESSING_ERROR,
B2B_PROCESSING_ERROR,
WAIT_FRAUD_MANUAL_CHECK,
PAYMENT_NOT_VOIDED,
TAX_NOT_VOIDED,
TAX_NOT_COMMITTED,
TAX_NOT_REQUOTED
eval {
my $result = $api_instance->getUserOrderHistory(baseSiteId => $baseSiteId, userId => $userId, currentPage => $currentPage, fields => $fields, pageSize => $pageSize, sort => $sort, statuses => $statuses);
print Dumper($result);
};
if ($@) {
warn "Exception when calling OrdersApi->getUserOrderHistory: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: oauth2_Password
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Configure OAuth2 access token for authorization: oauth2_client_credentials
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = swagger_client.OrdersApi()
baseSiteId = baseSiteId_example # String | Base site identifier
userId = userId_example # String | User identifier or one of the literals : 'current' for currently authenticated user, 'anonymous' for anonymous user
currentPage = 56 # Integer | Current result page. Default value is 0. (optional) (default to 0)
fields = fields_example # String | Response configuration. This is the list of fields that should be returned in the response body. Examples: BASIC,DEFAULT,FULL (optional) (default to DEFAULT)
pageSize = 56 # Integer | The number of results returned per page. (optional) (default to 20)
sort = sort_example # String | Sorting method applied to the return results. (optional)
statuses = statuses_example # String | Filters orders with specified status(es). For example, statuses = CANCELLED returns CANCELLED orders. To filter multiple statues, separate statues with "," and all orders with these statuses will be returned. For example, statuses = CANCELLED,COMPLETED,READY returns all orders with statuses CANCELLED,COMPLETED, and READY.
Options available are:
CANCELLING,
CHECKED_VALID,
CREATED,
OPEN,
READY,
CHECKED_INVALID,
ON_HOLD,
ON_VALIDATION,
PENDING_APPROVAL,
SUSPENDED,
COMPLETED,
PAYMENT_AUTHORIZED,
PENDING_APPROVAL_FROM_MERCHANT,
CANCELLED,
PAYMENT_NOT_AUTHORIZED,
PENDING_QUOTE,
APPROVED_QUOTE,
PAYMENT_AMOUNT_RESERVED,
PAYMENT_AMOUNT_NOT_RESERVED,
REJECTED_QUOTE,
APPROVED,
PAYMENT_CAPTURED,
PAYMENT_NOT_CAPTURED,
REJECTED,
APPROVED_BY_MERCHANT,
FRAUD_CHECKED,
ORDER_SPLIT,
REJECTED_BY_MERCHANT,
ASSIGNED_TO_ADMIN,
PROCESSING_ERROR,
B2B_PROCESSING_ERROR,
WAIT_FRAUD_MANUAL_CHECK,
PAYMENT_NOT_VOIDED,
TAX_NOT_VOIDED,
TAX_NOT_COMMITTED,
TAX_NOT_REQUOTED (optional)
try:
# Retrieves the order history of a customer.
api_response = api_instance.get_user_order_history(baseSiteId, userId, currentPage=currentPage, fields=fields, pageSize=pageSize, sort=sort, statuses=statuses)
pprint(api_response)
except ApiException as e:
print("Exception when calling OrdersApi->getUserOrderHistory: %s\n" % e)