Unblock electronic invoices#

This endpoint is used to unblock inbound documents.

Endpoint steps#

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

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

2.1 Request body structure#

Body can’t be empty

User need to indicate the company NIF that want to unlock the documents (need to belong to that company to be allowed to do it).

{
  "CompanyIntlVatCode": "string"
}

CompanyIntlVatCode#

  • 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

2.2 Request example#

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

#headers
headers = {
    'Content-Type': 'application/json',
    'Authorization': 'bearer ' + token
    }
# payload as json
payload = {
  "CompanyIntlVatCode": "PT501564432"
}
request_data=json.dumps(payload)
Endpoint url: POST https://dcn-solution-qa.saphety.com/Dcn.Business.WebApi/api/InboundFinancialDocument/unblockDocuments

2.3 Response example#

Return list with the Id’s of unlocked documents

{
  "CorrelationId": "78e353e7-bf44-49ed-a2c9-5e5d20c1bf9c",
  "IsValid": true,
  "Errors": [],
  "Data": [
    "2bde9d52-7fe5-4641-9855-1a3b5cb9f1a7",
    "a7b43a46-7135-4b6d-a96d-42e7d4143708",
    "64262b78-6ef6-4977-873d-52da808d045d",
    "2891fefd-bcc7-4bf6-bcaa-6a9bbe9a4df8",
    "dd6fddeb-ff31-4a84-8e0b-73717e0534c4",
    "083d2ace-b0e2-4178-848f-7c6509e74b72",
    "dbcd0faa-4a12-45e3-935c-8427f99b3a7b",
    "fdd25a93-f633-40bf-a5b5-852f90ea927d",
    "6c2c198e-1c9b-458b-bbf0-97a788df826f",
    "43bcd2fb-3de6-4c9a-bbcb-a2baafe2f7b3",
    "b109af0b-afd0-4fae-a9d1-e51454318255"
  ]
}