Updates a ticket order.
The updateOrder()
function returns a Promise that resolves to an
UpdateOrderResponse
when the ticket order
has been updated with the new form values specified in the updateInfo
parameter.
You cannot update an order after payment has been processed.
Note: To work with the Wix Events API, you need to publish your site.
function updateOrder(
eventId: string,
orderNumber: string,
updateInfo: UpdateInfo,
): Promise<UpdateOrderResponse>;
ID of the event that the ticket reservations are for.
Number of the order to update.
Information related to the update.
import wixEventsFrontend from 'wix-events-frontend';
// ...
const eventId = // Get the event ID
let orderNumber = // Returned from the order() function
// ...
let formValues = // get form values
wixEventsFrontend.tickets.updateOrder(eventId, reservationId, {formValues})
.then((response) => {
let order = response.order;
});
/* response:
*
* {
* "order": {
* "orderNumber": "FMQR-VSN7-E1",
* "reservationId": "7f6a522f-f34c-4a03-8d9a-05e88506c012",
* "eventId": "9a513b88-a223-4144-b0dc-938fd7cc5b4a",
* "contactId": "",
* "memberId": "",
* "firstName": "John",
* "lastName": "Doe",
* "email": "john@doe.com",
* "checkoutForm": {
* "inputValues": [
* {
* "inputName": "firstName",
* "value": "John",
* "values": [],
* },
*
* ...
*
* {
* inputName: "custom",
* value: "",
* values: ["Gluten free", "Vegetarian"],
* }
* ]
* },
* "confirmed": false,
* "status": "INITIATED",
* "ticketsPdf": "https://apps.wix.com/events/doc/tickets/v2/Tickets.pdf?request=JWS...",
* "tickets": [],
* "archived": false,
* "anonymized": false,
* "fullName": "John Doe",
* "invoice": {
* "items": [
* {
* "id": "de8e3fd8-b257-40a7-933b-77c627d884e4",
* "quantity": 2,
* "name": "VIP ticket",
* "price": {
* "amount": "6.00",
* "currency": "USD"
* },
* "total": {
* "amount": "12.00",
* "currency": "USD"
* },
* "discount":{
* "amount":{
* "amount":"2.0",
* "currency":"USD"
* },
* "afterDiscount":{
* "amount":"10.00",
* "currency":"USD"
* },
* "code":"CouponCode",
* "name":"Coupon Name",
* "couponId":"3b2e333c-5376-4b36-8543-00bae6dd8f59",
* "discounts":[
* {
* "amount":{
* "amount":"2.0",
* "currency":"USD"
* },
* "coupon":{
* "name":"Coupon Name",
* "code":"CouponCode",
* "couponId":"3b2e333c-5376-4b36-8543-00bae6dd8f59"
* }
* }
* ]
* },
* "fees": [
* {
* "name": "WIX_FEE",
* "type": "FEE_ADDED",
* "rate": "2.5",
* "amount": {
* "amount": "0",
* "currency": "USD"
* }
* }
* ]
* },
* {
* "id": "9207637c-3d49-43af-b91e-32e496620c60",
* "quantity": 1,
* "name": "Regular ticket",
* "price": {
* "amount": "3.50",
* "currency": "USD"
* },
* "total": {
* "amount": "3.50",
* "currency": "USD"
* },
* "discount":{
* "amount":{
* "amount":"1.0",
* "currency":"USD"
* },
* "afterDiscount":{
* "amount":"2.50",
* "currency":"USD"
* },
* "code":"CouponCode",
* "name":"Coupon Name",
* "couponId":"3b2e333c-5376-4b36-8543-00bae6dd8f59",
* "discounts":[
* {
* "amount":{
* "amount":"1.0",
* "currency":"USD"
* },
* "coupon":{
* "name":"Coupon Name",
* "code":"CouponCode",
* "couponId":"3b2e333c-5376-4b36-8543-00bae6dd8f59"
* }
* }
* ]
* },
* "fees": [
* {
* "name": "WIX_FEE",
* "type": "FEE_ADDED",
* "rate": "2.5",
* "amount": {
* "amount": "0",
* "currency": "USD"
* }
* }
* ]
* }
* ],
* "total":{
* "amount":"15.50",
* "currency":"BIF"
* },
* "discount":{
* "amount":{
* "amount":"3.0",
* "currency":"BIF"
* },
* "afterDiscount":{
* "amount":"12.50",
* "currency":"BIF"
* },
* "code":"CouponCode",
* "name":"Coupon Name",
* "couponId":"3b2e333c-5376-4b36-8543-00bae6dd8f59",
* "discounts":[
* {
* "amount":{
* "amount":"3.0",
* "currency":"BIF"
* },
* "coupon":{
* "name":"Coupon Name",
* "code":"CouponCode",
* "couponId":"3b2e333c-5376-4b36-8543-00bae6dd8f59"
* }
* }
* ]
* },
* "subTotal":{
* "amount":"15.50",
* "currency":"BIF"
* },
* "grandTotal":{
* "amount":"12.50",
* "currency":"BIF"
* },
* "fees":[],
* "revenue":{
* "amount":"12.50",
* "currency":"BIF"
* }
* },
* "fullyCheckedIn": false,
* "transactionId": "",
* "paymentId": "b0fb4d1c-858b-45cb-991d-2fd79bfb60d3",
* "createdDate": "2020-04-22T13:25:32.018Z",
* "paymentMethod": "",
* "ticketQuantity": 3,
* "price": {
* "amount": "15.50",
* "currency": "USD"
* }
* }
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.