Versions Compared

Key

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

...

Method
PUT
Comments
Description

updates customer settings

password cannot be updated here. It can only be done through changePassword. 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

A new account cannot be created if the customer is logged in. They must log out first to create an account. 
Path Parametersnone 
Query Parameters

none

 
Headers

none

 
Receives JsonMyAccount object 
Returns JsonMyAccount object

password is not returned. a string of asterisks is returned instead.

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  this.updateSettings = function (changes, options) {
    options = options || {};
    var account = null;
    jQuery.ajax({
      url: '/rest/myaccount/settings',
      data: JSON.stringify(changes),
      type: 'put',
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      contentType: 'application/json; charset=UTF-8',
      dataType: 'json'
    }).done(function (result) {
              account = result;
              if (options.success) {
                options.success(account);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(jqXHR, textStatus, errorThrown);
              }
            });
    return account;
  };

 

 

TODO: 

/

...

rest/myaccount/settings

...

/myaccount/settings (PUT)

/myaccount/settings (DELETE)

/myaccount/shippingAddresses (GET)

/myaccount/shippingAddresses/id (GET)

/myaccount/shippingAddresses (POST)

/myaccount/shippingAddresses/id (PUT)

/myaccount/shippingAddresses/id (DELETE)

/myaccount/billingAddresses (GET)

/myaccount/billingAddresses/id (GET)

/myaccount/billingAddresses (POST)

/myaccount/billingAddresses/id (PUT)

/myaccount/billingAddresses/id (DELETE)

/myaccount/creditCards (GET)

/myaccount/creditCards/id (GET)

/myaccount/creditCards (POST)

/myaccount/creditCards/id (PUT)

...

Method
DELETE
Comments
Description

deletes a customer profile

once a profile is deleted, it's gone. be careful allowing this.

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

Customer must be logged in to delete their profile.
Path Parametersnone 
Query Parameters

none

 
Headers

none

 
Receives JsonnoneThe settings object is not required to delete a profile. The cart id is sufficient. 
Returns Jsonnone

204 No Content returned on success

Example

 

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

 

 

 

/rest/myaccount/shippingAddresses

Method
GET
Comments
Description

returns all shipping addresses

 

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

 

Example

 

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

 

 

 

/rest/myaccount/shippingAddresses/{id}

Method
GET
Comments
Description

returns a shipping address record

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

The customer must be logged in.
Path Parametersidaddress record identifier 
Query Parameters

none

 
Headers

none

 
Receives Jsonnone 
Returns JsonAddress object

 

Example

 

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

 

 

 

 

/rest/myaccount/shippingAddresses

Method
POST
Comments
Description

adds a shipping address

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

Customer must be logged in to perform this operation
Path Parametersnone 
Query Parameters

none

 
Headers

none

 
Receives JsonAddress object 
Returns JsonAddress object

the return object will contain the record id (unique identifier) 

Any field violations (exceeded length, missing fields) will return a 400 Bad Request.

 If the address already exists, a 400 Bad Request is returned.

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  this.insertShippingAddress = function (address, options) {
    options = options || {};
    var insertedAddress = null; // will contain oid
    jQuery.ajax({
      url: '/rest/myaccount/shippingAddresses',
      type: 'post',
      data: JSON.stringify(address),
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      contentType: 'application/json; charset=UTF-8',
      dataType: 'json'
    }).done(function (result) {
              insertedAddress = result;
              if (options.success) {
                options.success(insertedAddress);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(jqXHR, textStatus, errorThrown);
              }
            });
    return insertedAddress;
  };

 

 

/rest/myaccount/shippingAddresses/{id}

Method
PUT
Comments
Description

updates a shipping address record

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

 
Path Parametersidshipping address record identifier 
Query Parameters

none

 
Headers

none

 
Receives JsonMyAccount object 
Returns JsonMyAccount object

If the address is updated to an address that already exists, a 400 Bad Request is returned.

Example

 

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

 

 

 

/rest/myaccount/shippingAddresses/{id}

Method
DELETE
Comments
Description

deletes a shipping address

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

Customer must be logged in to delete an address
Path Parametersidaddress record identifier 
Query Parameters

none

 
Headers

none

 
Receives Jsonnone 
Returns Jsonnone

204 No Content returned on success

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  this.deleteShippingAddress = function (address, options) {
    options = options || {};
    jQuery.ajax({
      url: '/rest/myaccount/shippingAddresses/' + address.id,
      type: 'delete',
      data: JSON.stringify(address),
      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(jqXHR, textStatus, errorThrown);
              }
            });
  };

 

 

 

/rest/myaccount/billingAddresses

Method
GET
Comments
Description

returns all billing addresses

 

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

 

Example

 

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

 

 

 

/rest/myaccount/billingAddresses/{id}

