[[{“value”:”
Are you a third-party service provider looking to integrate with Document and Reporting Compliance for Vietnam? This blog is your essential playbook for understanding the SAP interface, valid statuses, request/response structures, and expected business scenarios. By following this blueprint, your integration will be seamless, standardized, and ready for production.
What You Will Achieve
This blog will help you enable seamless electronic invoice exchange between SAP and your system, fully compatible with the SAP Document and Reporting Compliance, Cloud Edition Extensibility framework. Your system will receive electronic invoices from SAP in a SAP defined format, validate and process them, and respond with the required statuses and payloads. This ensures full traceability for customers and allows for the transfer of electronic invoices to the Vietnam General Department of Taxation (GDT), known in Vietnamese as Tổng cục Thuế.
API Endpoint Setup
Before starting, ensure you have an API endpoint that wraps all operations for SAP to send and receive payloads, in the following format:
<host>/v1/command
Replace <host> with your actual service’s host or domain name.
Example Request Payload From SAP to Service Provider
When SAP calls your API, the request is in JSON format with HTTP POST operation and a content type of multipart/form-data. The payload includes processing instructions and additional document attachments in XML format, which could be accessed using the boundary value:
POST <host>/v1/command
Content-Type: multipart/form-data; boundary=boundary
–boundary
Content-Disposition: form-data; name=”payload”
Content-Type: application/json
{
“processInstance”: {
“id”: “<SAP Internal document ID>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“action”: “TRANSMIT”,
“senderRegistrationID”: “123456789”,
“documents”: [
{
“id”: “<SAP Internal source key>”,
“type”: “SUBMIT_MAIN”
}
]
}
}
–boundary
Content-Disposition: form-data; name=”<SAP Internal document ID>+<SAP Internal source key>”; filename=”filename.XML”
Content-Type: application/xml
–boundary–
Where is the Actual XML?
The XML file is attached as a separate multipart section, not as a string in the JSON. Each entry in the documents array of the JSON is mapped by its id to a matched file (in this case, the invoice XML).
As you noticed in the example above, there is a field called “action” (e.g., TRANSMIT). SAP can send you one of three actions, and for each action, only certain response statuses are allowed from the service provider:
| Action from SAP to SP | Permitted Response Statuses from SP to SAP |
| TRANSMIT | TRANSMITTED, REJECTED |
| RETRANSMIT | RETRANSMITTED, REJECTED |
| UPDATE_TRANSMISSION_STATUS | TRANSMISSION_IN_PROGRESS, ACCEPTED, REJECTED |
| Status | When to use / Scenario | Required Additional Info |
| TRANSMITTED | Service Provider validations have passed. |
INVOICE_NUMBER |
| REJECTED |
Service Provider or GDT validations have failed |
Detailed error messages |
| RETRANSMITTED | Service Provider validations have passed. This status is used when a retransmission action has occurred successfully from SAP to Service Provider(in response to RETRANSMIT). |
INVOICE_NUMBER |
| ACCEPTED | Document approved by the Vietnamese tax authority (GDT). (Attach CQT code and PDF in documents.) |
CQT_CODE and PDF attachment |
| TRANSMISSION_IN_PROGRESS | Invoice is not yet sent to tax authority or is still under evaluation (used only in UPDATE_TRANSMISSION_STATUS). |
INVOICE_NUMBER |
Example Response Payload From Service Provider to SAP
Here are real-life examples for your API responses, aligned with the status scenario map above. The examples below cover all possible response scenarios required by SAP DRC Vietnam. Please note that, like request payload, response payload also has to be sent to SAP in multipart/form-data format.
1. TRANSMITTED
When service provider validations have passed for a TRANSMIT action
{
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “TRANSMITTED”,
“messages”: [
{
“code”: “INVOICE_NUMBER”,
“texts”: [
{
“language”: “EN”,
“text”: “<SP should update invoice number value here>”
}
]
}
]
}
}
2. RETRANSMITTED
When service provider validations have passed for a RETRANSMIT action
{
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “RETRANSMITTED”,
“messages”: [
{
“code”: “INVOICE_NUMBER”,
“texts”: [
{
“language”: “EN”,
“text”: “<Update Invoice Number value here>”
}
]
}
]
}
}
3. REJECTED
a) When service provider validations fail for any action (TRANSMIT, RETRANSMIT or UPDATE_TRANSMISSION_STATUS)
{
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “REJECTED”,
“messages”: [
{
“code”: “ERROR_SP”,
“texts”: [
{
“language”: “EN”,
“text”: “<Validation failed: Missing or invalid field in XML>”
}
]
}
]
}
}
b) When GDT validations fail for any action (TRANSMIT, RETRANSMIT or UPDATE_TRANSMISSION_STATUS)
{
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “REJECTED”,
“messages”: [
{
“code”: “ERROR_GOV”,
“texts”: [
{
“language”: “EN”,
“text”: “<Validation failed: Invalid field in XML. This text can be in Vietnamese language as well>”
}
]
}
]
}
}
4. ACCEPTED
GDT approved the invoice (for UPDATE_TRANSMISSION_STATUS action)
{
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “ACCEPTED”,
“messages”: [
{
“code”: “CQT_CODE”,
“texts”: [
{
“language”: “EN”,
“text”: “<Update Cơ quan thuế(CQT) Code value here>”
}
]
}
],
“documents”: [
{
“id”: “FINAL_RESPONSE”,
“type”: “PDF”,
“FileContent”: {
“filename”: “<invoice.pdf>”,
“content_type”: “PDF”,
“content”: “<Update PDF content here>”
}
}
]
}
}
5. TRANSMISSION_IN_PROGRESS
When Invoice is not yet sent to tax authority or is still under evaluation (for UPDATE_TRANSMISSION_STATUS action)
{
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “TRANSMISSION_IN_PROGRESS”,
“messages”: [
{
“code”: “INVOICE_NUMBER”,
“texts”: [
{
“language”: “EN”,
“text”: “<Update Invoice Number value here>”
}
]
}
]
}
}
Note:
For each status, you must use the exact values for fields such as code (e.g., ERROR_SP, INVOICE_NUMBER, CQT_CODE) as shown, these are not placeholders, but mandatory values for integration. Also, only include the documents tag in your response when it is shown in the example. If a scenario example omits documents, then you must not attach any additional documents for that particular response.
Mandatory Fields in Requests and Responses
Every interaction between SAP and the service provider relies on a standardized set of fields to ensure seamless communication and traceability.
When building your integration, make sure your API receives and sends the following key elements in every request and response:
| Field | Description |
| id | A unique SAP internal document ID for each transaction. Echo this back in every response. |
| processType | Indicates the document type; e.g., CUSTOMER_INVOICE. |
| processSubtype | Specifies the transaction context; e.g., B2B. |
| countryRegion | Always VN for Vietnam compliance flows. |
| processVersion | Specifies the document type version; e.g., 1.0.0 |
| senderRegistrationID | Customer registration ID from the SAP request payload. |
| status | Your response status, selected from the allowed list for the given action. |
| documents | [Conditional] List of all files included in the transmission (such as PDF attachments), each mapped by id. |
| messages | [Conditional] Use for conveying errors, validation feedback, or status updates, particularly when the transaction fails or the document is rejected. |
Final Checklist to Go Live
- Implement only allowed status codes per action.
- Ensure all required fields are present and correctly formatted.
- Include and map attachments precisely.
- Robust error handling and logging.
By following this playbook, you’ll ensure rapid, compliant, and support-minimal onboarding for any Vietnam service provider integrating with SAP Document and Reporting Compliance Cloud Edition Extensibility Vietnam.
To know more details, refer to SAP Document and Reporting Compliance Cloud Edition Extensibility and Vietnam Cloud Integration.
Feel free to leave a comment or follow us for more updates on SAP Document and Reporting Compliance in the SAP Community.
Best regards,
Mahesh Varma
“}]]
[[{“value”:”Are you a third-party service provider looking to integrate with Document and Reporting Compliance for Vietnam? This blog is your essential playbook for understanding the SAP interface, valid statuses, request/response structures, and expected business scenarios. By following this blueprint, your integration will be seamless, standardized, and ready for production.What You Will AchieveThis blog will help you enable seamless electronic invoice exchange between SAP and your system, fully compatible with the SAP Document and Reporting Compliance, Cloud Edition Extensibility framework. Your system will receive electronic invoices from SAP in a SAP defined format, validate and process them, and respond with the required statuses and payloads. This ensures full traceability for customers and allows for the transfer of electronic invoices to the Vietnam General Department of Taxation (GDT), known in Vietnamese as Tổng cục Thuế.API Endpoint SetupBefore starting, ensure you have an API endpoint that wraps all operations for SAP to send and receive payloads, in the following format:<host>/v1/commandReplace <host> with your actual service’s host or domain name. Example Request Payload From SAP to Service Provider When SAP calls your API, the request is in JSON format with HTTP POST operation and a content type of multipart/form-data. The payload includes processing instructions and additional document attachments in XML format, which could be accessed using the boundary value:POST <host>/v1/command
Content-Type: multipart/form-data; boundary=boundary
–boundary
Content-Disposition: form-data; name=”payload”
Content-Type: application/json
{
“processInstance”: {
“id”: “<SAP Internal document ID>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“action”: “TRANSMIT”,
“senderRegistrationID”: “123456789”,
“documents”: [
{
“id”: “<SAP Internal source key>”,
“type”: “SUBMIT_MAIN”
}
]
}
}
–boundary
Content-Disposition: form-data; name=”<SAP Internal document ID>+<SAP Internal source key>”; filename=”filename.XML”
Content-Type: application/xml
–boundary–Where is the Actual XML?The XML file is attached as a separate multipart section, not as a string in the JSON. Each entry in the documents array of the JSON is mapped by its id to a matched file (in this case, the invoice XML).As you noticed in the example above, there is a field called “action” (e.g., TRANSMIT). SAP can send you one of three actions, and for each action, only certain response statuses are allowed from the service provider:Action from SAP to SPPermitted Response Statuses from SP to SAPTRANSMITTRANSMITTED, REJECTEDRETRANSMITRETRANSMITTED, REJECTEDUPDATE_TRANSMISSION_STATUSTRANSMISSION_IN_PROGRESS, ACCEPTED, REJECTED Below you’ll find a scenario map and guideline for when each status is to be returned:StatusWhen to use / ScenarioRequired Additional Info TRANSMITTEDService Provider validations have passed.INVOICE_NUMBERREJECTEDService Provider or GDT validations have failedDetailed error messagesRETRANSMITTEDService Provider validations have passed. This status is used when a retransmission action has occurred successfully from SAP to Service Provider(in response to RETRANSMIT).INVOICE_NUMBERACCEPTEDDocument approved by the Vietnamese tax authority (GDT). (Attach CQT code and PDF in documents.)CQT_CODE and PDF attachment TRANSMISSION_IN_PROGRESSInvoice is not yet sent to tax authority or is still under evaluation (used only in UPDATE_TRANSMISSION_STATUS).INVOICE_NUMBERExample Response Payload From Service Provider to SAPHere are real-life examples for your API responses, aligned with the status scenario map above. The examples below cover all possible response scenarios required by SAP DRC Vietnam. Please note that, like request payload, response payload also has to be sent to SAP in multipart/form-data format.1. TRANSMITTEDWhen service provider validations have passed for a TRANSMIT action{
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “TRANSMITTED”,
“messages”: [
{
“code”: “INVOICE_NUMBER”,
“texts”: [
{
“language”: “EN”,
“text”: “<SP should update invoice number value here>”
}
]
}
]
}
}2. RETRANSMITTEDWhen service provider validations have passed for a RETRANSMIT action{
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “RETRANSMITTED”,
“messages”: [
{
“code”: “INVOICE_NUMBER”,
“texts”: [
{
“language”: “EN”,
“text”: “<Update Invoice Number value here>”
}
]
}
]
}
}3. REJECTEDa) When service provider validations fail for any action (TRANSMIT, RETRANSMIT or UPDATE_TRANSMISSION_STATUS){
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “REJECTED”,
“messages”: [
{
“code”: “ERROR_SP”,
“texts”: [
{
“language”: “EN”,
“text”: “<Validation failed: Missing or invalid field in XML>”
}
]
}
]
}
}b) When GDT validations fail for any action (TRANSMIT, RETRANSMIT or UPDATE_TRANSMISSION_STATUS){
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “REJECTED”,
“messages”: [
{
“code”: “ERROR_GOV”,
“texts”: [
{
“language”: “EN”,
“text”: “<Validation failed: Invalid field in XML. This text can be in Vietnamese language as well>”
}
]
}
]
}
}4. ACCEPTEDGDT approved the invoice (for UPDATE_TRANSMISSION_STATUS action){
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “ACCEPTED”,
“messages”: [
{
“code”: “CQT_CODE”,
“texts”: [
{
“language”: “EN”,
“text”: “<Update Cơ quan thuế(CQT) Code value here>”
}
]
}
],
“documents”: [
{
“id”: “FINAL_RESPONSE”,
“type”: “PDF”,
“FileContent”: {
“filename”: “<invoice.pdf>”,
“content_type”: “PDF”,
“content”: “<Update PDF content here>”
}
}
]
}
}5. TRANSMISSION_IN_PROGRESSWhen Invoice is not yet sent to tax authority or is still under evaluation (for UPDATE_TRANSMISSION_STATUS action){
“processInstance”: {
“id”: “<Internal document ID generated by SAP>”,
“processType”: “CUSTOMER_INVOICE”,
“processSubtype”: “B2B”,
“countryRegion”: “VN”,
“processVersion”: “1.0.0”,
“status”: “TRANSMISSION_IN_PROGRESS”,
“messages”: [
{
“code”: “INVOICE_NUMBER”,
“texts”: [
{
“language”: “EN”,
“text”: “<Update Invoice Number value here>”
}
]
}
]
}
}Note: For each status, you must use the exact values for fields such as code (e.g., ERROR_SP, INVOICE_NUMBER, CQT_CODE) as shown, these are not placeholders, but mandatory values for integration. Also, only include the documents tag in your response when it is shown in the example. If a scenario example omits documents, then you must not attach any additional documents for that particular response.Mandatory Fields in Requests and ResponsesEvery interaction between SAP and the service provider relies on a standardized set of fields to ensure seamless communication and traceability.When building your integration, make sure your API receives and sends the following key elements in every request and response:FieldDescriptionidA unique SAP internal document ID for each transaction. Echo this back in every response.processTypeIndicates the document type; e.g., CUSTOMER_INVOICE.processSubtypeSpecifies the transaction context; e.g., B2B.countryRegionAlways VN for Vietnam compliance flows.processVersionSpecifies the document type version; e.g., 1.0.0senderRegistrationIDCustomer registration ID from the SAP request payload.statusYour response status, selected from the allowed list for the given action.documents[Conditional] List of all files included in the transmission (such as PDF attachments), each mapped by id.messages[Conditional] Use for conveying errors, validation feedback, or status updates, particularly when the transaction fails or the document is rejected.Final Checklist to Go LiveImplement only allowed status codes per action.Ensure all required fields are present and correctly formatted.Include and map attachments precisely.Robust error handling and logging.By following this playbook, you’ll ensure rapid, compliant, and support-minimal onboarding for any Vietnam service provider integrating with SAP Document and Reporting Compliance Cloud Edition Extensibility Vietnam.To know more details, refer to SAP Document and Reporting Compliance Cloud Edition Extensibility and Vietnam Cloud Integration.Feel free to leave a comment or follow us for more updates on SAP Document and Reporting Compliance in the SAP Community.Best regards,Mahesh Varma”}]] Read More Technology Blog Posts by SAP articles
#SAPCHANNEL