Lead booker
Before a cart can become an order, it must contain information about the customer (also called the lead booker). The info may be used for invoicing, notifications and even personalizing issued tickets.
The requested info can vary based on the cart items. To see the requested customer info for a cart, make the following request:
curl -X GET '{baseUrl}/carts/{cartUuid}/customer/schema' \
-H 'X-Musement-Application: {applicationValue}' \
-H 'X-Musement-Version: 3.4.0' \
-H 'Authorization: Bearer {accessToken}'
The response returns a JSON schema which describes the requested info for the cart and how it must be submitted. All carts will request the name and email of the lead booker as well opt-in decisions for various newsletters:
{
"type": "object",
"title": "cart_customer_guest",
"properties": {
"firstname": {
"type": "string",
"title": "firstname",
"propertyOrder": 1
},
"lastname": {
"type": "string",
"title": "Cognome",
"propertyOrder": 2
},
"email": {
"type": "string",
"title": "email",
"format": "email",
"propertyOrder": 3
},
"musement_newsletter": {
"enum": [
"NO",
"YES"
],
"enum_titles": [
"NO",
"YES"
],
"type": "string",
"title": "musement_newsletter",
"propertyOrder": 4
},
"allow_profiling": {
"enum": [
"YES",
"NO"
],
"enum_titles": [
"YES",
"NO"
],
"type": "string",
"title": "allow_profiling",
"propertyOrder": 5
},
"thirdparty_newsletter": {
"enum": [
"YES",
"NO"
],
"enum_titles": [
"YES",
"NO"
],
"type": "string",
"title": "thirdparty_newsletter",
"propertyOrder": 6
},
"events_related_newsletter": {
"enum": [
"YES",
"NO"
],
"enum_titles": [
"YES",
"NO"
],
"type": "string",
"title": "events_related_newsletter",
"propertyOrder": 7
},
},
"required": [
"firstname",
"lastname",
"email",
"musement_newsletter",
"allow_profiling",
"thirdparty_newsletter",
"events_related_newsletter"
]
}
In the example above, the firstname
, lastname
and email
properties refer to the lead booker. The newsletter properties are as follows:
-
allow_profiling
- Allow Musement to profile the user's data for future use.
-
events_related_newsletter
- The customer wants to receive third-party newsletters related to cart item contents.
-
musement_newsletter
- The customer wants to subscribe to the Musement newsletter.
-
thirdparty_newsletter
- The customer wants to receive promotional materials from third parties.
In the example response, all of the properties accept string values. However, the email
property requires an email address while the newsletter properties will only accept a value of YES
or NO
.
Responses for a cart can vary and may contain extra customer data as well. Since the requested details about customers and the accepted values can change, we recommend using the react-jsonschema-form tool to create user-friendly forms from the endpoint's response. The tool features a live playground where you can paste Musement API responses and see the resulting form in real time.
Once you have collected the required customer information, make the following request to update the cart:
curl -X PUT '{baseUrl}/carts/{cartUuid}/customer' \
-H 'X-Musement-Application: {applicationValue}' \
-H 'X-Musement-Version: 3.4.0' \
-H 'Authorization: Bearer {accessToken}' \
-H 'Content-Type: application/json' \
--data-raw '{
"allow_profiling": "NO",
"email": "test@musment.com",
"events_related_newsletter": "YES",
"firstname": "Test",
"lastname": "Test",
"musement_newsletter": "YES",
"thirdparty_newsletter": "NO",
"events_related_newsletter": "NO"
}'