API v1 Reference

Add Item to Shopping Cart

Add an item to a shopping cart. Item types supported: Product, Donation, Membership.

REST

Request

https://api.neoncrm.com/neonws/services/api/store/addItemToShoppingCart?userSessionId=[session id]&shoppingCartId=55496&shoppingCartItem.product.productid=86&shoppingCartItem.quantity=1&shoppingCartItem.selectedOptionIds.selectedOption.optionid=40&shoppingCartItem.selectedOptionIds.selectedOption.optionValueId=106

Response

{
    "addItemToShoppingCartResponse": {
        "operationResult": "SUCCESS",
        "responseMessage": "Item added into shopping cart.",
        "responseDateTime": "2013-02-20T04:23:47.966-06:00",
        "sequenceId": 0
    }
}

SOAP

Request

<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:neon="http://www.z2systems.com/schemas/neonws/">
   <soapenv:header>
       <soapenv:body>
          <neon:additemtoshoppingcartrequest>
            <usersessionid>T1361847074046</usersessionid>
             <shoppingcartid>55601</shoppingcartid>
             <shoppingcartitem>
               <product>
                   <productid>78</productid>
                </product>
               <quantity>1</quantity>
               <selectedoptionids>
                <selectedoption>
                    <optionid>37</optionid>
                    <optionvalueid>100</optionvalueid>
                </selectedoption>
                </selectedoptionids>
             </shoppingcartitem>
          </neon:additemtoshoppingcartrequest>
       </soapenv:body>
    </soapenv:header>
</soapenv:envelope>

Response

<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:body>
      <ns2:additemtoshoppingcartresponse xmlns:ns2="http://www.z2systems.com/schemas/neonws/">
         <operationresult>SUCCESS</operationresult>
         <responsemessage>Item added into shopping cart.</responsemessage>
         <responsedatetime>2013-02-25T21:25:32.022-06:00</responsedatetime>
         <sequenceid>1</sequenceid>
      </ns2:additemtoshoppingcartresponse>
   </soap:body>
</soap:envelope>

Request Parameters

