Timekit developers

GET /bookings/graphs/:name

Get a JSON representation of the selected flow graph.

Available graphs: instant + confirm_decline

Endpoint

GET https://api.timekit.io/v2/bookings/graphs/:name

Parameters

Name In Type Required Default Description
name path string yes The name of the graph

Response examples

200

json
// Instant graph
{
    "data": {
        "config": {
            "graph": "Timekit\\Booking\\StateMachine\\Graphs\\InstantGraph",
            "class": "Timekit\\Booking",
            "states": {
                "initialized": {
                    "type": "initial",
                    "properties": {
                        "autoplay": true
                    }
                },
                "confirm": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "customer_data_saved": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "booking_data_saved": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "event_created": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "notified_owner_by_email": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "notified_customer_by_email": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "confirm_webhook_triggered": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "confirmed": {
                    "type": "final",
                    "properties": []
                },
                "error": {
                    "type": "final",
                    "properties": []
                }
            },
            "transitions": {
                "confirm": {
                    "from": [
                        "initialized"
                    ],
                    "to": "confirm"
                },
                "save_customer_data": {
                    "from": [
                        "confirm"
                    ],
                    "to": "customer_data_saved"
                },
                "save_booking_data": {
                    "from": [
                        "customer_data_saved"
                    ],
                    "to": "booking_data_saved"
                },
                "create_event": {
                    "from": [
                        "booking_data_saved"
                    ],
                    "to": "event_created"
                },
                "notify_owner_by_email": {
                    "from": [
                        "event_created"
                    ],
                    "to": "notified_owner_by_email"
                },
                "notify_customer_by_email": {
                    "from": [
                        "notified_owner_by_email"
                    ],
                    "to": "notified_customer_by_email"
                },
                "trigger_confirm_webhook": {
                    "from": [
                        "notified_customer_by_email"
                    ],
                    "to": "confirm_webhook_triggered"
                },
                "confirmed": {
                    "from": [
                        "confirm_webhook_triggered"
                    ],
                    "to": "confirmed"
                }
            }
        }
    }
}

// Confirm/decline graph
{
    "data": {
        "config": {
            "graph": "Timekit\\Booking\\StateMachine\\Graphs\\ConfirmDeclineGraph",
            "class": "Timekit\\Booking",
            "states": {
                "initialized": {
                    "type": "initial",
                    "properties": {
                        "autoplay": true
                    }
                },
                "created": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "customer_data_saved": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "booking_data_saved": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "tentative": {
                    "type": "normal",
                    "properties": []
                },
                "confirming": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "event_created": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "notified_owner_by_action_email": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "notified_customer_by_email": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "confirm_webhook_triggered": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "confirmed": {
                    "type": "final",
                    "properties": []
                },
                "declining": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "notified_customer_declined_by_email": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "decline_webhook_triggered": {
                    "type": "normal",
                    "properties": {
                        "autoplay": true
                    }
                },
                "declined": {
                    "type": "final",
                    "properties": []
                },
                "error": {
                    "type": "final",
                    "properties": []
                }
            },
            "transitions": {
                "create": {
                    "from": [
                        "initialized"
                    ],
                    "to": "created"
                },
                "save_customer_data": {
                    "from": [
                        "created"
                    ],
                    "to": "customer_data_saved"
                },
                "save_booking_data": {
                    "from": [
                        "customer_data_saved"
                    ],
                    "to": "booking_data_saved"
                },
                "send_confirm_decline_email_to_owner": {
                    "from": [
                        "booking_data_saved"
                    ],
                    "to": "notified_owner_by_action_email"
                },
                "tentative": {
                    "from": [
                        "notified_owner_by_action_email"
                    ],
                    "to": "tentative"
                },
                "confirm": {
                    "from": [
                        "tentative"
                    ],
                    "to": "confirming"
                },
                "create_event": {
                    "from": [
                        "confirming"
                    ],
                    "to": "event_created"
                },
                "notify_customer_by_email": {
                    "from": [
                        "event_created"
                    ],
                    "to": "notified_customer_by_email"
                },
                "trigger_confirm_webhook": {
                    "from": [
                        "notified_customer_by_email"
                    ],
                    "to": "confirm_webhook_triggered"
                },
                "confirmed": {
                    "from": [
                        "confirm_webhook_triggered"
                    ],
                    "to": "confirmed"
                },
                "decline": {
                    "from": [
                        "tentative"
                    ],
                    "to": "declining"
                },
                "notify_customer_declined_by_email": {
                    "from": [
                        "declining"
                    ],
                    "to": "notified_customer_declined_by_email"
                },
                "trigger_decline_webhook": {
                    "from": [
                        "notified_customer_declined_by_email"
                    ],
                    "to": "decline_webhook_triggered"
                },
                "declined": {
                    "from": [
                        "decline_webhook_triggered"
                    ],
                    "to": "declined"
                }
            }
        }
    }
}