> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Checkout

# Package: ticketing

# Namespace: CheckoutService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/registration/ticketing/orders/checkout?apiView=SDK.md

## Permission Scopes:
Events Checkout: SCOPE.EVENTS.EVENTS-CHECKOUT

## Introduction

Checks out the reserved tickets.

Creates an order and associates it with a site contact. Guest details are received from the
registration form input fields. See the Forms API for details.

To change an existing order's `status` from `"INITIATED"`, `"PENDING"`, or `"OFFLINE_PENDING"` to `"PAID"`, call Confirm Order.

You can also use a separate ready-made Wix checkout form where the visitor will be redirected from a non-Wix site or a custom ticket picker.
To build the checkout form path for this format, use Get Event to retrieve the `eventPageUrl.base` and `eventPageUrl.path`.
Then, add the following path: `/{{EVENT_PAGE_SLUG}}/{{SLUG}}/ticket-form?reservationId={{YOUR_RESERVATION_ID}}`

Example:  `"https://johndoe.wixsite.com/weddings/event-details/doe-wedding/ticket-form?reservationId=2be6d34a-2a1e-459f-897b-b4a66e73f69a"`

---

## REST API

### Schema

```
 Method: checkout
 Description: Checks out the reserved tickets.  Creates an order and associates it with a site contact. Guest details are received from the registration form input fields. See the Forms API for details.  To change an existing order's `status` from `"INITIATED"`, `"PENDING"`, or `"OFFLINE_PENDING"` to `"PAID"`, call Confirm Order.  You can also use a separate ready-made Wix checkout form where the visitor will be redirected from a non-Wix site or a custom ticket picker. To build the checkout form path for this format, use Get Event to retrieve the `eventPageUrl.base` and `eventPageUrl.path`. Then, add the following path: `/{{EVENT_PAGE_SLUG}}/{{SLUG}}/ticket-form?reservationId={{YOUR_RESERVATION_ID}}`  Example:  `"https://johndoe.wixsite.com/weddings/event-details/doe-wedding/ticket-form?reservationId=2be6d34a-2a1e-459f-897b-b4a66e73f69a"`
 URL: https://www.wixapis.com/events/v1/checkout
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  guests.form, eventId
 Method parameters: 
   param name: buyer | type: Buyer    
        - name: firstName | type: string | description: Buyer first name.  | validation: minLength 1, maxLength 50
        - name: lastName | type: string | description: Buyer last name.  | validation: minLength 1, maxLength 50
        - name: email | type: string | description: Buyer email.  | validation: minLength 5, maxLength 255, format EMAIL
   param name: discount | type: DiscountRequest    
        - name: couponCode | type: string | description: Discount coupon code.  | validation: maxLength 20
   param name: eventId | type: eventId | description: Event GUID. | required: true | validation: format GUID
   param name: giftCardCode | type: giftCardCode | description: Gift card code to redeem toward the order.  | validation: maxLength 30
   param name: guests | type: array<guests> | description: Guest details.  | validation: minItems 1, maxItems 50
              - name: form | type: FormResponse | description: Specific guest info. | required: true 
                 - 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
   param name: marketingConsent | type: marketingConsent | description: Whether marketing consent was given.  
   param name: memberId | type: memberId | description: Member GUID. If empty, no site member is associated with this order.  
   param name: options | type: CheckoutOptions    
        - name: silent | type: boolean | description: Whether to ignore settings to notify contacts.  
        - name: payInPerson | type: boolean | description: Whether the payment is to be done in person between the buyer and the merchant. When true, the completed order is created with status `OFFLINE_PENDING` and `inPerson` payment method.  
        - name: ignoreFormValidation | type: boolean | description: Whether to ignore form validation.  
        - name: paymentRedirectUrl | type: string | description: URL to return the buyer to after payment, instead of the default order page. Must be on the site URL: the same scheme, host and port, at the site's path or a page under it. The `token`, `eventId`, `orderNumber` and `status` query parameters are appended, and `lang` when the request has a language.  | validation: minLength 0, maxLength 2500, format WEB_URL
        - name: markAsPaid | type: boolean | description: Marks payment as already paid  
   param name: paidPlanBenefit | type: PaidPlanBenefit    
        - name: planOrderId | type: string | description: Pricing plan GUID.  | validation: format GUID
        - name: benefitId | type: string | description: Pricing plan benefit GUID.  | validation: format GUID
   param name: reservationId | type: reservationId | description: Ticket reservation GUID.  | validation: format GUID
 Return type: CheckoutResponse
  - name: order | type: Order | description: Created order.  
     - name: orderNumber | type: string | description: Unique order number.  
     - name: reservationId | type: string | description: Reservation GUID.  | validation: format GUID
     - name: snapshotId | type: string | description: Payment snapshot GUID. Empty if `status` of the order is `"FREE"`.  | read-only: true | validation: format GUID
     - name: eventId | type: string | description: Event GUID to which the order belongs.  | validation: format GUID
     - name: contactId | type: string | description: Contact GUID of buyer, resolved using the email address specified. See the Contacts API for additional information.  | validation: format GUID
     - name: memberId | type: string | description: Buyer member GUID, if applicable. See the Members API for additional information.  | validation: format GUID
     - name: created | type: string | description: Date and time the order was created.  | read-only: true | validation: format date-time
     - name: firstName | type: string | description: Guest first name.  
     - name: lastName | type: string | description: Guest last name.  
     - name: email | type: string | description: Guest email address.  | validation: format EMAIL
     - name: checkoutForm | type: FormResponse | description: Checkout form response. When each purchased ticket is assigned to a guest, guest forms are returned for each ticket, and buyer info is returned.  
        - 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: confirmed | type: boolean | description: Whether the order is confirmed. Triggered once the payment gateway processes the payment and funds reach the merchant's account.  
     - name: status | type: OrderStatus | description: Order status.  
         - enum:
         -     NA_ORDER_STATUS: Order status isn't available for this request fieldset.
         -     FREE: Order is confirmed, no payment is required.
         -     PENDING: Order was paid, but the payment gateway suspended the payment.
         -     PAID: Order is paid.
         -     OFFLINE_PENDING: Order is confirmed but must be paid via offline payment. Status needs to be manually updated to `"PAID"`.
         -     INITIATED: Order is waiting for payment at the cashier.
         -     CANCELED: Order is canceled.
         -     DECLINED: Order payment is declined.
         -     AUTHORIZED: Order payment is authorized.
         -     VOIDED: Order payment is voided.
         -     PARTIALLY_PAID: Order is partially paid with less than the total amount.
     - name: method | type: string | description: Payment method used for purchase, for example, "payPal", "creditCard", etc.  
     - name: ticketsQuantity | type: integer | description: Amount of tickets ordered.  
     - name: totalPrice | type: Money | description: Total order price.  
        - name: currency | type: string | description: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. For example, `USD`.  | validation: format CURRENCY
        - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, starts with a single (-), to indicate that the amount is negative.  | validation: format DECIMAL_VALUE
     - name: ticketsPdf | type: string | description: Ticket PDF URL.  
     - name: tickets | type: array<Ticket> | description: Tickets (generated after payment).  
        - name: ticketNumber | type: string | description: Unique ticket number which is assigned automatically when creating a ticket.  
        - name: orderNumber | type: string | description: Associated order number.  
        - name: ticketDefinitionId | type: string | description: Ticket definition GUID. See the Ticket Definition API for additional information.  | validation: format GUID
        - name: name | type: string | description: Ticket type.  
        - name: price | type: Money | description: Ticket price.  
        - name: free | type: boolean | description: Whether the ticket requires payment.  | read-only: true 
        - name: policy | type: string | description: Ticket and event policies.  
        - name: checkIn | type: CheckIn | description: Ticket check-in.  
           - name: created | type: string | description: Time of a ticket's check-in.  | validation: format date-time
        - name: orderStatus | type: OrderStatus | description: Associated order status.  
        - name: orderArchived | type: boolean | description: Whether the order and ticket are archived. If set to `true`, they aren't visible in the order list.  
        - name: orderFullName | type: string | description: Buyer full name.  
        - name: guestFullName | type: string | description: Guest full name.  
        - name: guestDetails | type: GuestDetails | description: Guest personal details.  
           - name: guestAssigned | type: boolean | description: Whether ticket belongs to assigned guest.  
           - name: firstName | type: string | description: Guest first name.  
           - name: lastName | type: string | description: Guest last name.  
           - name: email | type: string | description: Guest email.  | validation: format EMAIL
           - name: form | type: FormResponse | description: Full form response.  
           - name: contactId | type: string | description: Contact GUID associated with this guest.  | validation: format GUID
           - name: phone | type: string | description: Guest phone number.  | validation: format PHONE
        - name: archived | type: boolean | description: Whether the ticket is visible in an order.  
        - name: memberId | type: string | description: Ticket owner member GUID.  | validation: format GUID
        - name: anonymized | type: boolean | description: Whether ticket was anonymized by GDPR delete. Anonymized tickets no longer contain personally identifiable information (PII).  
        - name: checkInUrl | type: string | description: Ticket check-in URL.  Shown as QR code image in PDF.  <br/> Format: `"https://www.wixevents.com/check-in/{ticket number},{event id}"`  <br/> Example: `"https://www.wixevents.com/check-in/AAAA-AAAA-BB021,00000000-0000-0000-0000-000000000000"`  
        - name: ticketPdfUrl | type: string | description: URL for ticket PDF download.  
        - name: channel | type: ChannelType | description: Associated order checkout channel type.  
             - enum:
             -     ONLINE: Buyer created the order via an online channel, such as a website or mobile app.
             -     OFFLINE_POS: Sales person created the order and collected the money.
        - name: walletPassUrl | type: string | description: URL to download a ticket in `.pkpass` format for Apple Wallet.  | read-only: true | validation: format WEB_URL
        - name: canceled | type: boolean | description: Whether ticket is canceled.  | read-only: true 
     - name: archived | type: boolean | description: Whether the order is archived.  
     - name: anonymized | type: boolean | description: Whether the order is anonymized by GDPR delete.  
     - name: fullName | type: string | description: Guest full name.  
     - name: invoice | type: Invoice | description: Order invoice.  
        - name: items | type: array<Item> | description:   
           - name: id | type: string | description: Unique line item GUID.  | validation: format GUID
           - name: quantity | type: integer | description: Line item quantity.  | validation: minimum 1, maximum 50
           - name: name | type: string | description: Line item name.  
           - name: price | type: Money | description: Line item price.  
           - name: total | type: Money | description: Total price for line items. Always equal to price * quantity.  
           - name: discount | type: Discount | description: Discount applied to the line item.  
              - name: amount | type: Money | description: Total discount amount.  
              - name: afterDiscount | type: Money | description: Total sum after the discount.  
              - name: discounts | type: array<DiscountItem> | description: Discount items.  
                 - ONE-OF: 
                    - name: coupon | type: CouponDiscount | description: Coupon discount.  
                       - name: name | type: string | description: Discount coupon name. **Deprecated:** Use `invoice.discounts.coupon.name` instead.  
                       - name: code | type: string | description: Discount coupon code. **Deprecated:** Use `invoice.discounts.coupon.code` instead.  
                       - name: couponId | type: string | description: Discount coupon GUID. **Deprecated:** Use `invoice.discounts.coupon.couponId` instead.  
                    - name: paidPlan | type: PaidPlanDiscount | description: Pricing plan discount.  
                       - ONE-OF: 
                          - name: percentDiscount | type: PercentDiscount | description: Discount by percentage applied to tickets.  
                             - name: rate | type: string | description: Percent rate.  | validation: decimalValue {"gte":"0.01","lte":"100","maxScale":2}
                             - name: quantityDiscounted | type: integer | description: Number of discounted tickets.  | validation: minimum 0
                       - name: name | type: string | description: Name of pricing plan.  
                 - name: amount | type: Money | description: Total discount amount.  
           - name: tax | type: Tax | description: Tax applied to the item.  
              - name: type | type: TaxType | description: Tax type.  
                     - enum:
                     -     INCLUDED: Tax is included in the ticket price.
                     -     ADDED: Tax is added to the order at the checkout.
                     -     ADDED_AT_CHECKOUT: Tax is added to the final total at the checkout.
              - name: name | type: string | description: Tax name.  | read-only: true 
              - name: rate | type: string | description: Tax rate.  | validation: format DECIMAL_VALUE
              - name: taxable | type: Money | description: Taxable amount.  
              - name: amount | type: Money | description: Total tax amount.  
           - name: fees | type: array<Fee> | description: Wix ticket service fee on this item's tickets. The fee on additional fees is only in the invoice `fees`.  | read-only: true 
              - name: name | type: FeeName | description: Fee identifier.  
                     - enum:
                     -     WIX_FEE: Wix ticket service fee charges applied to the line item.
              - name: type | type: FeeType | description: How fee is calculated.  
                     - enum:
                     -     FEE_ADDED: Fee is added to the ticket price at checkout.
                     -     FEE_INCLUDED: Seller absorbs the fee. It's deducted from the ticket price.
                     -     FEE_ADDED_AT_CHECKOUT: Fee is added to the ticket price at checkout.
              - name: rate | type: string | description: Fee rate.  | read-only: true | validation: format DECIMAL_VALUE
              - name: amount | type: Money | description: Total amount of fee charges.  
        - name: discount | type: Discount | description: Discount applied to a cart.  
        - name: tax | type: Tax | description: Tax applied to a cart.  
        - name: subTotal | type: Money | description: Total cart amount before discount, tax, and fees.  
        - name: grandTotal | type: Money | description: Total amount of a cart after discount, tax, and fees. Grand total is calculated in the following order: 1. Total prices of all items in the cart are calculated. 2. Discount is subtracted from the cart, if applicable. 3. Tax on tickets is added, if applicable. 4. Wix ticket service fee paid by the buyer is added. 5. Additional fees configured by the event organizer (`additionalFees`) are added, including their tax.  
        - name: fees | type: array<Fee> | description: Wix ticket service fees on the order. The `FEE_INCLUDED` entries, which the organizer absorbs, also hold the fee on `additionalFees`.  | read-only: true 
        - name: revenue | type: Money | description: Total revenue: `grandTotal` minus the Wix ticket service fees in `fees` and any amount paid by gift card, never below 0. `additionalFees` stay in revenue. Taxes and payment provider fees aren't deducted.  
        - name: previewUrl | type: string | description: Invoice preview URL. Only returned if the order is paid.  
        - name: additionalFees | type: array<AppliedAdditionalFee> | description: Additional fees configured by the event organizer, in display order. Included in `grandTotal`, `tax` and `revenue`. The Wix ticket service fee on them is part of the `FEE_INCLUDED` entries in `fees`.  | read-only: true | validation: maxItems 3
           - name: appliedFeeId | type: string | description: Applied fee GUID, assigned once when the order is created.  | read-only: true | validation: format GUID
           - name: name | type: string | description: Fee name shown to buyers.  | read-only: true | validation: minLength 1, maxLength 50
           - name: amount | type: Money | description: Total amount charged for this fee, including tax.  | read-only: true 
           - name: tax | type: Tax | description: Tax applied to the fee. Not returned when no tax applies.  | read-only: true 
     - name: fullyCheckedIn | type: boolean | description: Whether all tickets in an order are checked in.  
     - name: paymentDetails | type: PaymentDetails | description: Internal order payment details.  
        - name: transaction | type: PaymentTransaction | description: Wix Payments transaction.  
           - name: transactionId | type: string | description: Wix Payments transaction GUID.  | read-only: true | validation: format GUID
           - name: method | type: string | description: Transaction payment method, for example, "payPal", "creditCard", etc.  | read-only: true 
     - name: channel | type: ChannelType | description: Checkout channel type.  
     - name: updated | type: string | description: Date and time the order was last updated.  | read-only: true | validation: format date-time
     - name: giftCardPaymentDetails | type: array<GiftCardPaymentDetails> | description: Gift card payments, including voided payments.  | validation: maxItems 10
        - name: voided | type: boolean | description: Whether the payment was reversed and no longer contributes to the order.  
        - name: amount | type: Money | description: Gift card payment amount, or projected amount for invoice previews.  
        - name: obfuscatedCode | type: string | description: Masked gift card code for display.  | validation: maxLength 30
     - name: marketingConsent | type: boolean | description: Whether marketing consent was given.  
  - name: expires | type: string | description: Time when the order expires, applies to orders with status = INITIATED.  | validation: format date-time
  - name: reservations | type: array<TicketReservation> | description: Ticket reservations.  
     - name: quantity | type: integer | description: Amount of reserved tickets.  | validation: minimum 1, maximum 20
     - name: ticket | type: TicketDefinition | description:   
        - name: id | type: string | description: Ticket definition GUID.  | validation: format GUID
        - name: price | type: Money | description: Ticket price.  
        - name: free | type: boolean | description: Whether the ticket is free (read only).  
        - name: name | type: string | description: Ticket name.  
        - name: description | type: string | description: Ticket description.  
        - name: limitPerCheckout | type: integer | description: Limit of tickets that can be purchased per checkout. Set to 20 for unlimited ticket definition.  | validation: minimum 0, maximum 20
        - name: orderIndex | type: integer | description: Custom sort index.  
        - name: policy | type: string | description: Policy information plain text block, as printed on the ticket.  
        - name: dashboard | type: Dashboard | description: Sensitive dashboard data.  
           - name: hidden | type: boolean | description: Whether ticket is hidden and cannot be sold.  
           - name: limited | type: boolean | description: Whether the ticket has limited quantity.  
           - name: quantity | type: integer | description: Ticket limit. `NULL` for unlimited ticket definitions.  | validation: format int32
           - name: unsold | type: integer | description: Number of unsold tickets. `NULL` for unlimited ticket definitions.  | validation: format int32
           - name: ticketsSold | type: integer | description: Number of tickets sold.  
           - name: ticketsReserved | type: integer | description: Number of tickets reserved.  
        - name: eventId | type: string | description: Event GUID associated with the ticket.  | validation: format GUID
        - name: wixFeeConfig | type: WixFeeConfig | description: Configuration of the fixed-rate Wix service fee that is applied at checkout to each ticket sold.  | read-only: true 
           - name: type | type: FeeType | description: Fee calculation method.  
        - name: salePeriod | type: TicketSalePeriod | description: Ticket sale period.  
           - name: startDate | type: string | description: Ticket sale start timestamp.  | validation: format date-time
           - name: endDate | type: string | description: Ticket sale end timestamp.  | validation: format date-time
           - name: hideNotOnSale | type: boolean | description: Whether to hide this ticket if it isn't on sale.  
        - name: saleStatus | type: TicketSaleStatus | description: Ticket sale status.  | read-only: true 
             - enum:
             -     SALE_SCHEDULED: Ticket sale is scheduled to start.
             -     SALE_STARTED: Ticket sale has started.
             -     SALE_ENDED: Ticket sale has ended.
        - name: state | type: array<State> | description: Ticket state.  
             - enum: INCLUDE_HIDDEN_NOT_ON_SALE
        - name: pricing | type: TicketPricing | description: Ticket pricing.  
           - ONE-OF: 
              - name: fixedPrice | type: Money | description: Ticket price which is read only.  
              - name: minPrice | type: Money | description: Min price per ticket, customizable.  
              - name: pricingOptions | type: PricingOptions | description: Ticket pricing options.  
                 - name: options | type: array<PricingOption> | description: Multiple ticket pricing options.  
                    - name: id | type: string | description: Ticket pricing option GUID.  | validation: format GUID
                    - name: name | type: string | description: Ticket pricing option name.  | validation: minLength 1, maxLength 200
                    - name: price | type: Money | description: Ticket pricing option price.  
           - name: pricingType | type: Type | description: Ticket pricing type.  | read-only: true 
                 - enum: STANDARD, DONATION
     - name: ticketDetails | type: array<TicketDetails> | description: Optional ticket details.  
        - name: seatId | type: string | description: Unique seat GUID in the event venue.  | validation: minLength 1, maxLength 36
        - name: sectionLabel | type: string | description: Section label.  | read-only: true 
        - name: areaLabel | type: string | description: Area label.  | read-only: true 
        - name: tableLabel | type: string | description: Table label.  | read-only: true 
        - name: rowLabel | type: string | description: Row label.  | read-only: true 
        - name: seatLabel | type: string | description: Seat label in a row or table.  | read-only: true 
        - name: planId | type: string | description: Seating plan GUID.  | read-only: true | validation: format GUID
        - name: capacity | type: integer | description: Number of places in the spot.  Default: `1`.  | validation: minimum 1, maximum 50, format int32
        - name: priceOverride | type: string | description: Custom price of a ticket.  | validation: format DECIMAL_VALUE
        - name: pricingOptionId | type: string | description: Pricing option GUID.  | validation: format GUID
        - name: pricingOptionName | type: string | description: Pricing option name.  | read-only: true 
  - name: orderPageUrl | type: string | description: Order page URL.  


```

