Question:
I’m creating an invoice using the wix billing API and it is being created successfully but not getting the invoice in return when calling the getInvoice API. In fact, getting an error saying EntityNotFound. Plus there is no new data inserted in the billing database, it is empty. Either we create the Invoice using API or directly from the dashboard, the billing database is always empty even though the onInvoiceCreated event is working.
Product:
WIX
What are you trying to achieve:
I want to create invoice, get invoice, delete invoice, update invoice. All these using the velo APIs
I just wanted to followup on this thread to see if there was any resolution to our issue. It would be great to have a positive update as my project has faced a serious timeline delay. Please let me know if we are close to finding a solution.
import * as wixAuth from 'wix-auth';
import {invoices} from 'wix-billing-backend';
export function getInvoice(id){
const elevatedGetInvoice = wixAuth.elevate(invoices.getInvoice)
return elevatedGetInvoice(id);
}
EDIT: Solved. createInvoice() does not require wixAuth.elevate() to work. There was something wrong with the date variables.
How do I combine wixAuth.elevate() with createInvoice()?
Specifically I am not able to integrate the variable createInvoiceFields) into the row with wixAuth.elevate.
When I run the function in the backend I get: [backend/invoice.jsw, createInvoice] returned with undefined