A stock payload can contain mappings and ordered lists. Reordering mapping keys may leave the intended data unchanged; reordering order lines may change it. A fingerprint policy should say which differences it ignores.
In a Shopify 3PL adapter, this distinction belongs in a documented payload contract. It can also matter to drop shipping imports and stocked shopify fulfillment. The code below is an isolated Python example, not a deployed integration.
import hashlib
import json
def fingerprint(value):
data = json.dumps(value, sort_keys=True, ensure_ascii=False,
separators=(",", ":"), allow_nan=False)
return hashlib.sha256(data.encode("utf-8")).hexdigest()
assert fingerprint({"sku": "A", "qty": 2}) == fingerprint({"qty": 2, "sku": "A"})
assert fingerprint({"nested": {"b": 2, "a": 1}}) == fingerprint({"nested": {"a": 1, "b": 2}})
assert fingerprint(["A", "B"]) != fingerprint(["B", "A"])
assert fingerprint({"qty": 1}) != fingerprint({"qty": True})
assert fingerprint({"sku": "01"}) != fingerprint({"sku": 1})
assert fingerprint({"note": "箱"}) == fingerprint({"note": "箱"})
try:
fingerprint({"weight": float("nan")})
except ValueError:
pass
else:
raise AssertionError("non-finite number accepted")
print("7 checks passed")
The seven checks cover mapping order at two depths, list order, Boolean versus integer, text versus number, Unicode and rejection of NaN. Python's JSON documentation describes sort_keys and allow_nan.
This is not a universal canonical JSON standard: numeric representation, Unicode normalization and accepted input types still need a contract. A matching hash is not permission to dispatch, and a payload hash alone does not implement durable idempotency.
For a china fulfillment workflow, test the actual field meanings before choosing a fingerprint. Ask a china 3PL which fields identify the event and which represent its ordered contents. International Fulfillment for Folligen is only a hypothetical enquiry phrase here, with no customer relationship asserted.
YX Fulfillment's integration preparation guide is further context. The checks run locally without a store, credentials or customer data.
Computer workstations and printing equipment in a warehouse.

Top comments (0)