{
    "info": {
        "name": "Best Guest Partner API",
        "description": "Runnable examples of the Best Guest partner API (v1) and its Chekin-compatible API. Set `apiKey` to your key (a sandbox key starts bgk_test_) and run the requests in order: each one stores what the next needs.",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "event": [
        {
            "listen": "prerequest",
            "script": {
                "type": "text/javascript",
                "exec": [
                    "pm.collectionVariables.set(\"date10\", new Date(Date.now() + 10 * 86400000).toISOString().slice(0, 10));",
                    "pm.collectionVariables.set(\"date13\", new Date(Date.now() + 13 * 86400000).toISOString().slice(0, 10));",
                    "pm.collectionVariables.set(\"date20\", new Date(Date.now() + 20 * 86400000).toISOString().slice(0, 10));",
                    "pm.collectionVariables.set(\"date23\", new Date(Date.now() + 23 * 86400000).toISOString().slice(0, 10));"
                ]
            }
        }
    ],
    "variable": [
        {
            "key": "baseUrl",
            "value": "https://api.bestguest.app"
        },
        {
            "key": "apiKey",
            "value": "bgk_test_replace_me"
        }
    ],
    "item": [
        {
            "name": "Best Guest API v1",
            "item": [
                {
                    "name": "Check that your key works",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "A sandbox key (bgk_test_...) answers sandbox: true.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/ping",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "ping"
                            ]
                        }
                    }
                },
                {
                    "name": "List your properties and their listings",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });",
                                    "var j = pm.response.json();",
                                    "pm.collectionVariables.set(\"accommodationId\", j.data[0].accommodationId);",
                                    "pm.collectionVariables.set(\"listingId\", j.data[0].listings[0].listingId);"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "The ids you need for upsertReservation. autoClose is the host's own \"close reservations automatically\" option; you cannot change it.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/getProperties",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "getProperties"
                            ]
                        }
                    }
                },
                {
                    "name": "Create a reservation with both guests",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });",
                                    "var j = pm.response.json();",
                                    "pm.collectionVariables.set(\"reservationId\", j.data.reservationId);"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "The lead guest is the booker: their form is made with the reservation, so it reports unchanged. Every other guest gets a form of their own (created). Best Guest pre-fills each form; nothing is e-mailed because of suppressGuestEmail. The response has one result per guest, with what each form still needs.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/upsertReservation",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "upsertReservation"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"externalId\": \"doc-example-1\",\n    \"accommodationId\": \"{{accommodationId}}\",\n    \"listingIds\": [\n        \"{{listingId}}\"\n    ],\n    \"fromDate\": \"{{date10}}\",\n    \"toDate\": \"{{date13}}\",\n    \"personsCount\": 2,\n    \"countryOfResidence\": \"Germany\",\n    \"recipientLanguage\": \"en\",\n    \"suppressGuestEmail\": true,\n    \"guests\": [\n        {\n            \"externalGuestId\": \"guest-1\",\n            \"isLead\": true,\n            \"firstName\": \"Anna\",\n            \"lastName\": \"Muster\",\n            \"email\": \"anna@example.com\"\n        },\n        {\n            \"externalGuestId\": \"guest-2\",\n            \"firstName\": \"Ben\",\n            \"lastName\": \"Muster\",\n            \"birthdate\": \"1990-04-02\",\n            \"nationality\": \"DEU\",\n            \"identType\": \"passport\",\n            \"identNumber\": \"C01X00T47\",\n            \"street\": \"Hauptstrasse\",\n            \"houseNumber\": \"5\",\n            \"city\": \"Berlin\",\n            \"postalCode\": \"10115\",\n            \"state\": \"Deutschland\",\n            \"purpose\": \"T\",\n            \"birthPlace\": \"Berlin\",\n            \"birthCountry\": \"DEU\"\n        }\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Send the same call again",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "Idempotent: the same externalId updates the same reservation, the same externalGuestId the same form. Nothing is duplicated.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/upsertReservation",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "upsertReservation"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"externalId\": \"doc-example-1\",\n    \"accommodationId\": \"{{accommodationId}}\",\n    \"listingIds\": [\n        \"{{listingId}}\"\n    ],\n    \"fromDate\": \"{{date10}}\",\n    \"toDate\": \"{{date13}}\",\n    \"personsCount\": 2,\n    \"countryOfResidence\": \"Germany\",\n    \"recipientLanguage\": \"en\",\n    \"suppressGuestEmail\": true,\n    \"guests\": [\n        {\n            \"externalGuestId\": \"guest-1\",\n            \"isLead\": true,\n            \"firstName\": \"Anna\",\n            \"lastName\": \"Muster\",\n            \"email\": \"anna@example.com\"\n        },\n        {\n            \"externalGuestId\": \"guest-2\",\n            \"firstName\": \"Ben\",\n            \"lastName\": \"Muster\",\n            \"birthdate\": \"1990-04-02\",\n            \"nationality\": \"DEU\",\n            \"identType\": \"passport\",\n            \"identNumber\": \"C01X00T47\",\n            \"street\": \"Hauptstrasse\",\n            \"houseNumber\": \"5\",\n            \"city\": \"Berlin\",\n            \"postalCode\": \"10115\",\n            \"state\": \"Deutschland\",\n            \"purpose\": \"T\",\n            \"birthPlace\": \"Berlin\",\n            \"birthCountry\": \"DEU\"\n        }\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Supply a guest's signature",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "With every required detail and a signature image (PNG or JPEG, base64), the form is complete and nothing is left for the guest to do. A form the guest completed, signed or edited is never overwritten: it is reported as skipped.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/upsertReservation",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "upsertReservation"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"externalId\": \"doc-example-1\",\n    \"accommodationId\": \"{{accommodationId}}\",\n    \"listingIds\": [\n        \"{{listingId}}\"\n    ],\n    \"fromDate\": \"{{date10}}\",\n    \"toDate\": \"{{date13}}\",\n    \"personsCount\": 2,\n    \"countryOfResidence\": \"Germany\",\n    \"recipientLanguage\": \"en\",\n    \"suppressGuestEmail\": true,\n    \"guests\": [\n        {\n            \"externalGuestId\": \"guest-1\",\n            \"isLead\": true,\n            \"firstName\": \"Anna\",\n            \"lastName\": \"Muster\",\n            \"email\": \"anna@example.com\"\n        },\n        {\n            \"externalGuestId\": \"guest-2\",\n            \"firstName\": \"Ben\",\n            \"lastName\": \"Muster\",\n            \"birthdate\": \"1990-04-02\",\n            \"nationality\": \"DEU\",\n            \"identType\": \"passport\",\n            \"identNumber\": \"C01X00T47\",\n            \"street\": \"Hauptstrasse\",\n            \"houseNumber\": \"5\",\n            \"city\": \"Berlin\",\n            \"postalCode\": \"10115\",\n            \"state\": \"Deutschland\",\n            \"purpose\": \"T\",\n            \"birthPlace\": \"Berlin\",\n            \"birthCountry\": \"DEU\",\n            \"signature\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==\"\n        }\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Read a reservation back",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "submissionStatus is the police-reporting status; compliance.readyToClose says whether every form is complete.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/getReservation?externalId=doc-example-1",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "getReservation"
                            ],
                            "query": [
                                {
                                    "key": "externalId",
                                    "value": "doc-example-1"
                                }
                            ]
                        }
                    }
                },
                {
                    "name": "Give the lead guest another e-mail",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "The old check-in link stops working and a new one is returned. Once a guest completed or signed their form the e-mail can no longer be changed (CONTACT_LOCKED); the lead's form here is still open.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/updateGuestContact",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "updateGuestContact"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"externalId\": \"doc-example-1\",\n    \"email\": \"anna.muster@example.com\",\n    \"suppressGuestEmail\": true\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Sandbox: close the reservation",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "Plays the outside world: in a Czech sandbox property the reservation is queued for the police (PENDING). Use submitReservation or failSubmission to finish or fail it. Sandbox only.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/sandboxSimulate",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "sandboxSimulate"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"externalId\": \"doc-example-1\",\n    \"action\": \"closeReservation\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Register a webhook",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });",
                                    "var j = pm.response.json();",
                                    "pm.collectionVariables.set(\"webhookId\", j.data.webhookId);"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "The secret is shown once. The URL must be https on port 443.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/createWebhook",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "createWebhook"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"url\": \"https://example.com/hooks/best-guest\",\n    \"events\": [\n        \"reservation.updated\",\n        \"guest.form_completed\",\n        \"reservation.submitted\"\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Send a test event",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "Queues a webhook.test event to that receiver to check the route and the signature.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/testWebhook",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "testWebhook"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"webhookId\": \"{{webhookId}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Read the event feed",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "The pull-based way to catch up. Pass the returned nextCursor as `after` next time.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/getEvents?after=0&limit=50",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "getEvents"
                            ],
                            "query": [
                                {
                                    "key": "after",
                                    "value": "0"
                                },
                                {
                                    "key": "limit",
                                    "value": "50"
                                }
                            ]
                        }
                    }
                },
                {
                    "name": "Cancel a reservation",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "Soft-deletes it. Refused with ALREADY_SENT once it was submitted for police reporting.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/cancelReservation",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "cancelReservation"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"externalId\": \"doc-example-1\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Sandbox: start over",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "{{apiKey}}"
                            }
                        ],
                        "description": "Removes every reservation of the sandbox. The test properties stay.",
                        "url": {
                            "raw": "{{baseUrl}}/v1/resetSandbox",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "v1",
                                "resetSandbox"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "[]",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "Chekin-compatible API",
            "item": [
                {
                    "name": "Log in",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });",
                                    "var j = pm.response.json();",
                                    "pm.collectionVariables.set(\"token\", j.token);"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "description": "password is your Best Guest API key. The token lasts one hour.",
                        "url": {
                            "raw": "{{baseUrl}}/api/v3/token/",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "api",
                                "v3",
                                "token"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"email\": \"integration@example.com\",\n    \"password\": \"{{apiKey}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "List housings",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });",
                                    "var j = pm.response.json();",
                                    "pm.collectionVariables.set(\"housingId\", j.results[0].id);"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "JWT {{token}}"
                            }
                        ],
                        "description": "Your properties, in Chekin's shape. is_auto_police_registration_enabled is the host's own option.",
                        "url": {
                            "raw": "{{baseUrl}}/api/v3/housings/",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "api",
                                "v3",
                                "housings"
                            ]
                        }
                    }
                },
                {
                    "name": "Create a reservation",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 201\", function () { pm.response.to.have.status(201); });",
                                    "var j = pm.response.json();",
                                    "pm.collectionVariables.set(\"reservationId\", j.id);"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "JWT {{token}}"
                            }
                        ],
                        "description": "send_invite_email false: Best Guest does not e-mail the guest; use signup_form_link yourself.",
                        "url": {
                            "raw": "{{baseUrl}}/api/v3/reservations/",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "api",
                                "v3",
                                "reservations"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"housing_id\": \"{{housingId}}\",\n    \"check_in_date\": \"{{date20}}\",\n    \"check_out_date\": \"{{date23}}\",\n    \"external_id\": \"chekin-doc-1\",\n    \"default_invite_email\": \"anna@example.com\",\n    \"default_leader_full_name\": \"Anna Muster\",\n    \"guest_group\": {\n        \"number_of_guests\": 2\n    },\n    \"send_invite_email\": false\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Add a guest",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 201\", function () { pm.response.to.have.status(201); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "JWT {{token}}"
                            }
                        ],
                        "description": "Nationality and residence use ISO alpha-2 codes. Gender and the document's issue/expiry dates are accepted and ignored. A signature (base64) is accepted.",
                        "url": {
                            "raw": "{{baseUrl}}/api/v3/guests/",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "api",
                                "v3",
                                "guests"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"reservation_id\": \"{{reservationId}}\",\n    \"name\": \"Ben\",\n    \"surname\": \"Muster\",\n    \"gender\": \"M\",\n    \"birth_date\": \"1992-05-06\",\n    \"nationality\": \"DE\",\n    \"document\": {\n        \"type\": \"P\",\n        \"number\": \"C01X00T47\"\n    },\n    \"residence\": {\n        \"country\": \"DE\",\n        \"city\": \"Berlin\",\n        \"postal_code\": \"10115\",\n        \"address\": \"Hauptstrasse 5\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Read it back",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 200\", function () { pm.response.to.have.status(200); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "JWT {{token}}"
                            }
                        ],
                        "description": "Statuses are derived from what Best Guest knows; outside Czechia police_check-in is always NOT_USED.",
                        "url": {
                            "raw": "{{baseUrl}}/api/v3/reservations/{{reservationId}}/",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "api",
                                "v3",
                                "reservations",
                                "{{reservationId}}"
                            ]
                        }
                    }
                },
                {
                    "name": "Subscribe to an event",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 201\", function () { pm.response.to.have.status(201); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "JWT {{token}}"
                            }
                        ],
                        "description": "One event per subscription. The body of a delivery is {hook, data}; the signature is HMAC-SHA256 (hex) of the raw body in x-payload-signature.",
                        "url": {
                            "raw": "{{baseUrl}}/api/v3/webhooks/",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "api",
                                "v3",
                                "webhooks"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"target\": \"https://example.com/hooks/chekin\",\n    \"event\": \"Reservation.updated\",\n    \"signature_secret\": \"my-secret\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Delete the reservation",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test(\"status is 204\", function () { pm.response.to.have.status(204); });"
                                ]
                            }
                        }
                    ],
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            },
                            {
                                "key": "Authorization",
                                "value": "JWT {{token}}"
                            }
                        ],
                        "description": "Cancels it. 204, no body.",
                        "url": {
                            "raw": "{{baseUrl}}/api/v3/reservations/{{reservationId}}/",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "api",
                                "v3",
                                "reservations",
                                "{{reservationId}}"
                            ]
                        }
                    }
                }
            ]
        }
    ]
}
