> 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 # Package: ticketing # Namespace: orders # Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/events/registration/ticketing/orders/order-initiated.md ## Introduction # Webhook Permissions Scopes IDs: Read Basic Events Order Info: SCOPE.DC-EVENTS.READ-BASIC-ORDERS --- ## REST API ### Schema ``` Webhook: Order Initiated Description: Payload: OrderInitiated - name: timestamp | type: string | description: Date and time the order was initiated. - name: language | type: string | description: Site language when the order was initiated. - name: locale | type: string | description: Locale in which the order was created. - name: eventId | type: string | description: Event GUID to which the order belongs. - name: orderNumber | type: string | description: Unique order number. - name: contactId | type: string | description: Contact GUID associated with the order. - name: memberId | type: string | description: Member GUID associated with the order. - name: created | type: string | description: Date and time the order was created. - name: updated | type: string | description: Date and time the order was updated. - name: firstName | type: string | description: Guest first name. - name: lastName | type: string | description: Guest last name. - name: email | type: string | description: Guest email address. - name: checkoutForm | type: FormResponse | description: Checkout form response. - name: inputValues | type: array | description: Form field inputs. - name: inputName | type: string | description: Form field input name. - name: value | type: string | description: Form field value. - name: values | type: array | description: Form field values. - 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: invoice | type: Invoice | description: Invoice. - name: items | type: array | description: - name: id | type: string | description: Unique line item GUID. - name: quantity | type: integer | description: Line item quantity. - name: name | type: string | description: Line item name. - name: price | type: Money | description: Line item 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`. - 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. - 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 | 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. - name: quantityDiscounted | type: integer | description: Number of discounted tickets. - 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. - name: rate | type: string | description: Tax rate. - name: taxable | type: Money | description: Taxable amount. - name: amount | type: Money | description: Total tax amount. - name: fees | type: array | description: Fees applied to the item. - 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. - 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 is added, if applicable. 4. Wix ticket service fee is added. - name: fees | type: array | description: Fees applied to the cart. - name: revenue | type: Money | description: Total revenue, excluding fees. Taxes and payment provider fees aren't deducted. - name: previewUrl | type: string | description: Invoice preview URL. Only returned if the order is paid. - name: reservationId | type: string | description: Reservation GUID associated with the order. - name: markedAsPaid | type: boolean | description: Order was marked as paid. - name: marketingConsent | type: boolean | description: Whether marketing consent was given. ``` ### Examples ```curl { "timestamp": "2020-04-28T12:23:51.523Z", "eventId": "566e7be9-1410-4095-ae7a-349a4ac95c6b", "orderNumber": "FMXC-BZG3-OT", "firstName": "John", "lastName": "Doe", "email": "john.doe@somedomain.com", "status": "INITIATED", "checkoutForm": { "inputValues": [ { "inputName": "firstName", "value": "John" }, { "inputName": "lastName", "value": "Doe" }, { "inputName": "email", "value": "john.doe@somedomain.com" } ] }, "invoice": { "items": [ { "id": "d72874cb-012a-4ad2-afbb-57fe8cf1e308", "quantity": 1, "name": "VIP", "price": { "amount": "123.00", "currency": "USD" }, "total": { "amount": "123.00", "currency": "USD" }, "fees": [ { "type": "FEE_INCLUDED", "rate": "2.5", "amount": { "amount": "3.08", "currency": "USD" } } ] }, { "id": "9c3dc432-f1a6-408f-82d8-4f64c7ff581b", "quantity": 1, "name": "Free", "price": { "amount": "0.00", "currency": "USD" }, "total": { "amount": "0.00", "currency": "USD" }, "fees": [ { "rate": "2.5", "amount": { "amount": "0.00", "currency": "USD" } } ] } ], "fees": [ { "rate": "2.5", "amount": { "amount": "0.00", "currency": "USD" } }, { "type": "FEE_INCLUDED", "rate": "2.5", "amount": { "amount": "3.08", "currency": "USD" } } ], "subTotal": { "amount": "123.00", "currency": "USD" }, "grandTotal": { "amount": "123.00", "currency": "USD" }, "revenue": { "amount": "119.92", "currency": "USD" } } } ``` --- ## JavaScript SDK ### Schema ``` Webhook: onOrderInitiated Description: Payload: OrderInitiatedEnvelope - name: data | type: OrderInitiated | description: none - name: timestamp | type: Date | description: Date and time the order was initiated. - name: language | type: string | description: Site language when the order was initiated. - name: locale | type: string | description: Locale in which the order was created. - name: eventId | type: string | description: Event GUID to which the order belongs. - name: orderNumber | type: string | description: Unique order number. - name: contactId | type: string | description: Contact GUID associated with the order. - name: memberId | type: string | description: Member GUID associated with the order. - name: created | type: Date | description: Date and time the order was created. - name: updated | type: Date | description: Date and time the order was updated. - name: firstName | type: string | description: Guest first name. - name: lastName | type: string | description: Guest last name. - name: email | type: string | description: Guest email address. - name: checkoutForm | type: FormResponse | description: Checkout form response. - name: inputValues | type: array | description: Form field inputs. - name: inputName | type: string | description: Form field input name. - name: value | type: string | description: Form field value. - name: values | type: array | description: Form field values. - 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: invoice | type: Invoice | description: Invoice. - name: items | type: array | description: - name: _id | type: string | description: Unique line item GUID. - name: quantity | type: integer | description: Line item quantity. - name: name | type: string | description: Line item name. - name: price | type: Money | description: Line item 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`. - 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. - 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 | 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. - name: quantityDiscounted | type: integer | description: Number of discounted tickets. - 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. - name: rate | type: string | description: Tax rate. - name: taxable | type: Money | description: Taxable amount. - name: amount | type: Money | description: Total tax amount. - name: fees | type: array | description: Fees applied to the item. - 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. - 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 is added, if applicable. 4. Wix ticket service fee is added. - name: fees | type: array | description: Fees applied to the cart. - name: revenue | type: Money | description: Total revenue, excluding fees. Taxes and payment provider fees aren't deducted. - name: previewUrl | type: string | description: Invoice preview URL. Only returned if the order is paid. - name: reservationId | type: string | description: Reservation GUID associated with the order. - name: markedAsPaid | type: boolean | description: Order was marked as paid. - name: marketingConsent | type: boolean | description: Whether marketing consent was given. - name: metadata | type: BaseEventMetadata | description: none - name: instanceId | type: string | description: App instance GUID. - name: eventType | type: string | description: Event type. - name: identity | type: IdentificationData | description: The identification type and identity data. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: identityType | type: WebhookIdentityType | description: - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP - name: accountInfo | type: AccountInfo | description: Details related to the account - name: accountId | type: string | description: GUID of the Wix account associated with the event. - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account. - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site. ``` ### Examples ```javascript import { orders } from '@wix/events'; orders.onOrderInitiated((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { orders } from '@wix/events'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { orders, }, }); wixClient.orders.onOrderInitiated((event) => { // handle your event here }); ``` ---