Developer's Network
Untitled Document

API Reference

Table of Contents

1 Implementation
1.1 Overview
1.2 Definitions
2 BuySAFE Checkout API
2.1 AddUpdateShoppingCart
2.1.1 Function Logic
2.1.2 Input Arguments
2.1.3 Return Values
2.1.4 Request Example
2.1.5 Example Response (Disabled)
2.1.6 Example Response (Not Bondable)
2.1.7 Example Response (Bonded Merchant)
2.1.8 Example Response (Certified Merchant – Bond Not Selected)
2.1.9 Example Response (Certified Merchant – Bond Selected)
2.2 SetShoppingCartCheckout
2.2.1 Function Logic
2.2.2 Input Argument
2.2.3 Return Values
2.2.4 Request Example
2.2.5 Example Response (Disabled)
2.2.6 Example Response (Not Bondable)
2.2.7 Example Response (Bonded Merchant)
2.2.8 Example Response (Certified Merchant – Bond Not Selected)
2.2.9 Example Response (Certified Merchant – Bond selected)
2.3 SetShoppingCartCancelOrder
2.3.1 Function Logic
2.3.2 Input Argument
2.3.3 Return Values
2.3.4 Request Example
2.3.5 Response Example
2.4 Example of Failed Result

1 IMPLEMENTATION


1.1 OVERVIEW

This document contains the technical documentation for the checkout API and explains each field used in the API.

1.2 DEFINITIONS

  • Merchant Service Provider – for the purposes of the API calls in this document this refers to you, the buySAFE Integration Partner. Credentials for the Merchant Service Provider include a user name and password provided to you by buySAFE. These credentials are provided in the SOAP header to verify your access with buySAFE.
  • User – for the purposes of the API calls in this document this refers to the individual store (Website) where products are being purchased. Credentials for the User is a private token which will be provided in one of two ways:
    • Enterprise clients – provided by buySAFE to the Integration Partner along with the Merchant Service Provider credentials. If the Enterprise partner has multiple stores (Websites) they need to request one public token for each individual store.
    • buySAFE Integration Partners – in general these organizations provide shopping cart/checkout services to multiple merchants. The tokens are provided as part of an “authentication process” where the individual merchant will use both buySAFE and the Integration Partner to associate their individual stores (Websites) to their buySAFE accounts.

2 BUYSAFE CHECKOUT API

The following functions are currently supported by buySAFE’s Checkout Web Service.

  • AddUpdateShoppingCart
  • SetShoppingCartCheckout
  • SetShoppingCartCancelOrder

The Checkout API is restricted for authorized users and users need to send their credentials in the SOAP envelope. Every request expects the partner credentials which are mandatory. The credentials are specified using the SOAP header. Create an instance of object MerchantServiceProviderCredentials and use the username and password provided by buySAFE.

2.1 ADDUPDATESHOPPINGCART


2.1.1 Function Logic

The function will create a shopping cart instance in the buySAFE system and will add or update the items associated with the shopping cart. This call should be executed every time the customer changes the cart contents or the cart is displayed in the browser. Also whenever the state of the buySAFE Button is toggled where customers opts for buySAFE changes, this call should be executed or when the billing/shipping information of the buyer is determined since location of buyer can effect the “bondability” of the transaction.

NOTE: The input arguments for the AddUpdateShoppingCart are identical to that of the SetShoppingCartCheckout. Some data may not be available while the cart is being filled (such as buyer information, order ID, billing and shipping country, etc.) in these cases do not pass these optional arguments in the AddUpdateShoppingCart. However, send this information as soon as it is known (for instance if a repeat buyer “logs into store).

2.1.2 Input Arguments

Argument
Soap Type
Data Type
Required
Explanation
MerchantServiceProviderCredentials
Header
Object
Yes
SOAP header to specify the integration partner’s credentials
MerchantServiceProviderCredentials.UserName
Header
String
Yes
The Integration Partner’s user name as provided by buySAFE
MerchantServiceProviderCredentials.Passwordu
Header
String
Yes
The Integration Partner’s password as provided by buySAFE
buySAFEUserCredentials
Header
Array
Yes
SOAP header to specify the individual stores credentials
buySAFEUserCredentials.AuthenticationToken
Header
String
Yes
The individual store’s private token provided by buySAFE
buySAFEWSHeader
Header
Object
Yes
Object to store the buySAFE WebService Version
buySAFEWSHeader.Version
Header
String
Yes
The version number provided by buySAFE
ShoppingCartAddUpdateRQ
Body
Object
Yes
The Request object to specify the request parameters
ShoppingCartId
Body
String
Yes
Unique shopping cart identifier which is persistent throughout the life of the cart
OrderNumber
Body
String
No
Order number which is shown to buyer – usually available after purchase
PreviouslyCanceledCartID
Body
String
No
Used only for “resubmits” – indicating the cart which was previously cancelled
ClientIP
Body
String
Yes
The buyer’s IP address.
SessionId
Body
String
No
The browser session for the version of the cart/checkout
BuyerInfo (Type BuyerInformation)
Body
Object
No
The information about the buyer who is shopping (pass information as soon as it is known – much of the time this will empty or not passed).
BuyerInformation.FirstName
Body
String
No
The first name of the buyer.
BuyerInformation.LastName
Body
String
No
The last name of the buyer.
BuyerInformation.Email
Body
String
No
The email address of the buyer.

 

