{
  "schema_version": 1,
  "kind": "chia.partner.integration_manifest",
  "contract_version": "2.1.0",
  "api_behavior_version": "2026-07-22",
  "audience": "confidential_partner_backend",
  "server_only": true,
  "operations": [
    {
      "operation_id": "listCatalogItems",
      "method": "GET",
      "path": "/v2/catalog/items",
      "credential_role": "runtime",
      "required_scope": "catalog:read",
      "success_statuses": [200, 304],
      "idempotency": "safe"
    },
    {
      "operation_id": "createHandoffSession",
      "method": "POST",
      "path": "/v2/handoff-sessions",
      "credential_role": "runtime",
      "required_scope": "handoffs:create",
      "success_statuses": [201],
      "idempotency": "required_random_uuid_v4"
    },
    {
      "operation_id": "listSettlementSummaries",
      "method": "GET",
      "path": "/v2/settlement_summaries",
      "credential_role": "finance",
      "required_scope": "settlements:read",
      "success_statuses": [200],
      "idempotency": "safe"
    },
    {
      "operation_id": "createWebhookTest",
      "method": "POST",
      "path": "/v2/webhook_tests",
      "credential_role": "runtime",
      "required_scope": "webhooks:test",
      "success_statuses": [202],
      "idempotency": "required_random_uuid_v4"
    }
  ],
  "non_json_routes": [
    {
      "method": "GET",
      "path_template": "/a/{opaque_asset_id}",
      "origin_source": "environment.asset_origin",
      "credential_role": "runtime",
      "required_scope": "catalog:read",
      "response": "verified_image_bytes",
      "contract": "api/partner/assets/v2.contract.yaml"
    }
  ],
  "webhook_event_types": [
    "endpoint.test",
    "catalog.updated",
    "settlement_summary.finalized"
  ],
  "environments": {
    "sandbox": {
      "api_origin": "https://api.sandbox.invalid",
      "api_origin_source": "exact_https_origin_from_signed_onboarding_package",
      "activation_mode": "business_test_after_sandbox_health_receipt",
      "asset_origin": "https://assets.sandbox.invalid",
      "asset_origin_source": "exact_https_origin_from_signed_onboarding_package",
      "runtime_key_prefix": "chia_test_",
      "finance_key_prefix": "chia_test_finance_",
      "webhook_secret_prefix": "whsec_test_",
      "livemode": false,
      "data_class": "synthetic_only"
    },
    "production": {
      "api_origin": "https://api.production.invalid",
      "api_origin_source": "exact_https_origin_from_signed_onboarding_package",
      "activation_mode": "live_business_after_recorded_chia_activation",
      "asset_origin": "https://assets.production.invalid",
      "asset_origin_source": "exact_https_origin_from_signed_onboarding_package",
      "runtime_key_prefix": "chia_live_",
      "finance_key_prefix": "chia_live_finance_",
      "webhook_secret_prefix": "whsec_live_",
      "livemode": true,
      "data_class": "approved_partner_business_data_only"
    }
  },
  "production_hosted_purchase": {
    "handoff_destination": "real_cobranded_chia_identity_intake_checkout_care_fulfillment_flow",
    "merchant_of_record": "chia",
    "partner_role": "paid_marketplace_publisher",
    "identity_collected_by_partner_api": false,
    "individual_status_returned_to_partner": false,
    "production_webhook_tests": [
      "endpoint.test",
      "catalog.updated",
      "settlement_summary.finalized"
    ]
  },
  "credential_roles": {
    "runtime": {
      "scopes": ["catalog:read", "handoffs:create", "webhooks:test"],
      "allowed_operations": ["listCatalogItems", "createHandoffSession", "createWebhookTest"],
      "storage": "confidential_backend_secret_store"
    },
    "finance": {
      "scopes": ["settlements:read"],
      "allowed_operations": ["listSettlementSummaries"],
      "storage": "isolated_finance_worker_secret_store"
    },
    "webhook_receiver": {
      "scopes": [],
      "allowed_operations": [],
      "storage": "isolated_webhook_receiver_secret_store"
    }
  },
  "onboarding_inputs": {
    "api_origin": "exact_environment_https_origin_from_signed_onboarding_package",
    "asset_origin": "exact_environment_https_origin_from_signed_onboarding_package",
    "care_origin": "exact_environment_https_origin_from_signed_onboarding_package",
    "sandbox_webhook_endpoint": "exact_pre_registered_https_url",
    "production_webhook_endpoint": "exact_pre_registered_https_url",
    "integration_support": "named_contact_authenticated_channel_hours_and_response_target_from_signed_receipt",
    "security_incident_contact": "named_contractual_security_channel_and_acknowledgement_target_from_signed_receipt",
    "credentials": "delivered_out_of_band_never_in_bundle"
  },
  "artifacts": {
    "openapi": {
      "path": "api/partner/openapi/v2.yaml",
      "sha256": "0f93b11b00ed6893bed058871a93be49a61630af27aec1dee9941d4cf060255c"
    },
    "asyncapi": {
      "path": "api/partner/webhooks/v2.asyncapi.yaml",
      "sha256": "6a199b55733d6ea4befcd402611700287f540ef286b5c0b4c1f699cb6b01c7ed"
    },
    "asset_contract": {
      "path": "api/partner/assets/v2.contract.yaml",
      "sha256": "c57eece28107ed70f43451a4bbd19d3e53ff628dc3e248c7ace466a0b42330c3"
    },
    "release_digests": {
      "path": "api/partner/release-digests.json"
    },
    "typescript_sdk": {
      "path": "sdks/typescript-partner",
      "package": "@chiahealth/partner",
      "version": "2.1.0",
      "runtime_dependencies": 0,
      "minimum_node_version": "20.11.0"
    }
  },
  "agent_integration_sequence": [
    "verify_bundle",
    "read_this_manifest",
    "install_local_sdk_tarball_by_exact_version",
    "configure_sandbox_runtime_client",
    "mirror_and_digest_verify_catalog_assets",
    "implement_local_display_and_handoff_gate",
    "create_short_lived_handoff_only_after_affirmative_disclosure_consent",
    "verify_dedupe_and_route_all_three_synthetic_webhook_shapes_in_both_environments",
    "configure_separate_finance_worker",
    "persist_immutable_finance_releases_by_id_and_apply_direct_supersedes_chain",
    "run_contract_and_sdk_checks",
    "configure_distinct_production_runtime_finance_and_webhook_credentials",
    "verify_production_authentication_fail_closed_catalog_and_handoff_then_all_synthetic_webhook_tests_before_activation",
    "after_written_activation_verify_production_catalog_and_cobranded_handoff_without_sending_identity",
    "verify_production_finance_release_rows_without_exposing_them_outside_finance",
    "verify_chia_is_merchant_of_record_and_no_individual_status_returns_to_partner"
  ],
  "verification_commands": [
    "python3 scripts/partner_contracts/verify_integration_bundle.py .",
    "python3 scripts/partner_contracts/check_compatibility.py --validate-all --output json",
    "cd sdks/typescript-partner && bun install --frozen-lockfile --ignore-scripts && bun run check"
  ],
  "allowed_data_classes": [
    "approved_catalog_publication",
    "opaque_catalog_asset",
    "opaque_short_lived_pre_care_handoff",
    "live_cobranded_chia_purchase_destination",
    "synthetic_webhook_test",
    "synthetic_sandbox_settlement_fixture",
    "finance_released_immutable_production_statement_revision",
    "privacy_thresholded_production_aggregate_release"
  ],
  "forbidden_resource_classes": [
    "patient",
    "consumer_identity",
    "care_session",
    "intake",
    "eligibility",
    "clinical",
    "prescription",
    "payment",
    "order",
    "fulfillment",
    "shipment",
    "refund",
    "support",
    "outcome"
  ],
  "hard_stops": [
    "never_send_api_keys_or_webhook_secrets_to_browser_mobile_logs_or_ai",
    "never_add_user_order_patient_or_outcome_identifiers_to_requests_webhooks_or_analytics",
    "never_add_partner_user_account_device_contact_or_arbitrary_metadata_to_handoff_requests",
    "never_log_or_analytics_capture_handoff_session_urls",
    "never_reuse_sandbox_credentials_in_production_or_production_credentials_in_sandbox",
    "never_treat_production_credentials_or_synthetic_webhook_success_as_commerce_activation",
    "never_treat_reserved_contract_origins_as_live_without_signed_onboarding_confirmation",
    "never_use_runtime_credentials_for_finance_or_finance_credentials_for_runtime",
    "never_parse_webhook_json_before_signature_verification",
    "never_process_test_true_as_a_business_event",
    "never_accept_or_emit_test_false_webhook_in_v2",
    "never_follow_api_asset_or_webhook_redirects",
    "never_construct_or_modify_catalog_copy_price_disclosures_or_handoff_urls",
    "never_infer_settlement_amount_due_paid_status_or_count_from_live_data_configuration_events_or_time",
    "never_release_a_production_aggregate_count_below_group_size_10_or_without_composition_approval",
    "never_sum_a_settlement_revision_that_is_superseded_by_a_later_finance_release",
    "never_expose_internal_settlement_privacy_proofs_or_patient_order_payment_level_shipment_program_geography_event_or_date_row_data",
    "never_integrate_or_launch_without_named_authenticated_integration_and_security_channels_from_signed_receipt"
  ]
}
