ROSE Developers - Web API Reference

Taxes | SAF-T Import Request

The SAFT Import Requests end point is used to upload the saft file to be imported to the system.

Overview


URL api/{tenantKey}/{orgKey}/taxAuthorityPT/sAFTImportRequests
Methods Supported GET, POST, PUT, DELETE

All Operations

This service includes the following operations:

All Resources

This service uses the following resources:

All Enumerations

This service uses the following enumerations:

GET Operations

GET SAFTImportRequests

Returns the list of all the entity records available.

Response:

When successful, the response body contains the list of records available. See SAFTImportRequestResource.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

GET /taxAuthorityPT/sAFTImportRequests

GET SAFTImportRequests (paged)

Returns a page of the list of all the entity records available.

The following elements are optional:

page (int) The index of the page of the list that should be returned. This is a query string parameter.
pageSize (int) The number of page elements that should be returned (max. is 1000). This is a query string parameter.

Response:

When successful, the response body contains the list of records available. See SAFTImportRequestResource.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

GET /taxAuthorityPT/sAFTImportRequests?page={page}&pageSize={pageSize}

GET SAFTImportRequest by identifier

Returns the entity record that matches the specified identifier.

The following elements are required:

id (string) The record identifier.

Response:

When successful, the response body contains the entity record. See SAFTImportRequestResource.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

GET /taxAuthorityPT/sAFTImportRequests/{id}

GET SAFTImportRequest by key

Returns the entity record that matches the specified key.

The following elements are required:

companyKey (string) The company key.
sAFTImportRequestKey (int) SAFT Import Request.

Response:

When successful, the response body contains the entity record. See SAFTImportRequestResource.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

GET /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}

GET Print SAFTImportRequest by identifier

Prints the specified entity record.

The following elements are required:

id (string) The record identifier.

The following elements are optional:

template (string) The report template that should be used. This is a query string parameter.

Response:

When successful, the response body contains a stream with the printed file.

Response status codes:

200 OK. The operation was completed successfully.
404 NotFound. The specified resord does not exist.

Resource URL:

GET /taxAuthorityPT/sAFTImportRequests/{id}/print?template={template}

GET Print SAFTImportRequest by key

Prints the specified entity record.

The following elements are required:

companyKey (string) The company key.
sAFTImportRequestKey (int) SAFT Import Request.

The following elements are optional:

template (string) The report template that should be used. This is a query string parameter.

Response:

When successful, the response body contains a stream with the printed file.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

GET /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/print

GET Original Print SAFTImportRequestOriginal by identifier

Prints the specified entity record.

The following elements are required:

id (string) The record identifier.

The following elements are optional:

template (string) The report template that should be used. This is a query string parameter.

Response:

When successful, the response body contains a stream with the printed file.

Response status codes:

200 OK. The operation was completed successfully.
404 NotFound. The specified resord does not exist.

Resource URL:

GET /taxAuthorityPT/sAFTImportRequests/{id}/printOriginal?template={template}

GET Original Print SAFTImportRequest by key

Prints the specified entity record.

The following elements are required:

companyKey (string) The company key.
sAFTImportRequestKey (int) SAFT Import Request.

The following elements are optional:

template (string) The report template that should be used. This is a query string parameter.

Response:

When successful, the response body contains a stream with the printed file.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

GET /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/printOriginal

POST Operations

POST SAFTImportRequests

Creates a new entity record.

The following elements are required:

sAFTImportRequestResource (ApiSAFTImportRequestResource) The request body should contain the entity record that should be created.
See ApiSAFTImportRequestResource.

Response:

When successful, the response body contains the new entity record identifier. The resource header location property contains the URL for the new entity record. See ApiSAFTImportRequestResource.

Response status codes:

201 Created. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

POST /taxAuthorityPT/sAFTImportRequests

POST Process SAF-T Completed

This operation wil change the satus of the SAFT Import Request when the process of SAFT importation is completed.

The following elements are required:

result (UploadSaftResult) The Upload Saflt Result Resource.

Response:

When successful, the response body is empty.

Resource URL:

POST /taxAuthorityPT/sAFTImportRequests/processSaftCompleted

POST Upload SAF-T Completed

This operation wil change the satus of the SAFT Import Request when the process of SAFT Upload is completed.

The following elements are required:

result (UploadSaftResult) The Upload Saflt Result Resource.

Response:

When successful, the response body is empty.

Resource URL:

POST /taxAuthorityPT/sAFTImportRequests/uploadSaftCompleted

POST Set Last Communication Date

Set last communication date column from SaftImportRequest Table to know if RAT is processing.

The following elements are required:

saftImportRequestId (Guid) SaftImportRequestId.

Response:

When successful, the response body is empty.

Resource URL:

POST /taxAuthorityPT/sAFTImportRequests/setLastCommunicationDate

POST Process Saft Data Completed

This operation wil change the satus of the SAFT Import Request when the process of validation the SAFT data is completed.

The following elements are required:

result (UploadSaftResult) The Upload Saflt Result Resource.

Response:

When successful, the response body is empty.

Resource URL:

POST /taxAuthorityPT/sAFTImportRequests/processSaftDataCompleted

POST Update SAFT Import Requests Status

Update Saft Import Requests Status.

Response:

When successful, the response body is empty.

