Jasmin Developers - Web API Reference

GET Operations

GET LegalDeclarations

Returns the list of all the entity records available.

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 /taxes/legalDeclarations

GET LegalDeclarations (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 LegalDeclarationResource.

Response status codes:

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

Resource URL:

GET /taxes/legalDeclarations?page={page}&pageSize={pageSize}

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 /taxes/legalDeclarations/{id}

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:

GET /taxes/legalDeclarations/{companyKey}/{legalDeclarationKey}

GET Print LegalDeclaration 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 /taxes/legalDeclarations/{id}/print?template={template}

GET Print LegalDeclaration by key

Prints the specified entity record.

The following elements are required:

companyKey (string) The company key.
legalDeclarationKey (string) The legal declaration's key. By default, it is a sequential number.

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 /taxes/legalDeclarations/{companyKey}/{legalDeclarationKey}/print

GET Original Print LegalDeclarationOriginal 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 /taxes/legalDeclarations/{id}/printOriginal?template={template}

GET Original Print LegalDeclaration by key

Prints the specified entity record.

The following elements are required:

companyKey (string) The company key.
legalDeclarationKey (string) The legal declaration's key. By default, it is a sequential number.

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 /taxes/legalDeclarations/{companyKey}/{legalDeclarationKey}/printOriginal

POST Operations

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 /taxes/legalDeclarations

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 /taxes/legalDeclarations/legalDeclarationSaft/{company}/{legalDeclarationPurpose}

POST Generate Saft

Custom operation 'GenerateSaft'.

The following elements are required:

legalDeclarationId (Guid) LegalDeclarationId.

Response:

When successful, the response body is empty.

Resource URL:

POST /taxes/legalDeclarations/generateSaft/{legalDeclarationId}

PUT Operations

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 /taxes/legalDeclarations/{companyKey}/{legalDeclarationKey}/generateAsyncSaft

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 /taxes/legalDeclarations/{companyKey}/{legalDeclarationKey}/generateSaft

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 /taxes/legalDeclarations/{companyKey}/{legalDeclarationKey}/isActive

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 /taxes/legalDeclarations/{companyKey}/{legalDeclarationKey}/note

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:

PUT /taxes/legalDeclarations/{companyKey}/{legalDeclarationKey}/remarks

DELETE Operations

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 /taxes/legalDeclarations/{id}

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:

DELETE /taxes/legalDeclarations/{companyKey}/{legalDeclarationKey}

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 (decimal) The legal declaration's total credit. Indicates the total amount of documents of type credit included on SAF-T.
totalDebit (decimal) The legal declaration's total debit. Indicates the total amount of documents of type debit included on SAF-T.
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.


Enumerations


AuditFileVersion

2 Version10301
4 Version10401


LegalDeclarationPurpose

1 MultidocumentFile
3 MovementOfGoodsDeclaration
4 Auditing


LegalDeclarationState

1 Pending
2 Processing
3 Succeeded
4 Failed