Resuming a Batch of China Company API Checks
Recover a stopped China company verification batch by replaying only unresolved lookup tasks and retaining results already received.
Retrieve a company’s registered identity, business status, address, capital and business scope.

A procurement data refresh stops after the application already finished several hundred Chinese company checks. A few requests went out just before the worker stopped. Starting the spreadsheet again can repeat completed calls, overwrite results that a reviewer has already used and increase the bill. The next run needs to know which records were completed, which inputs require correction and which requests might have completed without a saved response.
Save progress per lookup before you start the batch, and record every attempt against its own task. Use the documented single-company request for each verified identifier. Group the calls and retry decisions in your application. The goal is to finish the approved work without making an old result look new or assuming that a client timeout means the provider did no work.
Preserve the input and the lookup plan
Keep the original vendor export and give each row a stable internal reference. Before calling the API, group rows that truly need the same lookup. The same identified supplier, endpoint, required language and evidence window can often share a result if your data-use terms allow it. Keep a mapping from a lookup task to all of the original rows it will inform. This prevents one incomplete vendor row from obscuring a completed result for the company.
If a row identifies only a brand or English trading name, route it for candidate resolution first. Do not build a retry task for an assumed legal name. Business rows that have a good code can proceed without waiting for that work. Give an updated input a new revision if its legal identifier or requested scope changes. A restarted job should process the intended query, not whatever the vendor master happens to contain now.
The ChinaValidate Company Profile API takes one Chinese legal name or Unified Social Credit Code in company_name_or_credit_code. A client-side job can send those requests to a queue. Its batch identifier is internal to the client and should not be represented as a documented API parameter. Keep the API key at the server where the tasks execute. Record the endpoint and its request options without placing the key in an export, log or review file.
Give a task and an attempt different records
A task describes the result you are trying to obtain. An attempt says that a worker made a particular request at a particular time. A single task can have several attempts. An attempt can receive a valid result, receive a classified error, or end without a persisted result. Recording both levels keeps the review and the financial trace understandable.
The following fragment is a fictional client-side progress record. It is a possible shape for a job table or export. It does not represent a ChinaValidate request or response.
{
"task_id": "refresh-vendor-018",
"source_rows": ["row-018", "row-042"],
"endpoint": "company_profile",
"state": "completion_unknown",
"attempt": 1,
"response_saved": false
}
Save a successful response and its completed task state together in the database. The review interface should be able to locate the response from the task without depending on a worker's memory. If that write succeeds and a duplicate queue message arrives, the worker can see the completed task and avoid another API call. A worker lease or comparable claim can limit two workers to one active submission for the same task. Keep any late response as an attempt record and avoid blindly overwriting a newer or already adjudicated result.
Make a clear place for requests whose outcome the client cannot establish. The worker may have lost network connectivity after submitting the request or stopped after receiving a response but before persisting it. If the provider’s account records help you reconcile the completed request, consult them before sending a fresh one. Your local task ID is a way to prevent repeats in your job. It does not prove provider-side deduplication. AWS guidance on timeouts and retry side effects
Resume a stopped run by outcome
Suppose an approved fictional batch contains 240 lookup tasks. The worker successfully saved 180 matches and 35 completed no-result responses. Another 10 have invalid inputs flagged by the client before submission. Five may have reached the API but have no saved response, and 10 never started. The first decision is to exclude the 215 tasks with a completed result from the replay. Return the 10 invalid inputs for correction, review the five unknown outcomes, and schedule the 10 unstarted tasks. An operator should see the counts reconcile to the original 240.
The completed no-result response remains useful. The documented shape is a successful application response with zero total_count and an empty items list. Do not send the same request again just because the supplier has not yet been identified. The procurement desk can confirm the input or provide new evidence. If that investigation identifies a different source or legal company, create the appropriate new lookup. Keep the earlier outcome attached to the input it actually used.
Read the JSON application code independently of the HTTP status. ChinaValidate documents that application responses can arrive as HTTP 200. A response with insufficient balance calls for resolving the funding issue before continuing that part of the queue. An invalid key or denied access should go to the responsible administrator. A request limit calls for reducing or delaying starts under the applicable account limit. A transport-level HTTP 429, if present, is a distinct signal whose standard allows a Retry-After header. Use that guidance when the server provides it without assuming every application response includes the header. HTTP 429 in RFC 6585
If a reported service failure is suitable for another attempt, use a capped retry schedule with backoff and jitter and coordinate it across workers. Opening several new workers during a service interruption can multiply the load. Uncertain completion deserves a separate policy because a repeated completed call can be charged. Confirm the current terms, including ordinary no-result charges and the general treatment of input errors and service failures. ChinaValidate API pricing
Keep corrections separate from missing work
Sometimes a batch finishes but the team discovers that a field was mapped to the wrong vendor or that the wrong response language was requested. A correction run should identify the reason and the affected subset. If you already saved a valid original response and the mapping was local, the application may be able to correct the mapping without contacting the API again. If the original query itself was wrong, store the corrected task with a reference to the old one and retain both results. This will matter if a newer result explains a decision that previously appeared to be based on another company.
Decide whether results are still current for the intended decision. A resumed batch that was paused for weeks can legitimately need a fresh check for a high-exposure supplier. Make the older result visible and schedule the new check as an intentional refresh, rather than mistaking it for the original missing attempt. The business owner should set the review window and approve any broader recheck. This keeps two different reasons for a new request traceable.
For a data migration, bind the completed evidence back to the original rows only after checking the matching identifier and vendor role. A duplicate vendor row can reuse evidence without being erased. Treat the external check and changes to the ERP as separate stages. If an account should be linked, held or left alone, record the basis, reviewer and time. A restarted lookup worker should not independently change approved records.
Give operators a way to resolve an unknown attempt without forcing them to rerun the whole batch. Let them choose an already observed response when they can verify its identity and freshness, mark the work item for a funded recheck, or hold it pending better evidence. Record the decision and the new attempt, if any. A later audit can explain why extra credits were used and why that one supplier's evidence is dated differently from the rest of the file.
Reconcile each run before applying it
Retain the original number of tasks, completed results, unstarted tasks, corrected inputs and unresolved attempts. Compare attempt records to what the API account shows where information is available, and flag timing or unmatched charges for review. Do not define a run as complete just because no worker is active. An unanswered attempt, invalid input and completed no-match response deserve different next actions even if none creates a verified supplier record.
Test interruption after a request is sent, after its response is saved and before the output gets attached to a vendor row. Use completed local fixtures or the small authorized test scope appropriate for the team. Check that queued tasks cannot repeat merely because someone exports a summary twice. Review the final export to ensure two rows sharing one legal match still retain their own source context.
A reliable batch makes the next action clear from persisted evidence. A reviewer can use the completed results, a worker can resume only the appropriate outstanding tasks, and the account owner can explain any repeat request. This lets the same company-profile integration handle a small initial clean-up or a larger recurring project without a restart turning into a separate bill and a different set of facts.