China PDF Invoice Verification API in Power Automate

Read an approved SharePoint PDF in Power Automate, submit the original bytes to ChinaValidate, and write the dated verification result to a review list.

ArticlesPublished by ChinaValidatePublished December 3, 2026Last updated December 3, 2026

Verify a Chinese invoice from a Base64-encoded PDF document.

View API documentationAPI workspace
China PDF Invoice Verification API in Power Automate

A finance team keeps Chinese PDF invoices in a SharePoint library. It wants reviewers to see the verification result in a list beside the original file, where they can locate the exact document and decide what happens next. Power Automate can retrieve a selected PDF, send it to the ChinaValidate PDF Invoice Verification API as Base64, and update the review list. The document stays in the team's authorized library and follows its permissions.

The useful boundary is one explicit submission for one version of the file. Start with a selected-file flow so an operator can check the steps, then use an automated trigger if the organization has an approved intake rule. Configure the environment with access to the HTTP action, the authorized SharePoint connection and the API credential. Test with a permitted sample. Sending a real request can use credits under the API's published billing rules. Microsoft SharePoint connector · ChinaValidate PDF invoice verification API

The selected file and its review record

In the simplest flow, start from a selected file in the invoice library and add the SharePoint action to get file content. Pass the file identifier provided by the trigger. Use stable document identity and version information available in the library and the connected workflow, or record an explicit intake identifier tied to the submitted copy. A file name by itself can repeat across folders and can change after posting. Capture the identifier the reviewer will use to find the submitted version.

In the tracking list, give that submission a record before calling the external API. It can hold the original file link, document version, current workflow state, time of the request and access-controlled evidence reference. Keeping the submission visible when a later action fails makes it possible to recover a specific record. If the team retries the same version after a temporary connector error, it can continue that submission and record a new attempt if a new API request is actually sent.

A trigger attached to file updates requires a narrower condition. Updating the verification status or writing a note can itself modify a library item. If the trigger treats that edit as another invoice submission, the same PDF may repeatedly return to the queue. A selected-file flow limits this problem while the team learns the expected states. For automation, use an explicit submission condition or a separate review list that the file trigger does not monitor. Make the work item identity specific to the version intended for verification.

Microsoft notes that SharePoint's Automate menu exposes selected-file flows from the default environment. Confirm where the team will run this flow before relying on the menu, and check the SharePoint connection identity in that environment. A test with the designer's personal connection proves little about which libraries the operating connection can read. Use a representative file with the same permissions as the intended submissions. If reviewers work in several libraries, name the library in the work record and keep the access decision for each source explicit. That makes a failed retrieval actionable even when the identifier is unfamiliar to the person looking at the queue.

From file bytes to the JSON body

ChinaValidate's PDF endpoint expects a JSON request with file_base64. The value is the original PDF bytes encoded as Base64, without a data-URL prefix. The published limit applies to the JSON request body. Base64 expands the file, so an original PDF smaller than the JSON limit can still exceed it once encoded. Calculate what can be admitted before sending an HTTP request and use a threshold compatible with your Power Automate environment. The Power Automate limits and the receiving API limits are separate. ChinaValidate PDF request fields and limits · Power Automate limits

Inspect a sanitized test run to establish the representation of the file content returned by your connector. Microsoft's workflow content-type documentation explains that some binary action outputs carry a $content member with the Base64 content and a separate content-type member. When that wrapper is present, extract its Base64 value. If the previous step hands you an already encoded string, pass the string once. If it hands you raw binary, use the environment's correct encoding step. Encoding a Base64 string again produces different bytes and can make otherwise valid documents unreadable at the receiving endpoint. Microsoft workflow content-type documentation

The following is the request body shape when the action renamed Get file content exposes the usual binary wrapper. Adjust the action reference to the internal name in your own flow, and verify the wrapper in your test environment. The expression supplies only the Base64 content as a JSON string. The optional language value shown keeps the response in Chinese for field comparison.

