Function test_api() Dim objHTTP As Object Dim URL As String Dim requestData As String URL = "https://icentar.ba/api/invoices/index.php" Set objHTTP = CreateObject("MSXML2.XMLHTTP") requestData = "{""invoiceRequest"": {""invoiceType"": ""Normal"", ""transactionType"": ""Sale"", ""buyerId"": ""111758195"", ""payment"": [{""amount"": 100.00, ""paymentType"": ""Cash""}], ""items"": [{""name"": ""Artikl 1"", ""labels"": [""F""], ""totalAmount"": 100.00, ""unitPrice"": 50.00, ""quantity"": 2.000}], ""cashier"": ""Radnik 1""}}" With objHTTP .Open "POST", URL, False '.setRequestHeader "Authorization", "Bearer " & token '.setRequestHeader "RequestId", "12345" .setRequestHeader "Content-Type", "application/json" .Send requestData Text = .responseText End With MsgBox Text End Function