Count for electronic invoices#

This endpoint is used to count company inbound documents found by filter.

Endpoint steps#

  1. Get a token from your credentials by calling the endpoint Account/getToken;

  2. Count company inbound documents through the endpoint (POST) InboundFinancialDocument/count, 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#

# 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. Count for electronic invoices (POST InboundFinancialDocument/count)#

2.1 Request body structure#

Body can’t be empty

{
  "CompanyIntlVatCodes": [
    "string"
  ],
  "DocumentIds": [
    "string"
  ],
  "DocumentsType": [
    "string"
  ],
  "DocumentDateStart": "string",
  "DocumentDateEnd": "string",
  "DocumentNumber": "string",
  "DocumentTotalMin": "string",
  "DocumentTotalMax": "string",
  "SenderIntlVatCode": "string",
  "SenderName": "string",
  "IntegrationsStatus": [
    "string"
  ],
  "IntegrationDateStart": "string",
  "IntegrationDateEnd": "string",
  "CreationDateStart": "string",
  "CreationDateEnd": "string",
  "IsDocumentBlocked": true
}

CompanyIntlVatCodes#

  • Description: Tax identification of the client/receiver entity (aka as vat Number)

  • Required: No

  • Type: string

  • Example: “PT501564432”

  • Notes: Only accepts valid vat Numbers and filled with the country Code prefix

DocumentIds#

  • Description: Id associated with the legal document

  • Required: No

  • Type: string

  • Example: “f1baf2fa-98d2-4284-9233-bc6c18a51087”

DocumentsType#

  • Description: Document type for legal documents

  • Required: No

  • Type: string

  • Allowed values: “Invoice”, “Credit_Note”, “Debit_Note”, “Invoice_Receipt”, “Simplified_Invoice”

  • Example: “Invoice”

DocumentDateStart#

  • Description: Document start date

  • Required: No

  • Type: string

  • Format: “yyyy-MM-dd”

  • Example: “2024-12-12”

DocumentDateEnd#

  • Description: Document end date

  • Required: No

  • Type: string

  • Format: “yyyy-MM-dd”

  • Example: “2024-12-12”

DocumentTotalMin#

  • Description: Document total amount payable interval start amount

  • Required: No

  • Type: string

  • Format: “0000.00”

  • Example: “13547.23”

DocumentTotalMax#

  • Description: Document total amount payable interval end amount

  • Required: No

  • Type: string

  • Format: “0000.00”

  • Example: “13547.23”

SenderIntlVatCode#

  • Description: Tax identification of the issuer/sender entity (aka as vat Number)

  • Required: No

  • Type: string

  • Example: “PT501564432”

  • Notes: Only accepts valid vat Numbers and filled with the country Code prefix

SenderName#

  • Description: Name of the issuer/sender entity

  • Required: No

  • Type: string

  • Example: “Company Name Test”

  • Notes: The name is not case sensitive

IntegrationsStatus#

  • Description: Document integration status

  • Required: No

  • Type: string

  • Allowed values: “Not_Sent”, “Sent”, “Accepted”, “Rejected”, “Paid”

  • Example: “Not_Sent”

IntegrationDateStart#

  • Description: Start date of the last integration state

  • Required: No

  • Type: string

  • Format: “yyyy-MM-dd”

  • Example: “2024-12-12”

IntegrationDateEnd#

  • Description: End date of the last integration state

  • Required: No

  • Type: string

  • Format: “yyyy-MM-dd”

  • Example: “2024-12-12”

CreationDateStart#

  • Description: Start date in which the document is created in the system

  • Required: No

  • Type: string

  • Format: “yyyy-MM-dd”

  • Example: “2024-12-12”

CreationDateEnd#

  • Description: End date in which the document is created in the system

  • Required: No

  • Type: string

  • Format: “yyyy-MM-dd”

  • Example: “2024-12-12”

IsDocumentBlocked#

  • Description: Flag to get or not the blocked documents

  • Required: No

  • Type: boolean

  • Allowed values: “true”, “false”

  • Example: true

2.2 Request example#

service_url = "https://" + server_base_adress + "/api/InboundFinancialDocument/count"
print ('Endpoint url: POST ' + service_url)

#headers
headers = {
    'Content-Type': 'application/json',
    'Authorization': 'bearer ' + token
    }
# payload as json
# Search is done by user token that is authenticated and search for documents linked to the user.
payload = {
  "CompanyIntlVatCodes": [
    "" 
  ]
}
request_data=json.dumps(payload)
Endpoint url: POST https://dcn-solution-qa.saphety.com/Dcn.Business.WebApi/api/InboundFinancialDocument/count

2.3 Response example#

  "CorrelationId": "f611f438-f7d7-49f5-9055-5bb04b7431d0",
  "IsValid": true,
  "Errors": [],
  "Data": 51 (numero de documentos do utilizador que está autenticado)
}