- Request credentials for Partner’s Shopping Cart.
Please provide a test product for $0 with $0 cost shipping. If you are not able to provide a $0 product, provide a test credit card number, or test mode link to bypass actual payment details.
- Verify their implementation includes all the necessary requirements:
- Click here for the official guide on the settings page
- SharpSpring Page Tracking Code in head of all pages of the cart
- Verify the first thing triggered to our Shopping Cart API is the following call:
Use the _setTransaction method to initialize a transaction object. The transaction object stores all the related information about a single transaction, such as the transaction ID, shipping charges, and billing address. The information in the transaction object is associated with its items by means of the transaction IDs for the transaction and all items, which should be the same ID.
In the event that an email address is supplied as part of the _setTransaction payload, a lookup will be performed to determine if a matching record is available for the address supplied. If a matching record is located, the record's data may be optionally updated by supplying an additional firstName and/or lastName parameter.
If a matching record is not located for a supplied email address, a new record will be created automatically and may optionally be populated with any firstName and/or lastName data that is supplied. Regardless of whether an update or creation event results from including an email address in the payload, the user's tracking cookie will automatically associate with the email address supplied, and any subsequent transactions will be associated with the appropriate contact record.
Q. Which fields are required in setTransaction?
A. All of them with the exception of firstName, lastName, emailAddress.
'transactionID': '1234', (must be numeric, and remain constant in all calls)
'storeName': 'My Store Name Here', (any text value, can be hardcoded)
'total': '28.38', (only numbers with decimal, no “$”, ex: 0.00 or 125.00)
'tax': '1.29', (only numbers with decimal, no “$”, ex: 0.00 or 125.00)
'shipping': '15.00', (only numbers with decimal, no “$”, ex: 0.00 or 125.00)
'city': 'San Jose', (If Unknown Put ‘Unknown’)
'state': 'California', (If Unknown Put ‘Unknown’)
'zipcode': '32608', (If Unknown Put ‘00000’)
'country': 'USA', (If Unknown Put ‘Unknown’)
Q. I f I don’t know the total, tax or shipping can I leave it blank or null?
A. N o. Use ‘0.00’ if it is not known yet. You can and should run setTransaction any time you have additional information or wish to update the totals. It must also be the very first thing we ever receive from them.
Q . Is 'transactionID' the same as the order number?
A. I t can be... the only requirement is that it is a unique number used for all three API calls. It can not change midprocess. If your shopping cart can generate a unique order number right from the start, use it. But if not, it must be some other number generated on your side to represent the transaction that can not change.
Q. I s ‘storeName’ a value I should be getting from somewhere?
A. N o, this is only used to store in our system and is not a key of any kind. This should be a human readable friendly label for your store. Ex: ‘Fruits and Nuts Shoppe’
Q. Which fields are required in _setTransaction?
A . All of them with the exception of firstName, lastName, emailAddress.
Q. Why am I running _setTransaction first, I don’t know any details yet, like final order total?
A. This must be run first so we can establish the transactionID for the potential order. You may run _set Transaction during other steps to update the final order total(such as when someone adds a product to a cart, or finalizes their purchase, etc). It should be run multiple times during the process.
The _addTransactionItem method tracks information about each individual item in the user's shopping cart and associates the item with each transaction via the transactionId field. This method tracks the details about a particular item, such as SKU, price, category, and quantity. After running _addTransactionItem, you should also rerun setTransaction to update any totals.
Q. W hich fields are required in _addTransactionItem?
A. A ll of them. This item may not contain any “$” or null/blank values.
'transactionID': '1234', (required, should be the same value used in _setTransaction call)
'itemCode': 'DD44', (required, must be a unique key of that product)
'productName': 'TShirt', (required)
'category': 'Olive Medium',(required)
'price': '11.99', (required)
'quantity': '1' (Must be an integer of 0 or greater. 0 means the item is removed from cart)
The _completeTransaction method confirms that a purchase has occurred, and all data that has been built up in the transaction object is finalized as a transaction and saved as a closed opportunity.
Q. When should I run _completeTransaction?
A. This should be the final thing after the person checks out/pays, so it should be placed on the receipt page or final order confirmation page. It may be a good idea to rerun _setTransaction prior to _completeTrasnaction to ensure the final totals have been sent to SharpSpring. This should also use the same TransactionID that has been used in the other two calls. Even if an order number has been generated by the cart, you must not use that and continue to use the “Transaction” number used throughout the process.
'transactionID': '1234', (should be the same value used in _setTransaction call)
Code in Action
'storeName': 'My Store',
'country': 'USA', }]);
'category': 'Olive Medium',
One More Thing...
What if the checkout pages is hosted on another domain, subdomain, or it changes completely?
- The domain must be static. It can not be some randomly generated subdomain that you don’t know in advance. This is because you must add the full domain as a trackable site inside of SharpSpring.