Get Document

This API allows taxpayers to retrieve document source in XML or JSON format along with the additional tax authority metadata.

Get Submission Get Document Details

Overview

This API allows caller to get full details of the document when requested by unique ID assigned to document by MyInvois System.

Details include original XML or JSON submission and additional tax authority metadata i.e., additional ID, and current status. As the document is submitted in XML or JSON, this API returns document information also in either XML or JSON.

Document with invalid status will not be returned. Details of the invalid document can be fetched by Get Document Details API.

Signature

This is REST based API that takes unique ID of the document as URL parameter and returns document details that were received from the issuer and additional details added after submission and validation of the document by the tax authority.

Signature: GET /api/v1.0/documents/{uuid}/raw

Inputs

This API accepts standard e-Invoice API header parameters for authenticated call, but the content type parameter can define the expected output format - JSON or XML.

URL parameter Type Description Value example Requirement
uuid String Unique ID of the document to retrieve. F9D425P6DS7D8IU Mandatory

Outputs

Successful Response

This API returns HTTP status code 200.

The resulting structure is a single object of type DocumentExtended.

Document Extended contains:

Output parameter Type Description Value example
uuid String Unique document ID in e-Invoice F9D425P6DS7D8IU
submissionUid String Unique ID of the submission the document was part of HJSD135P2S7D8IU
longId String Unique long temporary Id that can be used to query document data anonymously. The long id will be returned only for valid documents LIJAF97HJJKH 8298KHADH0990 8570FDKK9S2LSIU HB377373
internalId String Internal ID used in submission for the document PZ-234-A
typeName String Unique name of the document type that can be used in submission of the documents. invoice
typeVersionName String Name of the document type version within the document type that can be used in document submission to identify document type version being submitted 1.0
issuerTin String TIN of issuer C2584563200
issuerName String Issuer company name AMS Setia Jaya Sdn. Bhd.
receiverId String Optional: receiver registration number (can be national ID or foreigner ID). 201901234567
receiverName String Optional: receiver name (can be company name or person’s name) AMS Setia Jaya Sdn. Bhd.
dateTimeIssued DateTime The date and time when the document was issued in the UTC timeformat. 2015-02-13T13:15:10Z
dateTimeReceived DateTime The date and time when the document was submitted in the UTC timeformat. 2015-02-13T13:15:10Z
dateTimeValidated DateTime The date and time when the document passed all validations and moved to the valid state. 2015-02-13T13:15:10Z
totalSales Decimal Total sales amount of the document in MYR. 10.10
totalDiscount Decimal Total discount amount of the document in MYR. 50.00
netAmount Decimal Total net amount of the document in MYR. 100.70
total Decimal Total amount of the document in MYR. 124.09
status String Status of the document - Submitted, Valid, Cancelled Valid
cancelDateTime Date Refer to the document cancellation that has been initiated by the taxpayer ‘issuer’ of the document on the system, will be in UTC format 2021-02-25T01:59:10Z
rejectRequestDateTime Date Refer to the document rejection request that has been initiated by the taxpayer ‘receiver’ of the document on the system, will be in UTC format 2021-02-25T01:59:10Z
documentStatusReason String Mandatory: Reason of the cancellation or rejection of the document. Examples of reasons: Wrong buyer details or Wrong invoice details or any other reasons as appropriate
createdByUserId String User created the document. Can be ERP ID or User Email 1XXXXXXXX00:9e21b10c-41c4-9323-c590-95abcb6e4e4d

general.ams@supplier.com
document Document Document object containing the original submitted raw document. Document with ‘invalid’ status with not be returned. Details of the invalid document can be fetched by Get Document Details API.  

Error Response

Error situations are reported back by this API through the standard error response.

Additional considerations

To get the unique ID that will be used to call this API, taxpayer system can first call API returning list of recent documents.

Receiver of the documents can retrieve documents that are in “Valid” or “Cancelled” status. If document exists, and is issued to given receiver, but status is “submitted” or “invalid”, not found code will be returned.

Issuer of the documents can retrieve documents in any status. The document validation or public URL can be created using below -

{envbaseurl}/uuid-of-document/share/longid

where {envbaseurl} need to be replaced with MyInvois portal Base URL