Document Compliance Gateway v4

Document Compliance Gateway v4 API is designed to manage the transmission of the compliance document to the validating vendor. Vendors can implement the API to read the compliance document sent to the SAP Concur system by the end user from an approved email, validate the compliance document against government records, and return the validation result. In addition, the vendor can read and parse the compliance document file to provide tax relevant data for creating expense entry.

The API supports an improved and efficient process for compliance document validation. The end user gets the compliance document validation result prior to expense creation preventing the unnecessary process, as well as, return and resubmission of the expense reports. The API also uses the data from the compliance document file to initiate the expense line item, saving the need for the user to manually type the information.

Prior Versions

No prior API version available

Limitations

API access is available only to the authenticated companies with granted permission. Access to this documentation does not provide access to the API. The API will be deployed to US2 & EU2 data centers.

Process Flow

Process Flow for Document Compliance Gateway

Products and Editions

  • Concur Expense Professional Edition

Scope Usage

Name Description Endpoint
receipts.read Receipts - Tax Validation GET
receipts.write Receipts - Tax Validation PUT

Authentication

Authentication is provided through an App for company JWT. This API requires the valid access token with required scopes. Before making requests to the API, please obtain an access token from the Authentication API.

Dependencies

None.

Endpoints

GET API CALL

Get the compliance document

Scopes

Refer to Scope Usage for full details.

receipts.read

Request

URI

Template
GET https://{region}.api.concursolutions.com/document-compliance-gateway/v4/tax-documents/{documentId}
Parameters
Name Type Format Description
documentId string - Unique id assigned to a document.

Headers

  • Authorization is provided through an App for Business and the company JWT. More details can be found here
  • concur-correlationid is used to track the workflow for every step.

Notes

  • The company JWT is data center specific. The auth service (/token endpoint) that signs the JWT determines which data center the JWT will work in.
  • To get a token or to refresh a token, use the curl command(s)specified here.
  • Once you have the token use the following curl command to POST invoice details:
curl --location --request GET 'https://integration.api.concursolutions.com/document-compliance-gateway/v4/tax-documents/{documentId}' -H 'Authorization: Bearer <JWT token>'
  -H 'concur-correlationid: {LogicalId}'

Response

Error Codes

Code Description
400 Validation errors in request body.
401 Unauthorized (invalid JWT or expired, etc.)
404 DCG Company Not Found
500 Internal Server Error
503 Service Unavailable
502 Bad Gateway

Example

Request

GET https://integration.api.concursolutions.com/document-compliance-gateway/v4/tax-documents/c92565ca-78c7-47be-a730-1d33ef35cdac
Authorization: Bearer <JWT Token>
concur-correlationid: "Test-FlOW"

Response

HTTP/1.1 200 OK
Content-Type: XML

PUT API CALL

Provide the compliance document validation result and parsed tax relevant data from the compliance document.

Scopes

Refer to Scope Usage for full details.

receipts.write

Request

URI

Template
PUT https://{region}.api.concursolutions.com/document-compliance-gateway/v4/tax-documents/{documentId}
Parameters
Name Type Format Description
documentId string   Unique id assigned to a document.

Headers

  • Authorization is provided through an App for Business and the company JWT. More details can be found here
  • concur-correlationid is used to track the workflow for every step.

Payload

  • digitalTaxDocument - A digitalTaxDocument file in JSON format that is required.

  • displayedVersion - A multipart compliant document in human-readable PDF format.

    • If the end user only uploads the XML file, the partner will receive the event with isDisplayVersionRequired = true.
      • In such scenarios, If the xml file is valid and processed, the partner needs to convert the XML file into PDF format and upload it in the displayedVersion field mandatorily.
      • If the XML file is invalid or has failed, uploading the displayedVersion is optional .

Notes

  • The company JWT is data center specific. The auth service (/token endpoint) that signs the JWT determines which DC the JWT will work in.
  • To get a token or to refresh a token, use the curl command(s)specified here. It is recommended to have a valid token and scope to make the post call to the API.
  • Once you have the token, use the following curl command to POST invoice details:
curl --location --request PUT 'https://integration.api.concursolutions.com/document-compliance-gateway/v4/tax-documents/{documentId}' -H 'Authorization: Bearer <JWT token>'
  -H "concur-correlationid": {LogicalId}\
  --form "digitalTaxDocument"=@"DigitalTaxToken.json"

Response

Error Codes

Code Description
400 Validation errors in request body.
401 Unauthorized (invalid JWT or expired, etc.)
404 DCG Company Not Found
500 Internal Server Error
503 Service Unavailable
502 Bad Gateway

Example

Request

