> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# createRsvp

# Package: @wix/events

# Namespace: rsvpV2

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/registration/rsvp-v2/create-rsvp.md

## Permission Scopes:
Manage Guest List: SCOPE.DC-EVENTS.MANAGE-GUEST-LIST

## Introduction

Creates an RSVP.

The event's `registration.initialType` must be `RSVP`. Events created with `TICKETING` registration can't accept RSVPs, and because `initialType` is immutable, changing `registration.type` later doesn't make them eligible.

To create an RSVP with multiple guests, specify the `additionalGuestDetails.guestCount` and `additionalGuestDetails.guestNames` fields.

Before creating an RSVP, retrieve the event's registration form by calling
[Get Event](https://dev.wix.com/docs/rest/business-solutions/events/events-v3/get-event.md) with `fields: ["FORM"]`.
Build `form.inputValues` from `event.form.controls[].inputs`, using each input's name, mandatory flag, and predefined options.
Unrecognized input names, missing mandatory values for `YES` responses, and values outside predefined options cause an `INVALID_FORM_RESPONSE` error.

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.events.rsvpV2.createRsvp(rsvp, options)
 Description: Creates an RSVP.  The event's `registration.initialType` must be `RSVP`. Events created with `TICKETING` registration can't accept RSVPs, and because `initialType` is immutable, changing `registration.type` later doesn't make them eligible.  To create an RSVP with multiple guests, specify the `additionalGuestDetails.guestCount` and `additionalGuestDetails.guestNames` fields.  Before creating an RSVP, retrieve the event's registration form by calling [Get Event](https://dev.wix.com/docs/rest/business-solutions/events/events-v3/get-event.md) with `fields: ["FORM"]`. Build `form.inputValues` from `event.form.controls[].inputs`, using each input's name, mandatory flag, and predefined options. Unrecognized input names, missing mandatory values for `YES` responses, and values outside predefined options cause an `INVALID_FORM_RESPONSE` error.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  rsvp.eventId, rsvp, rsvp.status, rsvp.firstName, rsvp.lastName, rsvp.email, rsvp.additionalGuestDetails.guestCount
 Method parameters: 
   param name: options | type: CreateRsvpOptions  none  
        - name: options | type: ModificationOptions | description: RSVP options. <br> The **WIX_EVENTS.MANAGE_RSVP** permission is required.  
           - name: ignoreLimits | type: boolean | description: Whether to create or update an RSVP regardless of the event's guest limit.  
           - name: ignoreFormValidation | type: boolean | description: Whether to ignore the form validation.  
           - name: ignoreResponseStatus | type: boolean | description: Whether to accept the RSVP `status` even when the event's registration doesn't allow it, for example when registration is closed or hasn't started, the waitlist is unavailable, or the event only accepts `YES` responses.  
           - name: ignoreAdditionalGuestNames | type: boolean | description: Whether to ignore the additional guest names validation.  
        - name: fields | type: array<RequestedFields> | description: Predefined sets of fields to return.  | validation: maxItems 3
             - enum:
             -     DETAILS: Returns `createdDate`, `updatedDate`, `firstName`, `lastName`, `totalGuests`, `guests`.
             -     FORM: Returns `form`.
             -     CONTACT_DETAILS: Returns `email`.
   param name: rsvp | type: Rsvp   | required: true 
        - name: eventId | type: string | description: Event GUID to which the RSVP belongs. | required: true | validation: format GUID, immutable
        - name: memberId | type: string | description: Site member GUID.  | validation: format GUID, immutable
        - name: contactId | type: string | description: Contact GUID of a guest who filled in the RSVP form. See the Contacts API for more details.  | validation: format GUID
        - name: firstName | type: string | description: First name of a guest who filled in the RSVP form. | required: true | validation: minLength 1, maxLength 50
        - name: lastName | type: string | description: Last name of a guest who filled in the RSVP form. | required: true | validation: minLength 1, maxLength 50
        - name: email | type: string | description: Email of a guest who filled in the RSVP form. | required: true | validation: minLength 4, maxLength 255, format EMAIL
        - name: form | type: FormResponse | description: Event registration form response. Each item in `inputValues` must use a defined input name and follow the applicable mandatory-field and predefined-option rules. Call [Get Event](https://dev.wix.com/docs/rest/business-solutions/events/events-v3/get-event.md) with `fields: ["FORM"]` to inspect the expected input names, mandatory fields, and predefined options.  
           - name: inputValues | type: array<InputValue> | description: Form field inputs.  | validation: maxItems 200
              - name: inputName | type: string | description: Form field input name.  | validation: maxLength 100
              - name: value | type: string | description: Form field value.  | validation: maxLength 5000
              - name: values | type: array<string> | description: Form field values.  | validation: maxItems 100, maxLength 5000
        - name: status | type: RsvpStatus | description: RSVP response status. | required: true 
             - enum:
             -     YES: Guest is attending the event.
             -     NO: Guest isn't attending the event.
             -     WAITLIST: Guest is on a waitlist.
        - name: additionalGuestDetails | type: AdditionalGuestDetails | description: Additional guest details.  Available only when the event's form includes a guest control (`GUEST_CONTROL` type). If the event doesn't support additional guests, omit this field.  
           - name: guestCount | type: integer | description: Number of additional guests. | required: true | validation: minimum 0, maximum 10, format int32
           - name: guestNames | type: array<string> | description: Names of additional guests.  | validation: maxItems 10, maxLength 101
        - name: disableNotifications | type: boolean | description: Whether notifications are disabled.  
        - name: marketingConsent | type: boolean | description: Whether a guest agreed to marketing.  
        - name: extendedFields | type: ExtendedFields | description: Custom field data for the RSVP object.  **Note:** You must configure extended fields using schema plugin extensions in your app's dashboard before you can access the extended fields with API calls.  
           - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
 Return type: PROMISE<Rsvp>
  - name: _id | type: string | description: GUID of the RSVP.  | read-only: true | validation: format GUID
  - name: revision | type: string | description: Revision number, which increments by 1 each time the RSVP is updated. To prevent conflicting changes, the existing `revision` must be used when updating the RSVP.  | read-only: true | validation: format int64
  - name: eventId | type: string | description: Event GUID to which the RSVP belongs.  | validation: format GUID, immutable
  - name: _createdDate | type: Date | description: Date and time the RSVP was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the RSVP was updated.  | read-only: true 
  - name: memberId | type: string | description: Site member GUID.  | validation: format GUID, immutable
  - name: contactId | type: string | description: Contact GUID of a guest who filled in the RSVP form. See the Contacts API for more details.  | validation: format GUID
  - name: firstName | type: string | description: First name of a guest who filled in the RSVP form.  | validation: minLength 1, maxLength 50
  - name: lastName | type: string | description: Last name of a guest who filled in the RSVP form.  | validation: minLength 1, maxLength 50
  - name: email | type: string | description: Email of a guest who filled in the RSVP form.  | validation: minLength 4, maxLength 255, format EMAIL
  - name: form | type: FormResponse | description: Event registration form response. Each item in `inputValues` must use a defined input name and follow the applicable mandatory-field and predefined-option rules. Call [Get Event](https://dev.wix.com/docs/rest/business-solutions/events/events-v3/get-event.md) with `fields: ["FORM"]` to inspect the expected input names, mandatory fields, and predefined options.  
     - name: inputValues | type: array<InputValue> | description: Form field inputs.  | validation: maxItems 200
        - name: inputName | type: string | description: Form field input name.  | validation: maxLength 100
        - name: value | type: string | description: Form field value.  | validation: maxLength 5000
        - name: values | type: array<string> | description: Form field values.  | validation: maxItems 100, maxLength 5000
  - name: status | type: RsvpStatus | description: RSVP response status.  
     - enum:
     -     YES: Guest is attending the event.
     -     NO: Guest isn't attending the event.
     -     WAITLIST: Guest is on a waitlist.
  - name: totalGuests | type: integer | description: Total number of guests per 1 RSVP.  | read-only: true | validation: format int32
  - name: guestList | type: GuestList | description: Guest list.  | read-only: true 
     - name: guests | type: array<Guest> | description: List of guests.  | validation: maxItems 11
        - name: index | type: integer | description: Index of each guest in the array.  | validation: format int32
        - name: fullName | type: string | description: Full name.  | validation: maxLength 101
        - name: checkInDetails | type: CheckInDetails | description: Check-in details.  
           - name: checkedIn | type: boolean | description: Whether the guest has checked in.  
           - name: checkInDate | type: Date | description: Date and time the guest checked in.  
           - name: checkInCanceledDate | type: Date | description: Date and time the guest cancelled check-in.  
           - name: checkedInBy | type: string | description: Id of the user who last performed check-in  | validation: format GUID
           - name: checkInCanceledBy | type: string | description: Id of the user who last canceled check-in  | validation: format GUID
           - name: checkedInByStaffMember | type: string | description: Id of the Staff Member who last performed check-in  | validation: format GUID
           - name: checkInCanceledByStaffMember | type: string | description: Id of theStaff Member who last canceled check-in  | validation: format GUID
        - name: guestId | type: integer | description: Guest GUID.  | validation: minimum 1, format int32
  - name: language | type: string | description: 2-letter language code in the [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.  | read-only: true | validation: format LANGUAGE
  - name: locale | type: string | description: Locale in the [IETF BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) format.  | read-only: true | validation: format LANGUAGE_TAG
  - name: fullyCheckedIn | type: boolean | description: Whether all guests are checked in.  | read-only: true 
  - name: checkedInGuestCount | type: integer | description: Number of checked in guests.  | read-only: true | validation: format int32
  - name: additionalGuestDetails | type: AdditionalGuestDetails | description: Additional guest details.  Available only when the event's form includes a guest control (`GUEST_CONTROL` type). If the event doesn't support additional guests, omit this field.  
     - name: guestCount | type: integer | description: Number of additional guests.  | validation: minimum 0, maximum 10, format int32
     - name: guestNames | type: array<string> | description: Names of additional guests.  | validation: maxItems 10, maxLength 101
  - name: disableNotifications | type: boolean | description: Whether notifications are disabled.  
  - name: onlineConferencingLogin | type: OnlineConferencingLogin | description: Guest login details for accessing the online conference event.  | read-only: true 
     - name: link | type: string | description: Link URL to the online conference.  | read-only: true | validation: format WEB_URL
     - name: password | type: string | description: Password for the online conference.  | read-only: true 
  - name: anonymized | type: boolean | description: Whether an RSVP is anonymized.  | read-only: true 
  - name: marketingConsent | type: boolean | description: Whether a guest agreed to marketing.  
  - name: extendedFields | type: ExtendedFields | description: Custom field data for the RSVP object.  **Note:** You must configure extended fields using schema plugin extensions in your app's dashboard before you can access the extended fields with API calls.  
     - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: ADDITIONAL_GUESTS_MUST_HAVE_NAMES | Description: Additional guests must have names when `guestCount` is greater than 0.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: UNEXPECTED_RSVP_STATUS | Description: RSVP status isn't valid for this operation.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_FORM_RESPONSE | Description: The submitted form response doesn't match the event's registration form requirements. Call [Get Event](https://dev.wix.com/docs/rest/business-solutions/events/events-v3/get-event.md) with `fields: ["FORM"]` to inspect the expected input names, mandatory fields, and predefined options.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: EVENT_NOT_FOUND | Description: Couldn't find the event.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: FORM_SUBMISSIONS_NOT_SUPPORTED | Description: The event has no registration form, so the submitted `formSubmission` can't be validated.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MEMBER_EMAIL_ALREADY_REGISTERED | Description: There is already an RSVP with this email address for this event.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: WAITING_LIST_UNAVAILABLE | Description: Waitlist isn't available for this event.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: RSVPS_NOT_STARTED | Description: RSVPs for this event haven't started yet.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: RSVPS_CLOSED | Description: RSVPs for this event are closed.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: GUEST_LIMIT_EXCEEDED | Description: Number of guests exceeds the event's guest limit.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: RSVP_LIMIT_EXCEEDED | Description: Event has reached the maximum number of RSVPs allowed per event.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MEMBER_ALREADY_REGISTERED | Description: Member already has an RSVP for this event.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: INVALID_EVENT_TYPE | Description: Event type doesn't support RSVPs. The event's `registration.initialType` isn't `RSVP`.


```

### Examples

### Create an RSVP for an event
```javascript
import { rsvpV2 } from "@wix/events";

const rsvp = {
  eventId: "201037a0-3ecc-4ee4-976b-a1c931c42a6b",
  firstName: "Jane",
  lastName: "Doe",
  email: "jane.doe@example.com",
  form: {
    inputValues: [
      { inputName: "firstName", value: "Jane" },
      { inputName: "lastName", value: "Doe" },
      { inputName: "email", value: "jane.doe@example.com" },
    ],
  },
  status: "YES" as const,
};

async function createRsvp() {
  const response = await rsvpV2.createRsvp(rsvp);
  return response;
}

```

### createRsvp (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { rsvpV2 } from '@wix/events';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { rsvpV2 },
  // Include the auth strategy and host as relevant
});


async function createRsvp(rsvp,options) {
  const response = await myWixClient.rsvpV2.createRsvp(rsvp,options);
};
```

---