{
  "components": {
    "parameters": {
      "ApiVersionHeader": {
        "description": "Pin the API version this call is answered with. Optional — omitting it uses your account's own pin. The dealer echoes the version it actually served back on `X-Peritus-Api-Version` on every response, success or failure.",
        "in": "header",
        "name": "X-Peritus-Api-Version",
        "required": false,
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "DecideRequest": {
        "description": "Read from the call site by hand and not re-checked by any test on any future change — unlike the 17 schemas above, whose field names and required/optional split partner_wire_shape.rs verifies against a real serialization.",
        "properties": {
          "scores": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          }
        },
        "required": [
          "scores"
        ],
        "type": "object"
      },
      "DecideResponse": {
        "description": "Read from the call site by hand and not re-checked by any test on any future change — unlike the 17 schemas above, whose field names and required/optional split partner_wire_shape.rs verifies against a real serialization.",
        "properties": {
          "matchId": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "matchId",
          "state"
        ],
        "type": "object"
      },
      "Error": {
        "additionalProperties": true,
        "description": "Every refusal is this envelope. Coded refusals — the ones this document enumerates per status below — carry `reason` too; a few shape-level ones do not: a malformed `idempotencyKey`, an unparseable query, or an unsupported content type answer a plain `{\"error\": \"...\"}` with no `reason` (see docs/public/partner-api-contract.md and /docs/errors). Some coded refusals also carry extra fields named in the contract table (`floorUsdCents`, `expectedUsdCents`, `ceilingUsdCents`, `maxRangeDays`, and others) — not enumerated here, so a field a partner has not seen yet does not make this schema wrong.",
        "properties": {
          "error": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "PartnerInvoiceDetail": {
        "properties": {
          "buyer": {
            "description": "An opaque snapshot of the party as it was at issue time. Its shape is not part of the contract and is deliberately not described here."
          },
          "currency": {
            "type": "string"
          },
          "dueAt": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "environment": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "issuedAt": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "paymentReference": {
            "type": [
              "string",
              "null"
            ]
          },
          "periodFromDay": {
            "type": "string"
          },
          "periodToDay": {
            "type": "string"
          },
          "seatCount": {
            "format": "int64",
            "type": "integer"
          },
          "seller": {
            "description": "An opaque snapshot of the party as it was at issue time. Its shape is not part of the contract and is deliberately not described here."
          },
          "status": {
            "type": "string"
          },
          "subtotalMicros": {
            "format": "int64",
            "type": "integer"
          },
          "taxMicros": {
            "format": "int64",
            "type": "integer"
          },
          "taxRateBps": {
            "format": "int64",
            "type": "integer"
          },
          "taxTreatment": {
            "type": "string"
          },
          "totalMicros": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "buyer",
          "currency",
          "dueAt",
          "environment",
          "invoiceId",
          "issuedAt",
          "number",
          "paymentReference",
          "periodFromDay",
          "periodToDay",
          "seatCount",
          "seller",
          "status",
          "subtotalMicros",
          "taxMicros",
          "taxRateBps",
          "taxTreatment",
          "totalMicros"
        ],
        "type": "object"
      },
      "PartnerInvoiceLine": {
        "properties": {
          "at": {
            "format": "int64",
            "type": "integer"
          },
          "feeUsdMicros": {
            "format": "int64",
            "type": "integer"
          },
          "matchId": {
            "type": "string"
          },
          "prizeUsdCents": {
            "format": "int64",
            "type": "integer"
          },
          "tierId": {
            "type": "string"
          }
        },
        "required": [
          "at",
          "feeUsdMicros",
          "matchId",
          "prizeUsdCents",
          "tierId"
        ],
        "type": "object"
      },
      "PartnerInvoiceLinesResponse": {
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/PartnerInvoiceLine"
            },
            "type": "array"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "invoiceId",
          "lines",
          "nextCursor"
        ],
        "type": "object"
      },
      "PartnerInvoiceSummary": {
        "properties": {
          "currency": {
            "type": "string"
          },
          "dueAt": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "invoiceId": {
            "type": "string"
          },
          "issuedAt": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "periodFromDay": {
            "type": "string"
          },
          "periodToDay": {
            "type": "string"
          },
          "seatCount": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "totalMicros": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "currency",
          "dueAt",
          "invoiceId",
          "issuedAt",
          "periodFromDay",
          "periodToDay",
          "seatCount",
          "status",
          "totalMicros"
        ],
        "type": "object"
      },
      "PartnerInvoicesResponse": {
        "properties": {
          "environment": {
            "type": "string"
          },
          "invoices": {
            "items": {
              "$ref": "#/components/schemas/PartnerInvoiceSummary"
            },
            "type": "array"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "environment",
          "invoices",
          "nextCursor"
        ],
        "type": "object"
      },
      "PartnerMatchRequest": {
        "description": "Read from the call site by hand and not re-checked by any test on any future change — unlike the 17 schemas above, whose field names and required/optional split partner_wire_shape.rs verifies against a real serialization.",
        "properties": {
          "gameId": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string"
          },
          "playerId": {
            "type": "string"
          },
          "tierId": {
            "type": "string"
          },
          "yourStakeUsdCents": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "playerId",
          "gameId",
          "tierId",
          "idempotencyKey",
          "yourStakeUsdCents"
        ],
        "type": "object"
      },
      "PartnerMatchResponse": {
        "properties": {
          "joined": {
            "type": "boolean"
          },
          "matchId": {
            "type": "string"
          },
          "uid": {
            "type": "string"
          }
        },
        "required": [
          "joined",
          "matchId",
          "uid"
        ],
        "type": "object"
      },
      "PartnerMe": {
        "properties": {
          "apiVersion": {
            "format": "int64",
            "type": "integer"
          },
          "environment": {
            "type": "string"
          },
          "games": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "origins": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "partnerId": {
            "type": "string"
          },
          "prices": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "webhook": {
            "additionalProperties": true,
            "description": "A nested object. Its inner shape is not tracked by the wire-shape file (which is flat) and is therefore not published as a schema here.",
            "type": "object"
          }
        },
        "required": [
          "apiVersion",
          "environment",
          "games",
          "name",
          "origins",
          "partnerId",
          "prices"
        ],
        "type": "object"
      },
      "PartnerResultsResponse": {
        "description": "Read from the call site by hand and not re-checked by any test on any future change — unlike the 17 schemas above, whose field names and required/optional split partner_wire_shape.rs verifies against a real serialization.",
        "properties": {
          "cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/PartnerRow"
            },
            "type": "array"
          }
        },
        "required": [
          "rows",
          "cursor",
          "hasMore"
        ],
        "type": "object"
      },
      "PartnerRow": {
        "properties": {
          "endedAt": {
            "format": "int64",
            "type": "integer"
          },
          "feeUsdMicros": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "gameId": {
            "type": "string"
          },
          "matchId": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          },
          "played": {
            "type": "boolean"
          },
          "playerId": {
            "type": "string"
          },
          "prizeUsdCents": {
            "format": "int64",
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "tierId": {
            "type": "string"
          },
          "yourStakeUsdCents": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "feeUsdMicros",
          "gameId",
          "matchId",
          "playerId",
          "state"
        ],
        "type": "object"
      },
      "PartnerSeatSummaryResponse": {
        "properties": {
          "environment": {
            "type": "string"
          },
          "fromDay": {
            "type": "string"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/PartnerSeatSummaryRow"
            },
            "type": "array"
          },
          "toDay": {
            "type": "string"
          }
        },
        "required": [
          "environment",
          "fromDay",
          "rows",
          "toDay"
        ],
        "type": "object"
      },
      "PartnerSeatSummaryRow": {
        "properties": {
          "day": {
            "type": "string"
          },
          "feeUsdMicros": {
            "format": "int64",
            "type": "integer"
          },
          "seats": {
            "format": "int64",
            "type": "integer"
          },
          "tierId": {
            "type": "string"
          },
          "yourStakeSeats": {
            "format": "int64",
            "type": "integer"
          },
          "yourStakeUsdCents": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "day",
          "feeUsdMicros",
          "seats",
          "tierId",
          "yourStakeSeats",
          "yourStakeUsdCents"
        ],
        "type": "object"
      },
      "PartnerSessionRequest": {
        "description": "Read from the call site by hand and not re-checked by any test on any future change — unlike the 17 schemas above, whose field names and required/optional split partner_wire_shape.rs verifies against a real serialization.",
        "properties": {
          "displayName": {
            "type": "string"
          },
          "gameId": {
            "type": "string"
          },
          "playerId": {
            "type": "string"
          }
        },
        "required": [
          "playerId",
          "gameId"
        ],
        "type": "object"
      },
      "PartnerSessionResponse": {
        "properties": {
          "displayName": {
            "type": "string"
          },
          "expiresAt": {
            "format": "int64",
            "type": "integer"
          },
          "token": {
            "type": "string"
          },
          "uid": {
            "type": "string"
          }
        },
        "required": [
          "displayName",
          "expiresAt",
          "token",
          "uid"
        ],
        "type": "object"
      },
      "PartnerTheme": {
        "properties": {
          "background": {
            "type": "string"
          },
          "corners": {
            "type": "string"
          },
          "derived": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartnerThemeFelt"
              },
              {
                "type": "null"
              }
            ]
          },
          "environment": {
            "type": "string"
          },
          "font": {
            "type": "string"
          },
          "logo": {
            "additionalProperties": true,
            "description": "A nested object, or null when unset. Its inner shape is not tracked by the wire-shape file (which is flat) and is therefore not published as a schema here.",
            "type": [
              "object",
              "null"
            ]
          }
        },
        "required": [
          "background",
          "corners",
          "derived",
          "environment",
          "font",
          "logo"
        ],
        "type": "object"
      },
      "PartnerThemeFelt": {
        "properties": {
          "felt0": {
            "type": "string"
          },
          "felt1": {
            "type": "string"
          },
          "felt2": {
            "type": "string"
          }
        },
        "required": [
          "felt0",
          "felt1",
          "felt2"
        ],
        "type": "object"
      },
      "PartnerThemeRequest": {
        "description": "Read from the call site by hand and not re-checked by any test on any future change — unlike the 17 schemas above, whose field names and required/optional split partner_wire_shape.rs verifies against a real serialization. Three appearance settings plus an optional logo, all optional on the wire (`ThemeBody`, dealer/src/routes/partner_admin/theme.rs): omit `background`/`font`/`corners` to leave them unset; omit `logo` entirely to leave the stored mark alone, send `logo: null` to remove it, or send `{ \"mime\": ..., \"base64\": ... }` to set it.",
        "properties": {
          "background": {
            "type": "string"
          },
          "corners": {
            "type": "string"
          },
          "font": {
            "type": "string"
          },
          "logo": {
            "description": "Absent: leave the stored mark alone. `null`: remove it. An object `{ \"mime\": ..., \"base64\": ... }`: set it."
          }
        },
        "type": "object"
      },
      "PartnerTierRow": {
        "properties": {
          "entryUsdCents": {
            "format": "int64",
            "type": "integer"
          },
          "minStakeUsdCents": {
            "format": "int64",
            "type": "integer"
          },
          "prizeUsdCents": {
            "format": "int64",
            "type": "integer"
          },
          "tierId": {
            "type": "string"
          }
        },
        "required": [
          "entryUsdCents",
          "minStakeUsdCents",
          "prizeUsdCents",
          "tierId"
        ],
        "type": "object"
      },
      "PartnerTiersResponse": {
        "properties": {
          "pricesUpdatedAt": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "tiers": {
            "items": {
              "$ref": "#/components/schemas/PartnerTierRow"
            },
            "type": "array"
          }
        },
        "required": [
          "pricesUpdatedAt",
          "tiers"
        ],
        "type": "object"
      },
      "PartnerUsageResponse": {
        "properties": {
          "days": {
            "items": {
              "$ref": "#/components/schemas/PartnerUsageRow"
            },
            "type": "array"
          },
          "environment": {
            "type": "string"
          },
          "fromDay": {
            "type": "string"
          },
          "toDay": {
            "type": "string"
          }
        },
        "required": [
          "days",
          "environment",
          "fromDay",
          "toDay"
        ],
        "type": "object"
      },
      "PartnerUsageRow": {
        "properties": {
          "day": {
            "type": "string"
          },
          "gameId": {
            "type": "string"
          },
          "matches": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "day",
          "gameId",
          "matches"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "bearerFormat": "pgs_test_… or pgs_live_…",
        "description": "Your partner API key, sent as a bearer token in the `Authorization` header. A test key (`pgs_test_…`) and a live key (`pgs_live_…`) are restricted to their own environment.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "The HTTP surface a partner integrates against: mint a session, seat a paid match, read results, tiers, usage and invoices, and (on a test key) drive a test match to a decided result. Generated from the dealer's own route table, wire shapes and error contract — see docs/public/partner-api-contract.md for the narrative version of this same surface. I3: the statuses enumerated per operation below are the CODED-REFUSAL surface only — every `reason` in docs/public/partner-api-contract.md's CODES table that applies to that operation. Shape-level refusals can also occur on any operation — a malformed body, an unparseable query, an unsupported content type — and are not enumerated here; they are described on /docs/errors.",
    "title": "Peritus Games Partner API",
    "version": "1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/partner/invoices": {
      "get": {
        "operationId": "getPartnerInvoices",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerInvoicesResponse"
                }
              }
            },
            "description": "Your invoices, newest first."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_cursor, invoice_status_invalid, malformed_day, missing_parameter, range_backwards, range_too_wide, unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: live_key_against_test, partner_inactive, test_key_against_live."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: settlement_unavailable."
          }
        },
        "summary": "Your invoices, newest first."
      }
    },
    "/partner/invoices/{invoice_id}": {
      "get": {
        "operationId": "getPartnerInvoicesInvoiceId",
        "parameters": [
          {
            "in": "path",
            "name": "invoice_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerInvoiceDetail"
                }
              }
            },
            "description": "One invoice in full."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: live_key_against_test, partner_inactive, test_key_against_live."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invoice_not_found."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invoice_not_readable."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: settlement_unavailable."
          }
        },
        "summary": "One invoice in full."
      }
    },
    "/partner/invoices/{invoice_id}/lines": {
      "get": {
        "operationId": "getPartnerInvoicesInvoiceIdLines",
        "parameters": [
          {
            "in": "path",
            "name": "invoice_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerInvoiceLinesResponse"
                }
              },
              "text/csv; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The per-match lines behind one invoice. `application/json` by default; pass `format=csv` for `text/csv; charset=utf-8` instead, with the next page's cursor in an `x-next-cursor` response header rather than in the body."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_cursor, unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: live_key_against_test, partner_inactive, test_key_against_live."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invoice_not_found."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invoice_not_readable."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: settlement_unavailable."
          }
        },
        "summary": "The per-match lines behind one invoice."
      }
    },
    "/partner/matches": {
      "post": {
        "operationId": "postPartnerMatches",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerMatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerMatchResponse"
                }
              }
            },
            "description": "Seat a player into a paid match at a tier you have priced."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: malformed_player_id, stake_above_prize, stake_below_floor, stake_does_not_match_price, unknown_tier, unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: game_not_licensed, game_not_licensed_in_this_environment, live_key_against_test, partner_inactive, rake_terms_not_agreed, test_key_against_live."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: idempotency_key_conflict, tier_locked."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: settlement_unavailable."
          }
        },
        "summary": "Seat a player into a paid match at a tier you have priced."
      }
    },
    "/partner/me": {
      "get": {
        "operationId": "getPartnerMe",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerMe"
                }
              }
            },
            "description": "What this key proves: partner id, environment, licensed games, origins and prices."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: live_key_against_test, partner_inactive, test_key_against_live."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          }
        },
        "summary": "What this key proves: partner id, environment, licensed games, origins and prices."
      }
    },
    "/partner/results": {
      "get": {
        "operationId": "getPartnerResults",
        "parameters": [
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerResultsResponse"
                }
              }
            },
            "description": "The authoritative result of every decided match, newest first."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_cursor, unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: live_key_against_test, partner_inactive, test_key_against_live."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          }
        },
        "summary": "The authoritative result of every decided match, newest first."
      }
    },
    "/partner/seat-summary": {
      "get": {
        "operationId": "getPartnerSeatSummary",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerSeatSummaryResponse"
                }
              }
            },
            "description": "Seats and fees for a date range, summarised."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: day_not_final, malformed_day, missing_parameter, range_backwards, range_too_expensive, range_too_wide, unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: live_key_against_test, partner_inactive, test_key_against_live."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: settlement_unavailable."
          }
        },
        "summary": "Seats and fees for a date range, summarised."
      }
    },
    "/partner/sessions": {
      "post": {
        "operationId": "postPartnerSessions",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerSessionResponse"
                }
              }
            },
            "description": "Mint a session token for one player and one game."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: malformed_player_id, unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: game_not_licensed, game_not_licensed_in_this_environment, live_key_against_test, partner_inactive, test_key_against_live."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          }
        },
        "summary": "Mint a session token for one player and one game."
      }
    },
    "/partner/test/matches/{match_id}/decide": {
      "post": {
        "operationId": "postPartnerTestMatchesMatchIdDecide",
        "parameters": [
          {
            "in": "path",
            "name": "match_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecideRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecideResponse"
                }
              }
            },
            "description": "Decide a test match, so a test key can exercise the result path."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: live_key_against_test, partner_inactive, test_key_against_live."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No such test match: wrong environment, not your match, or not a test match at all — `no_such_test_match` answers all three identically so a live key cannot map which matches exist. HAND-ADDED: this refusal is uncoded (`{\"error\": \"...\"}`, no `reason`) and is therefore not in the CODES table this document otherwise derives every status from."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          }
        },
        "summary": "Decide a test match, so a test key can exercise the result path."
      }
    },
    "/partner/theme": {
      "get": {
        "operationId": "getPartnerTheme",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerTheme"
                }
              }
            },
            "description": "The appearance your embedded games are served with."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: live_key_against_test, partner_inactive, test_key_against_live."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          }
        },
        "summary": "The appearance your embedded games are served with."
      },
      "put": {
        "operationId": "putPartnerTheme",
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerThemeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerTheme"
                }
              }
            },
            "description": "Set the appearance, on a test key only."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: live_key_against_test, live_theme_not_writable, partner_inactive, test_key_against_live."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: logo_malformed, logo_not_that_image, logo_too_large, logo_unsupported_type."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          }
        },
        "summary": "Set the appearance, on a test key only."
      }
    },
    "/partner/tiers": {
      "get": {
        "operationId": "getPartnerTiers",
        "parameters": [
          {
            "in": "query",
            "name": "gameId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerTiersResponse"
                }
              }
            },
            "description": "The tier ladder offerable for a game, with the price your players see."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: game_not_licensed, game_not_licensed_in_this_environment, live_key_against_test, partner_inactive, test_key_against_live."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: settlement_unavailable."
          }
        },
        "summary": "The tier ladder offerable for a game, with the price your players see."
      }
    },
    "/partner/usage": {
      "get": {
        "operationId": "getPartnerUsage",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerUsageResponse"
                }
              }
            },
            "description": "Metered seats over a date range, for reconciliation."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: day_not_final, malformed_day, missing_parameter, range_backwards, range_too_wide, unsupported_api_version."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: invalid_key."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: live_key_against_test, partner_inactive, test_key_against_live."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: rate_limited."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`reason` is one of: registry_unavailable."
          }
        },
        "summary": "Metered seats over a date range, for reconciliation."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ],
  "servers": [
    {
      "url": "https://api.peritusgames.com"
    }
  ]
}
