General export declarations: HTTP integrations for procurement

Review HTTP integrations for procurement in General export declarations. Check document scope, failure paths and source evidence through controlled tests.

What the documents look like

General trade export declaration work handles an export declaration form, a commercial invoice, a packing list and a contract for every shipment. Data sources named in the brief are the China International Trade Single Window, the customs code library, freight forwarder bills of lading and enterprise ERP systems. Compared with general trade import declaration, export declaration also affects the matching of export tax rebate vouchers.

For inventory procurement and supplier records, the practical issue is that quantity, amount, product name and unit of measure must stay consistent across the purchase contract, the supplier invoice, the packing list and the export declaration form. Any mismatch can trigger a returned declaration, a filing error or a blocked tax rebate. The brief states the update frequency as per shipment. This page addresses only the HTTP integration step for that material set.

Constraints at the HTTP integrations step

The HTTP module sends a request to a specified address. Params, Headers and Body can each reference variables with {{}}. Variables come from global variables, system variables and upstream node outputs. The documented system variables are appId, chatId, responseChatItemId, variables, cTime and histories. Histories default to at most 10 entries and the length cannot be changed. chatId and responseChatItemId do not exist in test mode, so an empty value read in a test environment is a debugging state, not evidence that business data is missing.

Return values are configured per key and extracted from the transformed response using JSON path or JS object access rules. When the output type is set to string, the value at that key is converted to a JSON string. A similarity score in a retrieval step does not act as a permission filter or a business entity separator, and retrieval is not authorization. The HTTP module can also call external services, but any database write, approval, or external synchronization requires its own downstream implementation.

Hypothetical paper exercise sample: on 10 March 2025 a document clerk at a foreign trade company prepares supplier records for one export order. The purchase contract text states: "Supplier: Huadong Textile Co., Ltd.; Product: polyester knitted fabric; Quantity: 12,000 metres; Unit price: 4.5 yuan per metre; Total amount: 54,000 yuan; Delivery date: 20 March 2025." The commercial invoice text states: "Invoice No. INV-20250310; Quantity: 12,000 metres; Total amount: 54,000 yuan." The packing list text states: "400 cartons total, 30 metres per carton, 12,000 metres in total." The draft request under review is: "Write the contract amount of 54,000 yuan, the invoice amount of 54,000 yuan and the packing list quantity of 12,000 metres into the corresponding fields of the export declaration form." The materials are collected and awaiting cross-check. Authorization to submit to the external declaration system has not been granted.

Configuration and implementation checks

Configuration itemHypothetical trial starting pointHow to check
Request address and methodFill in the URL and POST method stated in the external declaration system interface documentationCompare against the path and method declared in the interface documentation
Headers authenticationAuthorization injected through a separate secure configuration; no credential written into the sampleConfirm the credential source is an independent configuration item
Body structureBuild JSON to the interface contract with field names matching the external system requirementsCompare field by field against the interface documentation field table
Variable referencesContract amount, invoice amount and packing list quantity each reference an upstream node outputCheck that the reference key matches the upstream node output name
Return value extractionExtract the acceptance status field returned by the external system using JSON pathCompare the key path against the interface response example

The trial starting points above are chosen because these fields appear in the sample materials, and the purpose is to check whether the HTTP module passes these values correctly. If the external interface documentation gives different field names, the documentation governs.

Three common errors

  1. Writing the contract amount of 54,000 yuan directly into the declaration amount field without cross-checking the invoice amount and packing list quantity. Input: the three material texts. Comparison: whether quantity and amount agree across all three. Observable result: all three show 12,000 metres and 54,000 yuan, which satisfies the cross-check condition before any further step.
  2. Referencing a string variable in Body without double quotation marks, which breaks JSON parsing. Input: the amount field in the draft request. Comparison: whether the string is wrapped in "" in the Body declaration. Observable result: the parsed JSON keeps the amount as a string type.
  3. Treating an empty chatId in test mode as a business fault and stopping the request. Input: the test environment call record. Comparison: the documented test mode behaviour. Observable result: chatId not existing in test mode is expected behaviour.

How to verify the setup

  1. Input the three material texts from the hypothetical sample and the draft request. Compare the quantity and amount fields across contract, invoice and packing list. The condition is satisfied when all three show 12,000 metres and 54,000 yuan.
  2. Input the Body declaration from the draft request. Compare whether string fields are wrapped in double quotation marks as the documentation requires. The condition is satisfied when the parsed JSON structure matches the interface contract field table.
  3. Input the response example returned by the external system. Compare whether the configured return value extraction key corresponds to the actual field path in the response. The condition is satisfied when the extracted result matches the interface documentation example. If the response does not contain the expected field, record the actual response content and do not infer a failure cause.

No test, submission, approval or external synchronization is claimed here. The materials remain collected and awaiting cross-check, and authorization to submit to the external declaration system has not been granted.