Checkout

Place the Order which will update the cart state to “won” if it was successful!

mutation placeTheOrder($cartId: ID!) {
    cart {
        placeOrder(input: {
            cartId: $cartId
        }) {
            errors {label value message}
            cart {
                id
                state
                registration {
                    registerables {
                        edges {
                            node {
                                type
                                id
                            }
                        }
                    }
                }
            }
        }
    }
}

Will result in:

{
    "data": {
        "cart": {
            "id": "T3Bwb3J0dW5pdHk6OTUw",
            "state": "won",
            "registration": {
                "registerables": {
                    "edges": [
                        {
                            "node": {
                                "id": "bGVhcm5lcjoyNzEz",
                                "type": "Learner"
                            }
                        }
                    ]
                }
            }
        }
    }
}

From here you can have a learner registered onto the event, and the cart’s ID is the Opportunity ID (base 64 decode to get the id for sales opportunity TMS page) which can be found in the TMS, and the Learner will see the new event in the my course page in the LMS