Versions Compared

Key

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

...

FieldTypeComment
cartIdstringThe unique ID for the cart. This needs to be stored as a cookie on the customer's browser so that the cart can be retrieved.
merchantIdstringThe char(5) merchant designation (created during sign up)
errorsstring[]an array of errors returned from a call.  This property should always be consulted after a call returns and messages displayed to the end customer.

advertisingSourcestringAdvertising source the customer selected or entered.
affiliateIdstringThe ID of the affiliate associated with this cart. You can set this field to manually assign an order to a specific affiliate. If no affiliate is associated with the order then this field will be null.
affiliateSubIdstringThe Sub ID of the affiliate associated with this cart. The same comments for affiliateId apply to this field as well.
amazonMerchantIdstringThe merchant's Amazon Seller ID as configured in the UltraCart system.
amazonOrderReferenceIdstring

The reference id provided by Amazon once the customer has initiated checkout with them. If this is non-null and cart.paymentMethod is "Amazon", the order will be processed through Amazon.

Tip

This cart example has all of the amazon code plumbed. Take some time to understand it. It is NOT a trivial few lines of code to make it work seamlessly.

https://github.com/UltraCart/rest_api/tree/master/cart_example


amazonWidgetUrlstring

The url for the amazon widget script. This will be production or sandbox depending on your UltraCart configuration.

Note

The example link in the amazonOrderReferenceId does not use these values since the scripts are loaded statically.


amazonButtonUrlstringThe url for the amazon button script. This will be production or sandbox depending on your UltraCart configuration.
arbitraryShippingHandlingTotalnumberOverride field allowing merchant to override the shipping and handling calculated by the system. To use this field, the Shipping and Handling must be configured to allow overrides.
arbitraryTaxnumberOverride field allowing merchants to override calculated tax. To use this field, the Tax must be configured to allow overrides.
arbitraryTaxRatenumberOverride field allowing merchants to override calculated tax rate. To use this field, the Tax must be configured to allow overrides.
arbitraryTaxableSubtotalnumberOverride field allowing merchants to override the taxable subtotal. To use this field, the Tax must be configured to allow overrides.
baseCurrencyCodestring

The default currency code for the merchant. For most merchants, this will be USD, but can be changed in the merchant's configuration.

see also currencyCode

Valid values are:

AUD Australian Dollar
CAD Canadian Dollar
EUR Euro
JPY  Japanese Yen
MXN  Mexican Peso
NOK  Norwegian Krone
NZD  New Zealand Dollar
GBP  Pound Sterling
RUB  Russian Ruble
SGD  Singapore Dollar
SEK  Swedish Krona
CHF  Swiss Franc
TRY  Turkish New Lira
USD  US Dollar
BRL  Brazilian Real

billToAddress1stringBill to address line 1
billToAddress2stringBill to address line 2
billToCitystringBill to city
billToCompanystringBill to company
billToCountrystringBill to country. Must be a valid country name from the getAllowedCountries() API call.
billToDayPhonestringBill to day phone
billToEveningPhonestringBill to evening phone
billToFirstNamestringBill to first name
billToLastNamestringBill to last name
billToPostalCodestringBill to postal code
billToStatestringBill to state
billToTitlestringBill to title
buysafeBondAvailablebooleanbuySAFE bond availability
buysafeBondCostnumberCost of the buySAFE bond (for buySAFE merchants only)
buysafeBondFreenumberTrue if the buySAFE bond is free to the customer
buysafeBondWantedbooleanTrue if the customer has opted in to a buySAFE bond
buysafeCartDisplayTextstringThe sales text to display by the buySAFE control
buysafeCartDisplayUrlstringThe URL to link the sales text to so the customer can learn more about buySAFE.
ccEmailstringCC Email address
collectCreditCardVerificationNumberbooleanTrue if the CVV2 should be collected for this merchant.
commentsstring

customer comments. this is usually collected via a textarea field.

Added 12/2/2013

couponsCartCoupon[ ]Coupons that have been applied to the cart.
creditCardExpirationMonthIntegerCredit card expiration month 1 = January 12 = December
creditCardExpirationYearintegerCredit card expiration year. Must be a four digit year.
creditCardNumberstring

Credit card number

Warning

