Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Method
POST
Comments
Description

inserts a case message object for a case

See Case Management to better understand what a case is 

This will trigger an email to customer service.

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

The customer must be logged in.
Path ParametersorderIdOrder ID
Query Parameters

none

 
Headers

none

 
Receives JsonCaseMessage Object

If this order id doesn't exist, a 404 is returned.

If no case exists for this order, a 400 Bad Request is returned.

If no message is supplied, a 400 Bad Request is returned.

Returns JsonCase object

contains record identifier as well as submitted fields.

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
    this.insertOrderCaseMessage = function (orderId, messageText, options) {
    options = options || {};
    var orderCaseMessage = {message: messageText}; // this is all that's needed to insert message.
    jQuery.ajax({
      url: '/rest/myaccount/orders/' + orderId + "/case/messages",
      data: JSON.stringify(orderCaseMessage),
      type: 'post',
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      dataType: 'json',
      contentType: 'application/json; charset=UTF-8'
    }).done(function (result) {
              if (result) {
                orderCaseMessage = result;
              }
              if (options.success) {
                options.success(orderCaseMessage);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(jqXHR, textStatus, errorThrown);
              }
            });
    return orderCaseMessage;
  };

 

 

TODO: 

/rest/myaccount/notReviewedYet

...

/myaccount/reviews (GET)

...

Method
GET
Comments
Description

returns a distinct list of purchased items not yet reviewed.

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

The customer must be logged in.
Path Parametersnone 
Query Parameters

pageNumber

pageSize

 

pagination number

number of records per page (max is 10)

Headers

Returned headers:

uc-pagination-page-size

uc-pagination-page-number

uc-pagination-total-records

uc-pagination-total-pages

 

page size of result set

page number of result set

total number of records found

total number of pages found

Receives Jsonnone 
Returns JsonArray of NotReviewedItem objects

 

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  /**
   * returns back pagination of NotReviewedItem items, the success callback will
   * receive 1) review items, 2) pagination object (pageSize,pageNumber,totalRecords,totalPages)
   * @param [options] success and failure callbacks, 'pageNumber' and 'pageSize'
   * @return Object no callbacks specified, this returns back an object containing 'notYetReviewed' and 'pagination' of records (on success), else null
   */
  this.getNotReviewedYet = function (options) {
    options = options || {};
    var data = {};
    data['pageNumber'] = options.pageNumber || '';
    data['pageSize'] = options.pageSize || '';
    var notReviewedYet = [];
    var pagination = {};
    jQuery.ajax({
      url: '/rest/myaccount/notReviewedYet',
      type: 'get',
      data: data,
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      dataType: 'json'
    }).done(function (result, textStatus, jqXHR) {
              notReviewedYet = result;
              pagination['pageSize'] = parseInt(jqXHR.getResponseHeader('uc-pagination-page-size'));
              pagination['pageNumber'] = parseInt(jqXHR.getResponseHeader('uc-pagination-page-number'));
              pagination['totalRecords'] = parseInt(jqXHR.getResponseHeader('uc-pagination-total-records'));
              pagination['totalPages'] = parseInt(jqXHR.getResponseHeader('uc-pagination-total-pages'));
              if (options.success) {
                options.success(notReviewedYet, pagination);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(textStatus, errorThrown);
              }
            });
    return {notReviewedYet: notReviewedYet, pagination: pagination};
  };

 

 

/rest/myaccount/orders

Method
GET
Comments
Description

returns a list of reviews the customer has submitted

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

The customer must be logged in.
Path Parametersnone 
Query Parameters

pageNumber

pageSize

pagination number

number of records per page (max is 10)

Headers

Returned headers:

uc-pagination-page-size

uc-pagination-page-number

uc-pagination-total-records

uc-pagination-total-pages

 

page size of result set

page number of result set

total number of records found

total number of pages found

Receives Jsonnone 
Returns JsonArray of ReviewedItem objects

 

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  /**
   * returns back pagination of ReviewedItem items, the success callback will
   * receive 1) review items, 2) pagination object (pageSize,pageNumber,totalRecords,totalPages)
   * @param [options] success and failure callbacks, 'pageNumber' and 'pageSize'
   * @return Object no callbacks specified, this returns back an object containing 'reviews' and 'pagination' of records (on success), else null
   */
  this.getReviews = function (options) {
    options = options || {};
    var data = {};
    data['pageNumber'] = options.pageNumber || '';
    data['pageSize'] = options.pageSize || '';
    var reviews = [];
    var pagination = {};
    jQuery.ajax({
      url: '/rest/myaccount/reviews',
      type: 'get',
      data: data,
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      dataType: 'json'
    }).done(function (result, textStatus, jqXHR) {
              reviews = result;
              pagination['pageSize'] = parseInt(jqXHR.getResponseHeader('uc-pagination-page-size'));
              pagination['pageNumber'] = parseInt(jqXHR.getResponseHeader('uc-pagination-page-number'));
              pagination['totalRecords'] = parseInt(jqXHR.getResponseHeader('uc-pagination-total-records'));
              pagination['totalPages'] = parseInt(jqXHR.getResponseHeader('uc-pagination-total-pages'));
              if (options.success) {
                options.success(reviews, pagination);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(textStatus, errorThrown);
              }
            });
    return {reviews: reviews, pagination: pagination};
  };