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 5 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

MyAccount

NotReviewedItem

Order

OrderTracking

OrderItem

ReviewedItem

 

 

 

 

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