# Create / Update Booking \[EXPERIENCE]

## Booking NFT Creation Request

To make your first request, send an authenticated request to the endpoint. This will create a `Booking NFT.`

Take a look at how you might call this method using the technology of your choice:

{% tabs %}
{% tab title="Node JS" %}

```javascript
const URI = "https://staging-api.takyon.io/v2"

const nftdata = 
{
  "collectionId": "ce2bb8e9-ffde-4138-bc3a-bb00b879e9ec", // or your internal ID
  "owner": "dora.explorer@gmail.com",
  "originalPrice": 599,
  "images": [
    "https://www.yourhosting.com/image.png",
    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAADHQA...",
  ],
  "lockDate": "2023-02-14T22:59:00.000Z",
  "guests": [
    {
      "firstName": "Dora",
      "secondName": "Explorer",
      "email": "dora.explorer@gmail.com"
    },
    {
      "firstName": "Indiana",
      "secondName": "Jones",
      "email": "indiana.jones@gmail.com"
    }
  ],
  "lang": "en",
  "webhook": "https://your-webhook.com/",
  "payload": {
    "type": "experience",
    "reference": "x123456",
    "category": "Tour in gondola", // Tour in gondola, Surfskate, Wakesurf, Snowshuttle, Enogastronomia, Com'è fatto, Chef experience, A caccia del bello, Amore, Natura, Adrenalina, Artisti e artigiani, Benessere, VIP
    "date": "2023-02-14T23:00:00.000Z",
    "duration": "experience duration",
    "participants": "number of participants",
    "description": "experience description",
    "tour": [
      {
        "step": 1,
        "name": "Meeting with the host",
        "location": {"label": "via Roma 37, Milano 20147"},
        "date": "2023-02-14T10:00:00.000Z",
      },
      {
        "step": 2,
        "name": "Looking at the sunset",
        "location": {"label": "via Napoli 56, Milano 20147"},
        "date": "2023-02-14T18:00:00.000Z",
      }
    ],
    "hostName": "host name",
    "hostDescription": "host description",
    "extra": "Write here what's included in the experience",
  }
}

const apikey = "1fed1306-3645-42d0-97d5-a39afa3195fa";

(async () => {
  const rawRes = await fetch(URI + "/nft", {
    method: "post",
    headers: {
      "Content-Type": "application/json",
      API_KEY: apikey,
    },
    body: JSON.stringify(nftdata),
  });

  const res = await rawRes.json();

  console.log(JSON.stringify(res));
})();
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
To avoid saving the Takyon collection ID in your systems you can set a custom ALIAS in /account/developer.
{% endhint %}

| PARAMETER               | DESCRIPTION                                                                                                              | TYPE                                                                                                                                                                                                                                         | REQUIRED |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| collectionId            | Id of the collection (takyon ID or the id from your database, you can set up your own ID from the Takyon Dashboard)      | string                                                                                                                                                                                                                                       | yes      |
| owner                   | email of the first owner of the NFT                                                                                      | string                                                                                                                                                                                                                                       | yes      |
| originalPrice           | price of the Booking                                                                                                     | number                                                                                                                                                                                                                                       | yes      |
| images                  | List of images (links to your hosting or raw data of the image)                                                          | array of strings                                                                                                                                                                                                                             | no       |
| lockDate                | Lock date of the NFT (most likely 23:59 of the day before the checkin)                                                   | ISOdate as string                                                                                                                                                                                                                            | yes      |
| guests                  | List of guests                                                                                                           | array of guests (firstName, secondName, email)                                                                                                                                                                                               | no       |
| lang                    | Language of customer                                                                                                     | Enum: "en" or "it"                                                                                                                                                                                                                           | no       |
| webhook                 | Overrides the webhook endpoint set in the[Retreive Booking Updates](/takyon-api-integration/retreive-booking-updates.md) | url string                                                                                                                                                                                                                                   | no       |
| payload.type            | Type of the payload                                                                                                      | "experience"                                                                                                                                                                                                                                 | yes      |
| payload.reference       | Reference of the booking                                                                                                 | string                                                                                                                                                                                                                                       | yes      |
| payload.category        | Experience category                                                                                                      | <p>string</p><p>examples: "Tour in gondola", "Surfskate", "Wakesurf", "Snowshutte", "Enogastronomia", "Com'è fatto", "Chef experience", "A caccia del bello", "Amore", "Natura", "Adrenalina", "Artisti e artigiani", "Benessere", "VIP"</p> | yes      |
| payload.date            | Experience date                                                                                                          | ISOdate as string                                                                                                                                                                                                                            | yes      |
| payload.duration        | Experience duration in minutes                                                                                           | number                                                                                                                                                                                                                                       | yes      |
| payload.participants    | Amount of participants                                                                                                   | number                                                                                                                                                                                                                                       | yes      |
| payload.description     | Experience description                                                                                                   | string                                                                                                                                                                                                                                       | yes      |
| payload.tour            | List of the steps of the experience                                                                                      | array of steps(step, name, location, date)                                                                                                                                                                                                   | yes      |
| payload.hostName        | Name of the host of the experience                                                                                       | string                                                                                                                                                                                                                                       | no       |
| payload.hostDescription | Description of the host of the experience                                                                                | string                                                                                                                                                                                                                                       | no       |
| payload.extra           | Features of the experience. Divided by comma                                                                             | string                                                                                                                                                                                                                                       | no       |

Keep note that the payload is customizable. We recommend using the structure provided in this example, but is possible to add information with custom keys or avoid some of the fields.

{% hint style="info" %}
You might want to omit some of the fields of the payload (ex Experience Name, location, website,...), since this information will be customizable directly by the experience provider in the Takyon dashboard and automatically placed inside the NFT.
{% endhint %}

## Update an existent booking

You can update a Booking NFT simply by calling the Create Endpoint and adding "id" as a parameter of the nftData. You'll get it in the response of the Create Endpoint, after the creation call, and you can store it in your systems.\
\
Alternatively, if you don't want to save the "*\_*&#x69;d" you can also use the same "payload.reference".


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.takyon.io/takyon-api-integration/create-update-booking-experience.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
