...
| | |
---|
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 Parameters | none | |
Query Parameters | none
| |
Headers | none
| |
Receives Json | MyAccount object | |
Returns Json | MyAccount object | password is not returned. a string of asterisks is returned instead. |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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)
...
| | |
---|
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 Parameters | none | |
Query Parameters | none
| |
Headers | none
| |
Receives Json | none | The settings object is not required to delete a profile. The cart id is sufficient. |
Returns Json | none | 204 No Content returned on success |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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
| | |
---|
Description | returns all shipping addresses | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| The customer must be logged in. |
Path Parameters | none | |
Query Parameters | none
| |
Headers | none
| |
Receives Json | none | |
Returns Json | Array of Address objects | |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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}
| | |
---|
Description | returns a shipping address record | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| The customer must be logged in. |
Path Parameters | id | address record identifier |
Query Parameters | none
| |
Headers | none
| |
Receives Json | none | |
Returns Json | Address object | |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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
| | |
---|
Description | adds a shipping address | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| Customer must be logged in to perform this operation |
Path Parameters | none | |
Query Parameters | none
| |
Headers | none
| |
Receives Json | Address object | |
Returns Json | Address 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 |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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}
| | |
---|
Description | updates a shipping address record | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| |
Path Parameters | id | shipping address record identifier |
Query Parameters | none
| |
Headers | none
| |
Receives Json | MyAccount object | |
Returns Json | MyAccount object | If the address is updated to an address that already exists, a 400 Bad Request is returned. |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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}
| | |
---|
Description | deletes a shipping address | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| Customer must be logged in to delete an address |
Path Parameters | id | address record identifier |
Query Parameters | none
| |
Headers | none
| |
Receives Json | none | |
Returns Json | none | 204 No Content returned on success |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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
| | |
---|
Description | returns all billing addresses | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| The customer must be logged in. |
Path Parameters | none | |
Query Parameters | none
| |
Headers | none
| |
Receives Json | none | |
Returns Json | Array of Address objects | |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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}
| | |
---|
Description | returns a billing address record | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| The customer must be logged in. |
Path Parameters | id | address record identifier |
Query Parameters | none
| |
Headers | none
| |
Receives Json | none | |
Returns Json | Address object | |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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
| | |
---|
Description | adds a billing address | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| Customer must be logged in to perform this operation |
Path Parameters | none | |
Query Parameters | none
| |
Headers | none
| |
Receives Json | Address object | |
Returns Json | Address 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 |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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}
| | |
---|
Description | updates a billing address | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| |
Path Parameters | id | billing address record identifier |
Query Parameters | none
| |
Headers | none
| |
Receives Json | MyAccount object | |
Returns Json | MyAccount object | If the address is updated to an address that already exists, a 400 Bad Request is returned. |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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}
| | |
---|
Description | deletes a billing address | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| Customer must be logged in to delete an address |
Path Parameters | id | address record identifier |
Query Parameters | none
| |
Headers | none
| |
Receives Json | none | |
Returns Json | none | 204 No Content returned on success |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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
| | |
---|
Description | returns all credit cards | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| The customer must be logged in. |
Path Parameters | none | |
Query Parameters | none
| |
Headers | none
| |
Receives Json | none | |
Returns Json | Array of CreditCard objects | |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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}
| | |
---|
Description | returns a credit card record | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| The customer must be logged in. |
Path Parameters | id | credit card identifier (not card number) |
Query Parameters | none
| |
Headers | none
| |
Receives Json | none | |
Returns Json | CreditCard object | |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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
| | |
---|
Description | adds a credit card | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| Customer must be logged in to perform this operation |
Path Parameters | none | |
Query Parameters | none
| |
Headers | none
| |
Receives Json | CreditCard object | |
Returns Json | CreditCard 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 |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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}
| | |
---|
Description | updates a credit card | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| |
Path Parameters | id | credit card record identifier (not card number) |
Query Parameters | none
| |
Headers | none
| |
Receives Json | CreditCard object | The 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 Json | CreditCard object | If the card number is updated to a card that already exists, a 400 Bad Request is returned. |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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}
| | |
---|
Description | deletes a credit card | |
Cookies | UltraCartMerchantID = Merchant ID
UltraCartShoppingCartId - Cart ID
| Customer must be logged in to delete an address |
Path Parameters | id | credit card identifier (not card number) |
Query Parameters | none
| |
Headers | none
| |
Receives Json | none | |
Returns Json | none | 204 No Content returned on success |
Example |
Code Block |
---|
theme | DJango |
---|
language | javascript |
---|
linenumbers | true |
---|
| 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)
...