> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Captures the partner's current implementation guide (validation + overlay) as

> the next immutable version.

the next immutable version.

### Path parameters

<ParamField path="id" type="string" required>
  Partner ID
</ParamField>

### Response

`GuideSnapshot`

<ResponseField name="author" type="string" required>
  Who captured it (`admin`, `partner:&#123;id&#125;`).
</ResponseField>

<ResponseField name="created_at" type="string (date-time)" required />

<ResponseField name="note" type="string" />

<ResponseField name="overlay" type="object">
  <Expandable title="overlay">
    <ResponseField name="element_overrides" type="ElementOverride[]">
      Force an element's value on the first matching segment of an outbound transaction (optionally scoped to a set) — e.g. a fixed qualifier.

      <Expandable title="ElementOverride">
        <ResponseField name="element" type="integer" required>
          1-based element position (element 1 is the first after the segment tag).
        </ResponseField>

        <ResponseField name="segment" type="string" required />

        <ResponseField name="transaction_set" type="string" />

        <ResponseField name="value" type="string" required />
      </Expandable>
    </ResponseField>

    <ResponseField name="extra_segments" type="OverlaySegment[]">
      Extra segments appended to outbound transactions (optionally scoped to a transaction set) — e.g. a partner-required `REF`/`N9`/`DTM`.

      <Expandable title="OverlaySegment">
        <ResponseField name="elements" type="string[]" />

        <ResponseField name="tag" type="string" required />

        <ResponseField name="transaction_set" type="string">
          Restrict to one transaction set (e.g. `856`); `None` applies to all.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="partner_id" type="string" required />

<ResponseField name="tenant_id" type="string" required />

<ResponseField name="validation" type="PartnerValidation" required>
  <Expandable title="PartnerValidation">
    <ResponseField name="accepted_inbound" type="string[]">
      If non-empty, inbound transaction sets not in this list are rejected (e.g. `['850', '860']` for a partner that only sends orders).
    </ResponseField>

    <ResponseField name="conditional_rules" type="ConditionalRule[]">
      If-then rules, e.g. 'when BEG02 is SA, a DTM segment is required'.

      <Expandable title="ConditionalRule">
        <ResponseField name="equals" type="string[]">
          Trigger values. Empty means 'when the element is present (non-empty)'.
        </ResponseField>

        <ResponseField name="require_element" type="object" />

        <ResponseField name="require_segment" type="string">
          Then this segment must be present somewhere in the transaction.
        </ResponseField>

        <ResponseField name="when_element" type="integer" required />

        <ResponseField name="when_segment" type="string" required>
          Trigger: segment tag + 1-based element position.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="count_checks" type="object">
      Count-balancing rules per inbound transaction set — `CTT01` must equal the number of `PO1` segments and friends. Checked only when the counter segment is present (pair with `required_segments` to mandate it).
    </ResponseField>

    <ResponseField name="element_constraints" type="ElementConstraint[]">
      Element-level constraints applied to matching segments anywhere in an inbound document — e.g. pin PO1-03 (unit of measure) to an allowed set.

      <Expandable title="ElementConstraint">
        <ResponseField name="allowed" type="string[]">
          If non-empty, the element must be one of these values.
        </ResponseField>

        <ResponseField name="element" type="integer" required>
          1-based element position, e.g. `3` for the PO1 unit of measure.
        </ResponseField>

        <ResponseField name="format" type="object" />

        <ResponseField name="max_len" type="integer">
          Maximum length (in characters) when the element is present.
        </ResponseField>

        <ResponseField name="min_len" type="integer">
          Minimum length (in characters) when the element is present.
        </ResponseField>

        <ResponseField name="required" type="boolean">
          If true, the element must be present (non-empty).
        </ResponseField>

        <ResponseField name="segment" type="string" required>
          Segment tag, e.g. `PO1`.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="required_qualified" type="object">
      Qualified-segment requirements per inbound transaction set — the guide staple `required_references` can't reach beyond REF: 'a DTM\*002 (delivery date) must be present', 'an N1 loop with N101=ST'. The `'*'` key applies to every set.
    </ResponseField>

    <ResponseField name="required_references" type="object">
      REF qualifiers that must be present per inbound transaction set, e.g. `&#123;'850': ['DP']&#125;` to require a department-number reference on every PO.
    </ResponseField>

    <ResponseField name="required_segments" type="object">
      Segment tags that must be present per inbound transaction set, e.g. `&#123;'850': ['DTM', 'REF']&#125;` to require a date and reference on every PO. The `'*'` key applies to every inbound set.
    </ResponseField>

    <ResponseField name="segment_cardinality" type="object">
      Occurrence bounds per inbound transaction set, e.g. `&#123;'850': [&#123;'segment': 'BEG', 'min': 1, 'max': 1&#125;]&#125;` for 'exactly one BEG' or a guide's 'max 200 PO1 lines'. The `'*'` key applies to every set; a set-specific rule for the same segment takes precedence.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="version" type="integer (int32)" required>
  Monotonic version, starting at 1.
</ResponseField>

### Status codes

| Code  | Meaning                    |
| ----- | -------------------------- |
| `200` | The captured guide version |
| `404` | Unknown partner            |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://edi.stateset.com/v1/partners/{id}/guide/snapshot' \
    --header 'Authorization: Bearer YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "author": "string",
    "created_at": "2026-08-31T14:22:05Z",
    "note": "Two-person tent, green — replacement for damaged pole set.",
    "overlay": {
      "element_overrides": [
        {
          "element": null,
          "segment": null,
          "transaction_set": null,
          "value": null
        }
      ],
      "extra_segments": [
        {
          "elements": null,
          "tag": null,
          "transaction_set": null
        }
      ]
    },
    "partner_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "tenant_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "validation": {
      "accepted_inbound": [
        "string"
      ],
      "conditional_rules": [
        {
          "equals": null,
          "require_element": null,
          "require_segment": null,
          "when_element": null,
          "when_segment": null
        }
      ],
      "count_checks": {},
      "element_constraints": [
        {
          "allowed": null,
          "element": null,
          "format": null,
          "max_len": null,
          "min_len": null,
          "required": null,
          "segment": null
        }
      ],
      "required_qualified": {},
      "required_references": {},
      "required_segments": {},
      "segment_cardinality": {}
    },
    "version": 1
  }
  ```
</ResponseExample>