As of January 2014, there is a new method for collecting credit card numbers. Please collect card numbers through the card store script. This optional method will become a requirement in the very near future.


creditCardTokenstringCredit card token (if you are using a tokenizing gateway like Stripe.com)
creditCardTypestringType of credit card. See the CREDIT_CARD_TYPE_ constants in the checkoutapi.js file for valid values.
creditCardTypesstring[]An array of credit card types (Visa, Mastercard, etc.) that are currently accepted. Used to generate drop down lists.
creditCardVerificationNumberstringCredit card verification number 4 digits for American Express and 3 digits for all other types of credit cards.
currencyCodestring

The currency of the cart. The default is the merchant default. Change this value to set the currency of the cart to a different value. If the first item added to the cart has a default currency other than USD, the cart currency will change to match the first item automatically.

(see also baseCurrencyCode)

customerProfileCreditCardIdInteger

The oid (object id) of a stored (on file) credit card to use with the checkout. Supply this to us a credit card on file.

When this is value is passed in to an update call, it will return back a cart with all the card information populated (number masked).

If you wish to remove a stored credit card from an order, set this property to 0 (zero). That will reset it.

The credit card id is found in the cart object of a logged in customer at cart.customerProfile.creditCards[0].id


Warning

UltraCart does not store CVV values. If you chose to allow stored credit cards, you must configure your payment gateway not to require CVV values. If a stored card is used, UltraCart will not validate/require a CVV.

A list of stored credit cards can be obtained from the MyAccount REST API. The customer must be logged in to retrieve a list of credit cards on file.


Note

There are two ways to create a customer account (profile). The /rest/cart methods do not actually create the customer profile until the order completes. At that time, it will store the addresses used and credit cards (if your merchant account is configured to do so).

The MyAcccount REST API does create the customer immediately so it can be used with the MyAccount customer portal. Both APIs use a shopping cart as the underlying cookie/state maintenance. So a customer logged into one is automatically logged into the other.


customField1stringA custom field to store up to 50 characters.
customField2stringA custom field to store up to 50 characters.
customField3stringA custom field to store up to 50 characters.
customField4stringA custom field to store up to 50 characters.
customField5stringA custom field to store up to 50 characters.
customField6stringA custom field to store up to 50 characters.
customField7stringA custom field to store up to 50 characters.
customerProfileCustomerProfileIf loggedIn, this variable will contain the CustomerProfile for the current session.
deliveryDateDateDelivery date (optional)
emailstringEmail address
emailConfirmstringSecond copy of email address used to confirm the customer entered it correctly
exchangeRatenumberThe conversion rate between merchant default and local currencies
giftCertificatestringGift certificate code

giftCertificateAmount

giftCertificateAmountLocalized

giftCertificateAmountLocalizedFormatted

number

number

string

Gift certificate amount

giftCertificateRemainingBalanceAfterOrder

giftCertificateRemainingBalanceAfterOrderLocalized

giftCertificateRemainingBalanceAfterOrderLocalizedFormatted

number

number

string

The balance remaining the gift certificate if its initial value was greater than the cart total.

giftCharge

giftChargeLocalized

giftChargeLocalizedFormatted

number

number

string

Gift charge
giftEmailstringEmail address of the person receiving this purchase as a gift
giftEmailstringGift Email address
giftMessagestringGift message

giftWrapCost

giftWrapCostLocalized

giftWrapCostLocalizedFormatted

number

number

string

Gift wrap cost
hasAmazonbooleanThis will be true if the merchant has "Pay with Amazon" configured properly AND the cart supports it, i.e. the items can be process through Amazon Payments. If the cart is empty, this will be false, since you can't checkout with zero items.
hasPayPalbooleanTrue if the merchant has PayPal enabled.
ipAddressstringIP Address of the customer. Used for geo-location of shipping estimates.
itemsCartItem[ ]All the items in the cart.
liftGatebooleanTrue if this purchase will require delivery by lift gate, false (default) otherwise.
loggedInbooleantrue if a customer profile is active, false if otherwise
mailingListOptInbooleanWhether the customers wants to receive news and special offers via email.
needShippingbooleantrue if the cart needs shipping calculated.
needPaymentboolean