Method
GET
Comments
Description

returns a billing address record

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

The customer must be logged in.
Path Parametersidaddress record identifier 
Query Parameters

none

 
Headers

none

 
Receives Jsonnone 
Returns JsonAddress object

 

Example

 

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

 

 

 

 

/rest/myaccount/billingAddresses

Method
POST
Comments
Description

adds a billing address

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

Customer must be logged in to perform this operation
Path Parametersnone 
Query Parameters

none

 
Headers

none

 
Receives JsonAddress object 
Returns JsonAddress object

the return object will contain the record id (unique identifier) 

Any field violations (exceeded length, missing fields) will return a 400 Bad Request.

 If the address already exists, a 400 Bad Request is returned.

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  this.insertBillingAddress = function (address, options) {
    options = options || {};
    var insertedAddress = null; // will contain oid
    jQuery.ajax({
      url: '/rest/myaccount/billingAddresses',
      type: 'post',
      data: JSON.stringify(address),
      async: (options.success || options.failure) ? true : false,
      headers: { "cache-control": "no-cache" },
      cache: false,
      contentType: 'application/json; charset=UTF-8',
      dataType: 'json'
    }).done(function (result) {
              insertedAddress = result;
              if (options.success) {
                options.success(insertedAddress);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(jqXHR, textStatus, errorThrown);
              }
            });
    return insertedAddress;
  };

 

 

/rest/myaccount/billingAddresses/{id}

Method
PUT
Comments
Description

updates a billing address

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

 
Path Parametersidbilling address record identifier 
Query Parameters

none

 
Headers

none

 
Receives JsonMyAccount object 
Returns JsonMyAccount object

If the address is updated to an address that already exists, a 400 Bad Request is returned.

Example

 

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

 

 

 

/rest/myaccount/billingAddresses/{id}

Method
DELETE
Comments
Description

deletes a billing address

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

Customer must be logged in to delete an address
Path Parametersidaddress record identifier 
Query Parameters

none

 
Headers

none

 
Receives Jsonnone 
Returns Jsonnone

204 No Content returned on success

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  this.deleteBillingAddress = function (address, options) {
    options = options || {};
    jQuery.ajax({
      url: '/rest/myaccount/billingAddresses/' + address.id,
      type: 'delete',
      data: JSON.stringify(address),
      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(jqXHR, textStatus, errorThrown);
              }
            });
  };

 

 

/rest/myaccount/creditCards

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

 

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;
  };

 

 

 

/rest/myaccount/creditCards/{id}

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

 

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;
  };

 

 

 

 

/rest/myaccount/creditCards

Method
POST
Comments
Description

adds a credit card

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

Customer must be logged in to perform this operation
Path Parametersnone 
Query Parameters

none

 
Headers

none

 
Receives JsonCreditCard object 
Returns JsonCreditCard object

the return object will contain the record id (unique identifier) 

Any field violations (exceeded length, missing fields) will return a 400 Bad Request.

 If the card number already exists, a 400 Bad Request is returned.

The card number is not returned (only a mask)

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  this.insertCreditCard = function (creditCard, options) {
    options = options || {};
    var insertedCard = null; // will contain oid
    jQuery.ajax({
      url: '/rest/myaccount/creditCards',
      type: 'post',
      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 (result) {
              insertedCard = result;
              if (options.success) {
                options.success(insertedCard);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(jqXHR, jqXHR, textStatus, errorThrown);
              }
            });
    return insertedCard;
  };

 

 

/rest/myaccount/creditCards/{id}

Method
PUT
Comments
Description

updates a credit card

 

Cookies

UltraCartMerchantID = Merchant ID

UltraCartShoppingCartId - Cart ID

 
Path Parametersidcredit card record identifier  (not card number)
Query Parameters

none

 
Headers

none

 
Receives JsonCreditCard objectThe card number is only updated if it contains a valid card. If the mask is returned or an empty field returned, the card number is not updated. 
Returns JsonCreditCard object

If the card number is updated to a card that already exists, a 400 Bad Request is returned.

Example

 

Code Block
themeDJango
languagejavascript
linenumberstrue
  this.updateCreditCard = function (creditCard, options) {
    options = options || {};
    var updatedCard = null;
    jQuery.ajax({
      url: '/rest/myaccount/creditCards/' + creditCard.id,
      type: 'put',
      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 (result) {
              updatedCard = result;
              if (options.success) {
                options.success(updatedCard);
              }
            })
            .fail(function (jqXHR, textStatus, errorThrown) {
              if (options.failure) {
                options.failure(jqXHR, textStatus, errorThrown);
              }
            });
    return updatedCard;
  };

 

 

 

/rest/myaccount/creditCards/{id}

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:

/myaccount/orders (GET)

/myaccount/orders/orderId (GET)

...