POST https://integration.api.concursolutions.com/document-compliance-gateway/v4/tax-documents/c92565ca-78c7-47be-a730-1d33ef35cdac
Authorization: Bearer <JWT Token>
concur-correlationid: "Test-FlOW"
digitalTaxDocument:
{
   "Status":"processed",
   "DocumentData":{
      "FormatVersion":"4.0",
      "Code":"pos",
      "Number":"1234",
      "IssueDateTime":"2021-12-07T23:59:59",
      "UUID":"ED1752FE-E865-4FF2-BFE1-0F552E770DC9",
      "PaymentType":"Cash",
      "GrossAmount":0.0,
      "Discount":0.0,
      "Currency":"MXN",
      "ExchangeRate":"0.0",
      "NetAmount":0.0,
      "PaymentMethod":"PUE",
      "TotalWithholdingTax":0.0,
      "TotalSalesTax":0.0,
      "Vendor":{
         "CertificateNumber":"0000",
         "TaxNumber":"TXN-No-1000",
         "Name":"Vendor 1",
         "city":"Bellevue",
         "state":"WA",
         "country":"US",
         "phone":"888-867-5309",
         "addressLine":"123 Main St"
      },
      "Buyer":{
         "TaxNumber":"TXN-No-10001",
         "Name":"Buyer 1",
         "PostalCode":"MX-000001"
      },
      "LineItems":[
         {
            "ProductCode":"P1",
            "Description":"Description",
            "Amount":0.0
         }
      ],
      "DocumentPostalCode":"MX-000002"
   },
   "Description":"Document is valid",
   "Code":"200"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json
{
  "DocumentId": "c92565ca-78c7-47be-a730-1d33ef35cdac",
  "Description": "Tokens have been received."
}

Schema

DigitalTaxDocument Schema

Name Type Format Description
status string “enum”: [“processed, failed”] Required - Status of the CFDI document.
documentData object DocumentData Schema Required - Document details and Tax Token info (Can be null for failed status).
code string optional Response code provided by partner.
description string optional Comment/description provided by partner.

DocumentData Schema

Name Type Format Description
issueDateTime string YYYY-MM-DDTHH:mm:ssZ Required - Date and time when the document was created in the local timezone where it was issued.
uuid string - Required - Document UUID - field present in compliance document.
grossAmount number - Required - Sum of amounts before discounts and taxes.
currency string “enum”: [“INR”,”MXN”,”USD”] Required - Currency used to express amounts (According to the ISO 4217 codes)(MXN).
exchangeRate string - Required - Exchange Rate according to currency used. Mandatory id currency <> MXN.
netAmount number - Required - Gross Amount – Discounts + VAT Taxes – Withholding Taxes.
paymentMethod string - Required - Specify the code of payment method - PUE - only one payment, PPD - payment done in partial payments, PIP - Initial payment and partialities.
vendor object Vendor schema Required - details of the vendor.
formatVersion string “enum”: [“3.3, 4.0”] Version of the CFDI document.
buyer object Buyer schema Details of the buyer.
number string - Number of the receipt.
code string - Prefix of receipt, an alphanumeric field that can refer to a physical place (POS, branch, factory, warehouse, office, etc.) or any other criteria (like business, line of product, etc.)
documentPostalCode string - Postal code of place of receipt issue.
paymentType string “enum”: [“01, 02, 03”] Means of payment (01 (Cash), 02 (Cheque), 03 (Bank Transfer/Digital Wallet)).
discount number - Total amount of applicable discounts before taxes.
totalSalesTax number - Sum of all sales tax amounts of line items.
totalWithholdingTax number - Sum of all withhold tax amounts of line items.
lineItems array LineItem schema Line items present in the CFDI compliance document.
verificationCode string - Company’s certificate used to generate digital signature.
comments string - Comment/description.

Vendor Schema

Name Type Format Description
taxNumber string - Required - Taxpayer ID of the vendor.
certificateNumber string - Company’s certificate used to generate digital signature.
name string - Name of receipt issuer.
city string - City of receipt issuer.
state string - State of receipt issuer.
country string - Country of receipt issuer.
phone string - Phone number of receipt issuer.
addressLine string - AddressLine of receipt issuer.

Buyer Schema

Name Type Format Description
taxNumber string - Required - Buyer Tax Number.
PostalCode string - Postal code of tax domicile of recipient.
name string - Buyer Name.

LineItem Schema

Name Type Format Description
amount number - Required - Total amount of goods or service.
description string - Product Description.
productCode string - Required - Key of product or service covered - 10101502 (Dogs), 10101506 (Horses) (Catalogue: c_ClaveProdServ)

On this page