How do I mark an order as paid?

I can do it through the dashboard manually, but I’m looking for a way to do it with backend code.

I’ve already tried using the ‘wix-data’ API to update the order in the database, but it gives me a weird error message.

Here’s what I’ve tried so far:

const order = await  wixData.get(
 'Stores/Orders',
  paymentIntent.metadata.orderId,
  { suppressAuth: true }
);
 
console.log('ABOUT TO UPDATE', order);

order.paymentStatus = 'PAID';

const foo = await wixData.update(
 'Stores/Orders',
  order,
  { suppressAuth: true }
);

console.log('UPDATE OK', foo); // This never gets printed.

which throws this error:

Unknown error. Request ID: 1611770320.93139175542964216103. Message: Request failed with status code 404.

I’m at a loss for how to accomplish this.

As stated in the Permissions section of Velo: Wix Stores “Orders” Collection Fields , the Stores/Orders collection cannot be modified.

So then what’s the procedure for doing this?
I just want to update the payment status in response to a webhook.

@alexmeuer This function is not currently supported.

Wix is constantly working on improving the developer experience. Feel free to make your voice heard. The Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.

@yisrael-wix I see…

This is such a huge pitfall - I’m working on a site that has been built entirely around the Orders collection - which is locked and read only. This means I can’t manually update the fields of any of these rows. Is there a workaround for this?

1 Like

Hi! Some news?

Hello, any news? Wix come on…

:sob::sob::sob: