I'm using ShipStation API to create order, but getting error Access to XMLHttpRequest has blocked,
The code provided below is generated on https://www.shipstation.com/developer-api/#/reference/orders/createupdate-order/create/update-order?console=1
so I'm using it on https://tampermonkey.net/ extension, the funcion is called on button click error screenshot
(function () {
'use strict';
const $ = window.jQuery;
$(document).ready(function () {
const AUTHKEY = '112233'
$("#send").on("click", sendRequest)
const sendRequest = () => {
var request = new XMLHttpRequest();
request.open('POST', 'https://ssapi.shipstation.com/orders/createorder');
request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Authorization', AUTHKEY);
request.onreadystatechange = function () {
if (this.readyState === 4) {
console.log('Status:', this.status);
console.log('Headers:', this.getAllResponseHeaders());
console.log('Body:', this.responseText);
}
};
var body = { 'data is correct just deleted for now': '' };
request.send(JSON.stringify(body));
}
});
})();