### Examples

### Checkout with guest assigned tickets
If guest assigned tickets is turned on of event, the guest form mus be filled for each of the ticket. Also buyer details has to be provided that will be visible in the order.

```curl
curl -X POST 'https://www.wixapis.com/events/v1/checkout' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH TOKEN>' \
--data-binary '{
                 "eventId": "419d52c0-c93b-4155-a55c-108048f20bef",
                 "reservationId": "106348fb-2a70-4e6e-b6c1-7aa48752efb4",
                 "discount": {
                   "couponCode": "SUMMER"
                 },
                 "buyer": {
                   "firstName": "John",
                   "lastName": "Doe",
                   "email": "john.doe@somedomain.com"
                 },
                 "guests": [
                   {
                     "form": {
                       "inputValues": [
                         {
                           "inputName": "firstName",
                           "value": "John"
                         },
                         {
                           "inputName": "lastName",
                           "value": "Doe"
                         },
                         {
                           "inputName": "email",
                           "value": "john.doe@somedomain.com"
                         }
                       ]
                     }
                   },
                   {
                     "form": {
                       "inputValues": [
                         {
                           "inputName": "firstName",
                           "value": "Sarah"
                         },
                         {
                           "inputName": "lastName",
                           "value": "Doe"
                         },
                         {
                           "inputName": "email",
                           "value": "sarah.doe@somedomain.com"
                         }
                       ]
                     }
                   },
                   {
                     "form": {
                       "inputValues": [
                         {
                           "inputName": "firstName",
                           "value": "Mathew"
                         },
                         {
                           "inputName": "lastName",
                           "value": "Doe"
                         },
                         {
                           "inputName": "email",
                           "value": "mathew.doe@somedomain.com"
                         }
                       ]
                     }
                   }
                 ]
               }'
```

