# Modify Customs fields for a guest

The **`xp-customs-fields`** endpoint allows partners to modify a list of customs fields (customer or stay).&#x20;

### Request

<mark style="color:orange;">**POST**</mark>

```url
https://interface.experience-hotel.com/api/xp-customs-fields?email=test@test.com
```

**URL Parameter**: `email` (the email address of the customer)

#### Body&#x20;

Example to modify a Customer Custom field&#x20;

```json
{
    "customer_custom_fields": [
        {
            "name": "Loyalty level",
            "values": [
                "Silver"
            ]
        }
    ]
}
```

Example to modify a Stay Custom field, you will need to specify the Stay reference, which is the unique reference of the reservation in the PMS.&#x20;

```json
{
     "stay_custom_fields": [
        {
            "stay_reference": "123456",
            "data": [
                {
                    "name": "ota_src",
                    "value": "Booking.com"
                }
            ]
        }
    ]
}
```

You can combine a modification of Customer and Stay fields in the same request, for example:&#x20;

```json
{
    "customer_custom_fields": [
        {
            "name": "Loyalty level",
            "values": [
                "Silver"
            ]
        }
    ],
    "stay_custom_fields": [
        {
            "stay_reference": "123456",
            "data": [
                {
                    "name": "ota_src",
                    "value": "Booking.com"
                }
            ]
        }
    ]
}
```

### Possible return&#x20;

<mark style="color:green;">`200 OK`</mark>

```json
{
    "successes": {
        "customer_custom_fields": [
            "Loyalty level"
        ]
    },
    "errors": {
        "customer_custom_fields": []
    }
}
```

<mark style="color:orange;">`404 Not Found`</mark>

```json
"customer not found"
```

&#x20;No Customer found with this email in the CRM.&#x20;


---

# 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://experience-crm.gitbook.io/experience-crm-api/guests/guest-custom-fields/modify-customs-fields-for-a-guest.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.
