Private Sub Gotovinski_Click() Dim http As Object Dim url As String Dim body As String Dim response As String ' Definisite URL url = "http://192.168.1.21:3566/api/invoices" ' Kreirajte XMLHTTP objekat Set http = CreateObject("MSXML2.ServerXMLHTTP.6.0") ' Definisite tijelo zahtjeva kao JSON string sa jednim artiklom i jednim nacinom placanja body = "{""print"": true, ""email"": ""ofs@gmail.com"", ""invoiceRequest"": {""invoiceType"": ""Training"", ""transactionType"": ""Sale"", ""payment"": [{""amount"": 0.10, ""paymentType"": ""0""}], ""items"": [{""name"": ""KESA TREGERICA"", ""labels"": [""E""], ""totalAmount"": 0.10, ""unitPrice"": 0.05, ""quantity"": 2.000}], ""cashier"": """"}}" ' Otvorite HTTP konekciju http.Open "POST", url, False ' Dodajte zaglavlja http.setRequestHeader "Authorization", "Bearer 4b0920000000000caccdfa5b57eb23f3" http.setRequestHeader "RequestId", "19345" http.setRequestHeader "Content-Type", "application/json" ' Posaljite zahtjev http.send body ' Dobijte odgovor response = http.responseText ' Prikazite odgovor MsgBox response Debug.Print response ' Oslobodite resurse Set http = Nothing End Sub