B2C Shopping Cart
Shopping carts help you collect and manage items users select as they navigate through the purchase flows. The cart can either be built and updated as a stand-alone object or it can be built directly in the checkout call when the order is submitted.
Note: Creating a stand-alone shopping cart isn’t required for checkout but the shopping cart object is used in most of the checkout flows. For that reason, we strongly recommend using the shopping cart features.
Method | Endpoint | Actions | Request Payload | Response Payload |
POST | /v2/b2c/carts | Create a new shopping cart | Shopping Cart Object* | Shopping Cart ID |
GET | /v2/b2c/carts/{id} | Get an existing shopping cart | None | Shopping Cart Object |
PUT | /v2/b2c/carts/{id} | Update an existing shopping cart | Shopping Cart Object | Shopping Cart Object |
DELETE | /v2/b2c/carts/{id} | Delete an existing shopping cart | None | Shopping Cart Object |
*If you’d like to create an empty shopping cart, pass an empty object {} into the create a new shopping cart call
Sample Requests
Create a new shopping cart or update an existing shopping cart. This example includes all possible items that can be included in a cart. Add or remove items depending on what the user selects.
//Event Example { "items": [{ "itemType": "Event", "eventName": "History of Magic", "eventId": "5d96453460309f26d082bc80", "ticketingTypeName": "Adult", "ticketingTypeId": "55268c54e4b0fb9be01106bd", "quantity": 2, "unitPrice": "20.00", "amount": "40.00" }, //Event Add-On Example { "itemType": "Inventory", "eventName": "History of Magic", "eventId": "5d96453460309f26d082bc80", "inventoryName": "Horocrux", "inventoryId": 594, "quantity": 1, "unitPrice": "100.00", "amount": "100.00" }, //Discrete Add-On Example (does not have an event attached) { "itemType": "Inventory", "inventoryName": "Floo Powder", "inventoryId": 818, "quantity": 1, "unitPrice": "10.00", "amount": "10.00" }, //Fixed Donation Example { "itemType": "Inventory", "addonType": "fixedDonation", "inventoryName": "$10 Donation", "inventoryId": 889, "quantity": 1, "unitPrice": "100.00", "amount": "100.00", "donationDetail": { "donationAppealName": "Appeal One", "donationCampaignName": "Spring Direct Mail Appeal", "donationFundName": "General Fund", "donorRecognition": "self", "donorRecognitionType": "self", "dedicationLastName": "Longbottom", "dedicationFirstName": "Mr. and Mrs.", "beneficiaryType": "In memory of", "beneficiaryLastName": "Longbottom", "beneficiaryFirstName": "Neville", "beneficiaryEmail": "nlongbottom@hsww.magic.edu", "beneficiaryPhoneNumber": "555-555-5555", "beneficiaryStreetAddress1": "123 Main Street", "beneficiaryStreetAddress2": "Apt 2B", "beneficiaryCity": "Anytown", "beneficiaryState": "GA", "beneficiaryZipCode": "30303", "beneficiaryCountry": "United States" } }, //Cariable Donation Example { "itemType": "Inventory", "addonType": "donation", "inventoryName": "Variable Donation", "inventoryId": 888, "quantity": 1, "unitPrice": "10000.00", "amount": "10000.00", "donationDetail": { "donationAppealName": "Appeal One", "donationCampaignName": "Spring Direct Mail Appeal", "donationFundName": "General Fund", "donorRecognition": "anonymous", "donorRecognitionType": "anonymous" } }, //Membership Purchase Example (new membership only) { "itemType": "MembershipPurchase", "quantity": 1, "unitPrice": "100.00", "amount": "100.00", "membershipInfo": { "membershipCategoryId": "5a049c3b60309f5d917c6e63", "membershipCategoryName": "Founders", "membershipOfferingId": "519d569cd32748ae9e3c507fe0456e5e", "membershipOfferingName": "Offering One", "pricePointId": "59aeb29a60309f07f6c6bef6", "pricePointName": "Membership", "membershipCards": [{ "cardType": "primary", "name": "B Bagshot", "email": "bbagshot@email.com", "firstName": "B", "lastName": "Bagshot", "phoneNumber": "555-555-5555", "streetAddress1": "123 Main St", "streetAddress2": "Apt 2", "city": "Springfield", "state": "Oregon", "zipCode": "97477", "country": "United States" }, { "cardType": "secondary", "email": "hsimpson@springfieldnuclear.org", "firstName": "H", "lastName": "Simpson", "phoneNumber": "939-555-0113" } ], "isGift": false } } ], "forms": [], "comboItems": [], "verifyEntitlements": false, "reservationId": "10788" }
Sample Responses
Empty shopping cart object
{ "id": "5e14cd4f60309f41499e653b", "tempVisitorId": "706ae7924a824d2483ac8827db78511e", "items": [], "forms": [], "comboItems": [], "verifyEntitlements": false }
Full shopping cart object
{ "id": "5e173d6060309f41499e6602", "tempVisitorId": "43b66f951401416781903934f8c68e9a", "membershipCategoryId": "5a049c3b60309f5d917c6e63", "membershipId": "000000000", //*** "couponCode": "COUPONCODE", //*** // ***coupon code and membership id cannot be used at the same time "items": [ { // typical ticket example "itemId": "fb433e2a72594339bfe1be054440cd41", "eventId": "5d96453460309f26d082bc80", "ticketingTypeId": "55268c54e4b0fb9be01106bd", "eventName": "History of Magic", "ticketingTypeName": "Adult", "quantity": 2, "unitPrice": "20.00", "retailUnitPrice": "20.00", "amount": "40.00", "itemType": "Event", "admissionType": "standard", "isRetail": false, "ignoreEntitlements": false }, { // full price ticket when using entitlements example "itemId": "fb433e2a72594339bfe1be054440cd41", "eventId": "5d96453460309f26d082bc80", "ticketingTypeId": "55268c54e4b0fb9be01106bd", "eventName": "History of Magic", "ticketingTypeName": "Adult", "quantity": 2, "unitPrice": "20.00", "retailUnitPrice": "20.00", "amount": "40.00", "itemType": "Event", "admissionType": "standard", "isRetail": true, "ignoreEntitlements": false }, { // addon tied to event example "itemId": "0b2dc945b9e34bd2ab3c1ff8fb407d7b", "eventId": "5d96453460309f26d082bc80", "eventName": "History of Magic", "quantity": 1, "unitPrice": "100.00", "retailUnitPrice": "0.00", "amount": "100.00", "itemType": "Inventory", "inventoryId": 594, "inventoryName": "Horocrux", "admissionType": "standard", "isRetail": false, "ignoreEntitlements": false }, { // addon not tied to an event example "itemId": "b898f7f493834dab8d21946838a89b4f", "quantity": 1, "unitPrice": "10.00", "retailUnitPrice": "0.00", "amount": "10.00", "itemType": "Inventory", "inventoryId": 818, "inventoryName": "Floo Powder", "admissionType": "standard", "isRetail": false, "ignoreEntitlements": false }, { // fixed donation example "itemId": "75df1d03e1534e37bbcefd6b956aaa2e", "quantity": 1, "unitPrice": "100.00", "retailUnitPrice": "0.00", "amount": "100.00", "itemType": "Inventory", "inventoryId": 889, "inventoryName": "$10 Donation", "admissionType": "standard", "addonType": "fixedDonation", "donationDetail": { "donorRecognition": "self", "donorRecognitionType": "self", "dedicationLastName": "Longbottom", "dedicationFirstName": "Mr. and Mrs.", "donationCampaignName": "Spring Direct Mail Appeal", "donationFundName": "General Fund", "beneficiaryType": "In memory of", "beneficiaryLastName": "Longbottom", "beneficiaryFirstName": "Neville", "beneficiaryEmail": "nlongbottom@hsww.magic.edu", "beneficiaryPhoneNumber": "555-555-5555", "beneficiaryStreetAddress1": "123 Main Street", "beneficiaryStreetAddress2": "Apt 2B", "beneficiaryCity": "Anytown", "beneficiaryState": "GA", "beneficiaryZipCode": "30303", "beneficiaryCountry": "United States", "customFieldValues": [], "donationAppealName": "Appeal One" }, "isRetail": false, "ignoreEntitlements": false }, { // variable donation example "itemId": "d52ab9a933e64b0bb82771cfeb1a871d", "quantity": 1, "unitPrice": "10000.00", "retailUnitPrice": "0.00", "amount": "10000.00", "itemType": "Inventory", "inventoryId": 888, "inventoryName": "Variable Donation", "admissionType": "standard", "addonType": "donation", "donationDetail": { "donorRecognition": "anonymous", "donorRecognitionType": "anonymous", "donationCampaignName": "Spring Direct Mail Appeal", "donationFundName": "General Fund", "customFieldValues": [], "donationAppealName": "Appeal One" }, "isRetail": false, "ignoreEntitlements": false }, { // membership purchase example "itemId": "b278c0577a8a42d497dbaeca8bc7112a", "quantity": 1, "unitPrice": "100.00", "retailUnitPrice": "100.00", "amount": "100.00", "itemType": "MembershipPurchase", "membershipInfo": { "membershipCategoryId": "5a049c3b60309f5d917c6e63", "membershipCategoryName": "Founders", "membershipOfferingId": "519d569cd32748ae9e3c507fe0456e5e", "membershipOfferingName": "Offering One", "pricePointId": "59aeb29a60309f07f6c6bef6", "pricePointName": "Membership", "membershipCards": [ { "cardType": "primary", "name": "B Bagshot", "email": "bbagshot@email.com", "firstName": "B", "lastName": "Bagshot", "phoneNumber": "555-555-5555", "streetAddress1": "123 Main St", "streetAddress2": "Apt 2", "city": "Springfield", "state": "Oregon", "zipCode": "97477", "country": "United States", "deceased": "no", "primaryCard": "no", "startDate": "1969-12-31T19:00:01-05:00", "expirationDate": "2038-01-18T22:14:07-05:00", "excludeCardOnMemberCreation": false, "ignoreUpdates": false }, { "cardType": "secondary", "name": "H Simpson", "email": "hsimpson@springfieldnuclear.org", "firstName": "H", "lastName": "Simpson", "phoneNumber": "939-555-0113", "deceased": "no", "primaryCard": "no", "startDate": "1969-12-31T19:00:01-05:00", "expirationDate": "2038-01-18T22:14:07-05:00", "excludeCardOnMemberCreation": false, "ignoreUpdates": false } ], "waiveBenefits": false, "isGift": false, "notifyGiftRecipient": false, "donationAmount": "0.00", "markDonationAsAnonymous": false, "cancellationRefundAmount": "0.00", "auxiliary": false }, "admissionType": "standard", "isRetail": false, "ignoreEntitlements": false } ], "forms": [], "comboItems": [], "verifyEntitlements": false }