BlogIntegrations · November 3, 2026 · 4 min read

Contact Form 7 API Record IDs: Prevent Large JSON Integers from Rounding

Preserve large record IDs across CF7 integrations. Check JSON number limits, avoid lossy conversions and verify exact identifiers through every consumer.

Two rows of geometric beads cross a transparent bridge between form cards beneath a magnifying lens.
Generated conceptual illustration; not a product screenshot or measured result.

A custom Contact Form 7 connector creates a lead in an external system and receives a large record ID. The request succeeds, yet the next update targets a different or nonexistent record. One possible cause is numeric rounding in an intermediate consumer. The API’s decimal digits can be valid JSON while exceeding the exact integer range of the runtime that reads them.

This guide follows API-generated record identities, rather than form quantities. The examples are synthetic and do not describe a failure measured on your site. For references entered by visitors, also review our leading-zero preservation guide; this failure can occur even when there are no leading zeros.

Find the first numeric conversion

List every component that touches the ID: HTTP response parser, workflow mapping, queue, database column, browser administration screen and export process. Identify its actual type at each step. A value displayed as digits might be a string in one component and a floating-point number in the next.

JavaScript’s maximum safe integer is 9,007,199,254,740,991. Beyond that range, ordinary Number values cannot represent every integer exactly. RFC 8259 also discusses interoperable integer precision. The problem is the consumer’s representation, not a universal rule that JSON rejects larger numeric tokens.

Use an exact synthetic boundary example

Consider the following comparison in an ordinary JavaScript runtime. It illustrates loss of distinction between adjacent integer values after conversion, rather than a benchmark or an API-specific defect.

const first = Number("9007199254740992");
const second = Number("9007199254740993");
console.log(first === second); // true

const exact = "9007199254740993";
console.log(exact === "9007199254740992"); // false

If a connector stores the rounded number, converting it to a string afterward only preserves the wrong value. Retrying the update does not restore the original digits. Reconcile the identifier against an authorized source before modifying any affected record.

Prefer an opaque string contract where supported

Ask the receiver’s API owner whether identifiers are defined as strings or numbers. If you control both sides, an opaque string representation is often simpler for cross-language identity. It preserves spelling and avoids implying that addition or rounding is meaningful.

{
  "record_id": "9007199254740993",
  "handoff_state": "accepted"
}

Require a string in the relevant schema, mapping and storage column. Keep it a string when constructing a later URL or request. Do not silently change an external API’s required numeric type; use its documented representation and an implementation that preserves it exactly.

A representation change is a contract migration. Existing consumers may validate numeric types or compare values differently. Review those dependencies with the payload migration workflow before changing production responses.

Handle numeric APIs deliberately

If an API requires a numeric JSON token, inspect your parser’s integer support before choosing the conversion strategy. JavaScript BigInt can represent large integers, but default JSON serialization does not simply turn a BigInt into a portable JSON number. Define the wire representation explicitly and test the receiver.

MDN’s JSON.parse documentation explains that numeric values can lose precision before a traditional reviver processes them. A reviver that receives only the rounded Number cannot reconstruct the token. Source-aware techniques and specialized parsers require compatibility checks in the actual runtime; do not assume every browser or workflow platform provides them.

PHP offers JSON_BIGINT_AS_STRING for integers beyond its supported integer range, as documented by json_decode. That threshold depends on PHP’s integer representation. It is not automatically the same as JavaScript’s safe range: a value may fit a 64-bit PHP integer but become unsafe after passing to JavaScript.

Verify storage and subsequent reads

Inspect the destination column and the value read back from it. A database can preserve an integer correctly while its JavaScript client rounds the fetched result. Likewise, a dashboard can show a shortened display while storing the original string. Compare actual values through the authorized interface instead of inferring storage from a screenshot.

Export and reimport paths need attention too. Spreadsheet automatic conversion can damage an otherwise correct identifier. Keep interchange data separate from presentation formatting, and document the required import type for any recipient who will open the export.

Build a narrow round-trip check

Prepare synthetic identifiers at the safe boundary, immediately above it, two adjacent large values, and an ordinary small value. Include a nonnumeric opaque ID if the receiver supports that format. Record the exact expected string or numeric token before testing.

Check the raw synthetic response, parsed value, queued payload, stored record and later lookup. A pass requires the same identity at every boundary and two distinct large IDs remaining distinct. Run the checks without updating real contacts or generating customer mail.

Save a short compatibility record naming the runtime, parser, connector version and destination field type. Repeat the fixture after an upgrade that changes any of them. This gives the next maintainer a concrete regression check rather than an unexplained instruction to avoid large numbers.

Keep record IDs out of general analytics labels. They are operational references, not useful campaign dimensions. Our Svetlik Analytics for Contact Form 7 listing is a starting point for submission statistics; it does not verify that a custom API connector preserved an external record identity.