Set participants info

An activity might need info related to the participants. To know if and which data are required for a specific activities you need to call the endpoint:

curl -X GET \
  https://sandbox.musement.com/api/v3/carts/[CART_UUID]/items/[ITEM_UUID]/participants/schema \
  -H 'Accept-Language: it' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json'

The response will be a json schema with all required information to create a form.

A sample response is like:

{
    "title": "cart_item_participants_info",
    "type": "object",
    "properties": {
        "participants": {
            "type": "array",
            "title": "participants",
            "items": {
                "title": "prototype",
                "type": "object",
                "properties": {
                    "firstname": {
                        "type": "string",
                        "title": "Nome",
                        "propertyOrder": 1
                    },
                    "lastname": {
                        "type": "string",
                        "title": "Cognome",
                        "propertyOrder": 2
                    }
                },
                "required": [
                    "firstname",
                    "lastname"
                ]
            },
            "minItems": 2,
            "maxItems": 2,
            "propertyOrder": 1
        }
    },
    "required": [
        "participants"
    ]
}

Using these data you can create your form and validate it before send it.

If the response above return a 404 than the items does not require participants info.

Notes

To set the participants for the item you can use:

curl -X PUT \
  https://api.musement.com/api/v3/carts/[CART_UUID]/items/[ITEM_UUID]/participants \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "firstname" : "John",
    "lastname" : "Foo"
  },
  {
    "firstname" : "Susan",
    "lastname" : "Bar"
  }
]'