Versions Compared

Key

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

...

Method
GET
Comments
Description

returns all credit cards

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

The customer must be logged in.
Path Parametersnone 
Query Parameters

none

 
Headers

none

 
Receives Jsonnone 
Returns JsonArray of CreditCard objects

 The card number is not returned (only a mask)

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  this.getCreditCards = function (options) {
    options = options || {};
    var creditCards = [];
    jQuery.ajax({
      url: '/rest/myaccount/creditCards',
      type: 'get',
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      dataType: 'json'
    }).done(function (result) {
              creditCards = result;
              if (options.success) {
                options.success(creditCards);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(jqXHR, textStatus, errorThrown);
              }
            });
    return creditCards;
  };

...

Method
GET
Comments
Description

returns a credit card record

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

The customer must be logged in.
Path Parametersidcredit card identifier  (not card number)
Query Parameters

none

 
Headers

none

 
Receives Jsonnone 
Returns JsonCreditCard object

 The card number is not returned (only a mask)

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  this.getCreditCard = function (id, options) {
    options = options || {};
    var creditCard = null;
    jQuery.ajax({
      url: '/rest/myaccount/creditCards/' + id,
      type: 'get',
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      dataType: 'json'
    }).done(function (result) {
              creditCard = result;
              if (options.success) {
                options.success(creditCard);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(jqXHR, textStatus, errorThrown);
              }
            });
    return creditCard;
  };

...

Method
DELETE
Comments
Description

deletes a credit card

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

Customer must be logged in to delete an address
Path Parametersidcredit card identifier  (not card number)
Query Parameters

none

 
Headers

none

 
Receives Jsonnone 
Returns Jsonnone

204 No Content returned on success

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  this.deleteCreditCard = function (creditCard, options) {
    options = options || {};
    jQuery.ajax({
      url: '/rest/myaccount/creditCards/' + creditCard.id,
      type: 'delete',
      data: JSON.stringify(creditCard),
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      contentType: 'application/json; charset=UTF-8',
      dataType: 'json'
    }).done(function () {
              if (options.success) {
                options.success();
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(textStatus, errorThrown);
              }
            });
  };

 

 

 

 

 

TODO:

/rest/myaccount/orders

...

/myaccount/orders/orderId (GET)

/myaccount/orders/orderId/tracking (GET)

/myaccount/orders/orderId/case (GET)

/myaccount/orders/orderId/case (POST)

/myaccount/orders/orderId/case/messages (GET)

...

Method
GET
Comments
Description

returns orders belonging to customer

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

The customer must be logged in.
Path Parametersnone 
Query Parameters

pageNumber

pageSize

search

_filterTime

pagination number

number of records per page (max is 10)

order id, item id, or item description search term

One of the following values:

last30days

last6months

year-XXXX

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 Order objects

 

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
    /**
   * returns back pagination of orders, the success callback will
   * receive 1) orders, 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 'orders' and 'pagination' of orders (on success), else null
   */
  this.getOrders = function (options) {
    options = options || {};

    var data = {};
    data['pageNumber'] = options.pageNumber || '';
    data['pageSize'] = options.pageSize || '';
//    data['searchString'] = options.search || '';
    data['_filterTime'] = options.filter || '';
    var orders = [];
    var pagination = {};
    jQuery.ajax({
      url: '/rest/myaccount/orders',
      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) {
              orders = 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(orders, pagination);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(textStatus, errorThrown);
              }
            });
    return {orders: orders, pagination: pagination};
  };

 

 

 

/rest/myaccount/orders/{orderId}

Method
GET
Comments
Description

returns an order

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

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

none

 
Headers

none

 
Receives Jsonnone 
Returns JsonOrder object

404 if order is not found.

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
    this.getOrder = function (orderId, options) {
    options = options || {};

    var order = null;
    jQuery.ajax({
      url: '/rest/myaccount/orders/' + orderId,
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      dataType: 'json'
    }).done(function (result) {
              order = result;
              if (options.success) {
                options.success(order);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(textStatus, errorThrown);
              }
            });
    return order;
  };

 

 

/rest/myaccount/orders/{orderId}/tracking

Method
GET
Comments
Description

returns an order tracking information

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

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

none

 
Headers

none

 
Receives Jsonnone 
Returns JsonArray of OrderTracking objects

empty array if no tracking available.

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  this.getOrderTracking = function (orderId, options) {
    options = options || {};
    var tracking = null;
    jQuery.ajax({
      url: '/rest/myaccount/orders/' + orderId + "/tracking",
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      dataType: 'json'
    }).done(function (result) {
              tracking = result;
              if (options.success) {
                options.success(tracking);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(textStatus, errorThrown);
              }
            });
    return tracking;
  };

 

/rest/myaccount/orders/{orderId}/case

Method
GET
Comments
Description

returns a case object for an order

See Case Management to better understand what a case is 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

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

none

 
Headers

none

 
Receives Jsonnone 
Returns JsonCase object

empty object (NOT a 404) if no case created yet for this object.

case actions are not returned (internal use only)

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
   this.getOrderCase = function (orderId, options) {
    options = options || {};
    var orderCase = null;
    jQuery.ajax({
      url: '/rest/myaccount/orders/' + orderId + "/case",
      type: 'get',
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      dataType: 'json'
    }).done(function (result) {
              if (result && result.caseOid) {
                orderCase = result;
              }
              if (options.success) {
                options.success(orderCase);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(jqXHR, textStatus, errorThrown);
              }
            });
    return orderCase;
  };

 

/rest/myaccount/orders/{orderId}/case

Method
POST
Comments
Description

inserts a case object for an order

See Case Management to better understand what a case is 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

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

none

 
Headers

none

 
Receives JsonCase Object

 The case must have one and only one message. A case can't exist without customer initiated feedback.

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.insertOrderCase = function (orderId, orderCase, options) {
    options = options || {};
    jQuery.ajax({
      url: '/rest/myaccount/orders/' + orderId + "/case",
      data: JSON.stringify(orderCase),
      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) {
                orderCase = result;
              }
              if (options.success) {
                options.success(orderCase);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(jqXHR, textStatus, errorThrown);
              }
            });
    return orderCase;
  };

 

 

/rest/myaccount/orders/{orderId}/case/messages

Method
GET
Comments
Description

returns all messages for the case associated with an order

See Case Management to better understand what a case is 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

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

none

 
Headers

none

 
Receives Jsonnone 
Returns JsonArray of CaseMessage

if order doesn't exist, a 404 is returned.

If no case exists, a 404 is returned.

 

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
   this.getOrderCaseMessages = function (orderId, options) {
    options = options || {};
    var messages = [];
    jQuery.ajax({
      url: '/rest/myaccount/orders/' + orderId + "/case/messages",
      type: 'get',
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      dataType: 'json'
    }).done(function (result) {
              if (result) {
                messages = result;
              }
              if (options.success) {
                options.success(messages);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(jqXHR, textStatus, errorThrown);
              }
            });
    return messages;
  };

 

/rest/myaccount/orders/{orderId}/case/messages

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:

/myaccount/notReviewedYet (GET)

/myaccount/reviews (GET)

 

...