Taxes | SAF-T (PT)
Service to manage entities of type 'LegalDeclaration'.
Overview
| URL | api/{tenantKey}/{orgKey}/taxes/legalDeclarations |
| Methods Supported | GET, POST, PUT, DELETE |
All Operations
This service includes the following operations:
- GET:
- POST:
- PUT:
- DELETE:
All Resources
This service uses the following resources:
All Enumerations
This service uses the following enumerations:
GET LegalDeclarations (odata)
Returns a page of the list of all the entity records available.
The following elements are optional:
| opts | (ODataQueryOptions) OData query option. |
Response:
| When successful, the response body contains the list of records available. See LegalDeclarationResource. |
Response status codes:
| 200 | OK. The operation was completed successfully. |
| 400 | BadRequest. The request parameters are invalid. |
Resource URL:
GET LegalDeclaration 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 LegalDeclarationResource. |
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 LegalDeclaration by key
Returns the entity record that matches the specified key.
The following elements are required:
| companyKey | (string) The company key. |
| legalDeclarationKey | (string) The legal declaration's key. By default, it is a sequential number. |
Response:
| When successful, the response body contains the entity record. See LegalDeclarationResource. |
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:
POST LegalDeclarations
Creates a new entity record.
The following elements are required:
| legalDeclarationResource | (ApiLegalDeclarationResource) The request body should contain the entity record that should be created. See ApiLegalDeclarationResource. |
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 ApiLegalDeclarationResource. |
Response status codes:
| 201 | Created. The operation was completed successfully. |
| 400 | BadRequest. The request parameters are invalid. |
Resource URL:
POST Legal Declaration Saft
Custom operation 'LegalDeclarationSaft'.
The following elements are required:
| company | (string) Company. |
| legalDeclarationPurpose | (int) 1 - InvoiceDeclaration, 3- MovementOfGoods, 4 - Auditing. |
| startDate | (DateTime?) StartDate. |
| endDate | (DateTime?) EndDate. |
Response:
| When successful, the response body contains a unique identifier. |
Resource URL:
POST Generate Saft
Custom operation 'GenerateSaft'.
The following elements are required:
| legalDeclarationId | (Guid) LegalDeclarationId. |
Response:
| When successful, the response body is empty. |
Resource URL:
PUT Set GenerateAsyncSaft LegalDeclaration
Updates the value of attribute 'GenerateAsyncSaft' in the specified entity record.
The following elements are required:
| legalDeclarationKey | (string) The legal declaration's key. By default, it is a sequential number. |
| 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. |
Resource URL:
PUT Set GenerateSaft LegalDeclaration
Updates the value of attribute 'GenerateSaft' in the specified entity record.
The following elements are required:
| legalDeclarationKey | (string) The legal declaration's key. By default, it is a sequential number. |
| 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. |
Resource URL:
PUT Set IsActive LegalDeclaration
Updates the value of attribute 'IsActive' in the specified entity record.
The following elements are required:
| legalDeclarationKey | (string) The legal declaration's key. By default, it is a sequential number. |
| 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 Set Note LegalDeclaration
Updates the value of attribute 'Note' in the specified entity record.
The following elements are required:
| legalDeclarationKey | (string) The legal declaration's key. By default, it is a sequential number. |
| 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 Set Remarks LegalDeclaration
Updates the value of attribute 'Remarks' in the specified entity record.
The following elements are required:
| legalDeclarationKey | (string) The legal declaration's key. By default, it is a sequential number. |
| 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:
DELETE LegalDeclaration 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 LegalDeclaration by key
Deletes the entity record that matches the specified key.
The following elements are required:
| companyKey | (string) The company key. |
| legalDeclarationKey | (string) The legal declaration's key. By default, it is a sequential number. |
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:
Resources
ApiLegalDeclarationResource
The following elements are required:
| legalDeclarationKey | (string) The legal declaration's key. By default, it is a sequential number. |
| documentDate | (DateTime) The document's date. |
| startDate | (DateTime) The legal declaration's initial date. Sets the date from which documents should be included on SAF-T. |
| endDate | (DateTime) The legal declaration's final date. Sets the date up to which documents should be included on SAF-T. |
| company | (string) The legal declaration's company. The company code is the central organizational unit within the system. |
| auditFileVersion | (enum AuditFileVersion) The audit file's version. Indicates the SAF-T version used in the legal declaration.
See AuditFileVersion. |
| legalDeclarationPurpose | (enum LegalDeclarationPurpose) The legal declaration's purpose.
See LegalDeclarationPurpose. |
The following elements are optional:
| note | (string) The legal declaration's note. |
| remarks | (string) The legal declaration's remarks. |
| generateSaft | (bool) Indicates if the SAF-T file (xml) should be generated. When false, the legal declaration will remain in pending status and can later be used to generate the SAF-T file. Otherwise the SAF-T file will be generated synchronously on the create operation. Default value: true. |
| generateAsyncSaft | (bool) Indicates if the SAF-T file (xml) should be asynchronously generated. When true, it will override the 'generateSaft' flag and the SAF-T file will be generated asynchronously on the create operation. After the create operation, the legal declaration will remain in processing status until the generate SAF-T file process finishes. Default value: false. |
LegalDeclarationResource
The following elements are required:
| legalDeclarationKey | (string) The legal declaration's key. By default, it is a sequential number. |
| documentDate | (DateTime) The document's date. |
| startDate | (DateTime) The legal declaration's initial date. Sets the date from which documents should be included on SAF-T. |
| endDate | (DateTime) The legal declaration's final date. Sets the date up to which documents should be included on SAF-T. |
| totalCredit | (MoneyResource) The legal declaration's total credit. Indicates the total amount of documents of type credit included on SAF-T.
See MoneyResource . |
| totalDebit | (MoneyResource) The legal declaration's total debit. Indicates the total amount of documents of type debit included on SAF-T.
See MoneyResource . |
| company | (string) The legal declaration's company. The company code is the central organizational unit within the system. |
| status | (enum LegalDeclarationState) The legal declaration's status.
See LegalDeclarationState. |
| currency | (string) The legal declaration's currency. Indicates the money unit used by the generated document. |
| auditFileVersion | (enum AuditFileVersion) The audit file's version. Indicates the SAF-T version used in the legal declaration.
See AuditFileVersion. |
| legalDeclarationPurpose | (enum LegalDeclarationPurpose) The legal declaration's purpose.
See LegalDeclarationPurpose. |
The following elements are optional:
| note | (string) The legal declaration's note. |
| remarks | (string) The legal declaration's remarks. |
| isPrinted | (bool) Indicates if the legal declaration has been printed. Internally determined. |
| numberOfDocuments | (int) The number of documents included on SAF-T. |
| saftDocument | (string) The saft document. |
| generateSaft | (bool) Indicates if the SAF-T file (xml) should be generated. When false, the legal declaration will remain in pending status and can later be used to generate the SAF-T file. Otherwise the SAF-T file will be generated synchronously on the create operation. Default value: true. |
| generateAsyncSaft | (bool) Indicates if the SAF-T file (xml) should be asynchronously generated. When true, it will override the 'generateSaft' flag and the SAF-T file will be generated asynchronously on the create operation. After the create operation, the legal declaration will remain in processing status until the generate SAF-T file process finishes. Default value: false. |
MoneyResource
The following elements are required:
| amount | (decimal) The amount. |
The following elements are optional:
| baseAmount | (decimal) The base amount. |
| reportingAmount | (decimal) The reporting amount. |
| fractionDigits | (int) The fraction digits. |
| symbol | (string) The symbol. |
Notes: For the POST operation it is not necessary to send the fields: BaseAmount, ReportingAmount, FractionDigits and Symbol. Will be ignored.