I encounter the following issue in the Jasmin API integration process of the Spring company. I initially encountered the issue of token oAuth , so a registration was required at ApiRegisterJasmin and the somewhat confusing parameters in the sense that " ApplicationID " is " client_id ", which put in "scope" and " grant_type ".
Note: For security reasons account data, numbering, subscription, etc. are omitted.
Generating Token :
POST https://identity.primaverabss.com/core/connect/token
{
"client_secret": "obtido no site de registro sem problemas",
"client_id": "AplicationID",
"scope": "application",
"grant_type": "client_credentials"
}
And so I got the token , no problem, however, now the problems begin:
1) When sending a simple GET query ("The idea here is to get invoices generated with a value of 0.01 euro on the platform"),
GET https://my.jasminsoftware.com/api/{ACCOUNT}/{SUBSCRIPTION}/billing/invoices
HEADERS {
"Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json"
}
BODY {
}
In this scenario I find that my access is not authorized (Status: 401) . I tried communication through the email, which I did not get an answer to, to validate if it was something with the token generation or something else that could be doing wrong. I tried communication in the chat to which they reported to seek information in the communities. So here I am in one of them.
2) It's about Invoice Creation and Credit Memo , here the problem with the token , I'm having a some difficulty with minimum parameters (required) .
POST https://my.jasminsoftware.com/api/{ACCOUNT}/{SUBSCRIPTION}/billing/invoices
HEADERS {
"Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json"
}
BODY {
"documentType": "FT",
"serie": "10T2018",
"seriesNumber": 1,
"Company": "TesteCompany", **Nome de minha Compania?**
"paymentTerm": "Na hora",
"paymentMethod": "cash",
"currency": "EUR", **deveria passar um valor?**
"documentDate": "2018-09-13",
"postingDate": "2018-09-13",
"BuyerCustomerParty": "**Aqui fico na duvida o que colocar? Por causa do parametro abaixo.**",
"buyerCustomerPartyName": "Carlos Pereira Garcia Gomes",
"AccountingParty": "**A fatura não será enviada, será emitida e entregue no local**, mas está como obrigatório",
"ExchangeRate": 1.00,
"discount": 0.00,
"LoadingCountry": "PT",
"UnloadingCountry": "O que colocar",
}
As expected I get a beautiful unauthorized attempt to send, but the part that. I want to generate only a simple invoice and there are required parameters that they fit for? So the question is what is actually required to generate a simple invoice of the type:
NOME FANTASIA
NOME COMERCIAL LTDA
ENDEREÇO DA EMPRESA
CEP - PAIS
FATURA - Nº FATURA
ORIGINAL - DATA/HORA
------------------------------------
DESCRIMINAÇÃO DOS PRODUTOS VENDIDOS
------------------------------------
TOTAL: Eur 44,00
IDENTIFICAÇÃO DE ISENÇÃO (se houver)
-------------------------------------
DESCRIMINAÇÃO DO IVA
-------------------------------------
TOTAL
HASH - DOCUMENTO GERADO POR SOFTWARE CERTIFICADO xxxx/AT
Finally, what parameters do I have to send to api , so that it generates an invoice and returns the hash so I can either send it by email or print on the template for the customer.
While the Credit Note the question would be, how to identify the products and reference the invoice in question.