TABLE OF CONTENTS

Summary


This article describes how to purchase new memberships using the B2C cart and checkout APIs.


Prerequisites 


Back Office Setup


To purchase a new membership through the B2C checkout API, the membership must be properly configured in Back Office:

  •     The membership level must have a valid offering and price point
  •     The offering must have a "New Membership" lifecycle action
  •     The B2C sale channel must be enabled for the "New Membership" lifecycle action
  •     The membership level must be published


Create a Cart


Create a shopping cart and get the new id. For more information on how to use the cart see Shopping Cart.

POST /v2/b2c/carts/


Adding a Membership to the Cart


Add the membership information to the cart. A list of fields in the Membership Info object is available at the bottom of this page. The level, offering, and price point ids must be published ids. You can find published ids in the membership level list using the published=true flag. 


Sample Request


PUT https://sand10-api.acmeticketing.net/v2/b2c/carts/[shoppingCartId]

Request Payload


{
    "id": [shoppingCartId],
    "items":[
        {
            "quantity": 1,
            "itemType": "MembershipPurchase",
            "membershipInfo":{
                "membershipCategoryId":[levelId],
                "membershipOfferingId":[offeringId],
                "pricePointId":[pricePointId],
                "membershipCards":[{
                    "cardType": "primary",
                    "city": "San Jose",
                    "country": "United States",
                    "email": "support@acmeticketing.com",
                    "firstName": "Pascal",
                    "lastName": "de Belleville",
                    "phoneNumber": "1234567890",
                    "state": "CA",
                    "streetAddress1": "1 Almaden Blvd",
                    "streetAddress2": "Suite 310",
                    "zipCode": "00000"
                }],
                "isGift":false
            }
        }
    ]
}


Checkout


Provide payment information and purchase the items in the cart. A list of fields in the Checkout object is available at the bottom of this page.


Sample Request


POST https://sand10-buy.acmeticketing.net/v2/b2c/checkout


Request Payload


Most billing and contact information is optional. They can be different from each other and from the membership info. If no billing or contact information is provided, it will be copied from the membership. See the B2C Checkout API documentation for the Checkout Object for all customer info fields.

{
    "billingAddress1": "160 Forest Ave",
    "billingCity": "Palo Alto",
    "billingCountry": "United States",
    "billingEmail": "support@acmeticketing.com",
    "billingFirstName": "Pascal",
    "billingLastName": "de Belleville",
    "billingPhoneNumber": "1234567890",
    "billingState": "CA",
    "billingZipCode": "99999",
    "cvc": "123",
    "expDate": "0321",
    "manualEntryCardNumber": "4242424242424242",
    "shoppingCartId": "[shoppingCartId]"
}



Membership Info Object


Field
Type
Description
Required
membershipCategoryIdstringThe published id of the selected membership categoryRequired
membershipOfferingIdstringThe id of the selected membership offeringRequired
pricePointIdstringThe id of the selected price pointRequired
membershipIdstring

Only required for in-cycle actions


membershipCardsMembership Card Object

A list of membership cards. The number of cards may not exceed the limit specified on the offering in backoffice. Requires one primary cardholder with first name, last name, and zip code, email, or phone number. 


For a full list of membership card fields see Membership Cards. Do not include a constituent import id field unless a matching customer already exists. 

Required
waiveBenefitsbooleanInformational flag only
isGiftbooleanIf the membership is a gift, mark as true. If so, gifterInfo is required. Required
gifterInfobooleanA Customer object representing the gift giver. Required if isGift is true
notifyGiftRecipientbooleanIf the membership is a gift, setting this flag will send a correspondence to the gift recipient.
giftMessagebooleanIf the membership is a gift, the gift giver can add a message for the recipient