{
  "file_base64": "@{body('Get_file_content')?['$content']}",
  "language": "zh-CN"
}

Add an HTTP action for POST to https://api.chinavalidate.com/v1/invoices/verify-pdf, set Content-Type to application/json and supply the bearer authorization from the approved secret configuration. Microsoft documents secure inputs and outputs for keeping secrets and sensitive action data out of the standard run-history view. Set them on the steps that handle the key or document bytes, including upstream or downstream actions where the value could otherwise be shown. Use a dedicated non-sensitive fixture when inspecting portions of the action output during development. A public link to the invoice is unnecessary for this endpoint. Microsoft guidance on secrets and secure inputs and outputs

The response belongs to the exact submission

Keep the transport and application outcomes separate. For documented application responses the service may return HTTP 200, and the JSON code explains whether it completed the verification operation. When completed, look for verification records in data.items and use each available verification_status. Example values documented by ChinaValidate include matched, mismatch, and not_found. Those values describe an invoice observation. A list row should preserve the exact result, along with the submission ID and evidence date, and let finance apply the purchasing or posting rule. ChinaValidate PDF verification response

Observation Value in the review list Workflow action
Source file unavailable to the connection Source retrieval failed Check the source link and permissions
Transport failure or timeout after sending Verification attempt incomplete Review the recorded attempt before resending
Application response carries a failure code Request failed with the recorded code Route to the owner of that issue
Completed response gives a mismatch Invoice mismatch with the evidence reference Send for the applicable invoice review
Completed response gives a match Verification matched for the submitted version Apply the finance team's own approval rule
Completed response has no usable item No usable verification item Show what was received and ask for the needed follow-up

Retain invoice numbers as strings. If the team exposes an invoice number or date in the list, copy the original representation for evidence and keep any normalized sort or reporting value separately. A visible source link should enforce the file's normal permissions. Reviewers with different roles can work from a minimal result without receiving the entire supplier invoice in every flow run or notification. Store the full relevant response in the organization-approved evidence store if the review process needs it.

A useful list view has a document link and one concise status column for day-to-day routing, with the attempted time and last successful observation available for escalation. If one item was previously matched and a subsequent attempt failed, the list can still show the earlier verified version without disguising the later failure. The date and submitted version let the reviewer decide which record applies to the current invoice file.

Recovery when one action stops

Consider a flow that submitted the PDF successfully but stopped at the review-list update. A second run can recover the submission if the attempt and response were saved durably first. Associate that response with the existing review record rather than issuing another verification just to reconstruct the list. If no response was recorded, the system may be unable to tell whether the service processed the call. Give the owner an incomplete state, and include any available correlation data or documented usage record in the decision on whether to send another attempt.

Review the HTTP action's retry settings before enabling the automatic flow. Microsoft's flow limits documentation describes retry behavior and conditions in Power Automate. A retry can lead to another completed external request. Differentiate an automatic transport retry from a user's deliberate recheck of a new PDF version. If the business requires control of duplicate charges, make that policy visible in the workflow and resume deliberately from saved evidence. This also protects reviewers from seeing a refreshed label with no accessible original result. Microsoft Power Automate run and retry limits

An acceptance run with a known PDF

Use a PDF approved for development and record which version will be sent. Get the file from SharePoint using the same connection as the intended workflow, then verify that the extracted Base64 decodes to the same bytes in a protected test process. Feed synthetic or recorded, authorized response fixtures through the remaining branches so testing a mismatch or unavailable file does not depend on repeated live charges. Test a successfully stored observation, an application error and a connector timeout against the same review schema.

In the next trial, let the list update fail after a fixture response was recorded. Check that the reviewer can still find the evidence and that recovery updates the original list row. Replace the PDF with a newer version and confirm that the new event has its own record instead of relabeling the earlier observation. Finally, test from the role that will review the result. The person needs to open the source file that was actually sent, see which verification attempt completed, and distinguish that observation from the decision to post or approve the invoice.