Argument
Soap Type
Data Type
Required
Explanation
BuyerInformation.BuyerType
Body
Enum
No
Type of buyer: valid values include, Repeat, Registered, NewRegistered, NotRegistered, Unknown
BuyerInformation.BillingAddress (Type Address)
Body
Object
No
Information about where the product is going to be billed.
BuyerInformation.BillingAddress.PostalCode
Body
String
No
The billing postal code of the buyer
BuyerInformation.BillingAddress.CountryCode
Body
Enum
No
The country to which the purchase items are billed.
BuyerInformation.ShippingAddress (Type Address)
Body
Object
No
Information about where the product is going to be shipped.
BuyerInformation.ShippingAddress.PostalCode
Body
String
No
The shipping postal code of the buyer
BuyerInformation.ShippingAddress.CountryCode
Body
Enum
No
The country to which the purchase items are shipped.
WantsBond(Type CustomBoolean)
Body
Object
Yes
Object to hold CustomBoolean
WantsBond.HasBoolean
Body
Boolean
Yes
Indicates whether buyer opted for bonding if the value is specified
WantsBond.Value
Body
Boolean
Yes
Indicates whether buyer wants to bond this transaction or not. (NOTE: On first AddUpdateShoppingCart a false may be used since the “initial state” is set by a buySAFE preference. All subsequent calls indicate whether the buyer selected or unselected bonding.
Items (Array of Type ShoppingCartItem)
Body
Array
Yes
The list of items to be inserted/updated
ShoppingCartItem.UserToken
Body
String
Yes
The token for the marketplace this item belongs to. This token is provided by buySAFE as part of the authentication process.
ShoppingCartItem.MarketplaceItemCode
Body
String
Yes
This is the unique item identifier in the merchants store (Item #)
ShoppingCartItem.StockKeepingUnit
Body
String
No
The SKU for this item (ISBN, UPC, etc)
ShoppingCartItem.Title
Body
String
Yes
The title of the item
ShoppingCartItem.Attributes
Body
String
No
A string of attributes assigned to a particular item
ShoppingCartItem.isRestricted
Body
Boolean
No
Indicates whether item is not bondable.
ShoppingCartItem.isNew
Body
Boolean
No
Indicates whether the item is new or used.
ShoppingCartItem.QuantityPurchased
Body
Integer
Yes
Quantity of this item in the buyer’s shopping cart/basket
ShoppingCartItem.PriceInfo (Type PricingDetails)
Body
Object
Yes
Object for various pricing associated with the item
Item.PriceInfo.FinalPrice (Type Amount)
Body
Object
Yes
Object to indicate the final price the buyer of the item paid.
ShoppingCartItem.PriceInfo.FinalPrice.CurrencyCode
Body
Enum
Yes
Enum to indicate the currency in which the value is specified. Currently buySAFE only supports USD as valid currency.
ShoppingCartItem.PriceInfo.FinalPrice.Value
Body
Double
Yes
Indicates the value of the item.
ShoppingCartItem.UrlInfo (Type ItemUrl)
Body
Object
Yes
Indicate the various Urls related to the item.
ShoppingCartItem.UrlInfo.ViewItem
Body
String
Yes
Indicates the Url where the item can be accessed.
ShoppingCartItem.UrlInfo.Thumbnail
Body
String
No
Indicates the Url where the thumbnail of the item can be accessed.

 

2.1.3 Return Values

Argument
Soap
Type
Data Type
Always Specified
Explanation
TransactionStatus
Header
Object
Yes
Object which holds the details about the status of the current transaction
TransactionStatus.Id
Header
Integer
Yes
Sequential transaction number assigned by buySAFE
TransactionStatus.isSuccessful
Header
Boolean
Yes
Indicates whether the current transaction is successful or not
ShoppingCartAddUpdateRS
Body
Object
Yes
Response of the transaction
isBuysafeEnabled
Body
Boolean
Yes
Master switch which indicates whether buySAFE signals should be displayed
TotalBondCost
Body
Double
No
The total cost the buyer will need to pay to bond the shopping cart. If the cart is bondable and the value is zero then the bonds are free
CartDetailsDisplayText
Body
String
No
The text that should be used for the “buySAFE Learn More” link
CartDetailsURL
Body
String
No
Url where buyers can learn more about buySAFE
BondingSignal
Body
String
No
Flash file and associated inputs to display the correct signal
BondCostDisplayText
Body
String
No
Indicates the text to display in the cost column of the cart for buySAFE
Items (Array of ShoppingCartRSItem)
Body
Array
Yes
The list of items in this cart
ShoppingCartRSItem.MarketplaceItemCode
Body
String
Yes
Matches MarketplaceItemCode sent in the call
ShoppingCartRSItem.BondingSignal
Body
String
Yes
Indicates what to display in the buySAFE Column

 

2.1.4 Request Example

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<MerchantServiceProviderCredentials xmlns="http://ws.buysafe.com">
<UserName>integration_partner_username</UserName>
<Password>integration_partner_password</Password>
</MerchantServiceProviderCredentials>
<BuySafeUserCredentials
xmlns="http://ws.buysafe.com">
<AuthenticationTokens>
<string>PrivateTokenForStore</string>
</AuthenticationTokens>
</BuySafeUserCredentials
<BuySafeWSHeader
xmlns="http://ws.buysafe.com">
<Version>
600</Version>
</BuySafeWSHeader>
</soap:Header>
<soap:Body>
<AddUpdateShoppingCart xmlns="http://ws.buysafe.com">
<ShoppingCartAddUpdateRQ xmlns="http://ws.buysafe.com">
<ShoppingCartId>mystorecart1043434</ShoppingCartId>
<OrderNumber>
Not_yet_known</OrderNumber>
<ClientIP>
68.114.238.240</ClientIP>
<SessionId>
9xVF1VwcxlkZtaDcML4LTeONH</SessionId>
<BuyerInfo>
<FirstName>
FirstName</FirstName>
<LastName>
LastName</LastName>
<Email>
first.last@website.com</Email>
<BuyerType>
Repeat</BuyerType>
<BillingAddress>
<PostalCode>
12345-6789</PostalCode>
<CountryCode>
US</CountryCode>
</BillingAddress>
<ShippingAddress>
<PostalCode>
12345-6789</PostalCode>
<CountryCode>
US</CountryCode>
</ShippingAddress>
</BuyerInfo>
<WantsBond>
<HasBoolean>
true</HasBoolean>
<Value>
true</Value>
</WantsBond>
<Items>
<ShoppingCartItem>
<UserToken>
PrivateTokenForStore</UserToken>
<MarketplaceItemCode>
dvd12345</MarketplaceItemCode>
<StockKeepingUnit>
086162126086</StockKeepingUnit>
<Title>
Bid DVD (1999)</Title>
<isRestricted>
false</isRestricted>
<isNew>
true</isNew>
<QuantityPurchased>
1</QuantityPurchased>
<PriceInfo>
<FinalPrice>
<CurrencyCode>
USD</CurrencyCode>
<Value>
19.58</Value>
</FinalPrice>
</PriceInfo>
<URLInfo>
<ViewItem>
http://www.mystore.com/dvds/detail.cfm?invid=12345</ViewItem>
<Thumbnail>
http://www.mystore.com/pictures/thumb12345.gif</Thumbnail>
</URLInfo>
</ShoppingCartItem>
<ShoppingCartItem>
<UserToken>
PrivateTokenForStore</UserToken>
<MarketplaceItemCode>
2343433</MarketplaceItemCode>
<Title>
Sweater</Title>
<Attributes>
Style: Long Sleeve 0.0 Color: Red 0.0 Monogram: $3.00</ Attributes >
<QuantityPurchased>
1</QuantityPurchased>
<PriceInfo>
<FinalPrice>
<CurrencyCode>
USD</CurrencyCode>
<Value>
19.58</Value>
</FinalPrice>
</PriceInfo>
<URLInfo>
<ViewItem>
http://www.mystore.com/dvds/detail.cfm?invid=12345</ViewItem>
</URLInfo>
</ShoppingCartItem>
</Items>
</ShoppingCartAddUpdateRQ>
</AddUpdateShoppingCart>
</soap:Body>
</soap:Envelope>


2.1.5 Example Response (Disabled)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<TransactionStatus xmlns="http://ws.buysafe.com">
<TransactionId>8524</TransactionId>
<isSuccessful>true</isSuccessful>
</TransactionStatus>
</soap:Header>
<soap:Body>
<AddUpdateShoppingCartResponse xmlns="http://ws.buysafe.com">
<ShoppingCartAddUpdateRS xmlns="http://ws.buysafe.com">
<isBuysafeEnabled>false</isBuysafeEnabled>
</ShoppingCartAddUpdateRS>
</AddUpdateShoppingCartResponse>
</soap:Body>
</soap:Envelope>

2.1.6 Example Response (Not Bondable)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<TransactionStatus xmlns="http://ws.buysafe.com">
<TransactionId>8524</TransactionId>
<isSuccessful>true</isSuccessful>
</TransactionStatus>
</soap:Header>
<soap:Body>
<AddUpdateShoppingCartResponse xmlns="http://ws.buysafe.com">
<ShoppingCartAddUpdateRS xmlns="http://ws.buysafe.com">
<isBuysafeEnabled>true</isBuysafeEnabled>
<TotalBondCost>0.00</TotalBondCost>
<CartDetailsDisplayText>Learn more about buySAFE</CartDetailsDisplayText>
<CartDetailsURL>http://www.buysafe.com/Learnmore.aspx?CartId=mystorecart104343&amp;Token=PrivateTokenForStore</CartDetailsURL>
<BondCostDisplayText> </BondCostDisplayText>
<BondingSignal><script src= https://www.buysafe.com/getbutton?type=text&action=link></script>
</BondingSignal>
</AddUpdateShoppingCartResponse>
</soap:Body>
</soap:Envelope>

 

2.1.7 Example Response (Bonded Merchant)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<TransactionStatus xmlns="http://ws.buysafe.com">
<TransactionId>8524</TransactionId>
<isSuccessful>true</isSuccessful>
</TransactionStatus>
</soap:Header>
<soap:Body>
<AddUpdateShoppingCartResponse xmlns="http://ws.buysafe.com">
<ShoppingCartAddUpdateRS xmlns="http://ws.buysafe.com">
<isBuysafeEnabled>true</isBuysafeEnabled>
<TotalBondCost>0.00</TotalBondCost>
<CartDetailsDisplayText>Learn more about buySAFE</CartDetailsDisplayText>
<CartDetailsURL>http://www.buysafe.com/Learnmore.aspx?CartId=mystorecart104343&amp;Token=PrivateTokenForStore</CartDetailsURL>
<BondCostDisplayText>Free!</BondCostDisplayText>
<BondingSignal><script src=https://www.buysafe.com/getbutton?type=graphic&action=none></script>
</BondingSignal>
</ShoppingCartAddUpdateRS>
</AddUpdateShoppingCartResponse>
</soap:Body>
</soap:Envelope>

 

2.1.8 Example Response (Certified Merchant – Bond Not Selected)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<TransactionStatus xmlns="http://ws.buysafe.com">
<TransactionId>8526</TransactionId>
<isSuccessful>true</isSuccessful>
</TransactionStatus>
</soap:Header>
<soap:Body>
<AddUpdateShoppingCartResponse xmlns="http://ws.buysafe.com">
<ShoppingCartAddUpdateRS xmlns="http://ws.buysafe.com">
<isBuysafeEnabled>true</isBuysafeEnabled>
<TotalBondCost>0.00</TotalBondCost>
<CartDetailsDisplayText>Learn more about buySAFE</CartDetailsDisplayText>
<CartDetailsURL>http://www.buysafe.com/Learnmore.aspx?CartId= mystorecart104343&amp;Token=PrivateTokenForStore</CartDetailsURL>
<BondCostDisplayText></BondCostDisplayText>
<BondingSignal><script src= https://www.buysafe.com/getbutton?type=button&action=click&state=off&amount=0.59></script>
</BondingSignal>
</ShoppingCartAddUpdateRS>
</AddUpdateShoppingCartResponse>
</soap:Body>
</soap:Envelope>

2.1.9 Example Response (Certified Merchant – Bond Selected)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<TransactionStatus xmlns="http://ws.buysafe.com">
<TransactionId>8527</TransactionId>
<isSuccessful>true</isSuccessful>
</TransactionStatus>
</soap:Header>
<soap:Body>
<AddUpdateShoppingCartResponse xmlns="http://ws.buysafe.com">
<ShoppingCartAddUpdateRS xmlns="http://ws.buysafe.com">
<isBuysafeEnabled>true</isBuysafeEnabled>
<TotalBondCost>0.59</TotalBondCost>
<CartDetailsDisplayText>Learn more about buySAFE</CartDetailsDisplayText>
<CartDetailsURL>http://www.buysafe.com/Learnmore.aspx?CartId= mystorecart104343&amp;Token=PrivateTokenForStore</CartDetailsURL>
<BondCostDisplayText>$0.59</BondCostDisplayText>
<BondingSignal><script src= https://www.buysafe.com/getbutton?type=button&action=click&state=on></script>
</BondingSignal>
</ShoppingCartAddUpdateRS>
</AddUpdateShoppingCartResponse>
</soap:Body>
</soap:Envelope>

2.2 SETSHOPPINGCARTCHECKOUT

2.2.1 Function Logic

The function will check out an existing shopping cart already created in buySAFE system and will generate the bond associated with all qualified items. In addition buySAFE will e-mail the bond to the consumers. This call can be executed only once per cart. Once this call is executed, the cart is locked in the buySAFE system and no changes can be made. Basically this call should be made as soon as a purchase has been accepted by the merchant such that the buyer has been informed that an order has been placed.

NOTE: The input arguments for the AddUpdateShoppingCart are identical to that of the SetShoppingCartCheckout. However some of the data that was optional is now required.

2.2.2 Input Argument

Argument
Soap Type
Data Type
Required
Explanation
MerchantServiceProviderCredentials
Header
Object
Yes
SOAP header to specify the integration partner’s credentials
MerchantServiceProviderCredentials.UserName
Header
String
Yes
The Integration Partner’s user name as provided by buySAFE
MerchantServiceProviderCredentials.Password
Header
String
Yes
The Integration Partner’s password as provided by buySAFE
buySAFEUserCredentials
Header
Array
Yes
SOAP header to specify the individual stores credentials
buySAFEUserCredentials.AuthenticationToken
Header
String
Yes
The individual store’s private token provided by buySAFE
buySAFEWSHeader
Header
Object
Yes
Object to store the buySAFE WebService Version
buySAFEWSHeader.Version
Header
String
Yes
The version number provided by buySAFE
ShoppingCartCheckoutRQ
Body
Object
Yes
The Request object to specify the request parameters
ShoppingCartId
Body
String
Yes
Unique shopping cart identifier which is persistent throughout the life of the cart
OrderNumber
Body
String
Yes
Order number which is shown to buyer – usually available after purchase
PreviouslyCanceledCartID
Body
String
No
Used only for “resubmits” – indicating the cart which was previously cancelled
PreviouslyCanceledOrderNumber
Body
String
No
Used only for resubmits” – indicating the order ID which was previously cancelled
ClientIP
Body
String
Yes
The buyer’s IP address
SessionId
Body
String
No
The browser session for the version of the cart/checkout
BuyerInfo (Type BuyerInformation)
Body
Object
Yes
The information about the buyer who is shopping (pass information as soon as it is known – much of the time this will empty or not passed)
BuyerInformation.FirstName
Body
String
No
The first name of the buyer
BuyerInformation.LastName
Body
String
No
The last name of the buyer
BuyerInformation.Email
Body
String
Yes
The email address of the buyer
BuyerInformation.BuyerType
Body
Enum
Yes
Type of buyer: valid values include, Repeat, Registered, NewRegistered, NotRegistered, Unknown

 

Argument
Soap Type
Data Type
Required
Explanation
BuyerInformation.BillingAddress (Type Address)
Body
Object
Yes
Information about where the product is going to be billed
BuyerInformation.BillingAddress.PostalCode
Body
String
Yes
The billing postal code of the buyer
BuyerInformation.BillingAddress.CountryCode
Body
Enum
Yes
The country to which the purchase items are billed
BuyerInformation.ShippingAddress (Type Address)
Body
Object
Yes
Information about where the product is going to be shipped
BuyerInformation.ShippingAddress.PostalCode
Body
String
Yes
The shipping postal code of the buyer
BuyerInformation.ShippingAddress.CountryCode
Body
Enum
Yes
The country to which the purchase items are shipped
WantsBond(Type CustomBoolean)
Body
Object
Yes
Object to hold CustomBoolean
WantsBond.HasBoolean
Body
Boolean
Yes
Indicates whether buyer opted for bonding if the value is specified
WantsBond.Value
Body
Boolean
Yes
Indicates whether buyer wants to bond this transaction or not. (NOTE: On first AddUpdateShoppingCart a false may be used since the “initial state” is set by a buySAFE preference. All subsequent calls indicate whether the buyer selected or unselected bonding
Items (Array of Type ShoppingCartItem)
Body
Array
Yes
The list of items to be inserted/updated
ShoppingCartItem.UserToken
Body
String
Yes
The token for the marketplace this item belongs to. This token is provided by buySAFE as part of the authentication process
ShoppingCartItem.MarketplaceItemCode
Body
String
Yes
This is the unique item identifier in the merchants store (Item #)
ShoppingCartItem.StockKeepingUnit
Body
String
No
The SKU for this item (ISBN, UPC, etc)
ShoppingCartItem.Title
Body
String
Yes
The title of the item
ShoppingCartItem.Attributes
Body
String
No
A string of attributes assigned to a particular item
ShoppingCartItem.isRestricted
Body
Boolean
No
Indicates whether item is not bondable
ShoppingCartItem.isNew
Body
Boolean
No
Indicates whether the item is new or used
ShoppingCartItem.QuantityPurchased
Body
Integer
Yes
Quantity of this item in the buyer’s shopping cart/basket
ShoppingCartItem.PriceInfo (Type PricingDetails)
Body
Object
Yes
Object for various pricing associated with the item
Item.PriceInfo.FinalPrice (Type Amount)
Body
Object
Yes
Object to indicate the final price the buyer of the item paid
ShoppingCartItem.PriceInfo.FinalPrice.CurrencyCode
Body
Enum
Yes
Enum to indicate the currency in which the value is specified. Currently buySAFE only supports USD as valid currency
ShoppingCartItem.PriceInfo.FinalPrice.Value
Body
Double
Yes
Indicates the value of the item
ShoppingCartItem.UrlInfo (Type ItemUrl)
Body
Object
Yes
Indicate the various Urls related to the item
ShoppingCartItem.UrlInfo.ViewItem
Body
String
Yes
Indicates the Url where the item can be accessed
ShoppingCartItem.UrlInfo.Thumbnail
Body
String
No
Indicates the Url where the thumbnail of the item can be accessed

 

2.2.3 Return Values

Argument
Soap Type
Data Type
Always Specified
Explanation
TransactionStatus
Header
Object
Yes
Object which holds the details about the status of the current transaction
TransactionStatus.Id
Header
Integer
Yes
Sequential transaction number assigned by buySAFE
TransactionStatus.isSuccessful
Header
Boolean
Yes
Indicates whether the current transaction is successful or not
ShoppingCartCheckoutRQ
Body
Object
Yes
Response of the transaction
isBuysafeEnabled
Body
Boolean
Yes
Master switch which indicates whether buySAFE signals should be displayed
TotalBondCost
Body
Double
No
The total cost the buyer paid to bond the shopping cart. For a Bonded Merchant this will be 0.00 and the Integration Partner should display the cost as “Free!”
CartDetailsDisplayText
Body
String
No
The text that should be used for the “buySAFE Learn More” link
CartDetailsURL
Body
String
No
Url where buyers can learn more about buySAFE
BondingSignal
Body
String
No
Flash file and associated inputs to display the correct signal
BondCostDisplayText
Body
String
No
Indicates the text to display in the cost column of the cart for buySAFE
Items (Array of ShoppingCartRSItem)
Body
Array
Yes
The list of items in this cart
ShoppingCartRSItem.MarketplaceItemCode
Body
String
Yes
Matches MarketplaceItemCode sent in the call
ShoppingCartRSItem.BondingSignal
Body
String
Yes
Indicates what to display in the buySAFE Column

 

2.2.4 Request Example

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<MerchantServiceProviderCredentials xmlns="http://ws.buysafe.com">
<UserName>integration_partner_username</UserName>
<Password>integration_partner_password</Password>
</MerchantServiceProviderCredentials>
<BuySafeUserCredentials xmlns="http://ws.buysafe.com">
<AuthenticationTokens>
<string>PrivateTokenForStore</string>
</AuthenticationTokens>
</BuySafeUserCredentials
<BuySafeWSHeader xmlns="http://ws.buysafe.com">
<Version>600</Version>
</BuySafeWSHeader>
</soap:Header>
<soap:Body>
<SetShoppingCartCheckout xmlns="http://ws.buysafe.com">
<ShoppingCartCheckoutRQ xmlns="http://ws.buysafe.com">
<ShoppingCartId>mystorecart1043434</ShoppingCartId>
<OrderNumber>11223344</OrderNumber>
<ClientIP>68.114.238.240</ClientIP>
<SessionId>9xVF1VwcxlkZtaDcML4LTeONH</SessionId>
<BuyerInfo>
<FirstName>FirstName</FirstName>
<LastName>LastName</LastName>
<Email>first.last@website.com</Email>
<BuyerType>Repeat</BuyerType>
<BillingAddress>
<PostalCode>12345-6789</PostalCode>
<CountryCode>US</CountryCode>
</BillingAddress>
<ShippingAddress>
<PostalCode>12345-6789</PostalCode>
<CountryCode>US</CountryCode>
</ShippingAddress>
</BuyerInfo>
<WantsBond>
<HasBoolean>true</HasBoolean>
<Value>true</Value>
</WantsBond>
<Items>
<ShoppingCartItem>
<UserToken>PrivateTokenForStore</UserToken>
<MarketplaceItemCode>dvd12345</MarketplaceItemCode>
<StockKeepingUnit>086162126086</StockKeepingUnit>
<Title>Bid DVD (1999)</Title>
<isRestricted>false</isRestricted>
<isNew>true</isNew>
<QuantityPurchased>1</QuantityPurchased>
<PriceInfo>
<FinalPrice>
<CurrencyCode>USD</CurrencyCode>
<Value>19.58</Value>
</FinalPrice>
</PriceInfo>
<URLInfo>
<ViewItem>http://www.mystore.com/dvds/detail.cfm?invid=12345</ViewItem>
<Thumbnail>http://www.mystore.com/pictures/thumb12345.gif</Thumbnail>
</URLInfo>
</ShoppingCartItem>
</Items>
</ShoppingCartCheckoutRQ>
</SetShoppingCartCheckout>
</soap:Body>
</soap:Envelope>

 

2.2.5 Example Response (Disabled)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<TransactionStatus xmlns="http://ws.buysafe.com">
<TransactionId>8524</TransactionId>
<isSuccessful>true</isSuccessful>
</TransactionStatus>
</soap:Header>
<soap:Body>
<SetShoppingCartCheckoutResponse xmlns="http://ws.buysafe.com">
<ShoppingCartCheckoutRS xmlns="http://ws.buysafe.com">
<isBuysafeEnabled>false</isBuysafeEnabled>
</ShoppingCartCheckoutRS>
</SetShoppingCartCheckoutResponse>
</soap:Body>
</soap:Envelope>

2.2.6 Example Response (Not Bondable)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<TransactionStatus xmlns="http://ws.buysafe.com">
<TransactionId>8524</TransactionId>
<isSuccessful>true</isSuccessful>
</TransactionStatus>
</soap:Header>
<soap:Body>
<SetShoppingCartCheckoutResponse xmlns="http://ws.buysafe.com">
<ShoppingCartCheckoutRS xmlns="http://ws.buysafe.com">
<isBuysafeEnabled>false</isBuysafeEnabled>
</ShoppingCartCheckoutRS>
</SetShoppingCartCheckoutResponse>
</soap:Body>
</soap:Envelope>

 

2.2.7 Example Response (Bonded Merchant)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<TransactionStatus xmlns="http://ws.buysafe.com">
<TransactionId>8524</TransactionId>
<isSuccessful>true</isSuccessful>
</TransactionStatus>
</soap:Header>
<soap:Body>
<SetShoppingCartCheckoutResponse xmlns="http://ws.buysafe.com">
<ShoppingCartCheckoutRS xmlns="http://ws.buysafe.com">
<isBuysafeEnabled>true</isBuysafeEnabled>
<TotalBondCost>0.00</TotalBondCost>
<CartDetailsDisplayText>Learn more about buySAFE</CartDetailsDisplayText>
<CartDetailsURL> http://www.buysafe.com/Learnmore.aspx?CartId= mystorecart104343&amp;Token=PrivateTokenForStore</CartDetailsURL>
<BondCostDisplayText>Free!</BondCostDisplayText>
<BondingSignal><script src= https://www.buysafe.com/getbutton?type=graphic&action=none&receipt=yes></script>
</BondingSignal>
</ShoppingCartCheckoutRS>
</SetShoppingCartCheckoutResponse>
</soap:Body>
</soap:Envelope>

 

2.2.8 Example Response (Certified Merchant – Bond Not Selected)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<TransactionStatus xmlns="http://ws.buysafe.com">
<TransactionId>8524</TransactionId>
<isSuccessful>true</isSuccessful>
</TransactionStatus>
</soap:Header>
<soap:Body>
<SetShoppingCartCheckoutResponse xmlns="http://ws.buysafe.com">
<ShoppingCartCheckoutRS xmlns="http://ws.buysafe.com">
<isBuysafeEnabled>false</isBuysafeEnabled>
</ShoppingCartCheckoutRS>
</SetShoppingCartCheckoutResponse>
</soap:Body>
</soap:Envelope>

2.2.9 Example Response (Certified Merchant – Bond selected)

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<TransactionStatus xmlns="http://ws.buysafe.com">
<TransactionId>8524</TransactionId>
<isSuccessful>true</isSuccessful>
</TransactionStatus>
</soap:Header>
<soap:Body>
<SetShoppingCartCheckoutResponse xmlns="http://ws.buysafe.com">
<ShoppingCartCheckoutRS xmlns="http://ws.buysafe.com">
<isBuysafeEnabled>true</isBuysafeEnabled>
<TotalBondCost>0.59</TotalBondCost>
<CartDetailsDisplayText>Learn more about buySAFE</CartDetailsDisplayText>
<CartDetailsURL> http://www.buysafe.com/Learnmore.aspx?CartId= mystorecart104343&amp;Token=PrivateTokenForStore</CartDetailsURL>
<BondCostDisplayText>$0.59</BondCostDisplayText>
<BondingSignal><script src= https://www.buysafe.com/getbutton?type=graphic&action=none&receipt=yes></script>
</BondingSignal>
</ShoppingCartCheckoutRS>
</SetShoppingCartCheckoutResponse>
</soap:Body>
</soap:Envelope>


2.3 SETSHOPPINGCARTCANCELORDER

2.3.1 Function Logic

The API will be sent ONLY when an order has been cancelled. This will essentially revoke the bond. Possible conditions which could trigger this include: an order where payment was made by check and it was never received or an item was ordered that cannot be shipped, or if during offline processing the credit card entered is determined to be invalid, etc. NOTE: This SHOULD NOT be used for returns, or cancelled orders where money has already exchanged hands. Once money has gone from the buyer to the merchant, the bond is in effect and in fact is there to provide refund or cancellation protection in keeping with the merchant’s stated terms of sale. This call should be executed only once.

2.3.2 Input Argument

Argument
Soap Type
Data Type
Required
Explanation
MerchantServiceProviderCredentials
Header
Object
Yes
SOAP header to specify the integration partner’s credentials
MerchantServiceProviderCredentials.UserName
Header
String
Yes
The Integration Partner’s user name as provided by buySAFE
MerchantServiceProviderCredentials.Password
Header
String
Yes
The Integration Partner’s password as provided by buySAFE
buySAFEUserCredentials
Header
Array
Yes
SOAP header to specify the individual stores credentials
buySAFEUserCredentials.AuthenticationToken
Header
String
Yes
The individual store’s private token provided by buySAFE
buySAFEWSHeader
Header
Object
Yes
Object to store the buySAFE WebService Version
buySAFEWSHeader.Version
Header
String
Yes
The version number provided by buySAFE
ShoppingCartCancelledStatusRQ
Body
Object
Yes
The Request object to specify the request parameters
ShoppingCartId
Body
String
Yes
Unique shopping cart identifier which is persistent throughout the life of the cart
ClientIP
Body
String
Yes
The buyer’s IP address
SessionId
Body
String
No
The browser session for the version of the cart/checkout

 

2.3.3 Return Values

Argument
Data Type
Always Specified
Explanation
TransactionStatus
Object
Yes
Object which holds the details about the status of the current transaction
TransactionStatus.isSuccessful
Boolean
Yes
Indicates whether the current transaction is successful or not
ShoppingCartCancelledStatusRS
Object
Yes
Response of the transaction

 

2.3.4 Request Example

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<MerchantServiceProviderCredentials xmlns="http://ws.buysafe.com">
<UserName>integration_partner_username</UserName>
<Password>integration_partner_password</Password>
</MerchantServiceProviderCredentials>
<BuySafeUserCredentials xmlns="http://ws.buysafe.com">
<AuthenticationTokens>
<string>PrivateTokenForStore</string>
</AuthenticationTokens>
</BuySafeUserCredentials
<BuySafeWSHeader xmlns="http://ws.buysafe.com">
<Version>600</Version>
</BuySafeWSHeader>
</soap:Header>
<soap:Body>
<SetShoppingCartCancelOrder xmlns="http://ws.buysafe.com">
<ShoppingCartCancelledStatusRQ>
<ShoppingCartId>mystorecart1043434</ShoppingCartId>
<ClientIP>68.114.238.240</ClientIP>
<SessionId>9xVF1VwcxlkZtaDcML4LTeONH</SessionId>
</ShoppingCartCancelledStatusRQ>
</SetShoppingCartCancelOrder>
</soap:Body>

2.3.5 Response Example

<?xml version="1.0" encoding="utf-8"?>
<ShoppingCartCancelledStatusRS xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.buysafe.com" />

2.4 EXAMPLE OF FAILED RESULT

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>Client</faultcode>
<faultstring>The property "ShoppingCartId" of class "ShoppingCartAddUpdateRQ" is null or an invalid enumeration value. This a required field.</faultstring>
<faultactor>http://sbws01/BuysafeWS/CheckoutAPI.dll</faultactor>
<detail>
<TransactionStatus xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.buysafe.com">
<TransactionId>0</TransactionId>
<isSuccessful>false</isSuccessful>
<AdvisoryList>
<AdvisoryInfo>
<isFatal>false</isFatal>
<ErrorCause>The property "ShoppingCartId" of class "ShoppingCartAddUpdateRQ" is null or an invalid enumeration value. This a required field.</ErrorCause>
<ErrorSolution>Include values for all required fields in the request.</ErrorSolution>
</AdvisoryInfo>
</AdvisoryList>
</TransactionStatus>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>