{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/plainrouter/json-schema/plainrouter-action-decision-receipt-read-schema.json",
  "title": "ActionDecisionReceiptRead",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/plainrouter-actionreadapi-api-openapi.yml#/components/schemas/ActionDecisionReceiptRead",
  "type": "object",
  "properties": {
    "document": {
      "type": "object",
      "additionalProperties": {}
    },
    "document_sha256": {
      "type": "string"
    },
    "chain_entry": {
      "type": "object",
      "properties": {
        "sequence": {
          "type": "integer"
        },
        "hash": {
          "type": "string"
        }
      },
      "required": [
        "sequence",
        "hash"
      ]
    },
    "disposition": {
      "$ref": "#/$defs/ActionCurrentDisposition"
    }
  },
  "required": [
    "document",
    "document_sha256",
    "chain_entry",
    "disposition"
  ],
  "$defs": {
    "ActionCurrentDisposition": {
      "type": "object",
      "properties": {
        "receipt_status": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "pending",
            "attempting",
            "reconciliation_required",
            "committed",
            "executed_pending_verification",
            "measuring",
            "verified",
            "compensating",
            "compensated",
            "compensation_failed",
            "irreversible",
            "failed",
            "reconciliation_exhausted",
            null
          ]
        },
        "outcome_payload": {
          "type": [
            "object",
            "null"
          ],
          "description": "Write-once outcome. Management comparisons use PlainRouter counted arrivals and Inventory spend. Resume compares the target after the change with the rest of the same account over those same days. Pause is not judged. Missing data never yields a verdict. Other action types retain their existing payloads.",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "measurable",
                "not_measurable",
                "unavailable"
              ]
            },
            "observed_at": {
              "type": "string",
              "format": "date-time"
            },
            "reason_code": {
              "type": [
                "string",
                "null"
              ]
            },
            "reason": {
              "type": [
                "string",
                "null"
              ]
            },
            "baseline": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string",
                      "enum": [
                        "target",
                        "rest_of_account"
                      ]
                    },
                    "days": {
                      "type": "array",
                      "description": "Three whole days in the ad account timezone; excludes the change day.",
                      "items": {
                        "type": "string",
                        "format": "date"
                      }
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "spend_minor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Decimal spend in ISO currency minor units; null when daily mirror data is missing."
                    },
                    "counted_arrivals": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Arrivals counted by PlainRouter through Signals, never provider conversions."
                    },
                    "cost_per_counted_arrival_minor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Spend divided by counted arrivals, in ISO currency minor units, displayed to six decimal places."
                    }
                  }
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            },
            "metrics": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "scope": {
                      "type": "string",
                      "enum": [
                        "target",
                        "rest_of_account"
                      ]
                    },
                    "days": {
                      "type": "array",
                      "description": "Three whole days in the ad account timezone; excludes the change day.",
                      "items": {
                        "type": "string",
                        "format": "date"
                      }
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "spend_minor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Decimal spend in ISO currency minor units; null when daily mirror data is missing."
                    },
                    "counted_arrivals": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Arrivals counted by PlainRouter through Signals, never provider conversions."
                    },
                    "cost_per_counted_arrival_minor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Spend divided by counted arrivals, in ISO currency minor units, displayed to six decimal places."
                    },
                    "verdict": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "held",
                        "lost",
                        "not_judged",
                        null
                      ]
                    },
                    "loss_threshold_percent": {
                      "type": "string"
                    }
                  }
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            },
            "inverse": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "proposed",
                    "inverse_not_proposed"
                  ]
                },
                "batch_id": {
                  "type": "string"
                },
                "reason_code": {
                  "type": "string"
                }
              },
              "required": [
                "status"
              ]
            }
          },
          "additionalProperties": {}
        },
        "outcome_status": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "measurable",
            "not_measurable",
            "unavailable",
            null
          ]
        },
        "outcome_reason_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "outcome_checked_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "compensation_reason_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "recovery_disposition": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "no_compensation",
            "restored",
            "unrestored",
            "contradictory",
            "irreversible",
            "uncertain",
            null
          ]
        },
        "late_restored": {
          "type": "boolean"
        }
      },
      "required": [
        "receipt_status",
        "outcome_status",
        "outcome_reason_code",
        "outcome_checked_at",
        "outcome_payload",
        "compensation_reason_code",
        "recovery_disposition",
        "late_restored"
      ],
      "title": "ActionCurrentDisposition"
    }
  }
}