Llamada Api, envio de archivo y json con ajax

Estoy intentando hacer una llamada a una api con ajax, el problema es que tengo que enviar por un lado un json y por otro la un archivo y aquí es donde se me complica la cosa. EL error que recibo es error 400. Decir que estoy importando el archivo ajax.js

Esta sería la función
#include “(CurrentProject)/vajax.js”
$.ajax({
type: “POST”,
url: “https://integra-servi.gob.es/wsregconsaica/servicioweb/nuevocontrato”,
headers: {“Authorization”:“Bearer hW3qqh2wNjy48jvI”},
data: {metadata: {“company_id”:“A18”,“producer_id”:“230F”},
files: {type: “file”, path: “C:/Users/Agro/Velneo/cacherun/127.0.0.1/1.pdf”}
},
responseType: “json”,
success: function(data, http_status) {
alert(data);
},
error: function(data, http_status) {
alert(http_status);
}
})


Muchas gracias.

Aqui la solución.

#include “(CurrentProject)/ajax.js”

var token = “Bearer eypo3hzakqWb_F3enmV974”

$.ajax({
type: “POST”,
headers : {Authorization: token},
url: “https://integrtrato”,
data: {metadata: ‘{“company_id”: “A18”,“producer_id”: “2F”}’,
files: {type: “file”, path: “C:/1.pdf”},
},
responseType: “json”,
success: function(data, http_status) {
alert( JSON.stringify(data))
alert( JSON.stringify(http_status))

},
error: function(data, http_status) {
alert( JSON.stringify(data))
alert( JSON.stringify(http_status))
}
})