> 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 # GetInvoice # Package: ticketing # Namespace: CheckoutService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/registration/ticketing/orders/get-invoice.md ## Permission Scopes: Read Basic Events Order Info: SCOPE.DC-EVENTS.READ-BASIC-ORDERS ## Introduction Generates a preview of a reservation invoice, including the specified coupon or pricing plan. --- ## REST API ### Schema ``` Method: getInvoice Description: Generates a preview of a reservation invoice, including the specified coupon or pricing plan. URL: https://www.wixapis.com/events/v1/checkout/invoices/{reservationId} Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: eventId Method parameters: param name: eventId | type: eventId | description: Event GUID to which the invoice belongs. | required: true param name: paidPlanBenefit | type: PaidPlanBenefit - name: planOrderId | type: string | description: Pricing plan GUID. - name: benefitId | type: string | description: Pricing plan benefit GUID. param name: withDiscount | type: DiscountRequest - name: couponCode | type: string | description: Discount coupon code. Return type: GetInvoiceResponse - name: invoice | type: Invoice | description: Invoice with applied discount. - 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: discountErrors | type: DiscountErrors | description: Discount errors, if relevant. - name: error | type: array | description: Error. - name: code | type: string | description: - name: expires | type: string | description: Time when the reservation expires. - name: reservationStatus | type: ReservationStatus | description: Reservation status. - enum: - RESERVATION_PENDING: The reservation is pending confirmation. It will expire after a certain amount of time. - RESERVATION_CONFIRMED: The reservation is confirmed and won't expire. - RESERVATION_CANCELED: The reservation is canceled because it's not paid. - RESERVATION_CANCELED_MANUALLY: The reservation is canceled manually by the buyer. - RESERVATION_EXPIRED: The reservation has expired. - name: reservationOccupied | type: boolean | description: Whether this reservation is already used in a checkout. - name: reservations | type: array | description: Ticket reservations. - name: quantity | type: integer | description: Amount of reserved tickets. - name: ticket | type: TicketDefinition | description: - name: id | type: string | description: Ticket definition 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. - 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. - name: unsold | type: integer | description: Number of unsold tickets. `NULL` for unlimited ticket definitions. - 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. - name: wixFeeConfig | type: WixFeeConfig | description: Configuration of the fixed-rate Wix service fee that is applied at checkout to each ticket sold. - 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. - name: endDate | type: string | 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. - 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 | 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 | description: Multiple ticket pricing options. - name: id | type: string | description: Ticket pricing option GUID. - name: name | type: string | description: Ticket pricing option name. - name: price | type: Money | description: Ticket pricing option price. - name: pricingType | type: Type | description: Ticket pricing type. - enum: STANDARD, DONATION - name: ticketDetails | type: array | description: Optional ticket details. - name: seatId | type: string | description: Unique seat GUID in the event venue. - name: sectionLabel | type: string | description: Section label. - name: areaLabel | type: string | description: Area label. - name: tableLabel | type: string | description: Table label. - name: rowLabel | type: string | description: Row label. - name: seatLabel | type: string | description: Seat label in a row or table. - name: planId | type: string | description: Seating plan GUID. - name: capacity | type: integer | description: Number of places in the spot. Default: `1`. - name: priceOverride | type: string | description: Custom price of a ticket. - name: pricingOptionId | type: string | description: Pricing option GUID. - name: pricingOptionName | type: string | description: Pricing option name. ``` ### Examples ### Get Invoice ```curl curl -X POST 'https://www.wixapis.com/events/v1/checkout/invoices/8fa44c06-050f-4538-9746-a6ff02079414' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ -d'{ "eventId": "a4f1a2c9-5ac0-4033-9c01-f6c177f78f04" "withDiscount": { "couponCode": "SUMMER" } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.ticketing.CheckoutService.getInvoice(reservationId, eventId, options) Description: Generates a preview of a reservation invoice, including the specified coupon or pricing plan. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: eventId, reservationId Method parameters: param name: eventId | type: string | description: Event GUID to which the invoice belongs. | required: true param name: options | type: GetInvoiceOptions none - name: withDiscount | type: DiscountRequest | description: Optional discount to be applied on the returned invoice. - name: couponCode | type: string | description: Discount coupon code. - name: paidPlanBenefit | type: PaidPlanBenefit | description: Optional benefit granted by the pricing plan to be applied on the returned invoice. - name: planOrderId | type: string | description: Pricing plan GUID. - name: benefitId | type: string | description: Pricing plan benefit GUID. param name: reservationId | type: string | description: Reservation GUID. | required: true Return type: PROMISE - name: invoice | type: Invoice | description: Invoice with applied discount. - 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: discountErrors | type: DiscountErrors | description: Discount errors, if relevant. - name: error | type: array | description: Error. - name: code | type: string | description: - name: expires | type: Date | description: Time when the reservation expires. - name: reservationStatus | type: ReservationStatus | description: Reservation status. - enum: - RESERVATION_PENDING: The reservation is pending confirmation. It will expire after a certain amount of time. - RESERVATION_CONFIRMED: The reservation is confirmed and won't expire. - RESERVATION_CANCELED: The reservation is canceled because it's not paid. - RESERVATION_CANCELED_MANUALLY: The reservation is canceled manually by the buyer. - RESERVATION_EXPIRED: The reservation has expired. - name: reservationOccupied | type: boolean | description: Whether this reservation is already used in a checkout. - name: reservations | type: array | description: Ticket reservations. - name: quantity | type: integer | description: Amount of reserved tickets. - name: ticket | type: TicketDefinition | description: - name: _id | type: string | description: Ticket definition 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. - 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. - name: unsold | type: integer | description: Number of unsold tickets. `NULL` for unlimited ticket definitions. - 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. - name: wixFeeConfig | type: WixFeeConfig | description: Configuration of the fixed-rate Wix service fee that is applied at checkout to each ticket sold. - 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. - 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 | 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 | description: Multiple ticket pricing options. - name: _id | type: string | description: Ticket pricing option GUID. - name: name | type: string | description: Ticket pricing option name. - name: price | type: Money | description: Ticket pricing option price. - name: pricingType | type: Type | description: Ticket pricing type. - enum: STANDARD, DONATION - name: ticketDetails | type: array | description: Optional ticket details. - name: seatId | type: string | description: Unique seat GUID in the event venue. - name: sectionLabel | type: string | description: Section label. - name: areaLabel | type: string | description: Area label. - name: tableLabel | type: string | description: Table label. - name: rowLabel | type: string | description: Row label. - name: seatLabel | type: string | description: Seat label in a row or table. - name: planId | type: string | description: Seating plan GUID. - name: capacity | type: integer | description: Number of places in the spot. Default: `1`. - name: priceOverride | type: string | description: Custom price of a ticket. - name: pricingOptionId | type: string | description: Pricing option GUID. - name: pricingOptionName | type: string | description: Pricing option name. ``` ### Examples ### getInvoice ```javascript import { orders } from '@wix/events'; async function getInvoice(reservationId,eventId,options) { const response = await orders.getInvoice(reservationId,eventId,options); }; ``` ### getInvoice (with elevated permissions) ```javascript import { orders } from '@wix/events'; import { auth } from '@wix/essentials'; async function myGetInvoiceMethod(reservationId,eventId,options) { const elevatedGetInvoice = auth.elevate(orders.getInvoice); const response = await elevatedGetInvoice(reservationId,eventId,options); } ``` ### getInvoice (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 { 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 getInvoice(reservationId,eventId,options) { const response = await myWixClient.orders.getInvoice(reservationId,eventId,options); }; ``` ---