# Wix-ecom-backend updatePaymentStatus

**URL:** <https://forum.wixstudio.com/t/wix-ecom-backend-updatepaymentstatus/59324>\
**Category:** Ask the community\
**Tags:** wix, code, question, wix-stores\
**Created:** [May 19, 2024, 7:56am UTC](https://forum.wixstudio.com/t/wix-ecom-backend-updatepaymentstatus/59324 "2024-05-19T07:56:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![howardyang](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@howardyang](https://forum.wixstudio.com/u/howardyang)\
**Post date:** [May 19, 2024, 7:56am UTC](https://forum.wixstudio.com/t/wix-ecom-backend-updatepaymentstatus/59324/1 "2024-05-19T07:56:02Z")

</div>

**Question:**  
Hi, I’m trying to use Wix Ecom Backend to update the payment status of an offline order to PAID. Is there an example of how to do this?

**Product:**  
Wix Editor

**What are you trying to achieve:**  
When the user create an order via Wix Stores, I have an order ID with an initial NOT\_PAID paymentStatus. And I’d like to change the paymentStatus to PAID

**What have you already tried:**  
I have visited these documents:

- [updatePaymentStatus - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/wix-ecom-backend/ordertransactions/updatepaymentstatus)
- [updateOrder - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/wix-ecom-backend/orders/updateorder)

However, there’s only field definition without a real-world workable example.

---

<div class="post-metadata">

**Author:** ![Tinh\_Hoa](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/tinh_hoa/32/87029_2.png) [@Tinh\_Hoa](https://forum.wixstudio.com/u/Tinh_Hoa)\
**Post date:** [May 31, 2024, 3:00am UTC](https://forum.wixstudio.com/t/wix-ecom-backend-updatepaymentstatus/59324/2 "2024-05-31T03:00:48Z")

</div>

Please any update on this? Here my code

import { orderTransactions } from ‘wix-ecom-backend’;  
import { Permissions, webMethod } from ‘wix-web-module’;  
import { elevate } from ‘wix-auth’;

export const myElevatedupdatePaymentFunction = webMethod(Permissions.Anyone, async (orderId, payments) =\>{

try {  
const elevatedupdatePayment = elevate(orderTransactions.addPayments);  
const confirmedPayment = await elevatedupdatePayment(orderId, payments);

```
console.log('Success! Confirmed payment:', confirmedPayment);
return confirmedPayment;
} catch (error) {
console.error(error);
// Handle error
}

```

});

and my input

{  
“orderId”: “761c52c2-c8a1-4570-bd31-22d63f285811”,  
“payments”: [{  
“amount” : {  
“amount” : “90000”  
},  
“regularPaymentDetails” : {  
“offlinePayment” : true,  
“status” : “PAID”  
}  
}]  
}

But the returned result’s status is “undefined”

![image](https://us1.discourse-cdn.com/wix/original/3X/7/6/7637cf88d892848ff371e81aa7f8c4b810c6c8c1.png)

PLEASE HELP

---

<div class="post-metadata">

**Author:** ![Josh\_Brown](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/josh_brown/32/96246_2.png) [@Josh\_Brown](https://forum.wixstudio.com/u/Josh_Brown)\
**Post date:** [September 25, 2024, 2:28am UTC](https://forum.wixstudio.com/t/wix-ecom-backend-updatepaymentstatus/59324/4 "2024-09-25T02:28:09Z")

</div>

I know I’m late here, but better late than never, in case this pops up for someone else.  
In my case, I was trying to updatePaymentStatus with a payment ID from an Invoice and an order ID. Unfortunately I couldn’t get that to work, and this was the only thing that I could get to work.

Your line here is wrong:

> [@Tinh\_Hoa](#):
>
> “status” : “PAID”

All you’re missing is setting that status to Approved.

```javascript
status: orderTransactions.TransactionStatus.APPROVED 

```

This fixes your issue at the time of writing this, and marks the order as paid for offline orders. (Supposedly the same as marking it as paid by admins through the dashboard) Though, it’s also worth mentioning that this function is in early preview, so hopefully it doesn’t change in the future and causes you issues.
