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 (not a gift)


{

    "id": [shoppingCartId],

    "items":[

        {

            "quantity": 1,

            "itemType": "MembershipPurchase",

            "membershipInfo":{

                "membershipCategoryId":[levelId],

                "membershipOfferingId":[offeringId],

                "pricePointId":[pricePointId],

                "membershipCards":[{

                    "cardType": "primary",

                    "city": "San Jose",

                    "country": "United States",

                    "email": "pascal@email.com",

                    "firstName": "Pascal",

                    "lastName": "de Belleville",

                    "phoneNumber": "310-555-0000",

                    "state": "CA",

                    "streetAddress1": "1 Almaden Blvd",

                    "streetAddress2": "Suite 310",

                    "zipCode": "95113"

                }],

                "isGift":false

            }

        }

    ]

}



Request Payload (gift membership)


{

    "id": "[shoppingCartId]",

    "items": [

        {

            "id": "066ac9d1384f4ec595d496a849186d37",

            "price": "60.00",

            "retailPrice": "60.00",

            "amount": "60.00",

            "quantity": 1,

            "subtotal": null,

            "itemType": "MembershipPurchase",

            "membershipInfo": {

                "membershipCategoryId": "[levelId]",

                "membershipOfferingId": "[offeringId]",

                "pricePointId": "[pricePointId]",

                "membershipCards": [

                    {

                        "cardType": "primary",

                        "name": "Charlie Dear",

                        "email": "charlie@email.com",

                        "firstName": "Charlie",

                        "lastName": "Dear",

                        "phoneNumber": "123-569-9874",

                        "streetAddress1": "12345 Elm St.",

                        "city": "Berkeley",

                        "state": "California",

                        "zipCode": "94706",

                        "country": "United States"

                    }

                ],

                "isGift": true,

                "gifterInfo": {

                    "customerSource": "acme",

                    "email": "cat@email.com",

                    "firstName": "Cat",

                    "lastName": "Smith",

                    "phoneNumber": "371-555-1232",

                    "address": [

                        {

                            "streetAddress1": "123 Main St.",

                            "streetAddress2": "",

                            "city": "New York",

                            "state": "New York",

                            "zipCode": "10004",

                            "country": "United States",

                            "type": "primary",

                            "isPrimary": false,

                            "version": 0,

                            "obfuscated": false

                        }

                    ],

                    "version": 0,

                    "obfuscated": false

                },

                "notifyGiftRecipient": true,

                "giftMessage": "Happy Birthday!",

                "auxiliary": 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. Payment information is required to properly process membership purchases. Failure to provide payment information may result in orders with open balances. 


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": "pascal@email.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

Required for all membership actions except purchasing a new membership


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
waiveBenefitsbooleanInternal flag only
isGiftbooleanIf the membership is a gift, mark as true. If so, gifterInfo is required. Required
gifterInfoCustomerCustomer object representing the gift giver. 

You may either search for an existing customer and use that object, or create a new customer for the gifter.  

In order to create a new customer you must populate Customer Source, First, Last and one of (email, address, phone).  
Required when isGift is true
notifyGiftRecipientbooleanIf the membership is a gift, setting this flag will send a correspondence to the gift recipient.

Setting the flag to False will result in the email going to the gift giver

Setting the flag to True will result in the email going to the gift recipient (This is the default behavior if no flag value is set)

giftMessagestringIf the membership is a gift, the gift giver can add a message for the recipient which appears on the member card email, if configured to send in Backoffice.

Note: The gift membership is only used in sending the email at the time of purchase and is not stored in ACME.

isAutorenewbooleanIf the membership offering is configured as Auto Renew Optional, setting this flag to true will opt the member into Auto Renew and generate a subscription.

The default value is false, which will not opt the user into Auto Renew and will not create a subscription.