Trouble linking my Wix shop to Meta. How do I create a Checkout URL?

I’m having trouble with
I am new to this portion of eCommerce. Meta is asking for: Build parameters to handle products. In your URL, the ID and quantity for each product parameter should be separated by a colon. Commas (%2C) and colons (%3A) are escaped according to RFC 3986.

Working in
Meta and wix.com portal. Not sure I understand what is needed.

Site link

the instructions from Meta. Not to friendly for novices.

What I’m trying to do
I am trying to create a Checkout URL, that will automatically update when I add new items to my catalog, so that users can see these items on FB and IG, and FB and IG will push them to my checkout page.

What I’ve tried so far
I am not very familiar with the additional coding that is needed for this, but I have tried to follow the directions on Meta, Wix and ChatGPT.

Extra context
Screenshots attached.

CHatGPT provided the below, but I have no idea where this coding is supposed to go or how to test:

import { createCheckout } from ‘wix-ecom-backend’;

import wixStoresBackend from ‘wix-stores-backend’;

/**

* Generates a checkout URL with ALL active products in your store.

* Always up to date when products change.

*/

export async function getUniversalCheckoutUrl() {

try {

// Fetch up to 200 products (adjust limit if you have more)

const { products } = await wixStoresBackend.getProducts({ limit: 200 });

if (!products.length) {

throw new Error(“No products found in store.”);

}

// Map each product to a line item

const lineItems = products.map(product => ({

catalogReference: {

appId: ‘1380b703-ce81-ff05-f115-39571d94dfcd’, // Wix Stores App ID

catalogItemId: product._id

},

quantity: 1 // Default quantity; can be adjusted

}));

// Create checkout session

const checkout = await createCheckout({ lineItems });

// Return the checkout URL

return checkout.checkoutUrl;

} catch (err) {

console.error(“Error creating universal checkout URL:”, err);

throw err;

}

}

Were you able to get this issue resolved? I’m having the same issue.

As mentioned in a similar post:

has anyone found an answer to this?

Hey so the Facebook feed by Godatadfeed app is the way I have connected my store to Meta/FB/IG. I have gone round and round on the same Checkout url item and all 3 vendors, Wix, Meta and Godatafeed, circle back that I have to provide the URL. This url has to have a variable to insert the product/products and you can use Velo but I think Godatafeed is easier for non-coders to implement, at least for the feed of products from Wix to Meta. Still working on the checkout url problem but wanted to share since Wix Velo was brought up.