true if the cart should collect payment. This may seem a little useless since it would stand to reason that any time the total is greater than zero payment should be collected. However, there are outside cases where this flag makes the difficult easy. For example, if a customer purchases a free product that is tied to an auto order, then the total of the cart is zero, but payment must be collected for the recurring item to be charged against. This flag makes those scenarios automatic where they would otherwise be impossible to determine without some hardcoded measures.

Note: Added January 2014. Only available with the REST API

passwordstring

the password is only used during the login (or register) process to log a customer in. It is not populated on any returned objects, so it is lost (purposely) after login.

Constraints: 30 characters max.

payPalButtonAltTextstringAlt text to use on the PayPal express checkout image
payPalButtonUrlstringURL of the PayPal express checkout image
payPalCompatiblebooleanTrue if this cart is compatible with PayPal
paymentMethodstringType of payment method. See the PAYMENT_METHOD_ constants in the checkoutapi.js file for valid values.
purchaseOrderNumberstringPurchase order number
rtgCodestringSpecify the Rotating Transaction Gateway for this checkout experience.
screenBrandingThemeCodestringThe screen branding theme associated with the cart.
shipOnDateDateShip on date (optional)
shipToAddress1stringShip to address line 1
shipToAddress2stringShip to address line 2
shipToCitystringShip to city
shipToCompanystringShip to company
shipToCountrystringShip to country. Must be a valid country name from the getAllowedCountries() API call.
shipToFirstNamestringShip to first name
shipToLastNamestringShip to last name
shipToPhonestringShip to phone
shipToPostalCodestringShip to postal code
shipToResidentialbooleanTrue if the address is residential.
shipToStatestringShip to state
shipToTitlestringShip to title

shippingHandling

shippingHandlingLocalized

shippingHandlingLocalizedFormatted


number

number

string

Shipping and handling cost

Tip

This must be set manually when assigning the shippingMethod! The backend will not calculate this during cart updates. Shipping costs are extremely slow to calculate because numerous third party companies (Fed Ex, UPS, USPS) must be contacted etc. Therefore, when you assign the shipping method, you must also set the price in order the the customer to see it correctly reflected during the ordering process. When the order is submitted, the actual shipping is recalculated and set by the back end. This prevents any clever customers from trying to override the cost by putting zero in the field.


shippingHandlingDiscount

shippingHandlingDiscountLocalized

shippingHandlingDiscountLocalizedFormatted

number

number

string

Shipping and handling discount (because of coupon)

shippingHandlingWithDiscount

shippingHandlingWithDiscountLocalized

shippingHandlingWithDiscountLocalizedFormatted

number

number

string

Shipping and handling cost after discount applied.
shippingMethodstringShipping method
specialInstructionsstringSpecial instructions for delivery.
storeCreditCardboolean

If true and the customer has logged in (cart.customerProfile != null and cart.loggedIn == true), then the credit used during the purchase is stored in the customer's profile.

UltraCart considers it good ettiquette to prompt the user to store their credit card. On the normal checkout pages, this is done via a checkbox.

subtotal

subtotalLocalized

subtotalLocalizedFormatted

number

number

string

Subtotal

subtotalDiscount

subtotalDiscountLocalized

subtotalDiscountLocalizedFormatted

number

number

string

Subtotal discount (because of coupon)

subtotalWithDiscount

subtotalWithDiscountLocalized

subtotalWithDiscountLocalizedFormatted

number

number

string

Subtotal after discounts have been applied

surcharge

surchargeLocalized

surchargeLocalizedFormatted

number

number

string

Credit card surcharge amount

tax

taxLocalized

taxLocalizedFormatted

number

number

string

Tax
taxCountystringThe tax county assigned to this customer. See method getTaxCounties().
taxExemptnumberTrue if the customer is tax exempt
taxRatenumberTax rate

taxableSubtotal

taxableSubtotalLocalized

taxableSubtotalLocalizedFormatted

number

number

string

Taxable subtotal

taxableSubtotalDiscount

taxableSubtotalDiscountLocalized

taxableSubtotalDiscountLocalizedFormatted

number

number

string

Taxable subtotal discount (because of coupons)

taxableSubtotalWithDiscount

taxableSubtotalWithDiscountLocalized

taxableSubtotalWithDiscountLocalizedFormated

number

number

string