Resource URL:

POST /taxAuthorityPT/sAFTImportRequests/updateSAFTImportRequestsStatus

PUT Operations

PUT Set BlobFilename SAFTImportRequest

Updates the value of attribute 'BlobFilename' in the specified entity record.

The following elements are required:

sAFTImportRequestKey (int) SAFT Import Request.
companyKey (string) The company key.
value (string) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/blobFilename

PUT Set Company SAFTImportRequest

Updates the value of attribute 'Company' in the specified entity record.

The following elements are required:

sAFTImportRequestKey (int) SAFT Import Request.
companyKey (string) The company key.
value (string) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/company

PUT Set DISid SAFTImportRequest

Updates the value of attribute 'DISid' in the specified entity record.

The following elements are required:

sAFTImportRequestKey (int) SAFT Import Request.
companyKey (string) The company key.
value (Guid) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/dISid

PUT Set EndDate SAFTImportRequest

Updates the value of attribute 'EndDate' in the specified entity record.

The following elements are required:

sAFTImportRequestKey (int) SAFT Import Request.
companyKey (string) The company key.
value (DateTime) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/endDate

PUT Set Filename SAFTImportRequest

Updates the value of attribute 'Filename' in the specified entity record.

The following elements are required:

sAFTImportRequestKey (int) SAFT Import Request.
companyKey (string) The company key.
value (string) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/filename

PUT Set IsActive SAFTImportRequest

Updates the value of attribute 'IsActive' in the specified entity record.

The following elements are required:

sAFTImportRequestKey (int) SAFT Import Request.
companyKey (string) The company key.
value (bool) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

PUT /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/isActive

PUT Set SAFTImportRequestStatus SAFTImportRequest

Updates the value of attribute 'SAFTImportRequestStatus' in the specified entity record.

The following elements are required:

sAFTImportRequestKey (int) SAFT Import Request.
companyKey (string) The company key.
value (enum SAFTImportRequestStatus) The request body should contain the new value for the attribute.
See SAFTImportRequestStatus.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/sAFTImportRequestStatus

PUT Set StartDate SAFTImportRequest

Updates the value of attribute 'StartDate' in the specified entity record.

The following elements are required:

sAFTImportRequestKey (int) SAFT Import Request.
companyKey (string) The company key.
value (DateTime) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/startDate

PUT Set TaxRegistrationNumber SAFTImportRequest

Updates the value of attribute 'TaxRegistrationNumber' in the specified entity record.

The following elements are required:

sAFTImportRequestKey (int) SAFT Import Request.
companyKey (string) The company key.
value (string) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/taxRegistrationNumber

PUT Set UserId SAFTImportRequest

Updates the value of attribute 'UserId' in the specified entity record.

The following elements are required:

sAFTImportRequestKey (int) SAFT Import Request.
companyKey (string) The company key.
value (Guid) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}/userId

DELETE Operations

DELETE SAFTImportRequest by identifier

Deletes the entity record that matches the specified identifier.

The following elements are required:

id (string) The record identifier.

Response:

When successful, the response body is empty.

Response status codes:

204 Deleted. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

DELETE /taxAuthorityPT/sAFTImportRequests/{id}

DELETE SAFTImportRequest by key

Deletes the entity record that matches the specified key.

The following elements are required:

companyKey (string) The company key.
sAFTImportRequestKey (int) SAFT Import Request.

Response:

When successful, the response body is empty.

Response status codes:

204 Deleted. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

DELETE /taxAuthorityPT/sAFTImportRequests/{companyKey}/{sAFTImportRequestKey}

Resources


ApiSAFTImportRequestResource

The following elements are required:

company (string) Company.

The following elements are optional:

taxRegistrationNumber (string) Tax Registration Number.
filename (string) Filename.
blobFilename (string) Blob Filename.
startDate (DateTime) Start Date.
endDate (DateTime) End Date.
sAFTImportRequestStatus (enum SAFTImportRequestStatus) SAFT Import Request Status.
See SAFTImportRequestStatus.
dISid (Guid) DI Sid.
userId (Guid) User Id.


SAFTImportRequestResource

The following elements are required:

sAFTImportRequestKey (int) SAFT Import Request.
company (string) Company.

The following elements are optional:

taxRegistrationNumber (string) Tax Registration Number.
filename (string) Filename.
blobFilename (string) Blob Filename.
startDate (DateTime) Start Date.
endDate (DateTime) End Date.
sAFTImportRequestStatus (enum SAFTImportRequestStatus) SAFT Import Request Status.
See SAFTImportRequestStatus.
dISid (Guid) DI Sid.
lastCommunicationDate (DateTimeOffset) Last Communication Date.
userId (Guid) User Id.


UploadSaftResult

The following elements are required:

requestId (Guid) Request Id.
userId (Guid) User Id.

The following elements are optional:

saftId (Guid) Saft Id.
status (enum SAFTImportStatus) Status.
See SAFTImportStatus.


Enumerations


SAFTImportRequestStatus

1 Uploading
2 UploadError
3 PendingAccounting
4 Processing
5 AccountingSucceeded
6 AccountingPartiallySucceeded
7 AccountingFailed
8 Deleting
9 Deleted
10 ProcessingSaft
11 ProcessingSaftFailed
12 DeletingFailed
13 NothingToImport