{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rutter/json-schema/rutter-list-supplier-enablement-enrichments-response-schema.json",
  "title": "ListSupplierEnablementEnrichmentsResponse",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rutter-supplier-enablement-api-openapi.yml#/components/schemas/ListSupplierEnablementEnrichmentsResponse",
  "anyOf": [
    {
      "$ref": "#/$defs/AsyncResponsePayload"
    },
    {
      "type": "object",
      "properties": {
        "enrichments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SupplierEnablementEnrichmentResponse"
          }
        }
      },
      "required": [
        "enrichments"
      ],
      "additionalProperties": false
    }
  ],
  "$defs": {
    "AsyncResponsePayload": {
      "type": "object",
      "properties": {
        "async_response": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "response_url": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "enum": [
                "prequeued",
                "pending",
                "success",
                "failure"
              ]
            },
            "platform_rate_limit_details": {
              "type": "object",
              "properties": {
                "lookback_window_seconds": {
                  "type": "number"
                },
                "platform_rate_limited_basis": {
                  "type": "string",
                  "enum": [
                    "platform",
                    "connection",
                    "hybrid"
                  ]
                },
                "recent_connection_rate_limited_job_count": {
                  "type": "number"
                },
                "recent_platform_rate_limited_job_count": {
                  "type": "number"
                },
                "recent_rate_limited_job_count": {
                  "type": "number"
                }
              },
              "required": [
                "lookback_window_seconds",
                "platform_rate_limited_basis",
                "recent_connection_rate_limited_job_count",
                "recent_platform_rate_limited_job_count",
                "recent_rate_limited_job_count"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "id",
            "response_url",
            "status"
          ],
          "additionalProperties": false
        }
      }
    },
    "SupplierEnablementEnrichmentResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The Rutter generated unique ID of the supplier enablement enrichment report."
        },
        "analysis_end_date": {
          "type": [
            "string",
            "null"
          ],
          "description": "End date of the analysis date range."
        },
        "analysis_start_date": {
          "type": [
            "string",
            "null"
          ],
          "description": "Start date of the analysis date range."
        },
        "source": {
          "type": "string",
          "enum": [
            "rutter",
            "upload"
          ],
          "description": "Source of the enrichment request."
        },
        "status": {
          "type": "string",
          "enum": [
            "completed",
            "failed",
            "in_progress"
          ],
          "description": "Status of the enrichment request."
        },
        "progress": {
          "type": "object",
          "properties": {
            "completion_percentage": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "description": "Completion percentage (0-100)."
            },
            "estimated_time_remaining": {
              "type": "number",
              "minimum": 0,
              "description": "Estimated time remaining in seconds."
            },
            "processed_vendors": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of vendors already processed."
            },
            "total_vendors": {
              "type": "integer",
              "minimum": 0,
              "description": "Total number of vendors to process."
            }
          },
          "required": [
            "completion_percentage",
            "estimated_time_remaining",
            "processed_vendors",
            "total_vendors"
          ],
          "additionalProperties": false,
          "description": "Progress tracking information for the enrichment request."
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The Rutter generated unique ID of the supplier enablement enrichment file."
              },
              "uploaded_at": {
                "type": "string",
                "description": "Timestamp when the file was uploaded."
              },
              "name": {
                "type": "string",
                "description": "Name of the enrichment file."
              }
            },
            "required": [
              "id",
              "uploaded_at",
              "name"
            ],
            "additionalProperties": false,
            "description": "Supplier enablement source file."
          },
          "description": "Array of source files."
        },
        "vendors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The Rutter generated unique ID of the vendor."
              },
              "latest_bill_issue_date": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Timestamp of most recent bill issued."
              },
              "latest_expense_transaction_date": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Timestamp of most recent expense transaction."
              },
              "eligible_card_spend": {
                "type": "number",
                "minimum": 0,
                "description": "Amount of spend that is eligible for card payments."
              },
              "total_spend": {
                "type": "number",
                "minimum": 0,
                "description": "Total spend with this vendor over the last two years."
              },
              "vendor_address": {
                "type": "string",
                "description": "Address of the vendor."
              },
              "vendor_name": {
                "type": "string",
                "description": "Name of the vendor."
              },
              "accepts_card": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Whether the vendor accepts credit card payments."
              },
              "billing_portal_link": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Billing portal link for this vendor, extracted from OCR or other sources."
              },
              "card_activation_flow": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "merchant_auth_link",
                  "generic_job",
                  "payment_link",
                  "null"
                ],
                "description": "The recommended card activation flow for this vendor. 'merchant_auth_link' requires user to login via browser session, 'generic_job' queues job for manual action, 'payment_link' uses direct payment link."
              },
              "card_fee": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Amount of card payment fees."
              },
              "current_payment_account": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Current payment account used for this vendor."
              },
              "current_payment_method": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Current payment method used for this vendor."
              },
              "current_payment_source": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Current payment source used for this vendor."
              },
              "has_card_fees": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Whether the vendor has card payment fees."
              },
              "manual_activation_instructions": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "User-facing instructions on how to pay this vendor by card. To be used in the case when automated card switching is unable to complete successfully. Generated when the vendor accepts cards via billing portal or invoice link."
              },
              "merchant_code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The supported vendor identifier if this vendor matches a known supported vendor (e.g., AWS, VGS)."
              },
              "payment_link": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Payment link for this vendor, extracted from OCR or other sources."
              },
              "total_bills_count": {
                "type": "integer",
                "minimum": 0,
                "description": "Total number of bills associated with this vendor."
              },
              "total_expenses_count": {
                "type": "integer",
                "minimum": 0,
                "description": "Total number of expenses associated with this vendor."
              },
              "accepts_card_sources": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                },
                "description": "Sources of information for this card acceptance method."
              },
              "card_accept_options_sources": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                },
                "description": "Sources of information for this card acceptance options."
              },
              "card_fee_sources": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                },
                "description": "Sources of information for this card payment fees."
              },
              "historical_payment_methods": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                },
                "description": "Historical payment methods used with this vendor."
              },
              "card_accept_options": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "object",
                  "properties": {
                    "description": {
                      "type": "string",
                      "description": "Description of how to use this card acceptance method."
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "billing_portal",
                        "invoice_link",
                        "online_checkout",
                        "agent",
                        "phone",
                        "email",
                        "unknown"
                      ],
                      "description": "The type of card acceptance method available."
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Sources of information for this card acceptance method."
                    }
                  },
                  "required": [
                    "description",
                    "type",
                    "sources"
                  ],
                  "additionalProperties": false
                },
                "description": "Available options for setting up card payments with this vendor."
              }
            },
            "required": [
              "id",
              "latest_bill_issue_date",
              "latest_expense_transaction_date",
              "eligible_card_spend",
              "total_spend",
              "vendor_address",
              "vendor_name",
              "accepts_card",
              "billing_portal_link",
              "card_activation_flow",
              "card_fee",
              "current_payment_account",
              "current_payment_method",
              "current_payment_source",
              "has_card_fees",
              "manual_activation_instructions",
              "merchant_code",
              "payment_link",
              "accepts_card_sources",
              "card_accept_options_sources",
              "card_fee_sources",
              "historical_payment_methods",
              "card_accept_options"
            ],
            "additionalProperties": false
          },
          "description": "Array of vendor enrichment data."
        }
      },
      "required": [
        "id",
        "analysis_end_date",
        "analysis_start_date",
        "source",
        "status",
        "progress",
        "vendors"
      ]
    }
  }
}