Taxable subtotal after discounts.

total

totalLocalized

totalLocalizedFormatted

number

number

string

Total
upsellPathCodestring

A string dictating which upsell path code should be followed. By specifying this path, this will override any upsells normally followed based on the cart contents.

Note: Added Dec, 2013, Available only for the Checkout REST API.

...

FieldTypeComment
labelshashthis hash contains all the labels for the various fields below. This hash is powerful because it contains the mappings you specify in the back end "screen branding' section. See the order labels section for individual listings.
merchantIdstringyour merchant id
customerProfileIdintcustomer's internal identifier
orderIdstringorder id
rejectedbooleantrue if the order was rejected
themeCodestringthe theme code applied to this order. See screen branding. This code is often used when creating buy links to apply the proper look and feel to an order page. Some merchants only have one theme. Some merchants have 50.
creationDatestringISO-8601 format. When the order was created
creationDateFormattedstringDD-MMM-YYYY format. When the order was created
shipOnDatestringISO-8601 format. When the order was requested to ship on.
shipOnDateFormattedstringDD-MMM-YYYY format. When the order was requested to ship on.
saturdayDeliverybooleantrue if the order is set for Saturday delivery
rejectedDatestringISO-8601 format. When the order was rejected (null if it hasn't been)
rejectedDateFormattedstringDD-MMM-YYYY format of when the order was rejected, if it was.
quoteExpirationDatestringISO-8601 format. If this order is a quote, when the quote expires.
quoteExpirationDateFormattedstringDD-MMM-YYYY format. If this order is a quote, when the quote expires.
statusstringCompleted, Rejected, Quote Sent, Quote Requested, Pre-Order Item, Pending
testOrderbooleantrue if this order was a test
shippingMethodstring a bare bones description of the shipping method
shippingMethodNamestring a friendly version of the shipping method. This should be preferred for display over shippingMethod
shippingMethodDetailedstringan elaborate string contain shippingMethodName and any features such as lift gates and ship to residential,  
shippingMethodCompanystringUPS, FedEx, etc. 
shipping3rdPartyAccountNumberstring
emailstring
ccEmailsstring[ ]an array of email addresses who were cc'd on the order.  
giftEmailstringthe gift recipient's email address 
billToCompanystring
billToTitlestring
billToFirstNamestring
billToLastNamestring
billToAddress1string
billToAddress2string
billToCitystring
billToStatestring
billToPostalCodestring
billToCountrystring
billToDayPhonestring
billToEveningPhonestring
shipToCompanystring
shipToTitlestring
shipToFirstNamestring
shipToLastNamestring
shipToAddress1string
shipToAddress2string
shipToCitystring
shipToStatestring
shipToPostalCodestring
shipToCountrystring
shipToDayPhonestring
shipToEveningPhonestring
giftbooleantrue if the order is a gift
liftGatebooleantrue if the order requires a lift gate to deliver.
shipToResidentialbooleantrue if the delivery is a residence
hidePaymentInformationbooleanwhether or not to show payment information. Imagine the scenario where the cost is zero and/or gift certificates were used.
refundPresentbooleanduplicate of hasRefund. Use hasRefund, as this field is deprecated and will be removed without warning.
taxShippingbooleanis shipping taxed? this affects the display of subtotal information (tax before subtotal or subtotal before tax).
taxCountystring
referralCodestring
advertisingSourcestring
paymentMethodstring

Credit Card, PayPal Order, etc.

Supported payment methods as of 6/2013 (list may change):

Check
Credit Card
Credit Card Fax In
PayPal
eCheck
Purchase Order
Unknown
Money Order
Wire Transfer
COD
CASH
SafetyPay
Amazon SC
SkyMall
Smart Bargains
Quote Request

paymentNotestringA friendly working of the paymentMethod. For display purposes, use this value instead of paymentMethod. It will always read the same or better.
cardTypestringThe type of credit card used. VISA, MasterCard, etc.
cardNumberstringmasked. last four digits.
couponsCouponThe coupon class contains two simple fields: code and description
itemsItem[ ]The items for this order
giftWrapTitlestringthe name of the gift wrap
giftWrapCost / giftWrapCostFormattednumber / string
hasDiscountbooleantrue if a discount was made somewhere (often useful for adding an extra table column, etc.)
hasRefundbooleantrue if a refund was made somewhere (often useful for adding an extra table column, etc.)
subtotalBeforeDiscount / subtotalBeforeDiscountFormattednumber / string
discount / discountFormattednumber / string
subtotal / subtotalFormattednumber / stringsubtotal with any discounts and refunds already applied
subtotalRefunded / subtotalRefundedFormattednumber / string
taxRate / taxRateFormattednumber / string
shippingHandlingDiscount / shippingHandlingDiscountFormattednumber / string
shippingHandlingTotal / shippingHandlingTotalFormattednumber / stringtotal with any discounts and refunds already applied.
shippingHandlingRefunded / shippingHandlingRefundedFormattednumber / string
tax / taxFormattednumber / stringtax with any refund already applied
taxRefunded / taxRefundedFormattednumber / string
giftCharge / giftChargeFormattednumber / string
surcharge / surchargeFormattednumber / stringshowBuysafebooleantrue if this order used buySAFE and the amounts should be shown.buysafeCost / buysafeCostFormattednumber / stringbuysafeRefunded / buysafeRefundedFormattednumber / string
showInsureShipboolean

true if this order used InsureShip and the amounts should be shown.

Note

InsureShip is no longer available. This would only apply to old legacy orders. It's doubtful you need to consider this field.


insureShipCost / insureShipCostFormattednumber / stringinsure ship cost
insureShipRefunded / insureShipRefundedFormattednumber / stringvalue of any insure ship refunded
total / totalFormattednumber / stringgrand total
totalRefunded / totalRefundedFormattednumber / stringof the total, this amount was refunded
showCurrencyWarningbooleantrue if the currency warning (next line) should be shown.
currencyWarningstringthis is the standard currency warning if the order was placed in a different currnency. It contains a nicely formatted message to show to the customer.
giftCertificateCodestringthe gift certificate code. If the gift certificate was a credit card type, the code will be masked.
giftCertificateAmount / giftCertificateAmountFormattednumber / stringthe amount used of the gift certificate
giftMessagestring[ ]

array of gift message lines

when this field was entered, newlines were captured to preserve the look. so this field is an array of strings broken by newlines. You may join them or iterate them as desired.

specialInstructionsstring[ ]

array of special instructions text

when this field was entered, newlines were captured to preserve the look. so this field is an array of strings broken by newlines. You may join them or iterate them as desired.

commentsstring[ ]

array of comments

when this field was entered, newlines were captured to preserve the look. so this field is an array of strings broken by newlines. You may join them or iterate them as desired.

trackingNumbersstring[ ]array of tracking numbers
orderCaseCaseSee the case object above. If there is a case (customer feedback) associated with this order, it will be populated in this value.

...

Hash KeyDefault

quoteRequestIdField

Quote Request ID

requestDateField

Request Date

expirationDateField

Quote Expiration Date

orderIdField

Order ID

sbtField

SBT

orderDateField

Order Date

billToHeader

Bill To

shipToHeader

Ship To

jobTitleField

Job Title

titleField

Title

nameField

Name

companyField

Company

addressField

Address

cityField

City

stateField

State

zipField

Zip

countryField

Country

emailField

Email

ccEmailField

CC Email

giftEmailField

Gift Email

giftField

Gift

phoneField

Phone

eveningPhoneField

Evening Phone

taxCountyField

Tax County

shippingMethodField

Shipping Method

residential

Residential

liftGate

Lift Gate

shipOnDateField

Ship on Date

deliveryDateField

Delivery Date

shipOnAccountField

Ship on Account

advertisingSourceField

Advertising Source

wrappingPaperField

Wrapping Paper

itemHeader

Item

quantityHeader

Quantity

descriptionHeader

Description

amountHeader

Amount

refundedHeader

Refunded

subtotalBeforeDiscountsField

Subtotal before discounts

discountsField

Discounts

subtotalField

Subtotal

shippingHandlingField

Shipping/Handling

taxRateField

Tax Rate

taxField

Tax

giftChargeField

Gift Charge

surchargeField

Surcharge

giftCertificateField

Gift Certificate

totalField

Total

buySafeFree

Free!

yourActualMessage

Your actual financial statement may vary due to actual currency conversion.

...