Define a Hook after each sell

Hello everybody,

Is there the possibility to define a hook after each order to write information into an extra database:

 export function Stores$Orders_afterAdd(item, context) { 
                wixData.insert("newDB", item) 
	        .then((results) => {			 
		        console.log("uploaded order to newDB!"); 
	        }) 
	        // something went wrong 
	        .catch((error) => { 
		console.log("error cannot upload order to newDB" + error) 
	        }); 
            } 

Thank you so much guys,
you are just amazing.

Have a look at Events in Wix Stores Backend.
https://www.wix.com/corvid/reference/wix-stores-backend.Events.html

If you want to add a data hook, then you need to look here.
https://www.wix.com/corvid/reference/wix-data.Hooks.html

To see what fields in your Stores/Orders Collection that you can filter and by how, see here.
https://support.wix.com/en/article/corvid-wix-stores-orders-collection-fields