Get electronic invoices formats#
This endpoint is used to get a list of inbound document formats storage by documentId.
Endpoint steps#
Get a token from your credentials by calling the endpoint Account/getToken;
Get a list of inbound document formats storage by documentId through the endpoint GET InboundFinancialDocument/documentFormats/{documentId}, by specifying the necessary criteria.
Response structure from server#
When a request is well formed and the authentication data is correct the system responds with a message envelope as follows:
{
"CorrelationId": "<GUID>", /* for correlation purposes */
"IsValid": true, /* false in case of erros */
"Errors": [], /* if empty is a good signal */
"Data": "<Service Response Data>" /* the data retuned ex: token, invoice status, dependent on the endpoint called */
}
Endpoint Server Base URL#
# SANDBOX - Test Environment
server_base_adress = "dcn-solution-qa.saphety.com/Dcn.Business.WebApi"
# Saphety Invoice Network - Production Environment
#server_base_adress = "dcn-solution.saphety.com/Dcn.Business.WebApi"
1. Get a token (Account/getToken)#
Get a token from your account credentials using endpoint api/Account/getToken
Check here how to obtain an authentication token.
2. Get a list of inbound document formats storage by documentId (GET InboundFinancialDocument/documentFormats/{documentId})#
* Note: The number of formats returned and their type depends on several factors. In the case of this documentation, the formats are fixed, as you can see in the following example.
2.1 Request structure#
In the endpoint url you need to supply the documentId received
documentId#
Description: You need to supply the id of the invoice.
Required: Yes
Type: string
Example: “824c6233-d7b4-44ee-abe6-597113b87c01”
2.2 Request example#
inboundFinancialDocumentId = "f9513fcf-1fa9-4c39-bd54-7b17c88e253b"
# SIN endpoint url for retrieving inforfation on invoice previously sent
service_url = "https://" + server_base_adress + "/api/InboundFinancialDocument/documentFormats/" + inboundFinancialDocumentId
print ('Endpoint url: GET ' + service_url)
Endpoint url: GET https://dcn-solution-qa.saphety.com/Dcn.Business.WebApi/api/InboundFinancialDocument/documentFormats/f9513fcf-1fa9-4c39-bd54-7b17c88e253b
2.3 Response example#
{
"CorrelationId": "eebcb3c9-cfac-4a28-9950-d2058d1aeca6",
"IsValid": true,
"Errors": [],
"Data": [
{
"InboundFinancialDocumentId": "824c6233-d7b4-44ee-abe6-597113b87c01",
"FormatType": "final",
"ContentType": "application/xml",
"SignatureProvider": "Xml",
"DocumentLink": "https://dcn-solution-int.saphety.com/IN2.ContentStorage.WebApi/api/Content?token=1Y%2FPG562WtS88FpDsESF5DeE18x7ImN0SWQiOiIwM2ViNmM4NS0wNGZhLTQ1NDYtYjFlZS0yYmQ3Y2I0NDI2NzgiLCJpRHQiOiIyMDI1LTAzLTI4IiwiZUR0IjoiMjAyNS0wMy0zMSIsImlCeSI6IkRlbW8gUmVjZWl2ZXIiLCJpVG8iOiJEZW1vIFJlY2VpdmVyIiwicyI6IndlYiIsImFhaCI6ZmFsc2V9"
},
{
"InboundFinancialDocumentId": "824c6233-d7b4-44ee-abe6-597113b87c01",
"FormatType": "signed",
"ContentType": "application/xml",
"SignatureProvider": "Xml",
"DocumentLink": "https://dcn-solution-int.saphety.com/IN2.ContentStorage.WebApi/api/Content?token=wiDX0PTopphx7FSVXzv6i5Vfdwl7ImN0SWQiOiIzNDBhMjNhYy0wM2VkLTRhNWUtYmEwZC1iOTYwYjk0YWJlZDMiLCJpRHQiOiIyMDI1LTAzLTI4IiwiZUR0IjoiMjAyNS0wMy0zMSIsImlCeSI6IkRlbW8gUmVjZWl2ZXIiLCJpVG8iOiJEZW1vIFJlY2VpdmVyIiwicyI6IndlYiIsImFhaCI6ZmFsc2V9"
},
{
"InboundFinancialDocumentId": "824c6233-d7b4-44ee-abe6-597113b87c01",
"FormatType": "pdf",
"ContentType": "application/pdf",
"SignatureProvider": "Pdf",
"DocumentLink": "https://dcn-solution-int.saphety.com/IN2.ContentStorage.WebApi/api/Content?token=Aal7%2BSfNw4ntiVl9kZ46jTAOeWR7ImN0SWQiOiIxOTQyMDMxZi0yZWEyLTQwNGItOGM4Ni1kZWFhNjkzNzZlM2QiLCJpRHQiOiIyMDI1LTAzLTI4IiwiZUR0IjoiMjAyNS0wMy0zMSIsImlCeSI6IkRlbW8gUmVjZWl2ZXIiLCJpVG8iOiJEZW1vIFJlY2VpdmVyIiwicyI6IndlYiIsImFhaCI6ZmFsc2V9"
}
]
}