> ## 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.

# Runs a certification test pack against a partner: every sample interchange

> is validated (side-effect-free) against the partner's implementation guide and checked against its expected outcome…

is validated (side-effect-free) against the partner's implementation guide
and checked against its expected outcome. When the pack passes and the
partner's onboarding is at the `testing` stage, it auto-advances to
`certified`. Emits a signed `edi.operator.certification_run` audit event.

### Path parameters

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

### Request body

`TestPack`

<ParamField body="cases" type="TestCase[]" required />

<ParamField body="name" type="string" required />

### Response

`CertificationReport`

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

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

<ResponseField name="passed" type="boolean" required>
  True only when every case passed.
</ResponseField>

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

<ResponseField name="results" type="CaseResult[]" required>
  <Expandable title="CaseResult">
    <ResponseField name="actual_valid" type="boolean" required />

    <ResponseField name="detail" type="string">
      Why the validator reached its verdict — structural error or the first rejected document's reason — surfaced so a failing case is debuggable.
    </ResponseField>

    <ResponseField name="expected_valid" type="boolean" required />

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

    <ResponseField name="passed" type="boolean" required />
  </Expandable>
</ResponseField>

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

### Status codes

| Code  | Meaning                       |
| ----- | ----------------------------- |
| `200` | Certification report          |
| `403` | Not this credential's partner |
| `404` | Unknown partner               |
| `422` | Invalid test pack             |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://edi.stateset.com/v1/partners/{id}/certification/run' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "cases": [
      {
        "description": "Two-person tent, green — replacement for damaged pole set.",
        "expect_valid": true,
        "name": "Two-Person Tent",
        "raw": "string"
      }
    ],
    "name": "Two-Person Tent"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "pack_name": "string",
    "partner_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "passed": true,
    "passed_count": 1,
    "results": [
      {
        "actual_valid": true,
        "detail": "string",
        "expected_valid": true,
        "name": "Two-Person Tent",
        "passed": true
      }
    ],
    "total": 102
  }
  ```
</ResponseExample>
