{
  "components": {
    "schemas": {
      "UpsertBusinessPlanEventDto": {
        "properties": {
          "externalId": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "expectedDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "expectedEndDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "recurrence": {
            "type": "string"
          },
          "confidence": {
            "type": "number"
          },
          "scenario": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "eventType",
          "title"
        ]
      },
      "UpsertFinancingFacilityDto": {
        "properties": {
          "externalId": {
            "type": "string"
          },
          "facilityType": {
            "type": "string"
          },
          "lenderName": {
            "type": "string"
          },
          "originalAmount": {
            "type": "number"
          },
          "outstandingPrincipal": {
            "type": "number"
          },
          "limitAmount": {
            "type": "number"
          },
          "availableAmount": {
            "type": "number"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "interestRepresentation": {
            "type": "string"
          },
          "startDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "maturityDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "repaymentFrequency": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "schedules": {
            "items": {
              "$ref": "#/components/schemas/UpsertFinancingScheduleDto"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "facilityType",
          "currency"
        ]
      },
      "UpsertFinancingScheduleDto": {
        "properties": {
          "dueDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "paymentType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "dueDate",
          "amount",
          "currency"
        ]
      },
      "UpsertBusinessObligationDto": {
        "properties": {
          "externalId": {
            "type": "string"
          },
          "obligationType": {
            "type": "string"
          },
          "counterpartyId": {
            "type": "string"
          },
          "dueDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "recurrence": {
            "type": "string"
          },
          "paymentFlexibility": {
            "type": "string",
            "enum": [
              "fixed",
              "negotiable",
              "unknown"
            ]
          },
          "status": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "obligationType",
          "amount",
          "currency"
        ]
      },
      "UpsertBusinessReceivableDto": {
        "properties": {
          "externalId": {
            "type": "string"
          },
          "counterpartyId": {
            "type": "string"
          },
          "issueDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "dueDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "originalAmount": {
            "type": "number"
          },
          "outstandingAmount": {
            "type": "number"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "expectedPaymentDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "originalAmount",
          "outstandingAmount",
          "currency"
        ]
      },
      "CorrectCustomerTypeRequestDto": {
        "properties": {
          "customerType": {
            "type": "string",
            "enum": [
              "individual",
              "business"
            ]
          }
        },
        "type": "object",
        "required": [
          "customerType"
        ]
      },
      "UpsertBusinessProfileRequestDto": {
        "properties": {
          "legalName": {
            "maxLength": 500,
            "type": "string"
          },
          "tradingName": {
            "maxLength": 500,
            "type": "string"
          },
          "registrationNumber": {
            "maxLength": 128,
            "type": "string"
          },
          "legalForm": {
            "maxLength": 64,
            "type": "string"
          },
          "industryCode": {
            "maxLength": 64,
            "type": "string"
          },
          "industryLabel": {
            "maxLength": 255,
            "type": "string"
          },
          "incorporationDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string"
          },
          "countryCode": {
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "baseCurrency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "fiscalYearEndMonth": {
            "maximum": 12,
            "type": "integer",
            "minimum": 1
          },
          "employeeBand": {
            "maxLength": 64,
            "type": "string"
          },
          "annualRevenueBand": {
            "maxLength": 64,
            "type": "string"
          },
          "metadata": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "legalName",
          "baseCurrency"
        ]
      },
      "UpdateExistingPositionRequest": {
        "properties": {
          "currentValue": {
            "minimum": 0,
            "type": "number"
          },
          "units": {
            "minimum": 0,
            "type": "number"
          },
          "monthlyContribution": {
            "minimum": 0,
            "type": "number"
          },
          "startDate": {
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AddExistingPositionRequest": {
        "properties": {
          "shareClassId": {
            "type": "string"
          },
          "currentValue": {
            "minimum": 0,
            "type": "number"
          },
          "units": {
            "minimum": 0,
            "type": "number"
          },
          "monthlyContribution": {
            "minimum": 0,
            "type": "number"
          },
          "startDate": {
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "shareClassId"
        ]
      },
      "UpdateExistingInsuranceProductRequest": {
        "properties": {
          "sumAssured": {
            "minimum": 0,
            "type": "number"
          },
          "premiumMonthly": {
            "minimum": 0,
            "type": "number"
          },
          "cashValue": {
            "minimum": 0,
            "type": "number"
          },
          "startDate": {
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AddExistingInsuranceProductRequest": {
        "properties": {
          "productId": {
            "type": "string"
          },
          "sumAssured": {
            "minimum": 0,
            "type": "number"
          },
          "premiumMonthly": {
            "minimum": 0,
            "type": "number"
          },
          "cashValue": {
            "minimum": 0,
            "type": "number"
          },
          "startDate": {
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "productId"
        ]
      },
      "UpdateExistingProductRequest": {
        "properties": {
          "productId": {
            "format": "uuid",
            "type": "string"
          },
          "currentBalance": {
            "minimum": 0,
            "type": "number"
          },
          "outstandingBalance": {
            "minimum": 0,
            "type": "number"
          },
          "creditLimit": {
            "minimum": 0,
            "type": "number"
          },
          "loanAmount": {
            "minimum": 0,
            "type": "number"
          },
          "monthlyPayment": {
            "minimum": 0,
            "type": "number"
          },
          "lastUsedDate": {
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "productId"
        ]
      },
      "AddExistingProductRequest": {
        "properties": {
          "product": {
            "$ref": "#/components/schemas/ExistingProductInput"
          }
        },
        "type": "object",
        "required": [
          "product"
        ]
      },
      "ExistingProductInput": {
        "properties": {
          "productId": {
            "format": "uuid",
            "type": "string"
          },
          "currentBalance": {
            "minimum": 0,
            "type": "number"
          },
          "outstandingBalance": {
            "minimum": 0,
            "type": "number"
          },
          "creditLimit": {
            "minimum": 0,
            "type": "number"
          },
          "loanAmount": {
            "minimum": 0,
            "type": "number"
          },
          "monthlyPayment": {
            "minimum": 0,
            "type": "number"
          },
          "openedDate": {
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?",
            "type": "string"
          },
          "lastUsedDate": {
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?",
            "type": "string"
          },
          "metadata": {}
        },
        "type": "object",
        "required": [
          "productId"
        ]
      },
      "PartnerSubmitStatementRequestDto": {
        "properties": {
          "externalCustomerId": {
            "minLength": 1,
            "type": "string"
          },
          "customerType": {
            "type": "string",
            "enum": [
              "individual",
              "business"
            ]
          },
          "statementId": {
            "minLength": 1,
            "type": "string"
          },
          "account": {
            "$ref": "#/components/schemas/PartnerStatementAccountDto",
            "not": {
              "type": "null"
            }
          },
          "statement": {
            "$ref": "#/components/schemas/PartnerStatementSummaryDto",
            "not": {
              "type": "null"
            }
          },
          "transactions": {
            "items": {
              "$ref": "#/components/schemas/PartnerStatementTransactionDto"
            },
            "type": "array",
            "minItems": 1
          },
          "provenance": {
            "$ref": "#/components/schemas/PartnerStatementProvenanceDto"
          }
        },
        "type": "object",
        "required": [
          "externalCustomerId",
          "customerType",
          "statementId",
          "account",
          "statement",
          "transactions"
        ]
      },
      "PartnerStatementProvenanceDto": {
        "properties": {
          "sourceType": {
            "type": "string",
            "enum": [
              "bank_api",
              "pdf_extraction",
              "manual"
            ]
          },
          "extractionConfidence": {
            "maximum": 1,
            "type": "number",
            "minimum": 0
          }
        },
        "type": "object",
        "required": [
          "sourceType"
        ]
      },
      "PartnerStatementTransactionDto": {
        "properties": {
          "externalTransactionId": {
            "type": "string"
          },
          "transactionDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "format": "date"
          },
          "postedAt": {
            "type": "string",
            "format": "date-time"
          },
          "valueDate": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "format": "date"
          },
          "description": {
            "minLength": 1,
            "type": "string"
          },
          "amount": {
            "exclusiveMinimum": 0,
            "type": "number"
          },
          "direction": {
            "type": "string",
            "enum": [
              "credit",
              "debit"
            ]
          },
          "runningBalance": {
            "type": "number"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "counterpartyName": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "transactionChannel": {
            "type": "string"
          },
          "transactionStatus": {
            "type": "string",
            "enum": [
              "pending",
              "posted",
              "reversed",
              "failed"
            ]
          }
        },
        "type": "object",
        "required": [
          "transactionDate",
          "description",
          "amount",
          "direction"
        ]
      },
      "PartnerStatementSummaryDto": {
        "properties": {
          "periodStart": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "format": "date"
          },
          "periodEnd": {
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "format": "date"
          },
          "openingBalance": {
            "type": "number"
          },
          "closingBalance": {
            "type": "number"
          },
          "totalCredits": {
            "minimum": 0,
            "type": "number"
          },
          "totalDebits": {
            "minimum": 0,
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "periodStart",
          "periodEnd"
        ]
      },
      "PartnerStatementAccountDto": {
        "properties": {
          "externalAccountId": {
            "minLength": 1,
            "type": "string"
          },
          "institutionId": {
            "type": "string"
          },
          "institutionName": {
            "type": "string"
          },
          "accountType": {
            "type": "string"
          },
          "productName": {
            "type": "string"
          },
          "accountHolderName": {
            "type": "string"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "externalAccountId",
          "currency"
        ]
      }
    },
    "securitySchemes": {
      "bearerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Partner API key sent as `Authorization: Bearer <api_key>`."
      }
    }
  },
  "info": {
    "title": "Rimbun Partner API",
    "version": "1.0.0",
    "description": "Programmatic contract for financial institutions integrating Rimbun: ingest transactions, read explainable recommendations, and report outcomes."
  },
  "openapi": "3.0.0",
  "paths": {
    "/api/v1/partners/ingestion/statements": {
      "post": {
        "operationId": "PartnerIngestionController.submit",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerSubmitStatementRequestDto"
              }
            }
          },
          "description": "PartnerSubmitStatementRequestDto",
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jobId",
                    "status",
                    "idempotent"
                  ],
                  "properties": {
                    "jobId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "idempotent": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "description": "Accepted"
          }
        },
        "summary": "Enqueue async ingestion for a canonical bank statement (partner HMAC)",
        "tags": [
          "Partner Ingestion"
        ],
        "x-audience": [
          "partner"
        ],
        "description": "Authenticates via HMAC headers documented in docs/guides/partners/PARTNER_INGESTION_SIGNING.md. Returns 202 with a job id; processing happens asynchronously.",
        "security": []
      }
    },
    "/api/v1/partners/ingestion/jobs/{jobId}": {
      "get": {
        "operationId": "PartnerIngestionController.getJob",
        "parameters": [
          {
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "running",
                        "succeeded",
                        "failed",
                        "dead"
                      ]
                    },
                    "externalCustomerId": {
                      "type": "string"
                    },
                    "statementId": {
                      "type": "string"
                    },
                    "idempotencyKey": {
                      "type": "string"
                    },
                    "attemptCount": {
                      "type": "integer"
                    },
                    "nextRunAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "finishedAt": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    },
                    "lastError": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            },
            "description": "Job status"
          }
        },
        "summary": "Poll partner ingestion job status",
        "tags": [
          "Partner Ingestion"
        ],
        "x-audience": [
          "partner"
        ],
        "security": []
      }
    },
    "/api/v1/partners/customers/{customerId}/recommendations": {
      "get": {
        "operationId": "PartnerRecommendationsController.getRecommendations",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "goalId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "productType",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get banking product recommendations for a partner customer",
        "tags": [
          "Partner Recommendations"
        ],
        "x-audience": [
          "partner"
        ],
        "description": "Partner API. Authenticates with `Authorization: Bearer <api_key>`. `customerId` is the partner's customer identifier (same as `providerAccountId` in ingestion). Tenant scope is resolved from the API key.",
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/assessment": {
      "put": {
        "operationId": "PartnerAssessmentController.upsertAssessment",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Upsert assessment score data for a customer",
        "tags": [
          "Partner Assessment"
        ],
        "x-audience": [
          "partner"
        ],
        "description": "Replaces questionnaire capture (`response_groups` / `user_responses`). Stores JSON in `rimbun_tenant.assessment_score`.",
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/goals": {
      "post": {
        "operationId": "PartnerGoalsController.createGoal",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create a financial goal for a customer",
        "tags": [
          "Partner Goals"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/goals/{goalId}": {
      "put": {
        "operationId": "PartnerGoalsController.updateGoal",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "goalId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update a customer goal",
        "tags": [
          "Partner Goals"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      },
      "delete": {
        "operationId": "PartnerGoalsController.deleteGoal",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "goalId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Soft-delete a customer goal",
        "tags": [
          "Partner Goals"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/banking-profile/products": {
      "post": {
        "operationId": "PartnerBankingProfileController.addProduct",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddExistingProductRequest"
              }
            }
          },
          "description": "AddExistingProductRequest",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Add an existing banking product to a customer profile",
        "tags": [
          "Partner Banking Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/banking-profile/products/{productId}": {
      "put": {
        "operationId": "PartnerBankingProfileController.updateProduct",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "productId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExistingProductRequest"
              }
            }
          },
          "description": "UpdateExistingProductRequest",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update an existing product balance on a customer banking profile",
        "tags": [
          "Partner Banking Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      },
      "delete": {
        "operationId": "PartnerBankingProfileController.removeProduct",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "productId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Remove a product from a customer banking profile",
        "tags": [
          "Partner Banking Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/economic-profile": {
      "put": {
        "operationId": "PartnerEconomicProfileController.upsertEconomicProfile",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Upsert economic profile for a customer",
        "tags": [
          "Partner Economic Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/product-views": {
      "post": {
        "operationId": "PartnerProductViewController.recordProductView",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Record a product detail view for People Like You insights",
        "tags": [
          "Partner Product View"
        ],
        "x-audience": [
          "partner"
        ],
        "description": "Bank sends when a customer views a banking or insurance product. Segment snapshot is derived server-side.",
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/insurance-profile/products": {
      "post": {
        "operationId": "PartnerInsuranceProfileController.addProduct",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddExistingInsuranceProductRequest"
              }
            }
          },
          "description": "AddExistingInsuranceProductRequest",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Add an existing insurance policy to a customer profile",
        "tags": [
          "Partner Insurance Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/insurance-profile/products/{productId}": {
      "put": {
        "operationId": "PartnerInsuranceProfileController.updateProduct",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "productId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExistingInsuranceProductRequest"
              }
            }
          },
          "description": "UpdateExistingInsuranceProductRequest",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update an insurance policy on a customer profile",
        "tags": [
          "Partner Insurance Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      },
      "delete": {
        "operationId": "PartnerInsuranceProfileController.removeProduct",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "productId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Remove an insurance policy from a customer profile",
        "tags": [
          "Partner Insurance Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/investment-profile/positions": {
      "post": {
        "operationId": "PartnerInvestmentProfileController.addPosition",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddExistingPositionRequest"
              }
            }
          },
          "description": "AddExistingPositionRequest",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Add an investment position to a customer profile",
        "tags": [
          "Partner Investment Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/investment-profile/positions/{shareClassId}": {
      "put": {
        "operationId": "PartnerInvestmentProfileController.updatePosition",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "shareClassId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExistingPositionRequest"
              }
            }
          },
          "description": "UpdateExistingPositionRequest",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update an investment position on a customer profile",
        "tags": [
          "Partner Investment Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      },
      "delete": {
        "operationId": "PartnerInvestmentProfileController.removePosition",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "shareClassId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Remove an investment position from a customer profile",
        "tags": [
          "Partner Investment Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/business-profile": {
      "put": {
        "operationId": "PartnerBusinessProfileController.upsertProfile",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertBusinessProfileRequestDto"
              }
            }
          },
          "description": "UpsertBusinessProfileRequestDto",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create or update a business profile for a business customer",
        "tags": [
          "Partner Business Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/customer-type": {
      "put": {
        "operationId": "PartnerBusinessProfileController.correctType",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CorrectCustomerTypeRequestDto"
              }
            }
          },
          "description": "CorrectCustomerTypeRequestDto",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Administrative correction of customer type (explicit only)",
        "tags": [
          "Partner Business Profile"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/receivables": {
      "get": {
        "operationId": "PartnerBusinessDomainController.receivables",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Receivables",
        "tags": [
          "Partner Business Domain"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      },
      "post": {
        "operationId": "PartnerBusinessDomainController.upsertReceivable",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertBusinessReceivableDto"
              }
            }
          },
          "description": "UpsertBusinessReceivableDto",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Upsert receivable",
        "tags": [
          "Partner Business Domain"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/obligations": {
      "get": {
        "operationId": "PartnerBusinessDomainController.obligations",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Obligations",
        "tags": [
          "Partner Business Domain"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      },
      "post": {
        "operationId": "PartnerBusinessDomainController.upsertObligation",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertBusinessObligationDto"
              }
            }
          },
          "description": "UpsertBusinessObligationDto",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Upsert obligation",
        "tags": [
          "Partner Business Domain"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/facilities": {
      "get": {
        "operationId": "PartnerBusinessDomainController.facilities",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Facilities",
        "tags": [
          "Partner Business Domain"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      },
      "post": {
        "operationId": "PartnerBusinessDomainController.upsertFacility",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertFinancingFacilityDto"
              }
            }
          },
          "description": "UpsertFinancingFacilityDto",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Upsert facility",
        "tags": [
          "Partner Business Domain"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    },
    "/api/v1/partners/customers/{customerId}/plan-events": {
      "get": {
        "operationId": "PartnerBusinessDomainController.planEvents",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Plan events",
        "tags": [
          "Partner Business Domain"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      },
      "post": {
        "operationId": "PartnerBusinessDomainController.upsertPlanEvent",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "pattern": "[^\\/#\\?]+?",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertBusinessPlanEventDto"
              }
            }
          },
          "description": "UpsertBusinessPlanEventDto",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Upsert plan event",
        "tags": [
          "Partner Business Domain"
        ],
        "x-audience": [
          "partner"
        ],
        "security": [
          {
            "bearerApiKey": []
          }
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.rimbun.co"
    }
  ]
}