### Checkout
A simple checkout when the guest is the buyer.

```curl
curl -X POST 'https://www.wixapis.com/events/v1/checkout' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH TOKEN>' \
--data-binary '{
                 "eventId": "419d52c0-c93b-4155-a55c-108048f20bef",
                 "reservationId": "106348fb-2a70-4e6e-b6c1-7aa48752efb4",
                 "discount": {
                   "couponCode": "SUMMER"
                 },
                 "guests": [
                   {
                     "form": {
                       "inputValues": [
                         {
                           "inputName": "firstName",
                           "value": "John"
                         },
                         {
                           "inputName": "lastName",
                           "value": "Doe"
                         },
                         {
                           "inputName": "email",
                           "value": "john.doe@wix.com"
                         }
                       ]
                     }
                   }
                 ]
               }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.events.orders.checkout(eventId, options)
 Description: Checks out the reserved tickets.  Creates an order and associates it with a site contact. Guest details are received from the registration form input fields. See the Forms API for details.  To change an existing order's `status` from `"INITIATED"`, `"PENDING"`, or `"OFFLINE_PENDING"` to `"PAID"`, call Confirm Order.  You can also use a separate ready-made Wix checkout form where the visitor will be redirected from a non-Wix site or a custom ticket picker. To build the checkout form path for this format, use Get Event to retrieve the `eventPageUrl.base` and `eventPageUrl.path`. Then, add the following path: `/{{EVENT_PAGE_SLUG}}/{{SLUG}}/ticket-form?reservationId={{YOUR_RESERVATION_ID}}`  Example:  `"https://johndoe.wixsite.com/weddings/event-details/doe-wedding/ticket-form?reservationId=2be6d34a-2a1e-459f-897b-b4a66e73f69a"`
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  options.guests.form, eventId
 Method parameters: 
   param name: eventId | type: string | description: Event GUID to which the checkout belongs. | required: true | validation: format GUID
   param name: options | type: CheckoutOptions  none  
        - name: reservationId | type: string | description: Ticket reservation GUID.  | validation: format GUID
        - name: memberId | type: string | description: Member GUID. If empty, no site member is associated with this order.  
        - name: discount | type: DiscountRequest | description: Discount to apply on the invoice.  
           - name: couponCode | type: string | description: Discount coupon code.  | validation: maxLength 20
        - name: buyer | type: Buyer | description: Buyer details.  
           - name: firstName | type: string | description: Buyer first name.  | validation: minLength 1, maxLength 50
           - name: lastName | type: string | description: Buyer last name.  | validation: minLength 1, maxLength 50
           - name: email | type: string | description: Buyer email.  | validation: minLength 5, maxLength 255, format EMAIL
        - name: guests | type: array<Guest> | description: Guest details.  | validation: minItems 1, maxItems 50
           - name: form | type: FormResponse | description: Specific guest info.  
              - 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: paidPlanBenefit | type: PaidPlanBenefit | description: Benefit granted by the pricing plan.  
           - name: planOrderId | type: string | description: Pricing plan GUID.  | validation: format GUID
           - name: benefitId | type: string | description: Pricing plan benefit GUID.  | validation: format GUID
        - name: options | type: CheckoutOptions | description: Options controlling the checkout process.  
           - name: silent | type: boolean | description: Whether to ignore settings to notify contacts.  
           - name: payInPerson | type: boolean | description: Whether the payment is to be done in person between the buyer and the merchant. When true, the completed order is created with status `OFFLINE_PENDING` and `inPerson` payment method.  
           - name: ignoreFormValidation | type: boolean | description: Whether to ignore form validation.  
           - name: paymentRedirectUrl | type: string | description: URL to return the buyer to after payment, instead of the default order page. Must be on the site URL: the same scheme, host and port, at the site's path or a page under it. The `token`, `eventId`, `orderNumber` and `status` query parameters are appended, and `lang` when the request has a language.  | validation: minLength 0, maxLength 2500, format WEB_URL
           - name: markAsPaid | type: boolean | description: Marks payment as already paid  
        - name: giftCardCode | type: string | description: Gift card code to redeem toward the order.  | validation: maxLength 30
        - name: marketingConsent | type: boolean | description: Whether marketing consent was given.  
 Return type: PROMISE<CheckoutResponse>
  - name: order | type: Order | description: Created order.  
     - name: orderNumber | type: string | description: Unique order number.  
     - name: reservationId | type: string | description: Reservation GUID.  | validation: format GUID
     - name: snapshotId | type: string | description: Payment snapshot GUID. Empty if `status` of the order is `"FREE"`.  | read-only: true | validation: format GUID
     - name: eventId | type: string | description: Event GUID to which the order belongs.  | validation: format GUID
     - name: contactId | type: string | description: Contact GUID of buyer, resolved using the email address specified. See the Contacts API for additional information.  | validation: format GUID
     - name: memberId | type: string | description: Buyer member GUID, if applicable. See the Members API for additional information.  | validation: format GUID
     - name: created | type: Date | description: Date and time the order was created.  | read-only: true 
     - name: firstName | type: string | description: Guest first name.  
     - name: lastName | type: string | description: Guest last name.  
     - name: email | type: string | description: Guest email address.  | validation: format EMAIL
     - name: checkoutForm | type: FormResponse | description: Checkout form response. When each purchased ticket is assigned to a guest, guest forms are returned for each ticket, and buyer info is returned.  
        - 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: confirmed | type: boolean | description: Whether the order is confirmed. Triggered once the payment gateway processes the payment and funds reach the merchant's account.  
     - name: status | type: OrderStatus | description: Order status.  
         - enum:
         -     NA_ORDER_STATUS: Order status isn't available for this request fieldset.
         -     FREE: Order is confirmed, no payment is required.
         -     PENDING: Order was paid, but the payment gateway suspended the payment.
         -     PAID: Order is paid.
         -     OFFLINE_PENDING: Order is confirmed but must be paid via offline payment. Status needs to be manually updated to `"PAID"`.
         -     INITIATED: Order is waiting for payment at the cashier.
         -     CANCELED: Order is canceled.
         -     DECLINED: Order payment is declined.
         -     AUTHORIZED: Order payment is authorized.
         -     VOIDED: Order payment is voided.
         -     PARTIALLY_PAID: Order is partially paid with less than the total amount.
     - name: method | type: string | description: Payment method used for purchase, for example, "payPal", "creditCard", etc.  
     - name: ticketsQuantity | type: integer | description: Amount of tickets ordered.  
     - name: totalPrice | type: Money | description: Total order price.  
        - name: currency | type: string | description: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. For example, `USD`.  | validation: format CURRENCY
        - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, starts with a single (-), to indicate that the amount is negative.  | validation: format DECIMAL_VALUE
     - name: ticketsPdf | type: string | description: Ticket PDF URL.  
     - name: tickets | type: array<Ticket> | description: Tickets (generated after payment).  
        - name: ticketNumber | type: string | description: Unique ticket number which is assigned automatically when creating a ticket.  
        - name: orderNumber | type: string | description: Associated order number.  
        - name: ticketDefinitionId | type: string | description: Ticket definition GUID. See the Ticket Definition API for additional information.  | validation: format GUID
        - name: name | type: string | description: Ticket type.  
        - name: price | type: Money | description: Ticket price.  
        - name: free | type: boolean | description: Whether the ticket requires payment.  | read-only: true 
        - name: policy | type: string | description: Ticket and event policies.  
        - name: checkIn | type: CheckIn | description: Ticket check-in.  
           - name: created | type: Date | description: Time of a ticket's check-in.  
        - name: orderStatus | type: OrderStatus | description: Associated order status.  
        - name: orderArchived | type: boolean | description: Whether the order and ticket are archived. If set to `true`, they aren't visible in the order list.  
        - name: orderFullName | type: string | description: Buyer full name.  
        - name: guestFullName | type: string | description: Guest full name.  
        - name: guestDetails | type: GuestDetails | description: Guest personal details.  
           - name: guestAssigned | type: boolean | description: Whether ticket belongs to assigned guest.  
           - name: firstName | type: string | description: Guest first name.  
           - name: lastName | type: string | description: Guest last name.  
           - name: email | type: string | description: Guest email.  | validation: format EMAIL
           - name: form | type: FormResponse | description: Full form response.  
           - name: contactId | type: string | description: Contact GUID associated with this guest.  | validation: format GUID
           - name: phone | type: string | description: Guest phone number.  | validation: format PHONE
        - name: archived | type: boolean | description: Whether the ticket is visible in an order.  
        - name: memberId | type: string | description: Ticket owner member GUID.  | validation: format GUID
        - name: anonymized | type: boolean | description: Whether ticket was anonymized by GDPR delete. Anonymized tickets no longer contain personally identifiable information (PII).  
        - name: checkInUrl | type: string | description: Ticket check-in URL.  Shown as QR code image in PDF.  <br/> Format: `"https://www.wixevents.com/check-in/{ticket number},{event id}"`  <br/> Example: `"https://www.wixevents.com/check-in/AAAA-AAAA-BB021,00000000-0000-0000-0000-000000000000"`  
        - name: ticketPdfUrl | type: string | description: URL for ticket PDF download.  
        - name: channel | type: ChannelType | description: Associated order checkout channel type.  
             - enum:
             -     ONLINE: Buyer created the order via an online channel, such as a website or mobile app.
             -     OFFLINE_POS: Sales person created the order and collected the money.
        - name: walletPassUrl | type: string | description: URL to download a ticket in `.pkpass` format for Apple Wallet.  | read-only: true | validation: format WEB_URL
        - name: canceled | type: boolean | description: Whether ticket is canceled.  | read-only: true 
     - name: archived | type: boolean | description: Whether the order is archived.  
     - name: anonymized | type: boolean | description: Whether the order is anonymized by GDPR delete.  
     - name: fullName | type: string | description: Guest full name.  
     - name: invoice | type: Invoice | description: Order invoice.  
        - name: items | type: array<Item> | description:   
           - name: _id | type: string | description: Unique line item GUID.  | validation: format GUID
           - name: quantity | type: integer | description: Line item quantity.  | validation: minimum 1, maximum 50
           - name: name | type: string | description: Line item name.  
           - name: price | type: Money | description: Line item price.  
           - name: total | type: Money | description: Total price for line items. Always equal to price * quantity.  
           - name: discount | type: Discount | description: Discount applied to the line item.  
              - name: amount | type: Money | description: Total discount amount.  
              - name: afterDiscount | type: Money | description: Total sum after the discount.  
              - name: discounts | type: array<DiscountItem> | description: Discount items.  
                 - ONE-OF: 
                    - name: coupon | type: CouponDiscount | description: Coupon discount.  
                       - name: name | type: string | description: Discount coupon name. **Deprecated:** Use `invoice.discounts.coupon.name` instead.  
                       - name: code | type: string | description: Discount coupon code. **Deprecated:** Use `invoice.discounts.coupon.code` instead.  
                       - name: couponId | type: string | description: Discount coupon GUID. **Deprecated:** Use `invoice.discounts.coupon.couponId` instead.  
                    - name: paidPlan | type: PaidPlanDiscount | description: Pricing plan discount.  
                       - ONE-OF: 
                          - name: percentDiscount | type: PercentDiscount | description: Discount by percentage applied to tickets.  
                             - name: rate | type: string | description: Percent rate.  | validation: decimalValue {"gte":"0.01","lte":"100","maxScale":2}
                             - name: quantityDiscounted | type: integer | description: Number of discounted tickets.  | validation: minimum 0
                       - name: name | type: string | description: Name of pricing plan.  
                 - name: amount | type: Money | description: Total discount amount.  
           - name: tax | type: Tax | description: Tax applied to the item.  
              - name: type | type: TaxType | description: Tax type.  
                     - enum:
                     -     INCLUDED: Tax is included in the ticket price.
                     -     ADDED: Tax is added to the order at the checkout.
                     -     ADDED_AT_CHECKOUT: Tax is added to the final total at the checkout.
              - name: name | type: string | description: Tax name.  | read-only: true 
              - name: rate | type: string | description: Tax rate.  | validation: format DECIMAL_VALUE
              - name: taxable | type: Money | description: Taxable amount.  
              - name: amount | type: Money | description: Total tax amount.  
           - name: fees | type: array<Fee> | description: Wix ticket service fee on this item's tickets. The fee on additional fees is only in the invoice `fees`.  | read-only: true 
              - name: name | type: FeeName | description: Fee identifier.  
                     - enum:
                     -     WIX_FEE: Wix ticket service fee charges applied to the line item.
              - name: type | type: FeeType | description: How fee is calculated.  
                     - enum:
                     -     FEE_ADDED: Fee is added to the ticket price at checkout.
                     -     FEE_INCLUDED: Seller absorbs the fee. It's deducted from the ticket price.
                     -     FEE_ADDED_AT_CHECKOUT: Fee is added to the ticket price at checkout.
              - name: rate | type: string | description: Fee rate.  | read-only: true | validation: format DECIMAL_VALUE
              - name: amount | type: Money | description: Total amount of fee charges.  
        - name: discount | type: Discount | description: Discount applied to a cart.  
        - name: tax | type: Tax | description: Tax applied to a cart.  
        - name: subTotal | type: Money | description: Total cart amount before discount, tax, and fees.  
        - name: grandTotal | type: Money | description: Total amount of a cart after discount, tax, and fees. Grand total is calculated in the following order: 1. Total prices of all items in the cart are calculated. 2. Discount is subtracted from the cart, if applicable. 3. Tax on tickets is added, if applicable. 4. Wix ticket service fee paid by the buyer is added. 5. Additional fees configured by the event organizer (`additionalFees`) are added, including their tax.  
        - name: fees | type: array<Fee> | description: Wix ticket service fees on the order. The `FEE_INCLUDED` entries, which the organizer absorbs, also hold the fee on `additionalFees`.  | read-only: true 
        - name: revenue | type: Money | description: Total revenue: `grandTotal` minus the Wix ticket service fees in `fees` and any amount paid by gift card, never below 0. `additionalFees` stay in revenue. Taxes and payment provider fees aren't deducted.  
        - name: previewUrl | type: string | description: Invoice preview URL. Only returned if the order is paid.  
        - name: additionalFees | type: array<AppliedAdditionalFee> | description: Additional fees configured by the event organizer, in display order. Included in `grandTotal`, `tax` and `revenue`. The Wix ticket service fee on them is part of the `FEE_INCLUDED` entries in `fees`.  | read-only: true | validation: maxItems 3
           - name: appliedFeeId | type: string | description: Applied fee GUID, assigned once when the order is created.  | read-only: true | validation: format GUID
           - name: name | type: string | description: Fee name shown to buyers.  | read-only: true | validation: minLength 1, maxLength 50
           - name: amount | type: Money | description: Total amount charged for this fee, including tax.  | read-only: true 
           - name: tax | type: Tax | description: Tax applied to the fee. Not returned when no tax applies.  | read-only: true 
     - name: fullyCheckedIn | type: boolean | description: Whether all tickets in an order are checked in.  
     - name: paymentDetails | type: PaymentDetails | description: Internal order payment details.  
        - name: transaction | type: PaymentTransaction | description: Wix Payments transaction.  
           - name: transactionId | type: string | description: Wix Payments transaction GUID.  | read-only: true | validation: format GUID
           - name: method | type: string | description: Transaction payment method, for example, "payPal", "creditCard", etc.  | read-only: true 
     - name: channel | type: ChannelType | description: Checkout channel type.  
     - name: updated | type: Date | description: Date and time the order was last updated.  | read-only: true 
     - name: giftCardPaymentDetails | type: array<GiftCardPaymentDetails> | description: Gift card payments, including voided payments.  | validation: maxItems 10
        - name: voided | type: boolean | description: Whether the payment was reversed and no longer contributes to the order.  
        - name: amount | type: Money | description: Gift card payment amount, or projected amount for invoice previews.  
        - name: obfuscatedCode | type: string | description: Masked gift card code for display.  | validation: maxLength 30
     - name: marketingConsent | type: boolean | description: Whether marketing consent was given.  
  - name: expires | type: Date | description: Time when the order expires, applies to orders with status = INITIATED.  
  - name: reservations | type: array<TicketReservation> | description: Ticket reservations.  
     - name: quantity | type: integer | description: Amount of reserved tickets.  | validation: minimum 1, maximum 20
     - name: ticket | type: TicketDefinition | description:   
        - name: _id | type: string | description: Ticket definition GUID.  | validation: format GUID
        - name: price | type: Money | description: Ticket price.  
        - name: free | type: boolean | description: Whether the ticket is free (read only).  
        - name: name | type: string | description: Ticket name.  
        - name: description | type: string | description: Ticket description.  
        - name: limitPerCheckout | type: integer | description: Limit of tickets that can be purchased per checkout. Set to 20 for unlimited ticket definition.  | validation: minimum 0, maximum 20
        - name: orderIndex | type: integer | description: Custom sort index.  
        - name: policy | type: string | description: Policy information plain text block, as printed on the ticket.  
        - name: dashboard | type: Dashboard | description: Sensitive dashboard data.  
           - name: hidden | type: boolean | description: Whether ticket is hidden and cannot be sold.  
           - name: limited | type: boolean | description: Whether the ticket has limited quantity.  
           - name: quantity | type: integer | description: Ticket limit. `NULL` for unlimited ticket definitions.  | validation: format int32
           - name: unsold | type: integer | description: Number of unsold tickets. `NULL` for unlimited ticket definitions.  | validation: format int32
           - name: ticketsSold | type: integer | description: Number of tickets sold.  
           - name: ticketsReserved | type: integer | description: Number of tickets reserved.  
        - name: eventId | type: string | description: Event GUID associated with the ticket.  | validation: format GUID
        - name: wixFeeConfig | type: WixFeeConfig | description: Configuration of the fixed-rate Wix service fee that is applied at checkout to each ticket sold.  | read-only: true 
           - name: type | type: FeeType | description: Fee calculation method.  
        - name: salePeriod | type: TicketSalePeriod | description: Ticket sale period.  
           - name: startDate | type: Date | description: Ticket sale start timestamp.  
           - name: endDate | type: Date | description: Ticket sale end timestamp.  
           - name: hideNotOnSale | type: boolean | description: Whether to hide this ticket if it isn't on sale.  
        - name: saleStatus | type: TicketSaleStatus | description: Ticket sale status.  | read-only: true 
             - enum:
             -     SALE_SCHEDULED: Ticket sale is scheduled to start.
             -     SALE_STARTED: Ticket sale has started.
             -     SALE_ENDED: Ticket sale has ended.
        - name: state | type: array<State> | description: Ticket state.  
             - enum: INCLUDE_HIDDEN_NOT_ON_SALE
        - name: pricing | type: TicketPricing | description: Ticket pricing.  
           - ONE-OF: 
              - name: fixedPrice | type: Money | description: Ticket price which is read only.  
              - name: minPrice | type: Money | description: Min price per ticket, customizable.  
              - name: pricingOptions | type: PricingOptions | description: Ticket pricing options.  
                 - name: options | type: array<PricingOption> | description: Multiple ticket pricing options.  
                    - name: _id | type: string | description: Ticket pricing option GUID.  | validation: format GUID
                    - name: name | type: string | description: Ticket pricing option name.  | validation: minLength 1, maxLength 200
                    - name: price | type: Money | description: Ticket pricing option price.  
           - name: pricingType | type: Type | description: Ticket pricing type.  | read-only: true 
                 - enum: STANDARD, DONATION
     - name: ticketDetails | type: array<TicketDetails> | description: Optional ticket details.  
        - name: seatId | type: string | description: Unique seat GUID in the event venue.  | validation: minLength 1, maxLength 36
        - name: sectionLabel | type: string | description: Section label.  | read-only: true 
        - name: areaLabel | type: string | description: Area label.  | read-only: true 
        - name: tableLabel | type: string | description: Table label.  | read-only: true 
        - name: rowLabel | type: string | description: Row label.  | read-only: true 
        - name: seatLabel | type: string | description: Seat label in a row or table.  | read-only: true 
        - name: planId | type: string | description: Seating plan GUID.  | read-only: true | validation: format GUID
        - name: capacity | type: integer | description: Number of places in the spot.  Default: `1`.  | validation: minimum 1, maximum 50, format int32
        - name: priceOverride | type: string | description: Custom price of a ticket.  | validation: format DECIMAL_VALUE
        - name: pricingOptionId | type: string | description: Pricing option GUID.  | validation: format GUID
        - name: pricingOptionName | type: string | description: Pricing option name.  | read-only: true 
  - name: orderPageUrl | type: string | description: Order page URL.  


```

### Examples

### checkout
```javascript
import { orders } from '@wix/events';

async function checkout(eventId,options) {
  const response = await orders.checkout(eventId,options);
};
```

### checkout (with elevated permissions)
```javascript
import { orders } from '@wix/events';
import { auth } from '@wix/essentials';

async function myCheckoutMethod(eventId,options) {
  const elevatedCheckout = auth.elevate(orders.checkout);
  const response = await elevatedCheckout(eventId,options);
}
```

### checkout (self-managed)
Self-managed 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 { orders } from '@wix/events';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function checkout(eventId,options) {
  const response = await myWixClient.orders.checkout(eventId,options);
};
```

---