Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Object Model

These json objects are used with the REST MyAccount API.   

  • id fields are only required for existing objects. When creating/adding new objects, the id field is always blank and provided by the UltraCart servers.
  • Any string fields larger than their maximum size are silently truncated. The field sizes are large enough to handle most data, and the truncation is rarely a problem. The biggest issue with with email addresses. But, an email over 100 characters is also a rarity (pity the soul that has that address).

 

 

Address

 

FieldTypeRequiredComment
idintYes*

Object Identifier. This will always be returned from the server.

Do not create one on your own (won't be accepted).

A common problem that causes our json deserializer to vomit is submitting a new Address with an empty string.

Null is okay. A string that is a parsable integer is okay. But a zero length string has no integer equivalent. Be careful not to do this!

companystring(50)No 
firstNamestring(30)Yes 
lastNamestring(30)Yes 
address1string(32)Yes 
address2string(32)No 
citystring(32)Yes 
statestring(32)Yes 
postalCodestring(20)YesIn the US, this is known as 'zip code'
countrystring(32)Yes 
titlestring(50)No 
dayPhonestring(25)No 
eveningPhonestring(25)No 

 

Case

The case is the parent object for a series of emails that can be exchanges between a customer and a merchant when there is a problem.  The case is created when the customer clicks the "Feedback" button for an order.

They can then send a message to a merchant.

FieldTypeRequiredEdit/UpdateComment
caseOidstringYes*No

Object Identifier. This will always be returned from the server.

Do not create one on your own (won't be accepted).

merchantIdstring(5)YesNonot required during insert. it's collected from cookies
orderIdstring(30)YesNo 
emailstring(100)YesYesorder email is used if missing
customerProfileIdstringYesNo

this is an integer (it's type is a string to avoid server parser errors)

this is the customer identifier. It is created when a customer creates a new profile during ordering.

This value can be found from the MyAccount object returned from the login methods.

creationDatestringNoNo

ISO-8601 format. very handy when used with something like moment.js

Assigned during case creation. Immutable afterwards.

creationDateFormattedstringNoNo

A formatted version of creationDate.

Format is: dd MMM yyyy HH:mm:ss

Sometimes it's not practical to format the ISO-8601 string, for example, within a Handlebars template.

subjectstring(200)YesYesThis is whatever the customer chooses to name their correspondence with you. This isn't a prominent feature (it's not used as extensively as it could be).
statusstring(50)YesYes

Valid Values: New, Open, Reply Received, Awaiting Feedback, Closed

New

Open

Reply Received - the last activity on this case was the customer sending you, the merchant, an email

Awaiting Feedback - the last activity on this case was you, the merchant, sending the customer an email.

Closed

As a merchant, you'll want to monitor New and Reply Received very closely. They require immediate response.

lastUpdateDatestringNoNo

ISO-8601 format. very handy when used with something like moment.js 

Updated whenever activity occurs. The system updates this. It will ignore any changes you make to this field.

lastUpdateDateFormattedstringNoNo

A formatted version of lastUpdateDate.

Format is: dd MMM yyyy HH:mm:ss

Sometimes it's not practical to format the ISO-8601 string, for example, within a Handlebars template.

messagesCaseMessage[ ]NoInsertan array of messages (emails). Contains both customer and merchant emails.

 

 

Case Message

 This is a wrapper object for a message, either from a customer to merchant, or merchant to customer.

Messages cannot be updated once inserted since the emails go out immediately.  It would be pointless to edit a message record.

FieldTypeRequiredEdit/UpdateComment
caseMessageOidStringYes*NoObject Identifier. This will always be returned from the server.
caseOidstringYes*No

Object Identifier. This will always be returned from the server.

Do not create one on your own (won't be accepted).

The caseOid is usually not required when a message is being created because it is extracted from the REST url.

If this message is the first of a new case, the oid won't even exist yet. Don't worry about it. It will be created and populatd in the reture value from any insert calls.

messagestring(2000)YesNothe main body of the email
messageSenderstring(20)NoNo

 The messageSender is determined by the API call. Any message created from the MyAccount REST API will be from a customer. Any message created with the OrderEditor API (currently private) will be from the merchant.

Values: Customer or Customer Service

messageDatestringNoNo

ISO-8601 format. very handy when used with something like moment.js

Assigned during message creation. Immutable afterwards.

messageDateFormattedstringNoNo

A formatted version of messageDate.

Format is: dd MMM yyyy HH:mm:ss

     

 

ChangePasswordRequest

This is the wrapper object for the old and new passwords needed to change a customer's password.  The email address is not needed because the customer must be logged in to change their password and the email address is collected from their login record.

FieldTypeRequiredEdit/UpdateComment
oldPasswordstring(30)Yes*Noold password
newPasswordstring(30)Yes*No

new password

 

CreditCard

A credit card object used on the payment pages.

The credit card has several int fields. Be careful that you do not submit a json object with an empty string "" in any of these fields. That will cause a parse exception and your record rejected. For number fields, must provide either a number, or null/empty. Zero length strings are not the same thing.

FieldTypeRequiredEdit/UpdateComment
merchantIdstring(30)Yes*Noold password
customerProfileIdstring(30)Yes*No

new password

ididYes*Noan internal identifer to the record. Used during updates/deletes. Do not create your own. The server will assign an id when the object is created and it will be returned from the insert call.
cardTypestringYesYes

A Valid card type. This depends on what the merchant has configured, but the possible values are: VISA, MasterCard, Discover, Diners Club, JCB, AMEX

Case and spaces matter on the card type. Take care.

cardExpMonthintYesYes1-12 corresponding to the 12 months of Jan-Feb
cardExpYearintYesYesFour digit year.
cardNumberstringYesYes

A valid credit card number. Validity depends on the card type.

When credit card records are returned from the server, they are always masked. The only time this record has the full CC number is upon insert/update. Don't worry about wiping the CC field. Leave the mask in place.

The server is smart enough to check for an updated number and apply it. If the mask is returned, the server will ignore the field.

lastUsedDatestringNoNo

ISO-8601 format. very handy when used with something like moment.js

Updated whenever the card is used or changed. Do not provide or update this value. Any updates are ignored.

This value is assigned on the server.

lastUsedDateFormattedstringNoNo

A formatted version of lastUsedDate.

Format is: dd MMM yyyy HH:mm:ss


CustomerCredentials

This is the wrapper object for the values needed during login. 

FieldTypeRequiredEdit/UpdateComment
merchantIdstring(50)YesN/A 
emailstring(100)YesN/A

 

passwordstring(30)YesN/A 

 

MyAccount

 This contains the high level record for the customer.   While there is overlap between this record and the shipping/billing addresses, this is the address of record.  

It cannot be deleted, except to delete the entire customer.  

This record cannot be created, except during the ordering process by the customer.  It can only be selected / updated / deleted from the MyAccount API

FieldTypeRequiredComment
merchantIdstring(5)Yes 
customerProfileIdintYes*

Object Identifier. This will always be returned from the server.

Do not create one on your own (won't be accepted).

A common problem that causes our json deserializer to vomit is submitting a new Address with an empty string.

Null is okay. A string that is a parsable integer is okay. But a zero length string has no integer equivalent. Be careful not to do this!

titlestring(50)No 
companystring(50)No 
firstNamestring(30)Yes 
lastNamestring(30)Yes 
address1string(32)Yes 
address2string(32)No 
citystring(32)Yes 
statestring(32)Yes 
postalCodestring(20)YesIn the US, this is known as 'zip code'
countrystring(32)Yes 
titlestring(50)No 
dayPhonestring(25)No 
eveningPhonestring(25)No 
faxstring(32)NoDoes anyone even use fax machines any more? If so, this field is for them.
taxIdstring(15)NoVery popular field for wholesale customers.
passwordstring(30)No

This is not returned when the records are selected, and it cannot be updated via this record. It must be updated via a specific call (changePassword).

As I write this, I'm not really sure why it's even a part of this record...

 

NotReviewedItem

This object represents a purchased item that does not yet have a review written by the customer.  It's used on the reviews page and contains enough information to display a line enticing the customer to write a review and then direct them to the review screen.

Reviews cannot be created via this API.  This was done on purpose to drive all reviews through the review cgi.    That cgi has a multitude of functionality chosen not to duplicate.

FieldTypeComment
merchantIdstring(5) 
itemIdstring(30)

The merchant item id.

merchantItemOidstringAn string containing a number that is used to internally identify the item record. Both the item id and oid are provided because both are needed at different times during the display and link creation.
lastOrderDatestring

ISO-8601 format. very handy when used with something like moment.js

Contains the last date the item was ordered. Since the "not reviewed yet" item list is a distinct list, this value helps show the most recent purchases first.

lastOrderDateFormattedstring

A formatted version of lastOrderDate.

Format is: dd MMM yyyy HH:mm:ss

Sometimes it's not practical to format the ISO-8601 string, for example, within a Handlebars template.

itemItemA complex item containing all the details about the item. See its page for specifics.

 

Order

OrderTracking

ReviewedItem

This read-only object contains an item review.

FieldTypeComment
itemIdstringthe item id of the item reviewed
itemItem A complex item containing all the details about the item. See its page for specifics.
reviewOidintegerreview record's internal identifier
merchantIdstringthe merchant id (your merchant id)
customerProfileIdintegercustomer's internal identifier
merchantItemOidintegeritem's internal identifier
overallnumber1-5 The overall rating of the item. This should be featured prominently.
ratingName1stringThe name (category) of this rating. Configured by the merchant. Examples: Ease of Use, Price, Durability, etc.
ratingName2stringThe name (category) of this rating.
ratingName3stringThe name (category) of this rating.
ratingName4stringThe name (category) of this rating.
ratingName5stringThe name (category) of this rating.
ratingName6stringThe name (category) of this rating.
ratingName7stringThe name (category) of this rating.
ratingName8stringThe name (category) of this rating.
ratingName9stringThe name (category) of this rating.
ratingName10stringThe name (category) of this rating.
ratingScore1number1-5, the rating for the associated rating name.
ratingScore2number1-5, the rating for the associated rating name.
ratingScore3number1-5, the rating for the associated rating name.
ratingScore4number1-5, the rating for the associated rating name.
ratingScore5number1-5, the rating for the associated rating name.
ratingScore6number1-5, the rating for the associated rating name.
ratingScore7number1-5, the rating for the associated rating name.
ratingScore8number1-5, the rating for the associated rating name.
ratingScore9number1-5, the rating for the associated rating name.
ratingScore10number1-5, the rating for the associated rating name.
recommendToFriendbooleantrue if the customer would recomment the item to a friend.
titlestringThe title of the review
reviewstringThe review itself. These are the customer's comments.
statusCodestringApproved, Rejected, or Unapproved
featuredbooleantrue if the merchant has chosen to feature this review
recommendStoreToFriendbooleantrue if the customer would recommend your store to friends.
storeFeedbackstringany comments the customer had for your store
submittedDatestring

ISO-8601 format. very handy when used with something like moment.js

Contains the date when the review was submitted

submittedDateFormattedstring

A formatted version of submittedDate.

Format is: dd MMM yyyy HH:mm:ss

Sometimes it's not practical to format the ISO-8601 string, for example, within a Handlebars template.

helpfulYesVotesintegerthe number of times other customers have marked a review as helpful.
helpfulNoVotesintegerthe number of times other customers have marked a review as unhelpful.

 

 

 

 

 

TODO:

/myaccount/loggedIn (GET)

/myaccount/login (GET/POST)

/myaccount/logout (GET)

/myaccount/changePassword (POST)

/myaccount/forgotPassword (POST)

/myaccount/settings (GET)

/myaccount/settings (POST)

/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)

/myaccount/creditCards/id (DELETE)

/myaccount/orders (GET)

/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)
/myaccount/orders/orderId/case/messages (POST)

/myaccount/notReviewedYet (GET)

/myaccount/reviews (GET)

 

 

 

 

 

  • No labels