Error 500 when attempting to run Zapier Webhook

Question:
Could someone tell me if the problem causing the 500 Error messages I keep getting from Zapier is with the backend code pasted below?

'use strict';
import wixData from 'wix-data';
import {ok, response} from 'wix-http-functions';


export function post_storerecords(request) {

    return request.body.json()
    .then(body => {

        let recordInsert = {
            "invoiceNo": body.InvoiceNo,
            "dueDate": body.DueDate,
            "customer": body.Customer,
            "amount": body.InvoiceStatus,
            "balance": body.Balance,
            "invoiceStatus": body.InvoiceStatus,
            "pdf": body.PDF,
            "firstName": body.FirstName,
            "lastName": body.LastName,
            "email": body.Email

        };
        return wixData.insert('QBOInvoices', recordInsert)
        .then(result =>ok({body: JSON.stringify(result)}))
        .catch(err => response({status: 500, body: err}));
    });
    
}

Product:
Wix Editor

What are you trying to achieve:
Hello! I am successfully using Zapier to add a new row to a Google Sheet when a new invoice is generated in QBO. I want to use Zapier to push new spreadsheet rows into a Wix CMS database named QBO Invoices.

What have you already tried:
I have created the action in Zapier and followed the instructions in this video to add backend code to my website, but I get a 500 error message from Zapier when I test the action.

Additional information:
[Include any other pertinent details or information that might be helpful for people to know when trying to answer your question.]

Can you share the full error message that you’re getting?

It looks like the 500 Error messages you’re seeing from Zapier might be caused by a couple of things. First, make sure you’re using good hosting if you’re on shared hosting, it might get overloaded. You might want to switch to cloud hosting for better performance. Next, check your code to make sure it’s running smoothly. Remove any unnecessary scripts and make sure the code is not making too many requests or using too many resources. Also, make sure your error handling is set up to catch any issues. By fixing these things, you should be able to solve the 500 Error problem.