Name Required Description
shoppingCartId Yes Shopping cart ID to which this item is being added
shoppingCartItem.quantity Yes Quantity of the item being added.
shoppingCartItem.itemInfo.itemType Yes * Used if adding a membership or donation to a shopping cart. Possible values: Donation, Membership.
Store Products
The following fields are used if you are adding a store product to a shopping cart.
shoppingCartItem.product.productId Yes Product ID. Possible values can be retrieved from List Products method.
shoppingCartItem.selectedOptionIds.selectedOption.optionId Required if the given product has options.
shoppingCartItem.selectedOptionIds.selectedOption.optionValueId Required if the given product has options.
Donation Details
The following fields are used if adding a donation to a shopping cart.
shoppingCartItem.itemInfo.donation.accountId Yes Account ID of constituent to whom this donation will be credited
shoppingCartItem.itemInfo.donation.amount Yes Dollar amount of donation
shoppingCartItem.itemInfo.donation.date Yes Donation date. Format: 2012-12-30
shoppingCartItem.itemInfo.donation.anonymousType Possible values: No, DonorNameAnonymous, DonationAmountAnonymous
shoppingCartItem.itemInfo.donation.donorName Specify the donor name if it is different from the account being credited for the donation.
shoppingCartItem.itemInfo.donation.campaign.id Possible values can be retrieved from List Campaigns method. Required if campaign.name is not provided.
shoppingCartItem.itemInfo.donation.campaign.name Possible values can be retrieved from List Campaigns method. Required if campaign.id is not provided.
shoppingCartItem.itemInfo.donation.purpose.id Possible values can be retrieved from List Purposes method. Required if purpose.name is not provided.
shoppingCartItem.itemInfo.donation.purpose.name Possible values can be retrieved from List Purposes method. Required if purpose.id is not provided.
shoppingCartItem.itemInfo.donation.fund.id Possible values can be retrieved from List Funds method. Required if fund.name is not provided.
shoppingCartItem.itemInfo.donation.fund.name Possible values can be retrieved from List Funds method. Required if fund.id is not provided.
shoppingCartItem.itemInfo.donation.source.id Possible values can be retrieved from List Sources method. Required if source.name is not provided.
shoppingCartItem.itemInfo.donation.source.name Possible values can be retrieved from List Sources method. Required if source.id is not provided.
shoppingCartItem.itemInfo.donation.solicitation.id
shoppingCartItem.itemInfo.donation.solicitation.name
Donation Acknowledgee
If you specify the acknowledgee fields, a new account will be created and credited as the acknowledgee for this donation.
shoppingCartItem.itemInfo.donation.acknowledgee.name
shoppingCartItem.itemInfo.donation.acknowledgee.email
shoppingCartItem.itemInfo.donation.acknowledgee.address.shippingAddress
shoppingCartItem.itemInfo.donation.acknowledgee.address.addressType.id
shoppingCartItem.itemInfo.donation.acknowledgee.address.addressType.name
shoppingCartItem.itemInfo.donation.acknowledgee.address. addressLine1
shoppingCartItem.itemInfo.donation.acknowledgee.address. addressLine2
shoppingCartItem.itemInfo.donation.acknowledgee.address. addressLine3
shoppingCartItem.itemInfo.donation.acknowledgee.address. addressLine4
shoppingCartItem.itemInfo.donation.acknowledgee.address. city
shoppingCartItem.itemInfo.donation.acknowledgee.address.state.code
shoppingCartItem.itemInfo.donation.acknowledgee.address.state.name
shoppingCartItem.itemInfo.donation.acknowledgee.address.province
shoppingCartItem.itemInfo.donation.acknowledgee.address.county
shoppingCartItem.itemInfo.donation.acknowledgee.address.country.id
shoppingCartItem.itemInfo.donation.acknowledgee.address.country.name
shoppingCartItem.itemInfo.donation.acknowledgee.address.zipCode
shoppingCartItem.itemInfo.donation.acknowledgee.address.zipCodeSuffix
shoppingCartItem.itemInfo.donation.acknowledgee.address.startDate
shoppingCartItem.itemInfo.donation.acknowledgee.address.endDate
Donation Honor / Memory
shoppingCartItem.itemInfo.donation.honorMemory.name
shoppingCartItem.itemInfo.donation.honorMemory.hmType
Donation Custom Fields
shoppingCartItem.itemInfo.donation.customFieldDataList.fieldId Donation custom fields can be retrieved from the List Custom Fields method.
shoppingCartItem.itemInfo.donation.customFieldDataList.fieldValue Donation custom fields can be retrieved from the List Custom Fields method.
shoppingCartItem.itemInfo.donation.customFieldDataList.fieldOptionId Donation custom fields can be retrieved from the List Custom Fields method.
Membership Details
The following fields are used if you are adding a membership to a shopping cart.
shoppingCartItem.itemInfo.membership.accountId Yes The account to which this membership is being added.
shoppingCartItem.itemInfo.membership.membershipTerm.termInfo.id Yes * Membership Term ID. Possible values can be retrieved from List Membership Terms method. Required if termInfo.name is not provided.
shoppingCartItem.itemInfo.membership.membershipTerm.termInfo.name Yes * Membership Term Name. Possible values can be retrieved from List Membership Terms method. Required if termInfo.id is not provided.
shoppingCartItem.itemInfo.membership.autoRenewal Should this membership term automatically renew? Possible values: true, false
shoppingCartItem.itemInfo.membership.source.id Possible values can be retrieved from List Sources method.
shoppingCartItem.itemInfo.membership.source.name Possible values can be retrieved from List Sources method.
shoppingCartItem.itemInfo.membership.customFieldDataList.customFieldData.fieldId Membership custom fields can be populated. Possible values can be retrieved from List Custom Fields method. This field can be repeated.
shoppingCartItem.itemInfo.membership.customFieldDataList.customFieldData.fieldName Membership custom fields can be populated. Possible values can be retrieved from List Custom Fields method. This field can be repeated.
shoppingCartItem.itemInfo.membership.customFieldDataList.customFieldData.fieldOptionId Membership custom fields can be populated. Possible values can be retrieved from List Custom Fields method. This field can be repeated.

Response Parameters

Name Required Description
sequenceId Yes The position this item will occupy within the shopping cart.

Error Codes

Code Text Description
51 CustomField id is invalid.
52 CustomField option value is required.
53 CustomField option id is required.
54 CustomField option id is invalid.
55 CustomField option id is duplicated.
56 CustomField id is duplicated.
10014 Source id or name is invalid.
10130 Address Type is invalid.
10132 Account id is invalid.
10133 Address country is invalid
10134 Address state is invalid
11003 Amount is required
11004 Donation date is required.
11005 Fund ID or Name is invalid
11006 Campaign ID or Name is invalid
11007 Purpose ID or Name is invalid
12202 Product id is invalid.
12301 Shopping cart id is required.
12302 Shopping cart id is invalid.
12303 Shopping cart item type is required.
12304 One of the shopping cart productId or shopping cart itemId is required.
12306 Shopping cart item quantity is required.
12307 Product option id is required.
12308 Product option id is invalid.
12309 Product option value is required.
12310 Product option value is invalid.
12325 One of the product options are missing. please make sure all product options have been selected.
13000 Membership term id or name is required.
13001 Membership term id or name is invalid.
13003 Payment amount must be the same as membership fee.
13020 Child membership term is not allowed here. To purchase any child membership terms. please refer to addItemToShoppingCart under store api.