onOrderPaid( ) api/event Not triggereing

hi legends,
am trying integrate onOrderPaid( ) api with SHIPROCKET.
BUT ON ORDER PAID API IS NOT TRIGGERING.

import wixData from ‘wix-data’ ;
import {fetch} from ‘wix-fetch’ ;
let OrderID = Date.now();

export async function wixStores_onOrderPaid(event) {
let today = new Date();
console.log(today);
console.log(event);
var deliveryDates = new Date();
deliveryDates.setDate(today.getDate()+ 5 );

const paidOrderId = event._id;

let items = event.lineItems.map((item) => {
let obj = {
name: item.name,
sku : item.sku,
units: item.quantity,
selling_price: item.price,
discount: item.discount,
tax:item.tax ,
hsn: item.index
}
return obj;
})

console.log( "items : " , items) 

let DeliveryCompanyName = event.billingInfo.company;
let DeliveryAddress1 = event.billingInfo.address.addressLine.substring( 0 , 49 );
let DeliveryAddress2 = event.billingInfo.address.addressLine.substring( 0 , 49 );
let DeliveryCity = event.billingInfo.address.city;
let DeliveryCounty = event.billingInfo.address.subdivision;
let DeliveryPostCode = event.billingInfo.address.postalCode;
let DeliveryCountry = event.billingInfo.address.country;
let DeliveryPhone = event.billingInfo.phone;
let ReleaseDate = today;
let DeliveryDate = deliveryDates;
let DeliveryTime = event.shippingInfo.estimatedDeliveryTime;

let Weight = event.totals.weight;
let subTotal = event.totals.subtotal;
let discount = event.totals.discount;
let Shipping = event.totals.shipping;
let PaymentMethod = event.billingInfo.paymentMethod;
Weight = Math.ceil(Weight);
// let CustRef = event.billingInfo.firstName + " " + event.billingInfo.lastName;
let firstName = event.billingInfo.firstName;
let lastName = event.billingInfo.lastName;
let email = event.billingInfo.email;
let Remarks = “Notify confirmed delivery details asap!”
let PickItems = event.lineItems;
let NOP = event.totals.quantity;

let payload = {
“order_id” : OrderID,
“order_date” : ReleaseDate,
“pickup_location” : “Rishi” ,
“channel_id” : “1467720” ,
“comment” : "No Comments " ,
“billing_customer_name” : firstName,
“billing_last_name” : lastName,
“billing_address” : DeliveryAddress1,
“billing_address_2” : DeliveryAddress2,
“billing_city” : DeliveryCity,
“billing_pincode” : DeliveryPostCode,
“billing_state” : DeliveryCounty,
“billing_country” : DeliveryCountry,
“billing_email” : email,
“billing_phone” : DeliveryPhone,
“shipping_is_billing” : true ,
“shipping_customer_name” : firstName,
“shipping_last_name” : lastName,
“shipping_address” : DeliveryAddress1,
“shipping_address_2” : DeliveryAddress2,
“shipping_city” : DeliveryCity,
“shipping_pincode” : DeliveryPostCode,
“shipping_country” : DeliveryCountry,
“shipping_state” : DeliveryCounty,
“shipping_email” : email,
“shipping_phone” : DeliveryPhone,

“order_items” : items,

“payment_method” : PaymentMethod,
“shipping_charges” : Shipping,
“giftwrap_charges” : 0 ,
“transaction_charges” : 0 ,
“total_discount” : discount,
“sub_total” : subTotal,
“length” : 1 ,
“breadth” : 1 ,
“height” : 1 ,
“weight” : Weight
}

let headers = {
‘Content-type’ : ‘application/json’ ,
‘Authorization’ : ‘Bearer’ + TOKEN
};

console.log( 'body string = ' , payload); 

let options = {
method: ‘POST’ ,
headers: headers,
body: JSON.stringify(payload)
};

await fetch( ‘https://api.boxtrax.com/api/365/Warehouse/CreateWarehousePick?fullResponse=true’ , options)
.then( async (httpResponse) => {

let status = httpResponse.statusText;
console.log( "status: " , status);

    }) 

    . catch ((error) => { 
        console.log( 'Oops... '  + error+ "ErrorEnd :(" ); 
    }); 

}

thanks
yours trainee

Again, where did you put the code?

You must put in events.js

you miss the “s”

yes am doing the same

Solved?

thanks So Much